gdc-common-utils-ts 2.3.26 → 2.3.27

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.
Files changed (49) hide show
  1. package/README.md +5 -0
  2. package/dist/convert/convert-care-plan.js +25 -1
  3. package/dist/convert/convert-condition.js +12 -0
  4. package/dist/convert/convert-consent.js +59 -13
  5. package/dist/convert/convert-device-use-statement.js +3 -1
  6. package/dist/convert/convert-immunization.js +12 -2
  7. package/dist/convert/convert-medication-statement.js +35 -1
  8. package/dist/convert/convert-observation.js +43 -2
  9. package/dist/convert/convert-practitioner-role.d.ts +1 -1
  10. package/dist/convert/convert-practitioner-role.js +41 -13
  11. package/dist/convert/convert-shared.js +1 -1
  12. package/dist/models/consent-rule.d.ts +7 -0
  13. package/dist/models/consent-rule.js +7 -0
  14. package/dist/models/indexing.d.ts +4 -4
  15. package/dist/models/interoperable-claims/appointment-claims.d.ts +54 -54
  16. package/dist/models/interoperable-claims/appointment-claims.js +28 -29
  17. package/dist/models/interoperable-claims/appointment-response-claims.d.ts +11 -11
  18. package/dist/models/interoperable-claims/appointment-response-claims.js +11 -11
  19. package/dist/models/interoperable-claims/care-plan-claims.d.ts +11 -0
  20. package/dist/models/interoperable-claims/care-plan-claims.js +11 -0
  21. package/dist/models/interoperable-claims/condition-claims.d.ts +2 -0
  22. package/dist/models/interoperable-claims/condition-claims.js +2 -0
  23. package/dist/models/interoperable-claims/device-use-statement-claims.d.ts +3 -2
  24. package/dist/models/interoperable-claims/device-use-statement-claims.js +3 -2
  25. package/dist/models/interoperable-claims/immunization-claims.d.ts +4 -0
  26. package/dist/models/interoperable-claims/immunization-claims.js +4 -0
  27. package/dist/models/interoperable-claims/medication-statement-claims.d.ts +6 -0
  28. package/dist/models/interoperable-claims/medication-statement-claims.js +6 -0
  29. package/dist/models/interoperable-claims/observation-claims.d.ts +12 -4
  30. package/dist/models/interoperable-claims/observation-claims.js +10 -2
  31. package/dist/models/interoperable-claims/practitioner-role-claims.d.ts +9 -0
  32. package/dist/models/interoperable-claims/practitioner-role-claims.js +9 -0
  33. package/dist/models/params.d.ts +1 -1
  34. package/dist/utils/bundle-document-builder.js +37 -16
  35. package/dist/utils/bundle-entry-editor.d.ts +13 -0
  36. package/dist/utils/bundle-entry-editor.js +18 -0
  37. package/dist/utils/clinical-resource-converters.js +6 -4
  38. package/dist/utils/clinical-resource-view.d.ts +55 -0
  39. package/dist/utils/clinical-resource-view.js +137 -1
  40. package/dist/utils/communication-bundle-document-request.js +1 -1
  41. package/dist/utils/communication-fhir-r4.js +1 -1
  42. package/dist/utils/fhir-api-claim-helpers.d.ts +2 -0
  43. package/dist/utils/fhir-api-claim-helpers.js +16 -0
  44. package/dist/utils/ips-bundle-claims.d.ts +3 -4
  45. package/dist/utils/ips-bundle-claims.js +7 -7
  46. package/dist/utils/medication-statement-entry-editor.js +10 -10
  47. package/dist/utils/observation-component-entry-editor.d.ts +2 -2
  48. package/dist/utils/observation-component-entry-editor.js +2 -2
  49. package/package.json +1 -1
package/README.md CHANGED
@@ -49,6 +49,11 @@ It is intentionally not a full backend orchestration layer.
49
49
  `Communication.topic`; the native projection may contain
50
50
  `Communication.topic.coding`, but `Communication.topic.coding` is not a
51
51
  claims key.
52
+ - FHIR claims are version-independent FHIR API SearchParameter claims. Their
53
+ only context is `@context: org.hl7.fhir.api`; an expanded key is therefore
54
+ `org.hl7.fhir.api.<ResourceType>.<concrete-parameter>`. Never use
55
+ `org.hl7.fhir.r4.*` as a claim namespace: R4 identifies a native FHIR
56
+ resource representation, not the claims vocabulary.
52
57
  - Schema.org claims are a different vocabulary and preserve the canonical
53
58
  Schema.org camelCase property name.
54
59
  - Only define custom names when no canonical FHIR SearchParameter exists.
@@ -21,6 +21,8 @@ export function carePlanFlatToFhirR4(claims) {
21
21
  }]
22
22
  : undefined,
23
23
  created: claims[CarePlanClaim.Date],
24
+ description: claims[CarePlanClaim.Description],
25
+ period: claims[CarePlanClaim.PeriodStart] || claims[CarePlanClaim.PeriodEnd] ? { start: claims[CarePlanClaim.PeriodStart], end: claims[CarePlanClaim.PeriodEnd] } : undefined,
24
26
  note: claims[CarePlanClaim.Note] ? [{ text: claims[CarePlanClaim.Note] }] : undefined,
25
27
  basedOn: claims[CarePlanClaim.BasedOn] ? claims[CarePlanClaim.BasedOn].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
26
28
  careTeam: claims[CarePlanClaim.CareTeam] ? claims[CarePlanClaim.CareTeam].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
@@ -29,12 +31,22 @@ export function carePlanFlatToFhirR4(claims) {
29
31
  goal: claims[CarePlanClaim.Goal] ? claims[CarePlanClaim.Goal].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
30
32
  partOf: claims[CarePlanClaim.PartOf] ? claims[CarePlanClaim.PartOf].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
31
33
  replaces: claims[CarePlanClaim.Replaces] ? claims[CarePlanClaim.Replaces].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
32
- activity: (claims[CarePlanClaim.ActivityCode] || claims[CarePlanClaim.ActivityDate] || claims[CarePlanClaim.ActivityReference] || claims[CarePlanClaim.Performer]) ? [{
34
+ activity: (claims[CarePlanClaim.ActivityCode] || claims[CarePlanClaim.ActivityDate] || claims[CarePlanClaim.ActivityReference] || claims[CarePlanClaim.Performer] || claims[CarePlanClaim.ActivityStatus]) ? [{
35
+ outcomeCodeableConcept: claims[CarePlanClaim.ActivityOutcome] ? [{ coding: codingFromValue(claims[CarePlanClaim.ActivityOutcome]) }] : undefined,
33
36
  reference: claims[CarePlanClaim.ActivityReference] ? { reference: claims[CarePlanClaim.ActivityReference] } : undefined,
34
37
  detail: {
35
38
  code: claims[CarePlanClaim.ActivityCode] ? { coding: codingFromValue(claims[CarePlanClaim.ActivityCode]) } : undefined,
36
39
  scheduledString: claims[CarePlanClaim.ActivityDate],
37
40
  performer: claims[CarePlanClaim.Performer] ? claims[CarePlanClaim.Performer].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
41
+ status: claims[CarePlanClaim.ActivityStatus],
42
+ statusReason: claims[CarePlanClaim.ActivityStatusReason] ? { text: claims[CarePlanClaim.ActivityStatusReason] } : undefined,
43
+ doNotPerform: claims[CarePlanClaim.ActivityDoNotPerform] === undefined ? undefined : claims[CarePlanClaim.ActivityDoNotPerform] === 'true',
44
+ scheduledTiming: claims[CarePlanClaim.ActivityTimingFrequency] || claims[CarePlanClaim.ActivityTimingPeriod] ? { repeat: {
45
+ frequency: claims[CarePlanClaim.ActivityTimingFrequency] ? Number(claims[CarePlanClaim.ActivityTimingFrequency]) : undefined,
46
+ period: claims[CarePlanClaim.ActivityTimingPeriod] ? Number(claims[CarePlanClaim.ActivityTimingPeriod]) : undefined,
47
+ periodUnit: claims[CarePlanClaim.ActivityTimingPeriodUnit],
48
+ } } : undefined,
49
+ location: claims[CarePlanClaim.ActivityLocationDisplay] ? { display: claims[CarePlanClaim.ActivityLocationDisplay] } : undefined,
38
50
  },
39
51
  }] : undefined,
40
52
  };
@@ -43,6 +55,7 @@ export function carePlanFhirR4ToFlat(resource) {
43
55
  const activity = Array.isArray(resource.activity) ? resource.activity[0] : undefined;
44
56
  const detail = activity?.detail;
45
57
  const period = resource.period;
58
+ const repeat = detail?.scheduledTiming?.repeat;
46
59
  return {
47
60
  [CarePlanClaim.ActivityCode]: codingToValue(detail?.code?.coding?.[0]),
48
61
  [CarePlanClaim.ActivityDate]: detail?.scheduledString,
@@ -65,5 +78,16 @@ export function carePlanFhirR4ToFlat(resource) {
65
78
  [CarePlanClaim.Status]: resource.status,
66
79
  [CarePlanClaim.Subject]: referenceToValue(resource.subject),
67
80
  [CarePlanClaim.Note]: resource.note?.[0]?.text,
81
+ [CarePlanClaim.Description]: resource.description,
82
+ [CarePlanClaim.PeriodStart]: period?.start,
83
+ [CarePlanClaim.PeriodEnd]: period?.end,
84
+ [CarePlanClaim.ActivityStatus]: detail?.status,
85
+ [CarePlanClaim.ActivityStatusReason]: detail?.statusReason?.text,
86
+ [CarePlanClaim.ActivityDoNotPerform]: detail?.doNotPerform === undefined ? undefined : String(detail.doNotPerform),
87
+ [CarePlanClaim.ActivityOutcome]: codingToValue(activity?.outcomeCodeableConcept?.[0]?.coding?.[0]),
88
+ [CarePlanClaim.ActivityLocationDisplay]: detail?.location?.display,
89
+ [CarePlanClaim.ActivityTimingFrequency]: repeat?.frequency === undefined ? undefined : String(repeat.frequency),
90
+ [CarePlanClaim.ActivityTimingPeriod]: repeat?.period === undefined ? undefined : String(repeat.period),
91
+ [CarePlanClaim.ActivityTimingPeriodUnit]: repeat?.periodUnit,
68
92
  };
69
93
  }
@@ -23,6 +23,12 @@ export function conditionFlatToFhirR4(claims) {
23
23
  : undefined,
24
24
  clinicalStatus: claims[ConditionClaim.ClinicalStatus] ? { coding: [{ code: claims[ConditionClaim.ClinicalStatus] }] } : undefined,
25
25
  verificationStatus: claims[ConditionClaim.VerificationStatus] ? { coding: [{ code: claims[ConditionClaim.VerificationStatus] }] } : undefined,
26
+ category: claims[ConditionClaim.Category] ? [{ coding: codingFromValue(claims[ConditionClaim.Category]) }] : undefined,
27
+ severity: claims[ConditionClaim.Severity] ? { coding: codingFromValue(claims[ConditionClaim.Severity]) } : undefined,
28
+ onsetDateTime: claims[ConditionClaim.OnsetDateTime],
29
+ recordedDate: claims[ConditionClaim.RecordedDate],
30
+ asserter: claims[ConditionClaim.Asserter] ? { reference: claims[ConditionClaim.Asserter] } : undefined,
31
+ recorder: claims[ConditionClaim.Recorder] ? { reference: claims[ConditionClaim.Recorder] } : undefined,
26
32
  };
27
33
  }
28
34
  export function conditionFhirR4ToFlat(resource) {
@@ -35,5 +41,11 @@ export function conditionFhirR4ToFlat(resource) {
35
41
  [ConditionClaim.CodeDisplay]: code?.coding?.[0]?.display,
36
42
  [ConditionClaim.ClinicalStatus]: resource.clinicalStatus?.coding?.[0]?.code,
37
43
  [ConditionClaim.VerificationStatus]: resource.verificationStatus?.coding?.[0]?.code,
44
+ [ConditionClaim.Category]: codingToValue(resource.category?.[0]?.coding?.[0]),
45
+ [ConditionClaim.Severity]: codingToValue(resource.severity?.coding?.[0]),
46
+ [ConditionClaim.OnsetDateTime]: resource.onsetDateTime,
47
+ [ConditionClaim.RecordedDate]: resource.recordedDate,
48
+ [ConditionClaim.Asserter]: resource.asserter?.reference,
49
+ [ConditionClaim.Recorder]: resource.recorder?.reference,
38
50
  };
39
51
  }
@@ -1,32 +1,78 @@
1
1
  // Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
2
  import { ClaimConsent } from '../models/consent-rule.js';
3
- import { codingFromValue, codingToValue, fhirResourceToFlatClaims, flatClaimsToFhirResource, } from './convert-shared.js';
4
- export function consentFhirR4ToFlat(resource, context = 'org.hl7.fhir.r4') {
3
+ import { codingFromValue, codingToValue, referenceToValue, } from './convert-shared.js';
4
+ export function consentFhirR4ToFlat(resource, context = 'org.hl7.fhir.api') {
5
5
  const concept = resource.category?.[0];
6
+ const provision = resource.provision;
7
+ const scope = resource.scope;
8
+ const policyRule = resource.policyRule;
6
9
  return {
7
- ...fhirResourceToFlatClaims(resource, context),
10
+ '@context': context,
11
+ [ClaimConsent.identifier]: resource.identifier?.[0]?.value
12
+ || resource.id,
13
+ [ClaimConsent.status]: resource.status,
14
+ [ClaimConsent.subject]: referenceToValue(resource.patient),
15
+ [ClaimConsent.patient]: referenceToValue(resource.patient),
16
+ [ClaimConsent.date]: resource.dateTime,
17
+ [ClaimConsent.decision]: provision?.type,
18
+ [ClaimConsent.action]: codingToValue(provision?.action?.[0]?.coding?.[0]),
19
+ [ClaimConsent.periodStart]: provision?.period?.start,
20
+ [ClaimConsent.periodEnd]: provision?.period?.end,
21
+ [ClaimConsent.purpose]: codingToValue(provision?.purpose?.[0]),
22
+ [ClaimConsent.sourceReference]: referenceToValue(resource.sourceReference),
8
23
  [ClaimConsent.category]: codingToValue(concept?.coding?.[0]),
9
24
  [ClaimConsent.categoryText]: concept?.text,
10
25
  [ClaimConsent.categoryDisplay]: concept?.coding?.[0]?.display,
26
+ [ClaimConsent.scope]: codingToValue(scope?.coding?.[0]),
27
+ [ClaimConsent.scopeDisplay]: scope?.coding?.[0]?.display,
28
+ [ClaimConsent.policyRule]: codingToValue(policyRule?.coding?.[0]),
29
+ [ClaimConsent.provisionCode]: codingToValue(provision?.code?.[0]?.coding?.[0]),
30
+ [ClaimConsent.provisionCodeDisplay]: provision?.code?.[0]?.coding?.[0]?.display,
11
31
  };
12
32
  }
13
33
  export function consentFlatToFhirR4(claims) {
14
- const structuralClaims = { ...claims };
15
- delete structuralClaims[ClaimConsent.category];
16
- delete structuralClaims[ClaimConsent.categoryText];
17
- delete structuralClaims[ClaimConsent.categoryDisplay];
18
- const resource = flatClaimsToFhirResource(structuralClaims);
19
34
  const coding = codingFromValue(claims[ClaimConsent.category])?.map((item) => ({
20
35
  ...item,
21
36
  ...(claims[ClaimConsent.categoryDisplay]
22
37
  ? { display: claims[ClaimConsent.categoryDisplay] }
23
38
  : {}),
24
39
  }));
25
- if (coding || claims[ClaimConsent.categoryText]) {
26
- resource.category = [{
40
+ const actionCoding = codingFromValue(claims[ClaimConsent.action]);
41
+ const purposeCoding = codingFromValue(claims[ClaimConsent.purpose]);
42
+ const scopeCoding = codingFromValue(claims[ClaimConsent.scope])?.map((item) => ({ ...item, ...(claims[ClaimConsent.scopeDisplay] ? { display: claims[ClaimConsent.scopeDisplay] } : {}) }));
43
+ const provisionCodeCoding = codingFromValue(claims[ClaimConsent.provisionCode])?.map((item) => ({ ...item, ...(claims[ClaimConsent.provisionCodeDisplay] ? { display: claims[ClaimConsent.provisionCodeDisplay] } : {}) }));
44
+ return {
45
+ resourceType: 'Consent',
46
+ identifier: claims[ClaimConsent.identifier] ? [{ value: claims[ClaimConsent.identifier] }] : undefined,
47
+ status: claims[ClaimConsent.status],
48
+ scope: scopeCoding ? { coding: scopeCoding } : undefined,
49
+ policyRule: claims[ClaimConsent.policyRule] ? { coding: codingFromValue(claims[ClaimConsent.policyRule]) } : undefined,
50
+ patient: claims[ClaimConsent.subject] || claims[ClaimConsent.patient]
51
+ ? { reference: claims[ClaimConsent.subject] || claims[ClaimConsent.patient] }
52
+ : undefined,
53
+ dateTime: claims[ClaimConsent.date],
54
+ sourceReference: claims[ClaimConsent.sourceReference]
55
+ ? { reference: claims[ClaimConsent.sourceReference] }
56
+ : undefined,
57
+ category: coding || claims[ClaimConsent.categoryText] ? [{
27
58
  ...(coding ? { coding } : {}),
28
59
  ...(claims[ClaimConsent.categoryText] ? { text: claims[ClaimConsent.categoryText] } : {}),
29
- }];
30
- }
31
- return resource;
60
+ }] : undefined,
61
+ provision: claims[ClaimConsent.decision]
62
+ || claims[ClaimConsent.periodStart]
63
+ || claims[ClaimConsent.periodEnd]
64
+ || actionCoding
65
+ || purposeCoding
66
+ || provisionCodeCoding
67
+ ? {
68
+ type: claims[ClaimConsent.decision],
69
+ period: claims[ClaimConsent.periodStart] || claims[ClaimConsent.periodEnd]
70
+ ? { start: claims[ClaimConsent.periodStart], end: claims[ClaimConsent.periodEnd] }
71
+ : undefined,
72
+ action: actionCoding ? [{ coding: actionCoding }] : undefined,
73
+ purpose: purposeCoding,
74
+ code: provisionCodeCoding ? [{ coding: provisionCodeCoding }] : undefined,
75
+ }
76
+ : undefined,
77
+ };
32
78
  }
@@ -17,8 +17,9 @@ export function deviceUseStatementFlatToFhirR4(claims) {
17
17
  : {}),
18
18
  },
19
19
  status,
20
- recordedOn: claims[DeviceUseStatementClaim.RecordedOn],
20
+ recordedOn: claims[DeviceUseStatementClaim.RecordedOn] || claims['DeviceUseStatement.recordedon'],
21
21
  timingDateTime: claims[DeviceUseStatementClaim.TimingDateTime],
22
+ _timingDateTime: claims[DeviceUseStatementClaim.TimingAbsentReason] ? { extension: [{ url: 'http://hl7.org/fhir/StructureDefinition/data-absent-reason', valueCode: claims[DeviceUseStatementClaim.TimingAbsentReason] }] } : undefined,
22
23
  };
23
24
  }
24
25
  export function deviceUseStatementFhirR4ToFlat(resource) {
@@ -30,5 +31,6 @@ export function deviceUseStatementFhirR4ToFlat(resource) {
30
31
  [DeviceUseStatementClaim.Status]: resource.status,
31
32
  [DeviceUseStatementClaim.RecordedOn]: resource.recordedOn,
32
33
  [DeviceUseStatementClaim.TimingDateTime]: resource.timingDateTime,
34
+ [DeviceUseStatementClaim.TimingAbsentReason]: (resource._timingDateTime?.extension)?.[0]?.valueCode,
33
35
  };
34
36
  }
@@ -26,6 +26,8 @@ export function immunizationFlatToFhirR4(claims) {
26
26
  location: claims[ImmunizationClaim.Location] ? { reference: claims[ImmunizationClaim.Location] } : undefined,
27
27
  manufacturer: claims[ImmunizationClaim.Manufacturer] ? { reference: claims[ImmunizationClaim.Manufacturer] } : undefined,
28
28
  lotNumber: claims[ImmunizationClaim.LotNumber],
29
+ route: claims[ImmunizationClaim.Route] ? { coding: codingFromValue(claims[ImmunizationClaim.Route])?.map((coding) => ({ ...coding, ...(claims[ImmunizationClaim.RouteDisplay] ? { display: claims[ImmunizationClaim.RouteDisplay] } : {}) })) } : undefined,
30
+ site: claims[ImmunizationClaim.Site] ? { coding: codingFromValue(claims[ImmunizationClaim.Site])?.map((coding) => ({ ...coding, ...(claims[ImmunizationClaim.SiteDisplay] ? { display: claims[ImmunizationClaim.SiteDisplay] } : {}) })) } : undefined,
29
31
  performer: claims[ImmunizationClaim.Performer] ? claims[ImmunizationClaim.Performer].split(',').map((reference) => ({ actor: { reference: reference.trim() } })) : undefined,
30
32
  reasonCode: claims[ImmunizationClaim.ReasonCode] ? [{ coding: codingFromValue(claims[ImmunizationClaim.ReasonCode]) }] : undefined,
31
33
  reasonReference: claims[ImmunizationClaim.ReasonReference] ? [{ reference: claims[ImmunizationClaim.ReasonReference] }] : undefined,
@@ -34,7 +36,9 @@ export function immunizationFlatToFhirR4(claims) {
34
36
  protocolApplied: (claims[ImmunizationClaim.Series] || claims[ImmunizationClaim.TargetDisease] || claims[ImmunizationClaim.DoseSequence]) ? [{
35
37
  series: claims[ImmunizationClaim.Series],
36
38
  targetDisease: claims[ImmunizationClaim.TargetDisease] ? [{ coding: codingFromValue(claims[ImmunizationClaim.TargetDisease]) }] : undefined,
37
- doseNumberString: claims[ImmunizationClaim.DoseSequence],
39
+ ...(claims[ImmunizationClaim.DoseSequence] && /^\d+$/.test(claims[ImmunizationClaim.DoseSequence])
40
+ ? { doseNumberPositiveInt: Number(claims[ImmunizationClaim.DoseSequence]) }
41
+ : { doseNumberString: claims[ImmunizationClaim.DoseSequence] }),
38
42
  }] : undefined,
39
43
  reaction: claims[ImmunizationClaim.ReactionDate] ? [{ date: claims[ImmunizationClaim.ReactionDate] }] : undefined,
40
44
  };
@@ -63,8 +67,14 @@ export function immunizationFhirR4ToFlat(resource) {
63
67
  [ImmunizationClaim.VaccineCode]: codingToValue(resource.vaccineCode?.coding?.[0]),
64
68
  [ImmunizationClaim.VaccineCodeText]: resource.vaccineCode?.text,
65
69
  [ImmunizationClaim.VaccineCodeDisplay]: resource.vaccineCode?.coding?.[0]?.display,
66
- [ImmunizationClaim.DoseSequence]: protocolApplied?.doseNumberString,
70
+ [ImmunizationClaim.DoseSequence]: protocolApplied?.doseNumberPositiveInt === undefined
71
+ ? protocolApplied?.doseNumberString
72
+ : String(protocolApplied.doseNumberPositiveInt),
67
73
  [ImmunizationClaim.Subject]: referenceToValue(resource.patient),
68
74
  [ImmunizationClaim.Note]: resource.note?.[0]?.text,
75
+ [ImmunizationClaim.Route]: codingToValue(resource.route?.coding?.[0]),
76
+ [ImmunizationClaim.RouteDisplay]: resource.route?.coding?.[0]?.display,
77
+ [ImmunizationClaim.Site]: codingToValue(resource.site?.coding?.[0]),
78
+ [ImmunizationClaim.SiteDisplay]: resource.site?.coding?.[0]?.display,
69
79
  };
70
80
  }
@@ -22,6 +22,13 @@ export function medicationStatementFlatToFhirR4(claims) {
22
22
  expirationDate: medicationExpirationDate,
23
23
  } : undefined,
24
24
  } : undefined;
25
+ const dosageRoute = claims[MedicationStatementClaim.DosageRoute];
26
+ const dosageFrequency = claims[MedicationStatementClaim.TimingFrequency];
27
+ const dosagePeriod = claims[MedicationStatementClaim.TimingPeriod];
28
+ const dosagePeriodUnit = claims[MedicationStatementClaim.TimingPeriodUnit];
29
+ const doseValue = claims[MedicationStatementClaim.DoseQuantityValue];
30
+ const doseUnit = claims[MedicationStatementClaim.DoseQuantityUnit];
31
+ const hasDosage = claims[MedicationStatementClaim.DosageInstruction] || dosageRoute || dosageFrequency || dosagePeriod || doseValue;
25
32
  return {
26
33
  resourceType: 'MedicationStatement',
27
34
  identifier: claims[MedicationStatementClaim.Identifier] ? [{ value: claims[MedicationStatementClaim.Identifier] }] : undefined,
@@ -39,7 +46,21 @@ export function medicationStatementFlatToFhirR4(claims) {
39
46
  : (!hasContainedMedication && medicationText ? { text: medicationText } : undefined),
40
47
  medicationReference: hasContainedMedication ? { reference: `#${containedMedicationId}` } : undefined,
41
48
  contained: containedMedication ? [containedMedication] : undefined,
42
- dosage: claims[MedicationStatementClaim.DosageInstruction] ? [{ text: claims[MedicationStatementClaim.DosageInstruction] }] : undefined,
49
+ informationSource: claims[MedicationStatementClaim.Source] ? { reference: claims[MedicationStatementClaim.Source] } : undefined,
50
+ dosage: hasDosage ? [{
51
+ text: claims[MedicationStatementClaim.DosageInstruction],
52
+ route: dosageRoute ? { coding: codingFromValue(dosageRoute) } : undefined,
53
+ timing: dosageFrequency || dosagePeriod || dosagePeriodUnit ? { repeat: {
54
+ frequency: dosageFrequency ? Number(dosageFrequency) : undefined,
55
+ period: dosagePeriod ? Number(dosagePeriod) : undefined,
56
+ periodUnit: dosagePeriodUnit,
57
+ } } : undefined,
58
+ doseAndRate: doseValue ? [{ doseQuantity: {
59
+ value: Number(doseValue),
60
+ unit: doseUnit,
61
+ ...(codingFromValue(doseUnit)?.[0] || {}),
62
+ } }] : undefined,
63
+ }] : undefined,
43
64
  note: claims[MedicationStatementClaim.Note] ? [{ text: claims[MedicationStatementClaim.Note] }] : undefined,
44
65
  };
45
66
  }
@@ -55,6 +76,12 @@ export function medicationStatementFhirR4ToFlat(resource) {
55
76
  const medicationConcept = resource.medicationCodeableConcept;
56
77
  const medicationCode = codingToValue(medicationConcept?.coding?.[0]);
57
78
  const medicationText = containedMedicationText || medicationConcept?.text || undefined;
79
+ const dosage = resource.dosage?.[0];
80
+ const repeat = dosage?.timing
81
+ ? dosage.timing.repeat
82
+ : undefined;
83
+ const routeCoding = dosage?.route?.coding?.[0];
84
+ const doseQuantity = (dosage?.doseAndRate?.[0]?.doseQuantity);
58
85
  return {
59
86
  [MedicationStatementClaim.Identifier]: resource.identifier?.[0]?.value,
60
87
  [MedicationStatementClaim.Subject]: resource.subject?.reference,
@@ -65,6 +92,13 @@ export function medicationStatementFhirR4ToFlat(resource) {
65
92
  [MedicationStatementClaim.CodeDisplay]: medicationConcept?.coding?.[0]?.display,
66
93
  [MedicationStatementClaim.Note]: resource.note?.[0]?.text,
67
94
  [MedicationStatementClaim.DosageInstruction]: resource.dosage?.[0]?.text,
95
+ [MedicationStatementClaim.Source]: resource.informationSource?.reference,
96
+ [MedicationStatementClaim.DosageRoute]: codingToValue(routeCoding),
97
+ [MedicationStatementClaim.DoseQuantityValue]: doseQuantity?.value === undefined ? undefined : String(doseQuantity.value),
98
+ [MedicationStatementClaim.DoseQuantityUnit]: codingToValue(doseQuantity?.system || doseQuantity?.code ? { system: doseQuantity?.system, code: doseQuantity?.code } : undefined) || doseQuantity?.unit,
99
+ [MedicationStatementClaim.TimingFrequency]: repeat?.frequency === undefined ? undefined : String(repeat.frequency),
100
+ [MedicationStatementClaim.TimingPeriod]: repeat?.period === undefined ? undefined : String(repeat.period),
101
+ [MedicationStatementClaim.TimingPeriodUnit]: repeat?.periodUnit,
68
102
  [MedicationStatementClaim.MedicationIdentifier]: containedMedicationIdentifier,
69
103
  [MedicationStatementClaim.MedicationSerialNumber]: batch?.lotNumber,
70
104
  [MedicationStatementClaim.MedicationExpirationDate]: batch?.expirationDate,
@@ -2,6 +2,8 @@
2
2
  // File: src/utils/convert-observation.ts
3
3
  import { ObservationClaim } from '../models/interoperable-claims/observation-claims.js';
4
4
  import { codingFromValue, codingListToCsv, codingToValue, referenceListToCsv, referenceToValue } from './convert-shared.js';
5
+ /** Legacy camelCase claim accepted only while reading previously persisted rows. */
6
+ const LEGACY_OBSERVATION_EFFECTIVE_DATE_TIME = 'Observation.effectiveDateTime';
5
7
  /**
6
8
  * Converts flat editable Observation claims into a FHIR R4 Observation.
7
9
  *
@@ -33,6 +35,11 @@ export function observationFromFlatToFhirR4(claims) {
33
35
  ? { display: claims[ObservationClaim.ValueConceptDisplay] }
34
36
  : {}),
35
37
  }));
38
+ const componentCodes = splitClaimList(claims[ObservationClaim.ComponentCode]);
39
+ const componentDisplays = splitClaimList(claims[ObservationClaim.ComponentCodeDisplay]);
40
+ const componentNumbers = splitClaimList(claims[ObservationClaim.ComponentValueQuantityNumber]);
41
+ const componentUnits = splitClaimList(claims[ObservationClaim.ComponentValueQuantityUnit]);
42
+ const referenceUnit = claims[ObservationClaim.ReferenceRangeUnit];
36
43
  return {
37
44
  resourceType: 'Observation',
38
45
  identifier: claims[ObservationClaim.Identifier] ? [{ value: claims[ObservationClaim.Identifier] }] : undefined,
@@ -45,8 +52,12 @@ export function observationFromFlatToFhirR4(claims) {
45
52
  }
46
53
  : undefined,
47
54
  subject: subject ? { reference: subject } : undefined,
48
- effectiveDateTime: claims[ObservationClaim.EffectiveDateTime] ?? claims[ObservationClaim.Date],
49
- issued: claims[ObservationClaim.EffectiveDateTime] ? undefined : claims[ObservationClaim.Date],
55
+ effectiveDateTime: claims[ObservationClaim.EffectiveDateTime]
56
+ ?? claims[LEGACY_OBSERVATION_EFFECTIVE_DATE_TIME]
57
+ ?? claims[ObservationClaim.Date],
58
+ issued: claims[ObservationClaim.EffectiveDateTime] || claims[LEGACY_OBSERVATION_EFFECTIVE_DATE_TIME]
59
+ ? undefined
60
+ : claims[ObservationClaim.Date],
50
61
  performer: claims[ObservationClaim.Performer] ? claims[ObservationClaim.Performer].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
51
62
  valueCodeableConcept: valueConceptToken
52
63
  ? {
@@ -81,6 +92,17 @@ export function observationFromFlatToFhirR4(claims) {
81
92
  hasMember: claims[ObservationClaim.HasMember] ? claims[ObservationClaim.HasMember].split(',').map((reference) => ({ reference: reference.trim() })) : undefined,
82
93
  method: claims[ObservationClaim.Method] ? { coding: codingFromValue(claims[ObservationClaim.Method]) } : undefined,
83
94
  specimen: claims[ObservationClaim.Specimen] ? { reference: claims[ObservationClaim.Specimen] } : undefined,
95
+ referenceRange: claims[ObservationClaim.ReferenceRangeLowNumber] || claims[ObservationClaim.ReferenceRangeHighNumber] || claims[ObservationClaim.ReferenceRangeText]
96
+ ? [{
97
+ low: claims[ObservationClaim.ReferenceRangeLowNumber] ? quantityFromClaims(claims[ObservationClaim.ReferenceRangeLowNumber], referenceUnit) : undefined,
98
+ high: claims[ObservationClaim.ReferenceRangeHighNumber] ? quantityFromClaims(claims[ObservationClaim.ReferenceRangeHighNumber], referenceUnit) : undefined,
99
+ text: claims[ObservationClaim.ReferenceRangeText],
100
+ }]
101
+ : undefined,
102
+ component: componentCodes.map((code, index) => ({
103
+ code: { coding: codingFromValue(code)?.map((coding) => ({ ...coding, ...(componentDisplays[index] ? { display: componentDisplays[index] } : {}) })) },
104
+ valueQuantity: componentNumbers[index] ? quantityFromClaims(componentNumbers[index], componentUnits[index]) : undefined,
105
+ })),
84
106
  };
85
107
  }
86
108
  /**
@@ -94,6 +116,10 @@ export function observationToFlatFhirR4(resource) {
94
116
  const codeCoding = resource.code?.coding?.[0];
95
117
  const valueConceptCoding = valueCodeableConcept?.coding?.[0];
96
118
  const valueQuantity = resource.valueQuantity;
119
+ const referenceRange = resource.referenceRange?.[0];
120
+ const referenceLow = referenceRange?.low;
121
+ const referenceHigh = referenceRange?.high;
122
+ const components = resource.component || [];
97
123
  return {
98
124
  [ObservationClaim.BasedOn]: referenceListToCsv(resource.basedOn),
99
125
  [ObservationClaim.Category]: codingListToCsv(resource.category?.flatMap((item) => item.coding || [])),
@@ -128,8 +154,23 @@ export function observationToFlatFhirR4(resource) {
128
154
  [ObservationClaim.ValueString]: resource.valueString,
129
155
  [ObservationClaim.Note]: resource.note?.[0]?.text,
130
156
  [ObservationClaim.EffectiveDateTime]: resource.effectiveDateTime,
157
+ [ObservationClaim.ReferenceRangeLowNumber]: scalarString(referenceLow?.value),
158
+ [ObservationClaim.ReferenceRangeHighNumber]: scalarString(referenceHigh?.value),
159
+ [ObservationClaim.ReferenceRangeUnit]: codingToValue(referenceLow?.system || referenceLow?.code ? { system: referenceLow?.system, code: referenceLow?.code } : referenceHigh?.system || referenceHigh?.code ? { system: referenceHigh?.system, code: referenceHigh?.code } : undefined) || referenceLow?.unit || referenceHigh?.unit,
160
+ [ObservationClaim.ReferenceRangeText]: referenceRange?.text,
161
+ [ObservationClaim.ComponentCode]: joinClaimList(components.map((component) => codingToValue(component.code?.coding?.[0]))),
162
+ [ObservationClaim.ComponentCodeDisplay]: joinClaimList(components.map((component) => component.code?.coding?.[0]?.display)),
163
+ [ObservationClaim.ComponentValueQuantityNumber]: joinClaimList(components.map((component) => scalarString(component.valueQuantity?.value))),
164
+ [ObservationClaim.ComponentValueQuantityUnit]: joinClaimList(components.map((component) => { const quantity = component.valueQuantity; return codingToValue(quantity?.system || quantity?.code ? { system: quantity?.system, code: quantity?.code } : undefined) || quantity?.unit; })),
131
165
  };
132
166
  }
167
+ function splitClaimList(value) { return value ? JSON.parse(value) : []; }
168
+ function joinClaimList(values) { return values.some((value) => value !== undefined) ? JSON.stringify(values.map((value) => value || '')) : undefined; }
169
+ function scalarString(value) { return value === undefined || value === null ? undefined : String(value); }
170
+ function quantityFromClaims(number, unit) {
171
+ const coding = codingFromValue(unit)?.[0];
172
+ return { value: Number(number), ...(unit ? { unit, ...(coding?.system ? { system: coding.system } : {}), ...(coding?.code ? { code: coding.code } : {}) } : {}) };
173
+ }
133
174
  /** @deprecated Prefer `observationFromFlatToFhirR4`. */
134
175
  export const observationFlatToFhirR4 = observationFromFlatToFhirR4;
135
176
  /** @deprecated Prefer `observationToFlatFhirR4`. */
@@ -1,3 +1,3 @@
1
1
  import type { FhirResource, FlatClaims } from './convert-shared';
2
- export declare function practitionerRoleFhirR4ToFlat(resource: FhirResource, context?: string): FlatClaims;
2
+ export declare function practitionerRoleFhirR4ToFlat(resource: FhirResource, _context?: string): FlatClaims;
3
3
  export declare function practitionerRoleFlatToFhirR4(claims: FlatClaims): FhirResource;
@@ -1,34 +1,62 @@
1
1
  // Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
2
  import { PractitionerRoleClaim } from '../models/interoperable-claims/practitioner-role-claims.js';
3
- import { codingFromValue, codingToValue, fhirResourceToFlatClaims, flatClaimsToFhirResource, } from './convert-shared.js';
4
- export function practitionerRoleFhirR4ToFlat(resource, context = 'org.hl7.fhir.r4') {
3
+ import { codingFromValue, codingToValue, referenceListToCsv, referenceToValue, } from './convert-shared.js';
4
+ export function practitionerRoleFhirR4ToFlat(resource, _context = 'org.hl7.fhir.api') {
5
5
  const concept = resource.code?.[0];
6
6
  return {
7
- ...fhirResourceToFlatClaims(resource, context),
7
+ [PractitionerRoleClaim.Identifier]: resource.identifier?.[0]?.value,
8
+ [PractitionerRoleClaim.Active]: resource.active === undefined ? undefined : String(resource.active),
9
+ [PractitionerRoleClaim.Practitioner]: referenceToValue(resource.practitioner),
10
+ [PractitionerRoleClaim.Organization]: referenceToValue(resource.organization),
11
+ [PractitionerRoleClaim.Location]: referenceListToCsv(resource.location),
12
+ [PractitionerRoleClaim.Service]: referenceListToCsv(resource.healthcareService),
13
+ [PractitionerRoleClaim.Specialty]: codingToValue(resource.specialty?.[0]?.coding?.[0]),
14
+ [PractitionerRoleClaim.PeriodStart]: resource.period?.start,
15
+ [PractitionerRoleClaim.PeriodEnd]: resource.period?.end,
8
16
  [PractitionerRoleClaim.Code]: codingToValue(concept?.coding?.[0]),
9
17
  [PractitionerRoleClaim.CodeText]: concept?.text,
10
18
  [PractitionerRoleClaim.CodeDisplay]: concept?.coding?.[0]?.display,
11
19
  };
12
20
  }
13
21
  export function practitionerRoleFlatToFhirR4(claims) {
14
- const structuralClaims = { ...claims };
15
- delete structuralClaims[PractitionerRoleClaim.Code];
16
- delete structuralClaims[PractitionerRoleClaim.CodeText];
17
- delete structuralClaims[PractitionerRoleClaim.CodeDisplay];
18
- const resource = flatClaimsToFhirResource(structuralClaims);
22
+ const location = claims[PractitionerRoleClaim.Location]?.split(',').map((reference) => ({ reference: reference.trim() }));
23
+ const healthcareService = claims[PractitionerRoleClaim.Service]?.split(',').map((reference) => ({ reference: reference.trim() }));
19
24
  const coding = codingFromValue(claims[PractitionerRoleClaim.Code])?.map((item) => ({
20
25
  ...item,
21
26
  ...(claims[PractitionerRoleClaim.CodeDisplay]
22
27
  ? { display: claims[PractitionerRoleClaim.CodeDisplay] }
23
28
  : {}),
24
29
  }));
25
- if (coding || claims[PractitionerRoleClaim.CodeText]) {
26
- resource.code = [{
30
+ return {
31
+ resourceType: 'PractitionerRole',
32
+ identifier: claims[PractitionerRoleClaim.Identifier]
33
+ ? [{ value: claims[PractitionerRoleClaim.Identifier] }]
34
+ : undefined,
35
+ active: claims[PractitionerRoleClaim.Active] === undefined
36
+ ? undefined
37
+ : claims[PractitionerRoleClaim.Active] === 'true',
38
+ practitioner: claims[PractitionerRoleClaim.Practitioner]
39
+ ? { reference: claims[PractitionerRoleClaim.Practitioner] }
40
+ : undefined,
41
+ organization: claims[PractitionerRoleClaim.Organization]
42
+ ? { reference: claims[PractitionerRoleClaim.Organization] }
43
+ : undefined,
44
+ location,
45
+ healthcareService,
46
+ specialty: claims[PractitionerRoleClaim.Specialty]
47
+ ? [{ coding: codingFromValue(claims[PractitionerRoleClaim.Specialty]) }]
48
+ : undefined,
49
+ period: claims[PractitionerRoleClaim.PeriodStart] || claims[PractitionerRoleClaim.PeriodEnd]
50
+ ? {
51
+ start: claims[PractitionerRoleClaim.PeriodStart],
52
+ end: claims[PractitionerRoleClaim.PeriodEnd],
53
+ }
54
+ : undefined,
55
+ code: coding || claims[PractitionerRoleClaim.CodeText] ? [{
27
56
  ...(coding ? { coding } : {}),
28
57
  ...(claims[PractitionerRoleClaim.CodeText]
29
58
  ? { text: claims[PractitionerRoleClaim.CodeText] }
30
59
  : {}),
31
- }];
32
- }
33
- return resource;
60
+ }] : undefined,
61
+ };
34
62
  }
@@ -139,7 +139,7 @@ function assignInflatedPath(target, path, value, typeHint) {
139
139
  /**
140
140
  * Generic structural fallback for unsupported resources.
141
141
  */
142
- export function fhirResourceToFlatClaims(resource, context = 'org.hl7.fhir.r4') {
142
+ export function fhirResourceToFlatClaims(resource, context = 'org.hl7.fhir.api') {
143
143
  if (!resource?.resourceType) {
144
144
  throw new Error('FHIR resource must define resourceType.');
145
145
  }
@@ -1,11 +1,13 @@
1
1
  export declare enum ClaimConsent {
2
2
  'decision' = "Consent.decision",
3
+ 'status' = "Consent.status",
3
4
  'action' = "Consent.action",
4
5
  'category' = "Consent.category",
5
6
  'categoryText' = "Consent.category-text",
6
7
  'categoryDisplay' = "Consent.category-display",
7
8
  'resourceType' = "Consent.resourceType",
8
9
  'subject' = "Consent.subject",
10
+ 'patient' = "Consent.patient",
9
11
  'actorIdentifier' = "Consent.actor-identifier",
10
12
  'actorRole' = "Consent.actor-role",
11
13
  'date' = "Consent.date",
@@ -18,6 +20,11 @@ export declare enum ClaimConsent {
18
20
  'identifier' = "Consent.identifier",
19
21
  'eventBasedOn' = "Consent.event-basedon",
20
22
  'sourceReference' = "Consent.source-reference",
23
+ 'scope' = "Consent.scope",
24
+ 'scopeDisplay' = "Consent.scope-display",
25
+ 'policyRule' = "Consent.policy-rule",
26
+ 'provisionCode' = "Consent.provision-code",
27
+ 'provisionCodeDisplay' = "Consent.provision-code-display",
21
28
  'containedReferenceList' = "Consent.contained-reference-list",
22
29
  /**
23
30
  * @deprecated Use `containedReferenceList`.
@@ -2,12 +2,14 @@
2
2
  export var ClaimConsent;
3
3
  (function (ClaimConsent) {
4
4
  ClaimConsent["decision"] = "Consent.decision";
5
+ ClaimConsent["status"] = "Consent.status";
5
6
  ClaimConsent["action"] = "Consent.action";
6
7
  ClaimConsent["category"] = "Consent.category";
7
8
  ClaimConsent["categoryText"] = "Consent.category-text";
8
9
  ClaimConsent["categoryDisplay"] = "Consent.category-display";
9
10
  ClaimConsent["resourceType"] = "Consent.resourceType";
10
11
  ClaimConsent["subject"] = "Consent.subject";
12
+ ClaimConsent["patient"] = "Consent.patient";
11
13
  ClaimConsent["actorIdentifier"] = "Consent.actor-identifier";
12
14
  ClaimConsent["actorRole"] = "Consent.actor-role";
13
15
  ClaimConsent["date"] = "Consent.date";
@@ -20,6 +22,11 @@ export var ClaimConsent;
20
22
  ClaimConsent["identifier"] = "Consent.identifier";
21
23
  ClaimConsent["eventBasedOn"] = "Consent.event-basedon";
22
24
  ClaimConsent["sourceReference"] = "Consent.source-reference";
25
+ ClaimConsent["scope"] = "Consent.scope";
26
+ ClaimConsent["scopeDisplay"] = "Consent.scope-display";
27
+ ClaimConsent["policyRule"] = "Consent.policy-rule";
28
+ ClaimConsent["provisionCode"] = "Consent.provision-code";
29
+ ClaimConsent["provisionCodeDisplay"] = "Consent.provision-code-display";
23
30
  ClaimConsent["containedReferenceList"] = "Consent.contained-reference-list";
24
31
  /**
25
32
  * @deprecated Use `containedReferenceList`.
@@ -29,14 +29,14 @@ export declare const AllowedIndexableClaims: {
29
29
  * Keep this aligned with GW managers that build `indexed.attributes` from
30
30
  * claims-first payloads. UI-only or long free-text fields stay out.
31
31
  */
32
- readonly General: readonly ["Observation.identifier", "Observation.subject", "Observation.patient", "Observation.status", "Observation.category", "Observation.code-system", "Observation.code-value", "Observation.code", "Observation.date", "Observation.effectiveDateTime", "Observation.value-concept-system", "Observation.value-concept-value", "Observation.value-concept", "Observation.value-date", "Observation.value-quantity-comparator", "Observation.value-quantity-number", "Observation.value-quantity-unit", "Observation.score-total-number", "Observation.component-tags", "Observation.component-code-values", "Observation.component-names", "Observation.bp-systolic-number", "Observation.bp-diastolic-number", "Observation.has-member", "Observation.encounter", "Observation.device", "Observation.specimen", "Observation.performer", "Observation.based-on", "Observation.focus", "Observation.method", "Observation.language"];
32
+ readonly General: readonly ["Observation.identifier", "Observation.subject", "Observation.patient", "Observation.status", "Observation.category", "Observation.code-system", "Observation.code-value", "Observation.code", "Observation.date", "Observation.effective-datetime", "Observation.value-concept-system", "Observation.value-concept-value", "Observation.value-concept", "Observation.value-date", "Observation.value-quantity-comparator", "Observation.value-quantity-number", "Observation.value-quantity-unit", "Observation.score-total-number", "Observation.component-tags", "Observation.component-code-values", "Observation.component-names", "Observation.bp-systolic-number", "Observation.bp-diastolic-number", "Observation.has-member", "Observation.encounter", "Observation.device", "Observation.specimen", "Observation.performer", "Observation.based-on", "Observation.focus", "Observation.method", "Observation.language"];
33
33
  /**
34
34
  * Searchable/indexable subset for a Vital Signs Observation row.
35
35
  *
36
36
  * This is intentionally narrower than the full persisted claims list and
37
37
  * excludes local-language labels, XHTML/narrative, and note text.
38
38
  */
39
- readonly VitalSigns: readonly ["Observation.identifier", "Observation.subject", "Observation.patient", "Observation.status", "Observation.category", "Observation.code-system", "Observation.code-value", "Observation.code", "Observation.date", "Observation.effectiveDateTime", "Observation.value-concept-system", "Observation.value-concept-value", "Observation.value-concept", "Observation.value-date", "Observation.value-quantity-comparator", "Observation.value-quantity-number", "Observation.value-quantity-unit", "Observation.score-total-number", "Observation.component-tags", "Observation.component-code-values", "Observation.component-names", "Observation.bp-systolic-number", "Observation.bp-diastolic-number", "Observation.has-member", "Observation.method", "Observation.language"];
39
+ readonly VitalSigns: readonly ["Observation.identifier", "Observation.subject", "Observation.patient", "Observation.status", "Observation.category", "Observation.code-system", "Observation.code-value", "Observation.code", "Observation.date", "Observation.effective-datetime", "Observation.value-concept-system", "Observation.value-concept-value", "Observation.value-concept", "Observation.value-date", "Observation.value-quantity-comparator", "Observation.value-quantity-number", "Observation.value-quantity-unit", "Observation.score-total-number", "Observation.component-tags", "Observation.component-code-values", "Observation.component-names", "Observation.bp-systolic-number", "Observation.bp-diastolic-number", "Observation.has-member", "Observation.method", "Observation.language"];
40
40
  };
41
41
  readonly Condition: {
42
42
  readonly General: readonly ["Condition.identifier", "Condition.subject", "Condition.clinical-status", "Condition.verification-status", "Condition.category", "Condition.code", "Condition.severity", "Condition.onset-datetime", "Condition.recorder"];
@@ -58,8 +58,8 @@ export type AllowedIndexableClaimsKey = keyof typeof AllowedIndexableClaims;
58
58
  */
59
59
  export declare const AllowedIndexableClaimAliases: Readonly<{
60
60
  readonly organizationRegistry: readonly [ClaimsOrganizationSchemaorg.alternateName, ClaimsOrganizationSchemaorg.identifierValue, ClaimsOrganizationSchemaorg.identifierType, ClaimsOrganizationSchemaorg.addressCountry];
61
- readonly observationGeneral: readonly ["Observation.identifier", "Observation.subject", "Observation.patient", "Observation.status", "Observation.category", "Observation.code-system", "Observation.code-value", "Observation.code", "Observation.date", "Observation.effectiveDateTime", "Observation.value-concept-system", "Observation.value-concept-value", "Observation.value-concept", "Observation.value-date", "Observation.value-quantity-comparator", "Observation.value-quantity-number", "Observation.value-quantity-unit", "Observation.score-total-number", "Observation.component-tags", "Observation.component-code-values", "Observation.component-names", "Observation.bp-systolic-number", "Observation.bp-diastolic-number", "Observation.has-member", "Observation.encounter", "Observation.device", "Observation.specimen", "Observation.performer", "Observation.based-on", "Observation.focus", "Observation.method", "Observation.language"];
62
- readonly observationVitalSigns: readonly ["Observation.identifier", "Observation.subject", "Observation.patient", "Observation.status", "Observation.category", "Observation.code-system", "Observation.code-value", "Observation.code", "Observation.date", "Observation.effectiveDateTime", "Observation.value-concept-system", "Observation.value-concept-value", "Observation.value-concept", "Observation.value-date", "Observation.value-quantity-comparator", "Observation.value-quantity-number", "Observation.value-quantity-unit", "Observation.score-total-number", "Observation.component-tags", "Observation.component-code-values", "Observation.component-names", "Observation.bp-systolic-number", "Observation.bp-diastolic-number", "Observation.has-member", "Observation.method", "Observation.language"];
61
+ readonly observationGeneral: readonly ["Observation.identifier", "Observation.subject", "Observation.patient", "Observation.status", "Observation.category", "Observation.code-system", "Observation.code-value", "Observation.code", "Observation.date", "Observation.effective-datetime", "Observation.value-concept-system", "Observation.value-concept-value", "Observation.value-concept", "Observation.value-date", "Observation.value-quantity-comparator", "Observation.value-quantity-number", "Observation.value-quantity-unit", "Observation.score-total-number", "Observation.component-tags", "Observation.component-code-values", "Observation.component-names", "Observation.bp-systolic-number", "Observation.bp-diastolic-number", "Observation.has-member", "Observation.encounter", "Observation.device", "Observation.specimen", "Observation.performer", "Observation.based-on", "Observation.focus", "Observation.method", "Observation.language"];
62
+ readonly observationVitalSigns: readonly ["Observation.identifier", "Observation.subject", "Observation.patient", "Observation.status", "Observation.category", "Observation.code-system", "Observation.code-value", "Observation.code", "Observation.date", "Observation.effective-datetime", "Observation.value-concept-system", "Observation.value-concept-value", "Observation.value-concept", "Observation.value-date", "Observation.value-quantity-comparator", "Observation.value-quantity-number", "Observation.value-quantity-unit", "Observation.score-total-number", "Observation.component-tags", "Observation.component-code-values", "Observation.component-names", "Observation.bp-systolic-number", "Observation.bp-diastolic-number", "Observation.has-member", "Observation.method", "Observation.language"];
63
63
  }>;
64
64
  /**
65
65
  * Projects a claims-first record to the `ParameterData[]` shape used by GW/KMS