import { DATE_TIME_FORMAT } from '@/lib/constants';
import { Tables } from '@/packages/supabase/src/database.types';
import { format } from 'date-fns';
const isProd = process.env.NODE_ENV === 'production';
export const getPais = (
sender: string,
recipient: string,
createdAt: Date,
messageId: number,
) => {
if (isProd) {
// return correct data
}
return `
OL
${sender}
${recipient}
${format(createdAt, DATE_TIME_FORMAT)}
${messageId}
argo@medreport.ee
`;
};
export const getClientInstitution = () => {
if (isProd) {
// return correct data
}
return `
16381793
MedReport OÜ
TSU
+37258871517
`;
};
export const getProviderInstitution = () => {
if (isProd) {
// return correct data
}
return `
11107913
Synlab HTI Tallinn
SLA
Synlab HTI Tallinn
+3723417123
`;
};
export const getClientPerson = () => {
if (isProd) {
// return correct data
}
return `
1.3.6.1.4.1.28284.6.2.4.9
D07907
Eduard
Tsvetkov
+37258131202
`;
};
export const getOrderEnteredPerson = () => {
if (isProd) {
// return correct data
}
return `
1.3.6.1.4.1.28284.6.2.4.9
D07907
Eduard
Tsvetkov
+37258131202
`;
};
export const getPatient = (
idCode: number,
surname: string,
firstName: string,
birthDate: string,
genderLetter: string,
) => {
return `
1.3.6.1.4.1.28284.6.2.2.1
${idCode}
${surname}
${firstName}
${birthDate}
1.3.6.1.4.1.28284.6.2.3.16.2
${genderLetter}
`;
};
export const getConfidentiality = () => {
if (isProd) {
// return correct data
}
return `
2.16.840.1.113883.5.25
N
1.3.6.1.4.1.28284.6.2.2.39.1
N
1.3.6.1.4.1.28284.6.2.2.37.1
N
`;
};
export const getOrderEnteredByPerson = () => {
if (isProd) {
// return correct data
}
return `
1.3.6.1.4.1.28284.6.2.4.9
D07907
Eduard
Tsvetkov
+37258131202
`;
};
export const getSpecimen = (
materialTypeOid: string,
materialGroupId: string,
materialName: string,
order: number,
sampleContainerOid?: string,
sampleContainerId?: string,
) =>
`
${sampleContainerOid ? `${sampleContainerOid}` : null}
${sampleContainerId ? `${sampleContainerId}` : null}
${materialTypeOid}
${materialGroupId}
${materialName}
${order}
`;
export const getAnalysisElement = (
analysisIdOid: string,
analysisIdOriginal: string,
tehikShortLoinc: string,
tehikLoincName: string,
analysisElementId: number,
analysisNameLab?: string | null,
) => {
return `
${analysisIdOid}
${analysisIdOriginal}
${tehikShortLoinc}
${tehikLoincName}
${analysisNameLab ?? tehikLoincName}
${analysisElementId}
`;
};
export const getAnalysisGroup = (
analysisGroupOriginalId: string,
analysisGroupName: string,
specimenOrderNr: number,
analysisElement: Tables<{ schema: 'medreport' }, 'analysis_elements'>,
) =>
`
${analysisGroupOriginalId}
${analysisGroupName}
${getAnalysisElement(analysisElement.analysis_id_oid, analysisElement.analysis_id_original, analysisElement.tehik_short_loinc, analysisElement.tehik_loinc_name, analysisElement.id, analysisElement.analysis_name_lab)}
${specimenOrderNr}
`;