gdc-common-utils-ts 2.0.12 → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/examples/employee.d.ts +9 -1
- package/dist/examples/employee.js +7 -4
- package/dist/examples/shared.d.ts +1 -1
- package/dist/examples/shared.js +6 -2
- package/dist/utils/actor.d.ts +3 -1
- package/package.json +1 -5
- package/dist/examples/communication-bundle-session.d.ts +0 -22
- package/dist/examples/communication-bundle-session.js +0 -79
- package/dist/interfaces/IWallet.d.ts +0 -55
- package/dist/interfaces/IWallet.js +0 -3
- package/dist/models/fhir-related-person.d.ts +0 -61
- package/dist/models/fhir-related-person.js +0 -108
- package/dist/models/related-profile.d.ts +0 -42
- package/dist/models/related-profile.js +0 -16
- package/dist/utils/allergy-intolerance-claim-helpers.d.ts +0 -10
- package/dist/utils/allergy-intolerance-claim-helpers.js +0 -47
- package/dist/utils/appointment-claim-helpers.d.ts +0 -10
- package/dist/utils/appointment-claim-helpers.js +0 -26
- package/dist/utils/appointment-response-claim-helpers.d.ts +0 -8
- package/dist/utils/appointment-response-claim-helpers.js +0 -20
- package/dist/utils/claim-list-helpers.d.ts +0 -21
- package/dist/utils/claim-list-helpers.js +0 -50
- package/dist/utils/clinical-impression-claim-helpers.d.ts +0 -10
- package/dist/utils/clinical-impression-claim-helpers.js +0 -26
- package/dist/utils/communication-bundle-session.d.ts +0 -175
- package/dist/utils/communication-bundle-session.js +0 -524
- package/dist/utils/composition-claim-helpers.d.ts +0 -12
- package/dist/utils/composition-claim-helpers.js +0 -32
- package/dist/utils/condition-claim-helpers.d.ts +0 -10
- package/dist/utils/condition-claim-helpers.js +0 -47
- package/dist/utils/convert-allergy-intolerance.d.ts +0 -3
- package/dist/utils/convert-allergy-intolerance.js +0 -34
- package/dist/utils/convert-appointment-response.d.ts +0 -3
- package/dist/utils/convert-appointment-response.js +0 -32
- package/dist/utils/convert-appointment.d.ts +0 -3
- package/dist/utils/convert-appointment.js +0 -61
- package/dist/utils/convert-care-plan.d.ts +0 -3
- package/dist/utils/convert-care-plan.js +0 -58
- package/dist/utils/convert-clinical-impression.d.ts +0 -3
- package/dist/utils/convert-clinical-impression.js +0 -42
- package/dist/utils/convert-composition.d.ts +0 -3
- package/dist/utils/convert-composition.js +0 -35
- package/dist/utils/convert-condition.d.ts +0 -3
- package/dist/utils/convert-condition.js +0 -24
- package/dist/utils/convert-coverage.d.ts +0 -3
- package/dist/utils/convert-coverage.js +0 -51
- package/dist/utils/convert-device-use-statement.d.ts +0 -3
- package/dist/utils/convert-device-use-statement.js +0 -28
- package/dist/utils/convert-device.d.ts +0 -3
- package/dist/utils/convert-device.js +0 -37
- package/dist/utils/convert-diagnostic-report.d.ts +0 -3
- package/dist/utils/convert-diagnostic-report.js +0 -55
- package/dist/utils/convert-document-reference.d.ts +0 -3
- package/dist/utils/convert-document-reference.js +0 -35
- package/dist/utils/convert-encounter.d.ts +0 -3
- package/dist/utils/convert-encounter.js +0 -68
- package/dist/utils/convert-flag.d.ts +0 -3
- package/dist/utils/convert-flag.js +0 -34
- package/dist/utils/convert-immunization.d.ts +0 -3
- package/dist/utils/convert-immunization.js +0 -56
- package/dist/utils/convert-medication-statement.d.ts +0 -3
- package/dist/utils/convert-medication-statement.js +0 -64
- package/dist/utils/convert-observation.d.ts +0 -3
- package/dist/utils/convert-observation.js +0 -57
- package/dist/utils/convert-procedure.d.ts +0 -3
- package/dist/utils/convert-procedure.js +0 -50
- package/dist/utils/convert-related-person.d.ts +0 -3
- package/dist/utils/convert-related-person.js +0 -31
- package/dist/utils/convert-shared.d.ts +0 -34
- package/dist/utils/convert-shared.js +0 -179
- package/dist/utils/coverage-claim-helpers.d.ts +0 -10
- package/dist/utils/coverage-claim-helpers.js +0 -26
- package/dist/utils/diagnostic-report-claim-helpers.d.ts +0 -12
- package/dist/utils/diagnostic-report-claim-helpers.js +0 -32
- package/dist/utils/employee-editor.d.ts +0 -24
- package/dist/utils/employee-editor.js +0 -41
- package/dist/utils/encounter-claim-helpers.d.ts +0 -10
- package/dist/utils/encounter-claim-helpers.js +0 -26
- package/dist/utils/gateway-index-params.d.ts +0 -44
- package/dist/utils/gateway-index-params.js +0 -80
- package/dist/utils/medication-claim-helpers.d.ts +0 -88
- package/dist/utils/medication-claim-helpers.js +0 -259
- package/dist/utils/normalize-subject-uuid.d.ts +0 -1
- package/dist/utils/normalize-subject-uuid.js +0 -24
- package/dist/utils/related-person-claim-helpers.d.ts +0 -8
- package/dist/utils/related-person-claim-helpers.js +0 -20
- package/dist/utils/search-parameter-catalog.d.ts +0 -31
- package/dist/utils/search-parameter-catalog.js +0 -81
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
-
// File: src/utils/convert-flag.ts
|
|
3
|
-
import { FlagClaim } from '../models/interoperable-claims/flag-claims.js';
|
|
4
|
-
import { codingFromValue, codingToValue, referenceToValue } from './convert-shared.js';
|
|
5
|
-
export function flagFlatToFhirR4(claims) {
|
|
6
|
-
const subject = claims[FlagClaim.Subject] ?? claims[FlagClaim.Patient];
|
|
7
|
-
return {
|
|
8
|
-
resourceType: 'Flag',
|
|
9
|
-
identifier: claims[FlagClaim.Identifier] ? [{ value: claims[FlagClaim.Identifier] }] : undefined,
|
|
10
|
-
status: claims[FlagClaim.Status],
|
|
11
|
-
category: claims[FlagClaim.Category] ? { coding: codingFromValue(claims[FlagClaim.Category]) } : undefined,
|
|
12
|
-
code: claims[FlagClaim.Code] ? { coding: codingFromValue(claims[FlagClaim.Code]) } : undefined,
|
|
13
|
-
subject: subject ? { reference: subject } : undefined,
|
|
14
|
-
author: claims[FlagClaim.Author] ? { reference: claims[FlagClaim.Author] } : undefined,
|
|
15
|
-
encounter: claims[FlagClaim.Encounter] ? { reference: claims[FlagClaim.Encounter] } : undefined,
|
|
16
|
-
period: (claims[FlagClaim.PeriodStart] || claims[FlagClaim.PeriodEnd]) ? { start: claims[FlagClaim.PeriodStart], end: claims[FlagClaim.PeriodEnd] } : undefined,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export function flagFhirR4ToFlat(resource) {
|
|
20
|
-
const period = resource.period;
|
|
21
|
-
return {
|
|
22
|
-
[FlagClaim.Author]: referenceToValue(resource.author),
|
|
23
|
-
[FlagClaim.Date]: undefined,
|
|
24
|
-
[FlagClaim.Encounter]: referenceToValue(resource.encounter),
|
|
25
|
-
[FlagClaim.Identifier]: resource.identifier?.[0]?.value,
|
|
26
|
-
[FlagClaim.Patient]: referenceToValue(resource.subject),
|
|
27
|
-
[FlagClaim.Subject]: referenceToValue(resource.subject),
|
|
28
|
-
[FlagClaim.Status]: resource.status,
|
|
29
|
-
[FlagClaim.Category]: codingToValue(resource.category?.coding?.[0]),
|
|
30
|
-
[FlagClaim.Code]: codingToValue(resource.code?.coding?.[0]),
|
|
31
|
-
[FlagClaim.PeriodStart]: period?.start,
|
|
32
|
-
[FlagClaim.PeriodEnd]: period?.end,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
-
// File: src/utils/convert-immunization.ts
|
|
3
|
-
import { ImmunizationClaim } from '../models/interoperable-claims/immunization-claims.js';
|
|
4
|
-
import { codingFromValue, codingToValue, referenceToValue } from './convert-shared.js';
|
|
5
|
-
export function immunizationFlatToFhirR4(claims) {
|
|
6
|
-
const subject = claims[ImmunizationClaim.Subject] ?? claims[ImmunizationClaim.Patient];
|
|
7
|
-
return {
|
|
8
|
-
resourceType: 'Immunization',
|
|
9
|
-
identifier: claims[ImmunizationClaim.Identifier] ? [{ value: claims[ImmunizationClaim.Identifier] }] : undefined,
|
|
10
|
-
status: claims[ImmunizationClaim.Status],
|
|
11
|
-
vaccineCode: claims[ImmunizationClaim.VaccineCode] ? { coding: codingFromValue(claims[ImmunizationClaim.VaccineCode]) } : undefined,
|
|
12
|
-
patient: subject ? { reference: subject } : undefined,
|
|
13
|
-
occurrenceDateTime: claims[ImmunizationClaim.Date],
|
|
14
|
-
location: claims[ImmunizationClaim.Location] ? { reference: claims[ImmunizationClaim.Location] } : undefined,
|
|
15
|
-
manufacturer: claims[ImmunizationClaim.Manufacturer] ? { reference: claims[ImmunizationClaim.Manufacturer] } : undefined,
|
|
16
|
-
lotNumber: claims[ImmunizationClaim.LotNumber],
|
|
17
|
-
performer: claims[ImmunizationClaim.Performer] ? claims[ImmunizationClaim.Performer].split(',').map((reference) => ({ actor: { reference: reference.trim() } })) : undefined,
|
|
18
|
-
reasonCode: claims[ImmunizationClaim.ReasonCode] ? [{ coding: codingFromValue(claims[ImmunizationClaim.ReasonCode]) }] : undefined,
|
|
19
|
-
reasonReference: claims[ImmunizationClaim.ReasonReference] ? [{ reference: claims[ImmunizationClaim.ReasonReference] }] : undefined,
|
|
20
|
-
statusReason: claims[ImmunizationClaim.StatusReason] ? { coding: codingFromValue(claims[ImmunizationClaim.StatusReason]) } : undefined,
|
|
21
|
-
note: claims[ImmunizationClaim.Note] ? [{ text: claims[ImmunizationClaim.Note] }] : undefined,
|
|
22
|
-
protocolApplied: (claims[ImmunizationClaim.Series] || claims[ImmunizationClaim.TargetDisease] || claims[ImmunizationClaim.DoseSequence]) ? [{
|
|
23
|
-
series: claims[ImmunizationClaim.Series],
|
|
24
|
-
targetDisease: claims[ImmunizationClaim.TargetDisease] ? [{ coding: codingFromValue(claims[ImmunizationClaim.TargetDisease]) }] : undefined,
|
|
25
|
-
doseNumberString: claims[ImmunizationClaim.DoseSequence],
|
|
26
|
-
}] : undefined,
|
|
27
|
-
reaction: claims[ImmunizationClaim.ReactionDate] ? [{ date: claims[ImmunizationClaim.ReactionDate] }] : undefined,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export function immunizationFhirR4ToFlat(resource) {
|
|
31
|
-
const reaction = Array.isArray(resource.reaction) ? resource.reaction[0] : undefined;
|
|
32
|
-
const protocolApplied = Array.isArray(resource.protocolApplied) ? resource.protocolApplied[0] : undefined;
|
|
33
|
-
const performer = Array.isArray(resource.performer)
|
|
34
|
-
? resource.performer.map((item) => referenceToValue(item?.actor)).filter((item) => Boolean(item))
|
|
35
|
-
: [];
|
|
36
|
-
return {
|
|
37
|
-
[ImmunizationClaim.Identifier]: resource.identifier?.[0]?.value,
|
|
38
|
-
[ImmunizationClaim.Date]: resource.occurrenceDateTime,
|
|
39
|
-
[ImmunizationClaim.Location]: referenceToValue(resource.location),
|
|
40
|
-
[ImmunizationClaim.LotNumber]: resource.lotNumber,
|
|
41
|
-
[ImmunizationClaim.Manufacturer]: referenceToValue(resource.manufacturer),
|
|
42
|
-
[ImmunizationClaim.Patient]: referenceToValue(resource.patient),
|
|
43
|
-
[ImmunizationClaim.Performer]: performer.length ? performer.join(',') : undefined,
|
|
44
|
-
[ImmunizationClaim.ReactionDate]: reaction?.date,
|
|
45
|
-
[ImmunizationClaim.ReasonCode]: codingToValue(resource.reasonCode?.[0]?.coding?.[0]),
|
|
46
|
-
[ImmunizationClaim.ReasonReference]: referenceToValue(resource.reasonReference?.[0]),
|
|
47
|
-
[ImmunizationClaim.Series]: protocolApplied?.series,
|
|
48
|
-
[ImmunizationClaim.Status]: resource.status,
|
|
49
|
-
[ImmunizationClaim.StatusReason]: codingToValue(resource.statusReason?.coding?.[0]),
|
|
50
|
-
[ImmunizationClaim.TargetDisease]: codingToValue(protocolApplied?.targetDisease?.[0]?.coding?.[0]),
|
|
51
|
-
[ImmunizationClaim.VaccineCode]: codingToValue(resource.vaccineCode?.coding?.[0]),
|
|
52
|
-
[ImmunizationClaim.DoseSequence]: protocolApplied?.doseNumberString,
|
|
53
|
-
[ImmunizationClaim.Subject]: referenceToValue(resource.patient),
|
|
54
|
-
[ImmunizationClaim.Note]: resource.note?.[0]?.text,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
-
// File: src/utils/convert-medication-statement.ts
|
|
3
|
-
import { MedicationStatementClaim } from '../models/interoperable-claims/medication-statement-claims.js';
|
|
4
|
-
import { codingFromValue, codingToValue, requireClaim } from './convert-shared.js';
|
|
5
|
-
export function medicationStatementFlatToFhirR4(claims) {
|
|
6
|
-
const subject = requireClaim(claims, MedicationStatementClaim.Subject);
|
|
7
|
-
const status = requireClaim(claims, MedicationStatementClaim.Status);
|
|
8
|
-
const effectiveDateTime = claims[MedicationStatementClaim.Effective];
|
|
9
|
-
const medicationText = claims[MedicationStatementClaim.MedicationText];
|
|
10
|
-
const medicationIdentifier = claims[MedicationStatementClaim.MedicationIdentifier];
|
|
11
|
-
const medicationSerialNumber = claims[MedicationStatementClaim.MedicationSerialNumber];
|
|
12
|
-
const medicationExpirationDate = claims[MedicationStatementClaim.MedicationExpirationDate];
|
|
13
|
-
const hasContainedMedication = Boolean(medicationIdentifier) || Boolean(medicationSerialNumber) || Boolean(medicationExpirationDate) || Boolean(medicationText);
|
|
14
|
-
const containedMedicationId = 'medication-contained-1';
|
|
15
|
-
const containedMedication = hasContainedMedication ? {
|
|
16
|
-
resourceType: 'Medication',
|
|
17
|
-
id: containedMedicationId,
|
|
18
|
-
identifier: medicationIdentifier ? [{ value: medicationIdentifier }] : undefined,
|
|
19
|
-
code: medicationText ? { text: medicationText } : undefined,
|
|
20
|
-
batch: medicationSerialNumber || medicationExpirationDate ? {
|
|
21
|
-
lotNumber: medicationSerialNumber,
|
|
22
|
-
expirationDate: medicationExpirationDate,
|
|
23
|
-
} : undefined,
|
|
24
|
-
} : undefined;
|
|
25
|
-
return {
|
|
26
|
-
resourceType: 'MedicationStatement',
|
|
27
|
-
identifier: claims[MedicationStatementClaim.Identifier] ? [{ value: claims[MedicationStatementClaim.Identifier] }] : undefined,
|
|
28
|
-
status,
|
|
29
|
-
subject: { reference: subject },
|
|
30
|
-
effectiveDateTime,
|
|
31
|
-
medicationCodeableConcept: claims[MedicationStatementClaim.Code]
|
|
32
|
-
? { coding: codingFromValue(claims[MedicationStatementClaim.Code]) }
|
|
33
|
-
: (!hasContainedMedication && medicationText ? { text: medicationText } : undefined),
|
|
34
|
-
medicationReference: hasContainedMedication ? { reference: `#${containedMedicationId}` } : undefined,
|
|
35
|
-
contained: containedMedication ? [containedMedication] : undefined,
|
|
36
|
-
dosage: claims[MedicationStatementClaim.DosageInstruction] ? [{ text: claims[MedicationStatementClaim.DosageInstruction] }] : undefined,
|
|
37
|
-
note: claims[MedicationStatementClaim.Note] ? [{ text: claims[MedicationStatementClaim.Note] }] : undefined,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export function medicationStatementFhirR4ToFlat(resource) {
|
|
41
|
-
const medicationReference = resource.medicationReference?.reference;
|
|
42
|
-
const containedResources = Array.isArray(resource.contained) ? resource.contained : [];
|
|
43
|
-
const containedMedication = medicationReference?.startsWith('#')
|
|
44
|
-
? containedResources.find((item) => item?.resourceType === 'Medication' && String(item?.id || '') === medicationReference.slice(1))
|
|
45
|
-
: containedResources.find((item) => item?.resourceType === 'Medication');
|
|
46
|
-
const containedMedicationIdentifier = containedMedication?.identifier?.[0]?.value;
|
|
47
|
-
const containedMedicationText = containedMedication?.code?.text;
|
|
48
|
-
const batch = containedMedication?.batch;
|
|
49
|
-
const medicationCode = codingToValue(resource.medicationCodeableConcept?.coding?.[0]);
|
|
50
|
-
const medicationText = containedMedicationText || resource.medicationCodeableConcept?.text || undefined;
|
|
51
|
-
return {
|
|
52
|
-
[MedicationStatementClaim.Identifier]: resource.identifier?.[0]?.value,
|
|
53
|
-
[MedicationStatementClaim.Subject]: resource.subject?.reference,
|
|
54
|
-
[MedicationStatementClaim.Status]: resource.status,
|
|
55
|
-
[MedicationStatementClaim.Effective]: resource.effectiveDateTime,
|
|
56
|
-
[MedicationStatementClaim.Code]: medicationCode,
|
|
57
|
-
[MedicationStatementClaim.MedicationText]: medicationText,
|
|
58
|
-
[MedicationStatementClaim.Note]: resource.note?.[0]?.text,
|
|
59
|
-
[MedicationStatementClaim.DosageInstruction]: resource.dosage?.[0]?.text,
|
|
60
|
-
[MedicationStatementClaim.MedicationIdentifier]: containedMedicationIdentifier,
|
|
61
|
-
[MedicationStatementClaim.MedicationSerialNumber]: batch?.lotNumber,
|
|
62
|
-
[MedicationStatementClaim.MedicationExpirationDate]: batch?.expirationDate,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
-
// File: src/utils/convert-observation.ts
|
|
3
|
-
import { ObservationClaim } from '../models/interoperable-claims/observation-claims.js';
|
|
4
|
-
import { codingFromValue, codingListToCsv, codingToValue, referenceListToCsv, referenceToValue } from './convert-shared.js';
|
|
5
|
-
export function observationFlatToFhirR4(claims) {
|
|
6
|
-
const subject = claims[ObservationClaim.Subject] ?? claims[ObservationClaim.Patient];
|
|
7
|
-
return {
|
|
8
|
-
resourceType: 'Observation',
|
|
9
|
-
identifier: claims[ObservationClaim.Identifier] ? [{ value: claims[ObservationClaim.Identifier] }] : undefined,
|
|
10
|
-
status: claims[ObservationClaim.Status],
|
|
11
|
-
category: claims[ObservationClaim.Category] ? claims[ObservationClaim.Category].split(',').map((value) => ({ coding: codingFromValue(value.trim()) })) : undefined,
|
|
12
|
-
code: claims[ObservationClaim.Code] ? { coding: codingFromValue(claims[ObservationClaim.Code]) } : undefined,
|
|
13
|
-
subject: subject ? { reference: subject } : undefined,
|
|
14
|
-
effectiveDateTime: claims[ObservationClaim.EffectiveDateTime] ?? claims[ObservationClaim.Date],
|
|
15
|
-
issued: claims[ObservationClaim.EffectiveDateTime] ? undefined : claims[ObservationClaim.Date],
|
|
16
|
-
performer: claims[ObservationClaim.Performer] ? claims[ObservationClaim.Performer].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
|
|
17
|
-
valueCodeableConcept: claims[ObservationClaim.ValueConcept] ? { coding: codingFromValue(claims[ObservationClaim.ValueConcept]) } : undefined,
|
|
18
|
-
valueDateTime: claims[ObservationClaim.ValueDate],
|
|
19
|
-
valueString: claims[ObservationClaim.ValueString],
|
|
20
|
-
note: claims[ObservationClaim.Note] ? [{ text: claims[ObservationClaim.Note] }] : undefined,
|
|
21
|
-
basedOn: claims[ObservationClaim.BasedOn] ? claims[ObservationClaim.BasedOn].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
|
|
22
|
-
device: claims[ObservationClaim.Device] ? { reference: claims[ObservationClaim.Device] } : undefined,
|
|
23
|
-
encounter: claims[ObservationClaim.Encounter] ? { reference: claims[ObservationClaim.Encounter] } : undefined,
|
|
24
|
-
focus: claims[ObservationClaim.Focus] ? claims[ObservationClaim.Focus].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
|
|
25
|
-
hasMember: claims[ObservationClaim.HasMember] ? claims[ObservationClaim.HasMember].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
|
|
26
|
-
method: claims[ObservationClaim.Method] ? { coding: codingFromValue(claims[ObservationClaim.Method]) } : undefined,
|
|
27
|
-
specimen: claims[ObservationClaim.Specimen] ? { reference: claims[ObservationClaim.Specimen] } : undefined,
|
|
28
|
-
component: claims[ObservationClaim.ComponentCode] ? [{ code: { coding: codingFromValue(claims[ObservationClaim.ComponentCode]) } }] : undefined,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export function observationFhirR4ToFlat(resource) {
|
|
32
|
-
const valueCodeableConcept = resource.valueCodeableConcept;
|
|
33
|
-
const component = Array.isArray(resource.component) ? resource.component[0] : undefined;
|
|
34
|
-
return {
|
|
35
|
-
[ObservationClaim.BasedOn]: referenceListToCsv(resource.basedOn),
|
|
36
|
-
[ObservationClaim.Category]: codingListToCsv(resource.category?.flatMap((item) => item.coding || [])),
|
|
37
|
-
[ObservationClaim.Code]: codingToValue(resource.code?.coding?.[0]),
|
|
38
|
-
[ObservationClaim.Date]: resource.effectiveDateTime || resource.issued,
|
|
39
|
-
[ObservationClaim.Device]: referenceToValue(resource.device),
|
|
40
|
-
[ObservationClaim.Encounter]: referenceToValue(resource.encounter),
|
|
41
|
-
[ObservationClaim.Focus]: referenceListToCsv(resource.focus),
|
|
42
|
-
[ObservationClaim.HasMember]: referenceListToCsv(resource.hasMember),
|
|
43
|
-
[ObservationClaim.Identifier]: resource.identifier?.[0]?.value,
|
|
44
|
-
[ObservationClaim.Method]: codingToValue(resource.method?.coding?.[0]),
|
|
45
|
-
[ObservationClaim.Patient]: referenceToValue(resource.subject),
|
|
46
|
-
[ObservationClaim.Performer]: referenceListToCsv(resource.performer),
|
|
47
|
-
[ObservationClaim.Specimen]: referenceToValue(resource.specimen),
|
|
48
|
-
[ObservationClaim.Status]: resource.status,
|
|
49
|
-
[ObservationClaim.Subject]: referenceToValue(resource.subject),
|
|
50
|
-
[ObservationClaim.ValueConcept]: codingToValue(valueCodeableConcept?.coding?.[0]),
|
|
51
|
-
[ObservationClaim.ValueDate]: resource.valueDateTime,
|
|
52
|
-
[ObservationClaim.ValueString]: resource.valueString,
|
|
53
|
-
[ObservationClaim.ComponentCode]: codingToValue(component?.code?.coding?.[0]),
|
|
54
|
-
[ObservationClaim.Note]: resource.note?.[0]?.text,
|
|
55
|
-
[ObservationClaim.EffectiveDateTime]: resource.effectiveDateTime,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
-
// File: src/utils/convert-procedure.ts
|
|
3
|
-
import { ProcedureClaim } from '../models/interoperable-claims/procedure-claims.js';
|
|
4
|
-
import { codingFromValue, codingToValue, referenceListToCsv, referenceToValue } from './convert-shared.js';
|
|
5
|
-
export function procedureFlatToFhirR4(claims) {
|
|
6
|
-
const subject = claims[ProcedureClaim.Subject] ?? claims[ProcedureClaim.Patient];
|
|
7
|
-
return {
|
|
8
|
-
resourceType: 'Procedure',
|
|
9
|
-
identifier: claims[ProcedureClaim.Identifier] ? [{ value: claims[ProcedureClaim.Identifier] }] : undefined,
|
|
10
|
-
status: claims[ProcedureClaim.Status],
|
|
11
|
-
subject: subject ? { reference: subject } : undefined,
|
|
12
|
-
code: claims[ProcedureClaim.Code] ? { coding: codingFromValue(claims[ProcedureClaim.Code]) } : undefined,
|
|
13
|
-
performedDateTime: claims[ProcedureClaim.Date],
|
|
14
|
-
note: claims[ProcedureClaim.Note] ? [{ text: claims[ProcedureClaim.Note] }] : undefined,
|
|
15
|
-
basedOn: claims[ProcedureClaim.BasedOn] ? claims[ProcedureClaim.BasedOn].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
|
|
16
|
-
bodySite: claims[ProcedureClaim.BodySite] ? [{ coding: codingFromValue(claims[ProcedureClaim.BodySite]) }] : undefined,
|
|
17
|
-
encounter: claims[ProcedureClaim.Encounter] ? { reference: claims[ProcedureClaim.Encounter] } : undefined,
|
|
18
|
-
instantiatesCanonical: claims[ProcedureClaim.InstantiatesCanonical] ? [claims[ProcedureClaim.InstantiatesCanonical]] : undefined,
|
|
19
|
-
instantiatesUri: claims[ProcedureClaim.InstantiatesUri] ? [claims[ProcedureClaim.InstantiatesUri]] : undefined,
|
|
20
|
-
location: claims[ProcedureClaim.Location] ? { reference: claims[ProcedureClaim.Location] } : undefined,
|
|
21
|
-
partOf: claims[ProcedureClaim.PartOf] ? claims[ProcedureClaim.PartOf].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
|
|
22
|
-
performer: claims[ProcedureClaim.Performer] ? claims[ProcedureClaim.Performer].split(',').map((reference) => ({ actor: { reference: reference.trim() } })) : undefined,
|
|
23
|
-
reasonCode: claims[ProcedureClaim.ReasonCode] ? [{ coding: codingFromValue(claims[ProcedureClaim.ReasonCode]) }] : undefined,
|
|
24
|
-
reasonReference: claims[ProcedureClaim.ReasonReference] ? claims[ProcedureClaim.ReasonReference].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export function procedureFhirR4ToFlat(resource) {
|
|
28
|
-
const performer = Array.isArray(resource.performer)
|
|
29
|
-
? resource.performer.map((item) => referenceToValue(item?.actor)).filter((item) => Boolean(item))
|
|
30
|
-
: [];
|
|
31
|
-
return {
|
|
32
|
-
[ProcedureClaim.BasedOn]: referenceListToCsv(resource.basedOn),
|
|
33
|
-
[ProcedureClaim.BodySite]: codingToValue(resource.bodySite?.[0]?.coding?.[0]),
|
|
34
|
-
[ProcedureClaim.Code]: codingToValue(resource.code?.coding?.[0]),
|
|
35
|
-
[ProcedureClaim.Date]: resource.performedDateTime || resource.performedPeriod?.start,
|
|
36
|
-
[ProcedureClaim.Encounter]: referenceToValue(resource.encounter),
|
|
37
|
-
[ProcedureClaim.Identifier]: resource.identifier?.[0]?.value,
|
|
38
|
-
[ProcedureClaim.InstantiatesCanonical]: Array.isArray(resource.instantiatesCanonical) ? resource.instantiatesCanonical[0] : undefined,
|
|
39
|
-
[ProcedureClaim.InstantiatesUri]: Array.isArray(resource.instantiatesUri) ? resource.instantiatesUri[0] : undefined,
|
|
40
|
-
[ProcedureClaim.Location]: referenceToValue(resource.location),
|
|
41
|
-
[ProcedureClaim.PartOf]: referenceListToCsv(resource.partOf),
|
|
42
|
-
[ProcedureClaim.Patient]: referenceToValue(resource.subject),
|
|
43
|
-
[ProcedureClaim.Performer]: performer.length ? performer.join(',') : undefined,
|
|
44
|
-
[ProcedureClaim.ReasonCode]: codingToValue(resource.reasonCode?.[0]?.coding?.[0]),
|
|
45
|
-
[ProcedureClaim.ReasonReference]: referenceListToCsv(resource.reasonReference),
|
|
46
|
-
[ProcedureClaim.Status]: resource.status,
|
|
47
|
-
[ProcedureClaim.Subject]: referenceToValue(resource.subject),
|
|
48
|
-
[ProcedureClaim.Note]: resource.note?.[0]?.text,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
-
// File: src/utils/convert-related-person.ts
|
|
3
|
-
import { RelatedPersonClaim } from '../models/interoperable-claims/related-person-claims.js';
|
|
4
|
-
import { codingFromValue, codingToValue, referenceToValue } from './convert-shared.js';
|
|
5
|
-
export function relatedPersonFlatToFhirR4(claims) {
|
|
6
|
-
return {
|
|
7
|
-
resourceType: 'RelatedPerson',
|
|
8
|
-
identifier: claims[RelatedPersonClaim.Identifier] ? [{ value: claims[RelatedPersonClaim.Identifier] }] : undefined,
|
|
9
|
-
active: claims[RelatedPersonClaim.Active] === undefined ? undefined : claims[RelatedPersonClaim.Active] === 'true',
|
|
10
|
-
patient: claims[RelatedPersonClaim.Patient] ? { reference: claims[RelatedPersonClaim.Patient] } : undefined,
|
|
11
|
-
relationship: claims[RelatedPersonClaim.Relationship] ? [{ coding: codingFromValue(claims[RelatedPersonClaim.Relationship]) }] : undefined,
|
|
12
|
-
name: claims[RelatedPersonClaim.Name] ? [{ text: claims[RelatedPersonClaim.Name] }] : undefined,
|
|
13
|
-
telecom: claims[RelatedPersonClaim.Telecom] ? [{ value: claims[RelatedPersonClaim.Telecom] }] : undefined,
|
|
14
|
-
gender: claims[RelatedPersonClaim.Gender],
|
|
15
|
-
birthDate: claims[RelatedPersonClaim.BirthDate],
|
|
16
|
-
address: claims[RelatedPersonClaim.Address] ? [{ text: claims[RelatedPersonClaim.Address] }] : undefined,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export function relatedPersonFhirR4ToFlat(resource) {
|
|
20
|
-
return {
|
|
21
|
-
[RelatedPersonClaim.Identifier]: resource.identifier?.[0]?.value,
|
|
22
|
-
[RelatedPersonClaim.Active]: resource.active === undefined ? undefined : String(resource.active),
|
|
23
|
-
[RelatedPersonClaim.Patient]: referenceToValue(resource.patient),
|
|
24
|
-
[RelatedPersonClaim.Relationship]: codingToValue(resource.relationship?.[0]?.coding?.[0]),
|
|
25
|
-
[RelatedPersonClaim.Name]: resource.name?.[0]?.text,
|
|
26
|
-
[RelatedPersonClaim.Telecom]: resource.telecom?.[0]?.value,
|
|
27
|
-
[RelatedPersonClaim.Gender]: resource.gender,
|
|
28
|
-
[RelatedPersonClaim.BirthDate]: resource.birthDate,
|
|
29
|
-
[RelatedPersonClaim.Address]: resource.address?.[0]?.text,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export type FlatClaims = Record<string, string | undefined>;
|
|
2
|
-
export type FhirResource = Record<string, unknown> & {
|
|
3
|
-
resourceType: string;
|
|
4
|
-
};
|
|
5
|
-
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
6
|
-
export declare function codingFromValue(value?: string): Array<{
|
|
7
|
-
system?: string;
|
|
8
|
-
code: string;
|
|
9
|
-
}> | undefined;
|
|
10
|
-
export declare function codingToValue(coding?: {
|
|
11
|
-
system?: string;
|
|
12
|
-
code?: string;
|
|
13
|
-
}): string | undefined;
|
|
14
|
-
export declare function referenceToValue(reference?: {
|
|
15
|
-
reference?: string;
|
|
16
|
-
}): string | undefined;
|
|
17
|
-
export declare function referenceListToCsv(references?: Array<{
|
|
18
|
-
reference?: string;
|
|
19
|
-
}>): string | undefined;
|
|
20
|
-
export declare function codingListToCsv(codings?: Array<{
|
|
21
|
-
system?: string;
|
|
22
|
-
code?: string;
|
|
23
|
-
}>): string | undefined;
|
|
24
|
-
export declare function requireClaim(claims: FlatClaims, key: string): string;
|
|
25
|
-
export declare function requireSubjectIdentifier(value: string, key: string): void;
|
|
26
|
-
export declare function requireDidWeb(value: string, key: string): void;
|
|
27
|
-
/**
|
|
28
|
-
* Generic structural fallback for unsupported resources.
|
|
29
|
-
*/
|
|
30
|
-
export declare function fhirResourceToFlatClaims(resource: FhirResource, context?: string): FlatClaims;
|
|
31
|
-
/**
|
|
32
|
-
* Generic structural regeneration for unsupported resources.
|
|
33
|
-
*/
|
|
34
|
-
export declare function flatClaimsToFhirResource(claims: FlatClaims): FhirResource;
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
-
// File: src/utils/convert-shared.ts
|
|
3
|
-
export function isPlainObject(value) {
|
|
4
|
-
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
5
|
-
}
|
|
6
|
-
export function codingFromValue(value) {
|
|
7
|
-
if (!value)
|
|
8
|
-
return undefined;
|
|
9
|
-
const [system, code] = value.split('|');
|
|
10
|
-
if (!code)
|
|
11
|
-
return [{ code: system }];
|
|
12
|
-
return [{ system, code }];
|
|
13
|
-
}
|
|
14
|
-
export function codingToValue(coding) {
|
|
15
|
-
if (!coding?.code)
|
|
16
|
-
return undefined;
|
|
17
|
-
return coding.system ? `${coding.system}|${coding.code}` : coding.code;
|
|
18
|
-
}
|
|
19
|
-
export function referenceToValue(reference) {
|
|
20
|
-
return reference?.reference;
|
|
21
|
-
}
|
|
22
|
-
export function referenceListToCsv(references) {
|
|
23
|
-
const values = (references || [])
|
|
24
|
-
.map((item) => item?.reference)
|
|
25
|
-
.filter((item) => Boolean(item));
|
|
26
|
-
return values.length ? values.join(',') : undefined;
|
|
27
|
-
}
|
|
28
|
-
export function codingListToCsv(codings) {
|
|
29
|
-
const values = (codings || [])
|
|
30
|
-
.map((item) => codingToValue(item))
|
|
31
|
-
.filter((item) => Boolean(item));
|
|
32
|
-
return values.length ? values.join(',') : undefined;
|
|
33
|
-
}
|
|
34
|
-
export function requireClaim(claims, key) {
|
|
35
|
-
const value = claims[key];
|
|
36
|
-
if (!value)
|
|
37
|
-
throw new Error(`Missing required claim: ${key}`);
|
|
38
|
-
return value;
|
|
39
|
-
}
|
|
40
|
-
export function requireSubjectIdentifier(value, key) {
|
|
41
|
-
if (!value.startsWith('urn:') && !value.startsWith('did:web:')) {
|
|
42
|
-
throw new Error(`Invalid ${key}: expected urn:* or did:web:*`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
export function requireDidWeb(value, key) {
|
|
46
|
-
if (!value.startsWith('did:web:')) {
|
|
47
|
-
throw new Error(`Invalid ${key}: expected did:web:*`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function stringifyClaimLeaf(value) {
|
|
51
|
-
if (value === undefined || value === null)
|
|
52
|
-
return undefined;
|
|
53
|
-
if (typeof value === 'string')
|
|
54
|
-
return value;
|
|
55
|
-
if (typeof value === 'number' || typeof value === 'boolean')
|
|
56
|
-
return String(value);
|
|
57
|
-
return undefined;
|
|
58
|
-
}
|
|
59
|
-
function flattenClaimPath(prefix, value, out) {
|
|
60
|
-
const primitive = stringifyClaimLeaf(value);
|
|
61
|
-
if (primitive !== undefined) {
|
|
62
|
-
out[prefix] = primitive;
|
|
63
|
-
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
64
|
-
out[`${prefix}#type`] = typeof value;
|
|
65
|
-
}
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
if (Array.isArray(value)) {
|
|
69
|
-
value.forEach((entry, index) => {
|
|
70
|
-
flattenClaimPath(`${prefix}[${index}]`, entry, out);
|
|
71
|
-
});
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (isPlainObject(value)) {
|
|
75
|
-
for (const [key, nestedValue] of Object.entries(value)) {
|
|
76
|
-
if (key === 'meta' && isPlainObject(nestedValue) && 'claims' in nestedValue) {
|
|
77
|
-
const nestedMeta = { ...nestedValue };
|
|
78
|
-
delete nestedMeta.claims;
|
|
79
|
-
if (Object.keys(nestedMeta).length === 0)
|
|
80
|
-
continue;
|
|
81
|
-
flattenClaimPath(`${prefix}.${key}`, nestedMeta, out);
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
flattenClaimPath(`${prefix}.${key}`, nestedValue, out);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
function parseClaimPath(path) {
|
|
89
|
-
const segments = [];
|
|
90
|
-
const re = /([^[.\]]+)|\[(\d+)\]/g;
|
|
91
|
-
let match;
|
|
92
|
-
while ((match = re.exec(path)) !== null) {
|
|
93
|
-
if (match[1])
|
|
94
|
-
segments.push(match[1]);
|
|
95
|
-
else if (match[2])
|
|
96
|
-
segments.push(Number(match[2]));
|
|
97
|
-
}
|
|
98
|
-
return segments;
|
|
99
|
-
}
|
|
100
|
-
function coerceClaimLeaf(value, typeHint) {
|
|
101
|
-
if (typeHint === 'boolean')
|
|
102
|
-
return value === 'true';
|
|
103
|
-
if (typeHint === 'number')
|
|
104
|
-
return Number(value);
|
|
105
|
-
return value;
|
|
106
|
-
}
|
|
107
|
-
function assignInflatedPath(target, path, value, typeHint) {
|
|
108
|
-
const segments = parseClaimPath(path);
|
|
109
|
-
if (segments.length === 0)
|
|
110
|
-
return;
|
|
111
|
-
let cursor = target;
|
|
112
|
-
for (let index = 0; index < segments.length; index += 1) {
|
|
113
|
-
const segment = segments[index];
|
|
114
|
-
const nextSegment = segments[index + 1];
|
|
115
|
-
const isLast = index === segments.length - 1;
|
|
116
|
-
if (typeof segment === 'number') {
|
|
117
|
-
if (!Array.isArray(cursor))
|
|
118
|
-
return;
|
|
119
|
-
if (isLast) {
|
|
120
|
-
cursor[segment] = coerceClaimLeaf(value, typeHint);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
if (cursor[segment] === undefined)
|
|
124
|
-
cursor[segment] = typeof nextSegment === 'number' ? [] : {};
|
|
125
|
-
cursor = cursor[segment];
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
if (!isPlainObject(cursor))
|
|
129
|
-
return;
|
|
130
|
-
if (isLast) {
|
|
131
|
-
cursor[segment] = coerceClaimLeaf(value, typeHint);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
if (cursor[segment] === undefined)
|
|
135
|
-
cursor[segment] = typeof nextSegment === 'number' ? [] : {};
|
|
136
|
-
cursor = cursor[segment];
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Generic structural fallback for unsupported resources.
|
|
141
|
-
*/
|
|
142
|
-
export function fhirResourceToFlatClaims(resource, context = 'org.hl7.fhir.r4') {
|
|
143
|
-
if (!resource?.resourceType) {
|
|
144
|
-
throw new Error('FHIR resource must define resourceType.');
|
|
145
|
-
}
|
|
146
|
-
const out = { '@context': context };
|
|
147
|
-
for (const [key, value] of Object.entries(resource)) {
|
|
148
|
-
if (key === 'resourceType')
|
|
149
|
-
continue;
|
|
150
|
-
flattenClaimPath(`${resource.resourceType}.${key}`, value, out);
|
|
151
|
-
}
|
|
152
|
-
return out;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Generic structural regeneration for unsupported resources.
|
|
156
|
-
*/
|
|
157
|
-
export function flatClaimsToFhirResource(claims) {
|
|
158
|
-
const typeHints = new Map();
|
|
159
|
-
for (const [key, value] of Object.entries(claims || {})) {
|
|
160
|
-
if (key.endsWith('#type') && typeof value === 'string') {
|
|
161
|
-
typeHints.set(key.slice(0, -5), value);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
const entries = Object.entries(claims || {}).filter(([key, value]) => key !== '@context' && !key.endsWith('#type') && value !== undefined);
|
|
165
|
-
const firstClaimKey = entries[0]?.[0];
|
|
166
|
-
if (!firstClaimKey || !firstClaimKey.includes('.')) {
|
|
167
|
-
throw new Error('Flat claims must contain at least one contextualized resource claim.');
|
|
168
|
-
}
|
|
169
|
-
const resourceType = firstClaimKey.split('.')[0];
|
|
170
|
-
const resource = { resourceType };
|
|
171
|
-
for (const [key, value] of entries) {
|
|
172
|
-
if (typeof value !== 'string')
|
|
173
|
-
continue;
|
|
174
|
-
if (!key.startsWith(`${resourceType}.`))
|
|
175
|
-
continue;
|
|
176
|
-
assignInflatedPath(resource, key.slice(resourceType.length + 1), value, typeHints.get(key));
|
|
177
|
-
}
|
|
178
|
-
return resource;
|
|
179
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type GenericInteroperableClaims } from './claim-list-helpers.js';
|
|
2
|
-
export type CoverageInteroperableClaims = GenericInteroperableClaims;
|
|
3
|
-
export declare function getCoverageClaimList(claims: CoverageInteroperableClaims, claimKey: string): string[];
|
|
4
|
-
export declare function setCoverageClaimList(claims: CoverageInteroperableClaims, claimKey: string, values: string | readonly string[]): CoverageInteroperableClaims;
|
|
5
|
-
export declare function addCoverageClaimList(claims: CoverageInteroperableClaims, claimKey: string, values: string | readonly string[]): CoverageInteroperableClaims;
|
|
6
|
-
export declare function removeCoverageClaimList(claims: CoverageInteroperableClaims, claimKey: string, values: string | readonly string[]): CoverageInteroperableClaims;
|
|
7
|
-
export declare function getCoverageIdentifier(claims: CoverageInteroperableClaims): string;
|
|
8
|
-
export declare function setCoverageIdentifier(claims: CoverageInteroperableClaims, value: string): CoverageInteroperableClaims;
|
|
9
|
-
export declare function getCoveragePayorList(claims: CoverageInteroperableClaims): string[];
|
|
10
|
-
export declare function setCoveragePayorList(claims: CoverageInteroperableClaims, values: string | readonly string[]): CoverageInteroperableClaims;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { CoverageClaim } from '../models/interoperable-claims/coverage-claims.js';
|
|
2
|
-
import { addClaimValues, getClaimValues, normalizeClaimScalar, removeClaimValues, setClaimValues, } from './claim-list-helpers.js';
|
|
3
|
-
export function getCoverageClaimList(claims, claimKey) {
|
|
4
|
-
return getClaimValues(claims, claimKey);
|
|
5
|
-
}
|
|
6
|
-
export function setCoverageClaimList(claims, claimKey, values) {
|
|
7
|
-
return setClaimValues(claims, claimKey, values);
|
|
8
|
-
}
|
|
9
|
-
export function addCoverageClaimList(claims, claimKey, values) {
|
|
10
|
-
return addClaimValues(claims, claimKey, values);
|
|
11
|
-
}
|
|
12
|
-
export function removeCoverageClaimList(claims, claimKey, values) {
|
|
13
|
-
return removeClaimValues(claims, claimKey, values);
|
|
14
|
-
}
|
|
15
|
-
export function getCoverageIdentifier(claims) {
|
|
16
|
-
return normalizeClaimScalar(claims[CoverageClaim.Identifier]);
|
|
17
|
-
}
|
|
18
|
-
export function setCoverageIdentifier(claims, value) {
|
|
19
|
-
return { ...claims, [CoverageClaim.Identifier]: normalizeClaimScalar(value) };
|
|
20
|
-
}
|
|
21
|
-
export function getCoveragePayorList(claims) {
|
|
22
|
-
return getCoverageClaimList(claims, CoverageClaim.Payor);
|
|
23
|
-
}
|
|
24
|
-
export function setCoveragePayorList(claims, values) {
|
|
25
|
-
return setCoverageClaimList(claims, CoverageClaim.Payor, values);
|
|
26
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type GenericInteroperableClaims } from './claim-list-helpers.js';
|
|
2
|
-
export type DiagnosticReportInteroperableClaims = GenericInteroperableClaims;
|
|
3
|
-
export declare function getDiagnosticReportClaimList(claims: DiagnosticReportInteroperableClaims, claimKey: string): string[];
|
|
4
|
-
export declare function setDiagnosticReportClaimList(claims: DiagnosticReportInteroperableClaims, claimKey: string, values: string | readonly string[]): DiagnosticReportInteroperableClaims;
|
|
5
|
-
export declare function addDiagnosticReportClaimList(claims: DiagnosticReportInteroperableClaims, claimKey: string, values: string | readonly string[]): DiagnosticReportInteroperableClaims;
|
|
6
|
-
export declare function removeDiagnosticReportClaimList(claims: DiagnosticReportInteroperableClaims, claimKey: string, values: string | readonly string[]): DiagnosticReportInteroperableClaims;
|
|
7
|
-
export declare function getDiagnosticReportIdentifier(claims: DiagnosticReportInteroperableClaims): string;
|
|
8
|
-
export declare function setDiagnosticReportIdentifier(claims: DiagnosticReportInteroperableClaims, value: string): DiagnosticReportInteroperableClaims;
|
|
9
|
-
export declare function getDiagnosticReportResultList(claims: DiagnosticReportInteroperableClaims): string[];
|
|
10
|
-
export declare function setDiagnosticReportResultList(claims: DiagnosticReportInteroperableClaims, values: string | readonly string[]): DiagnosticReportInteroperableClaims;
|
|
11
|
-
export declare function getDiagnosticReportContainedDocumentIdentifierList(claims: DiagnosticReportInteroperableClaims): string[];
|
|
12
|
-
export declare function setDiagnosticReportContainedDocumentIdentifierList(claims: DiagnosticReportInteroperableClaims, values: string | readonly string[]): DiagnosticReportInteroperableClaims;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { DiagnosticReportClaim } from '../models/interoperable-claims/diagnostic-report-claims.js';
|
|
2
|
-
import { addClaimValues, getClaimValues, normalizeClaimScalar, removeClaimValues, setClaimValues, } from './claim-list-helpers.js';
|
|
3
|
-
export function getDiagnosticReportClaimList(claims, claimKey) {
|
|
4
|
-
return getClaimValues(claims, claimKey);
|
|
5
|
-
}
|
|
6
|
-
export function setDiagnosticReportClaimList(claims, claimKey, values) {
|
|
7
|
-
return setClaimValues(claims, claimKey, values);
|
|
8
|
-
}
|
|
9
|
-
export function addDiagnosticReportClaimList(claims, claimKey, values) {
|
|
10
|
-
return addClaimValues(claims, claimKey, values);
|
|
11
|
-
}
|
|
12
|
-
export function removeDiagnosticReportClaimList(claims, claimKey, values) {
|
|
13
|
-
return removeClaimValues(claims, claimKey, values);
|
|
14
|
-
}
|
|
15
|
-
export function getDiagnosticReportIdentifier(claims) {
|
|
16
|
-
return normalizeClaimScalar(claims[DiagnosticReportClaim.Identifier]);
|
|
17
|
-
}
|
|
18
|
-
export function setDiagnosticReportIdentifier(claims, value) {
|
|
19
|
-
return { ...claims, [DiagnosticReportClaim.Identifier]: normalizeClaimScalar(value) };
|
|
20
|
-
}
|
|
21
|
-
export function getDiagnosticReportResultList(claims) {
|
|
22
|
-
return getDiagnosticReportClaimList(claims, DiagnosticReportClaim.Result);
|
|
23
|
-
}
|
|
24
|
-
export function setDiagnosticReportResultList(claims, values) {
|
|
25
|
-
return setDiagnosticReportClaimList(claims, DiagnosticReportClaim.Result, values);
|
|
26
|
-
}
|
|
27
|
-
export function getDiagnosticReportContainedDocumentIdentifierList(claims) {
|
|
28
|
-
return getDiagnosticReportClaimList(claims, DiagnosticReportClaim.ContainedDocuments);
|
|
29
|
-
}
|
|
30
|
-
export function setDiagnosticReportContainedDocumentIdentifierList(claims, values) {
|
|
31
|
-
return setDiagnosticReportClaimList(claims, DiagnosticReportClaim.ContainedDocuments, values);
|
|
32
|
-
}
|