feat(MED-131): move jobs to /api/job/* secured with key

This commit is contained in:
2025-08-04 11:51:11 +03:00
parent 5746e1b087
commit 43493c261c
12 changed files with 204 additions and 93 deletions

View File

@@ -10,7 +10,6 @@ import {
getClientInstitution,
getClientPerson,
getConfidentiality,
getOrderEnteredByPerson,
getPais,
getPatient,
getProviderInstitution,
@@ -149,6 +148,7 @@ export async function getPrivateMessage(messageId: string) {
const parsed = parser.parse(data);
if (parsed.ANSWER?.CODE && parsed.ANSWER?.CODE !== 0) {
console.error("Bad response", data);
throw new Error(`Failed to get private message (id: ${messageId})`);
}
@@ -378,10 +378,13 @@ export async function syncPublicMessage(
}
}
// TODO use actual parameters
export async function composeOrderXML(
/* chosenAnalysisElements?: number[],
chosenAnalyses?: number[], */
person: {
idCode: string,
firstName: string,
lastName: string,
phone: string,
},
comment?: string,
) {
const supabase = createCustomClient(
@@ -512,11 +515,9 @@ export async function composeOrderXML(
<!--<TeostajaAsutus>-->
${getProviderInstitution()}
<!--<TellijaIsik>-->
${getClientPerson()}
<!--<SisestajaIsik>-->
${getOrderEnteredByPerson()}
${getClientPerson(person)}
<TellijaMarkused>${comment ?? ''}</TellijaMarkused>
${getPatient(49610230861, 'Surname', 'First Name', '1996-10-23', 'N')}
${getPatient(person)}
${getConfidentiality()}
${specimenSection.join('')}
${analysisSection?.join('')}