gdc-common-utils-ts 2.0.15 → 2.0.17

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.
@@ -0,0 +1,76 @@
1
+ import { ResourceTypesFhirR4 } from './fhir-resource-types.js';
2
+ import { HealthcareSummarySections } from './healthcare.js';
3
+ /**
4
+ * Reusable logical collection ids for normalized healthcare persistence and
5
+ * indexing layers.
6
+ *
7
+ * They are intentionally domain-level names, not backend-specific table names,
8
+ * so gateways, SDK tooling, and other runtimes can share one stable taxonomy
9
+ * when mapping IPS sections or FHIR resource families to indexed collections.
10
+ */
11
+ export const DataCollectionIds = Object.freeze({
12
+ adverseEvents: 'adverse-events',
13
+ allergies: 'allergies',
14
+ carePlans: 'care-plans',
15
+ communications: 'communications',
16
+ composition: 'composition',
17
+ conditions: 'conditions',
18
+ consents: 'consents',
19
+ diagnosticReports: 'diagnostic-reports',
20
+ documentReferences: 'document-references',
21
+ encounters: 'encounters',
22
+ imagingStudies: 'imaging-studies',
23
+ immunizations: 'immunizations',
24
+ medications: 'medications',
25
+ observations: 'observations',
26
+ procedures: 'procedures',
27
+ relatedPersons: 'related-persons',
28
+ });
29
+ /**
30
+ * Canonical IPS summary section -> collection mapping.
31
+ *
32
+ * Public search contracts should stay section-first. Internals can then fan
33
+ * out to the collections declared here without making callers pick one
34
+ * concrete `resourceType`.
35
+ */
36
+ export const HealthcareSummarySectionDataCollections = Object.freeze({
37
+ [HealthcareSummarySections.HistoryOfMedicationUse.attributeValue]: Object.freeze([DataCollectionIds.medications]),
38
+ [HealthcareSummarySections.AllergiesAndIntolerances.attributeValue]: Object.freeze([DataCollectionIds.allergies]),
39
+ [HealthcareSummarySections.ProblemList.attributeValue]: Object.freeze([DataCollectionIds.conditions]),
40
+ [HealthcareSummarySections.Results.attributeValue]: Object.freeze([
41
+ DataCollectionIds.observations,
42
+ DataCollectionIds.diagnosticReports,
43
+ ]),
44
+ [HealthcareSummarySections.Procedures.attributeValue]: Object.freeze([DataCollectionIds.procedures]),
45
+ [HealthcareSummarySections.Immunizations.attributeValue]: Object.freeze([DataCollectionIds.immunizations]),
46
+ [HealthcareSummarySections.FunctionalStatus.attributeValue]: Object.freeze([DataCollectionIds.conditions]),
47
+ [HealthcareSummarySections.PlanOfCare.attributeValue]: Object.freeze([DataCollectionIds.carePlans]),
48
+ [HealthcareSummarySections.PlanOfTreatment.attributeValue]: Object.freeze([DataCollectionIds.carePlans]),
49
+ [HealthcareSummarySections.SocialHistory.attributeValue]: Object.freeze([DataCollectionIds.observations]),
50
+ [HealthcareSummarySections.VitalSigns.attributeValue]: Object.freeze([DataCollectionIds.observations]),
51
+ [HealthcareSummarySections.AdvanceDirectives.attributeValue]: Object.freeze([DataCollectionIds.consents]),
52
+ [HealthcareSummarySections.HistoryOfPastIllness.attributeValue]: Object.freeze([DataCollectionIds.conditions]),
53
+ [HealthcareSummarySections.PregnancyHistory.attributeValue]: Object.freeze([DataCollectionIds.observations]),
54
+ [HealthcareSummarySections.GoalsAndPreferences.attributeValue]: Object.freeze([DataCollectionIds.consents]),
55
+ [HealthcareSummarySections.Alert.attributeValue]: Object.freeze([]),
56
+ [HealthcareSummarySections.MedicalDevices.attributeValue]: Object.freeze([]),
57
+ });
58
+ /**
59
+ * Canonical FHIR R4 resource family -> collection mapping for normalized
60
+ * storage/index adapters.
61
+ */
62
+ export const FhirResourceTypeDataCollections = Object.freeze({
63
+ [ResourceTypesFhirR4.AdverseEvent]: DataCollectionIds.adverseEvents,
64
+ [ResourceTypesFhirR4.AllergyIntolerance]: DataCollectionIds.allergies,
65
+ [ResourceTypesFhirR4.CarePlan]: DataCollectionIds.carePlans,
66
+ [ResourceTypesFhirR4.Condition]: DataCollectionIds.conditions,
67
+ [ResourceTypesFhirR4.Consent]: DataCollectionIds.consents,
68
+ [ResourceTypesFhirR4.DiagnosticReport]: DataCollectionIds.diagnosticReports,
69
+ [ResourceTypesFhirR4.Encounter]: DataCollectionIds.encounters,
70
+ [ResourceTypesFhirR4.ImagingStudy]: DataCollectionIds.imagingStudies,
71
+ [ResourceTypesFhirR4.Immunization]: DataCollectionIds.immunizations,
72
+ [ResourceTypesFhirR4.MedicationStatement]: DataCollectionIds.medications,
73
+ [ResourceTypesFhirR4.Observation]: DataCollectionIds.observations,
74
+ [ResourceTypesFhirR4.Procedure]: DataCollectionIds.procedures,
75
+ [ResourceTypesFhirR4.RelatedPerson]: DataCollectionIds.relatedPersons,
76
+ });
@@ -93,6 +93,19 @@ export declare const HealthcareCoreSections: Readonly<{
93
93
  i18nKey: `org.loinc.${string}`;
94
94
  titleEn?: string;
95
95
  }>;
96
+ Alert: Readonly<{
97
+ system: typeof LOINC_SYSTEM_URL;
98
+ code: string;
99
+ attributeValue: string;
100
+ /**
101
+ * @deprecated Use `attributeValue`.
102
+ * Kept as compatibility alias because this token is a reusable claim value,
103
+ * not a claim key/attribute name.
104
+ */
105
+ claim: string;
106
+ i18nKey: `org.loinc.${string}`;
107
+ titleEn?: string;
108
+ }>;
96
109
  DietAndNutrition: Readonly<{
97
110
  system: typeof LOINC_SYSTEM_URL;
98
111
  code: string;
@@ -171,6 +184,19 @@ export declare const HealthcareCoreSections: Readonly<{
171
184
  i18nKey: `org.loinc.${string}`;
172
185
  titleEn?: string;
173
186
  }>;
187
+ PregnancyHistory: Readonly<{
188
+ system: typeof LOINC_SYSTEM_URL;
189
+ code: string;
190
+ attributeValue: string;
191
+ /**
192
+ * @deprecated Use `attributeValue`.
193
+ * Kept as compatibility alias because this token is a reusable claim value,
194
+ * not a claim key/attribute name.
195
+ */
196
+ claim: string;
197
+ i18nKey: `org.loinc.${string}`;
198
+ titleEn?: string;
199
+ }>;
174
200
  ProblemList: Readonly<{
175
201
  system: typeof LOINC_SYSTEM_URL;
176
202
  code: string;
@@ -262,6 +288,19 @@ export declare const HealthcareCoreSections: Readonly<{
262
288
  i18nKey: `org.loinc.${string}`;
263
289
  titleEn?: string;
264
290
  }>;
291
+ GoalsAndPreferences: Readonly<{
292
+ system: typeof LOINC_SYSTEM_URL;
293
+ code: string;
294
+ attributeValue: string;
295
+ /**
296
+ * @deprecated Use `attributeValue`.
297
+ * Kept as compatibility alias because this token is a reusable claim value,
298
+ * not a claim key/attribute name.
299
+ */
300
+ claim: string;
301
+ i18nKey: `org.loinc.${string}`;
302
+ titleEn?: string;
303
+ }>;
265
304
  PlanOfTreatment: Readonly<{
266
305
  system: typeof LOINC_SYSTEM_URL;
267
306
  code: string;
@@ -370,6 +409,19 @@ export declare const HealthcareBasicSections: Readonly<{
370
409
  i18nKey: `org.loinc.${string}`;
371
410
  titleEn?: string;
372
411
  }>;
412
+ Alert: Readonly<{
413
+ system: typeof LOINC_SYSTEM_URL;
414
+ code: string;
415
+ attributeValue: string;
416
+ /**
417
+ * @deprecated Use `attributeValue`.
418
+ * Kept as compatibility alias because this token is a reusable claim value,
419
+ * not a claim key/attribute name.
420
+ */
421
+ claim: string;
422
+ i18nKey: `org.loinc.${string}`;
423
+ titleEn?: string;
424
+ }>;
373
425
  DietAndNutrition: Readonly<{
374
426
  system: typeof LOINC_SYSTEM_URL;
375
427
  code: string;
@@ -448,6 +500,19 @@ export declare const HealthcareBasicSections: Readonly<{
448
500
  i18nKey: `org.loinc.${string}`;
449
501
  titleEn?: string;
450
502
  }>;
503
+ PregnancyHistory: Readonly<{
504
+ system: typeof LOINC_SYSTEM_URL;
505
+ code: string;
506
+ attributeValue: string;
507
+ /**
508
+ * @deprecated Use `attributeValue`.
509
+ * Kept as compatibility alias because this token is a reusable claim value,
510
+ * not a claim key/attribute name.
511
+ */
512
+ claim: string;
513
+ i18nKey: `org.loinc.${string}`;
514
+ titleEn?: string;
515
+ }>;
451
516
  ProblemList: Readonly<{
452
517
  system: typeof LOINC_SYSTEM_URL;
453
518
  code: string;
@@ -539,6 +604,19 @@ export declare const HealthcareBasicSections: Readonly<{
539
604
  i18nKey: `org.loinc.${string}`;
540
605
  titleEn?: string;
541
606
  }>;
607
+ GoalsAndPreferences: Readonly<{
608
+ system: typeof LOINC_SYSTEM_URL;
609
+ code: string;
610
+ attributeValue: string;
611
+ /**
612
+ * @deprecated Use `attributeValue`.
613
+ * Kept as compatibility alias because this token is a reusable claim value,
614
+ * not a claim key/attribute name.
615
+ */
616
+ claim: string;
617
+ i18nKey: `org.loinc.${string}`;
618
+ titleEn?: string;
619
+ }>;
542
620
  PlanOfTreatment: Readonly<{
543
621
  system: typeof LOINC_SYSTEM_URL;
544
622
  code: string;
@@ -619,6 +697,254 @@ export declare const HealthcareBasicSections: Readonly<{
619
697
  titleEn?: string;
620
698
  }>;
621
699
  }>;
700
+ /**
701
+ * IPS summary-oriented subset aligned with the official HL7 IPS all-sections
702
+ * example and intended for "full patient summary / digital twin" flows.
703
+ *
704
+ * It excludes the broader core sections that are outside that summary example:
705
+ * - Diet and Nutrition
706
+ * - History of Family Member Diseases
707
+ * - History of Hospitalizations and Outpatient Visits
708
+ * - History of Present Illness
709
+ * - Problem List Narrative Reported
710
+ * - Instructions
711
+ */
712
+ export declare const HealthcareSummarySections: Readonly<{
713
+ readonly PatientSummaryDocument: Readonly<{
714
+ system: typeof LOINC_SYSTEM_URL;
715
+ code: string;
716
+ attributeValue: string;
717
+ /**
718
+ * @deprecated Use `attributeValue`.
719
+ * Kept as compatibility alias because this token is a reusable claim value,
720
+ * not a claim key/attribute name.
721
+ */
722
+ claim: string;
723
+ i18nKey: `org.loinc.${string}`;
724
+ titleEn?: string;
725
+ }>;
726
+ readonly AllergiesAndIntolerances: Readonly<{
727
+ system: typeof LOINC_SYSTEM_URL;
728
+ code: string;
729
+ attributeValue: string;
730
+ /**
731
+ * @deprecated Use `attributeValue`.
732
+ * Kept as compatibility alias because this token is a reusable claim value,
733
+ * not a claim key/attribute name.
734
+ */
735
+ claim: string;
736
+ i18nKey: `org.loinc.${string}`;
737
+ titleEn?: string;
738
+ }>;
739
+ readonly HistoryOfMedicationUse: Readonly<{
740
+ system: typeof LOINC_SYSTEM_URL;
741
+ code: string;
742
+ attributeValue: string;
743
+ /**
744
+ * @deprecated Use `attributeValue`.
745
+ * Kept as compatibility alias because this token is a reusable claim value,
746
+ * not a claim key/attribute name.
747
+ */
748
+ claim: string;
749
+ i18nKey: `org.loinc.${string}`;
750
+ titleEn?: string;
751
+ }>;
752
+ readonly ProblemList: Readonly<{
753
+ system: typeof LOINC_SYSTEM_URL;
754
+ code: string;
755
+ attributeValue: string;
756
+ /**
757
+ * @deprecated Use `attributeValue`.
758
+ * Kept as compatibility alias because this token is a reusable claim value,
759
+ * not a claim key/attribute name.
760
+ */
761
+ claim: string;
762
+ i18nKey: `org.loinc.${string}`;
763
+ titleEn?: string;
764
+ }>;
765
+ readonly Results: Readonly<{
766
+ system: typeof LOINC_SYSTEM_URL;
767
+ code: string;
768
+ attributeValue: string;
769
+ /**
770
+ * @deprecated Use `attributeValue`.
771
+ * Kept as compatibility alias because this token is a reusable claim value,
772
+ * not a claim key/attribute name.
773
+ */
774
+ claim: string;
775
+ i18nKey: `org.loinc.${string}`;
776
+ titleEn?: string;
777
+ }>;
778
+ readonly Procedures: Readonly<{
779
+ system: typeof LOINC_SYSTEM_URL;
780
+ code: string;
781
+ attributeValue: string;
782
+ /**
783
+ * @deprecated Use `attributeValue`.
784
+ * Kept as compatibility alias because this token is a reusable claim value,
785
+ * not a claim key/attribute name.
786
+ */
787
+ claim: string;
788
+ i18nKey: `org.loinc.${string}`;
789
+ titleEn?: string;
790
+ }>;
791
+ readonly Immunizations: Readonly<{
792
+ system: typeof LOINC_SYSTEM_URL;
793
+ code: string;
794
+ attributeValue: string;
795
+ /**
796
+ * @deprecated Use `attributeValue`.
797
+ * Kept as compatibility alias because this token is a reusable claim value,
798
+ * not a claim key/attribute name.
799
+ */
800
+ claim: string;
801
+ i18nKey: `org.loinc.${string}`;
802
+ titleEn?: string;
803
+ }>;
804
+ readonly MedicalDevices: Readonly<{
805
+ system: typeof LOINC_SYSTEM_URL;
806
+ code: string;
807
+ attributeValue: string;
808
+ /**
809
+ * @deprecated Use `attributeValue`.
810
+ * Kept as compatibility alias because this token is a reusable claim value,
811
+ * not a claim key/attribute name.
812
+ */
813
+ claim: string;
814
+ i18nKey: `org.loinc.${string}`;
815
+ titleEn?: string;
816
+ }>;
817
+ readonly VitalSigns: Readonly<{
818
+ system: typeof LOINC_SYSTEM_URL;
819
+ code: string;
820
+ attributeValue: string;
821
+ /**
822
+ * @deprecated Use `attributeValue`.
823
+ * Kept as compatibility alias because this token is a reusable claim value,
824
+ * not a claim key/attribute name.
825
+ */
826
+ claim: string;
827
+ i18nKey: `org.loinc.${string}`;
828
+ titleEn?: string;
829
+ }>;
830
+ readonly SocialHistory: Readonly<{
831
+ system: typeof LOINC_SYSTEM_URL;
832
+ code: string;
833
+ attributeValue: string;
834
+ /**
835
+ * @deprecated Use `attributeValue`.
836
+ * Kept as compatibility alias because this token is a reusable claim value,
837
+ * not a claim key/attribute name.
838
+ */
839
+ claim: string;
840
+ i18nKey: `org.loinc.${string}`;
841
+ titleEn?: string;
842
+ }>;
843
+ readonly Alert: Readonly<{
844
+ system: typeof LOINC_SYSTEM_URL;
845
+ code: string;
846
+ attributeValue: string;
847
+ /**
848
+ * @deprecated Use `attributeValue`.
849
+ * Kept as compatibility alias because this token is a reusable claim value,
850
+ * not a claim key/attribute name.
851
+ */
852
+ claim: string;
853
+ i18nKey: `org.loinc.${string}`;
854
+ titleEn?: string;
855
+ }>;
856
+ readonly GoalsAndPreferences: Readonly<{
857
+ system: typeof LOINC_SYSTEM_URL;
858
+ code: string;
859
+ attributeValue: string;
860
+ /**
861
+ * @deprecated Use `attributeValue`.
862
+ * Kept as compatibility alias because this token is a reusable claim value,
863
+ * not a claim key/attribute name.
864
+ */
865
+ claim: string;
866
+ i18nKey: `org.loinc.${string}`;
867
+ titleEn?: string;
868
+ }>;
869
+ readonly AdvanceDirectives: Readonly<{
870
+ system: typeof LOINC_SYSTEM_URL;
871
+ code: string;
872
+ attributeValue: string;
873
+ /**
874
+ * @deprecated Use `attributeValue`.
875
+ * Kept as compatibility alias because this token is a reusable claim value,
876
+ * not a claim key/attribute name.
877
+ */
878
+ claim: string;
879
+ i18nKey: `org.loinc.${string}`;
880
+ titleEn?: string;
881
+ }>;
882
+ readonly FunctionalStatus: Readonly<{
883
+ system: typeof LOINC_SYSTEM_URL;
884
+ code: string;
885
+ attributeValue: string;
886
+ /**
887
+ * @deprecated Use `attributeValue`.
888
+ * Kept as compatibility alias because this token is a reusable claim value,
889
+ * not a claim key/attribute name.
890
+ */
891
+ claim: string;
892
+ i18nKey: `org.loinc.${string}`;
893
+ titleEn?: string;
894
+ }>;
895
+ readonly HistoryOfPastIllness: Readonly<{
896
+ system: typeof LOINC_SYSTEM_URL;
897
+ code: string;
898
+ attributeValue: string;
899
+ /**
900
+ * @deprecated Use `attributeValue`.
901
+ * Kept as compatibility alias because this token is a reusable claim value,
902
+ * not a claim key/attribute name.
903
+ */
904
+ claim: string;
905
+ i18nKey: `org.loinc.${string}`;
906
+ titleEn?: string;
907
+ }>;
908
+ readonly PregnancyHistory: Readonly<{
909
+ system: typeof LOINC_SYSTEM_URL;
910
+ code: string;
911
+ attributeValue: string;
912
+ /**
913
+ * @deprecated Use `attributeValue`.
914
+ * Kept as compatibility alias because this token is a reusable claim value,
915
+ * not a claim key/attribute name.
916
+ */
917
+ claim: string;
918
+ i18nKey: `org.loinc.${string}`;
919
+ titleEn?: string;
920
+ }>;
921
+ readonly PlanOfCare: Readonly<{
922
+ system: typeof LOINC_SYSTEM_URL;
923
+ code: string;
924
+ attributeValue: string;
925
+ /**
926
+ * @deprecated Use `attributeValue`.
927
+ * Kept as compatibility alias because this token is a reusable claim value,
928
+ * not a claim key/attribute name.
929
+ */
930
+ claim: string;
931
+ i18nKey: `org.loinc.${string}`;
932
+ titleEn?: string;
933
+ }>;
934
+ readonly PlanOfTreatment: Readonly<{
935
+ system: typeof LOINC_SYSTEM_URL;
936
+ code: string;
937
+ attributeValue: string;
938
+ /**
939
+ * @deprecated Use `attributeValue`.
940
+ * Kept as compatibility alias because this token is a reusable claim value,
941
+ * not a claim key/attribute name.
942
+ */
943
+ claim: string;
944
+ i18nKey: `org.loinc.${string}`;
945
+ titleEn?: string;
946
+ }>;
947
+ }>;
622
948
  export declare const HealthcareDocumentTypes: Readonly<{
623
949
  readonly IPS: Readonly<{
624
950
  id: string;
@@ -816,6 +1142,19 @@ export declare const HealthcareAllSections: Readonly<{
816
1142
  i18nKey: `org.loinc.${string}`;
817
1143
  titleEn?: string;
818
1144
  }>;
1145
+ Alert: Readonly<{
1146
+ system: typeof LOINC_SYSTEM_URL;
1147
+ code: string;
1148
+ attributeValue: string;
1149
+ /**
1150
+ * @deprecated Use `attributeValue`.
1151
+ * Kept as compatibility alias because this token is a reusable claim value,
1152
+ * not a claim key/attribute name.
1153
+ */
1154
+ claim: string;
1155
+ i18nKey: `org.loinc.${string}`;
1156
+ titleEn?: string;
1157
+ }>;
819
1158
  DietAndNutrition: Readonly<{
820
1159
  system: typeof LOINC_SYSTEM_URL;
821
1160
  code: string;
@@ -894,6 +1233,19 @@ export declare const HealthcareAllSections: Readonly<{
894
1233
  i18nKey: `org.loinc.${string}`;
895
1234
  titleEn?: string;
896
1235
  }>;
1236
+ PregnancyHistory: Readonly<{
1237
+ system: typeof LOINC_SYSTEM_URL;
1238
+ code: string;
1239
+ attributeValue: string;
1240
+ /**
1241
+ * @deprecated Use `attributeValue`.
1242
+ * Kept as compatibility alias because this token is a reusable claim value,
1243
+ * not a claim key/attribute name.
1244
+ */
1245
+ claim: string;
1246
+ i18nKey: `org.loinc.${string}`;
1247
+ titleEn?: string;
1248
+ }>;
897
1249
  ProblemList: Readonly<{
898
1250
  system: typeof LOINC_SYSTEM_URL;
899
1251
  code: string;
@@ -985,6 +1337,19 @@ export declare const HealthcareAllSections: Readonly<{
985
1337
  i18nKey: `org.loinc.${string}`;
986
1338
  titleEn?: string;
987
1339
  }>;
1340
+ GoalsAndPreferences: Readonly<{
1341
+ system: typeof LOINC_SYSTEM_URL;
1342
+ code: string;
1343
+ attributeValue: string;
1344
+ /**
1345
+ * @deprecated Use `attributeValue`.
1346
+ * Kept as compatibility alias because this token is a reusable claim value,
1347
+ * not a claim key/attribute name.
1348
+ */
1349
+ claim: string;
1350
+ i18nKey: `org.loinc.${string}`;
1351
+ titleEn?: string;
1352
+ }>;
988
1353
  PlanOfTreatment: Readonly<{
989
1354
  system: typeof LOINC_SYSTEM_URL;
990
1355
  code: string;
@@ -66,12 +66,14 @@ function buildWorkbookSectionCatalog(codes) {
66
66
  export const HealthcareCoreSections = Object.freeze({
67
67
  PatientSummaryDocument: defineSection('60591-5', 'Patient summary document'),
68
68
  AllergiesAndIntolerances: defineSection('48765-2', 'Allergies and adverse reactions'),
69
+ Alert: defineSection('104605-1', 'Alert'),
69
70
  DietAndNutrition: defineSection('61144-2', 'Diet and nutrition'),
70
71
  HistoryOfMedicationUse: defineSection('10160-0', 'History of medication use'),
71
72
  HistoryOfFamilyMemberDiseases: defineSection('10157-6', 'History of family member diseases'),
72
73
  HistoryOfHospitalizationsAndOutpatientVisits: defineSection('46240-8', 'History of hospitalizations+History of outpatient visits'),
73
74
  HistoryOfPastIllness: defineSection('11348-0', 'History of past illness'),
74
75
  HistoryOfPresentIllness: defineSection('10164-2', 'History of present illness'),
76
+ PregnancyHistory: defineSection('10162-6', 'Pregnancy History'),
75
77
  ProblemList: defineSection('11450-4', 'Problem list'),
76
78
  ProblemListNarrativeReported: defineSection('57852-6', 'Problem list'),
77
79
  Results: defineSection('30954-2', 'Relevant diagnostic tests/laboratory data'),
@@ -79,6 +81,7 @@ export const HealthcareCoreSections = Object.freeze({
79
81
  Immunizations: defineSection('11369-6', 'History of immunization'),
80
82
  MedicalDevices: defineSection('46264-8', 'History of medical device use'),
81
83
  FunctionalStatus: defineSection('47420-5', 'Functional status'),
84
+ GoalsAndPreferences: defineSection('81338-6', 'Goals / Preferences'),
82
85
  PlanOfTreatment: defineSection('18776-5', 'Plan of treatment'),
83
86
  /** @deprecated Use `PlanOfTreatment`. */
84
87
  PlanOfCare: defineSection('18776-5', 'Plan of treatment'),
@@ -89,6 +92,38 @@ export const HealthcareCoreSections = Object.freeze({
89
92
  });
90
93
  /** @deprecated Use `HealthcareCoreSections`. */
91
94
  export const HealthcareBasicSections = HealthcareCoreSections;
95
+ /**
96
+ * IPS summary-oriented subset aligned with the official HL7 IPS all-sections
97
+ * example and intended for "full patient summary / digital twin" flows.
98
+ *
99
+ * It excludes the broader core sections that are outside that summary example:
100
+ * - Diet and Nutrition
101
+ * - History of Family Member Diseases
102
+ * - History of Hospitalizations and Outpatient Visits
103
+ * - History of Present Illness
104
+ * - Problem List Narrative Reported
105
+ * - Instructions
106
+ */
107
+ export const HealthcareSummarySections = Object.freeze({
108
+ PatientSummaryDocument: HealthcareCoreSections.PatientSummaryDocument,
109
+ AllergiesAndIntolerances: HealthcareCoreSections.AllergiesAndIntolerances,
110
+ HistoryOfMedicationUse: HealthcareCoreSections.HistoryOfMedicationUse,
111
+ ProblemList: HealthcareCoreSections.ProblemList,
112
+ Results: HealthcareCoreSections.Results,
113
+ Procedures: HealthcareCoreSections.Procedures,
114
+ Immunizations: HealthcareCoreSections.Immunizations,
115
+ MedicalDevices: HealthcareCoreSections.MedicalDevices,
116
+ VitalSigns: HealthcareCoreSections.VitalSigns,
117
+ SocialHistory: HealthcareCoreSections.SocialHistory,
118
+ Alert: HealthcareCoreSections.Alert,
119
+ GoalsAndPreferences: HealthcareCoreSections.GoalsAndPreferences,
120
+ AdvanceDirectives: HealthcareCoreSections.AdvanceDirectives,
121
+ FunctionalStatus: HealthcareCoreSections.FunctionalStatus,
122
+ HistoryOfPastIllness: HealthcareCoreSections.HistoryOfPastIllness,
123
+ PregnancyHistory: HealthcareCoreSections.PregnancyHistory,
124
+ PlanOfCare: HealthcareCoreSections.PlanOfCare,
125
+ PlanOfTreatment: HealthcareCoreSections.PlanOfTreatment,
126
+ });
92
127
  export const HealthcareDocumentTypes = Object.freeze({
93
128
  [DocumentTypeLoincOntology.IPS]: defineDocumentType(DocumentTypeLoincOntology.IPS, '60591-5', 'International Patient Summary'),
94
129
  });
@@ -2,6 +2,7 @@ export * from './actor-session';
2
2
  export * from './communication';
3
3
  export * from './clinical-statuses';
4
4
  export * from './cryptography';
5
+ export * from './data-collections';
5
6
  export * from './data-capabilities';
6
7
  export * from './dataspace-discovery';
7
8
  export * from './dataspace-protocol';
@@ -2,6 +2,7 @@ export * from './actor-session.js';
2
2
  export * from './communication.js';
3
3
  export * from './clinical-statuses.js';
4
4
  export * from './cryptography.js';
5
+ export * from './data-collections.js';
5
6
  export * from './data-capabilities.js';
6
7
  export * from './dataspace-discovery.js';
7
8
  export * from './dataspace-protocol.js';
@@ -29,6 +29,21 @@ export type BundleReaderResponseAnalysis = Readonly<{
29
29
  success: BundleReaderSeverityBucket;
30
30
  }>;
31
31
  }>;
32
+ /**
33
+ * Returns the canonical claims view for one bundle entry array index.
34
+ *
35
+ * The helper accepts the full bundle-like object plus the entry position to
36
+ * inspect inside `bundle.data[]` or `bundle.entry[]`.
37
+ */
38
+ export declare function getClaimsInBundleEntryAt(bundle: unknown, index: number): Record<string, unknown>;
39
+ /**
40
+ * Returns the merged claims view for the first `data[]` or `entry[]` item in a
41
+ * bundle-like body.
42
+ *
43
+ * Use this for the common "one operation, one returned entry" flows when the
44
+ * caller does not want to manually navigate `body.data[0]`.
45
+ */
46
+ export declare function getClaimsInFirstDataEntry(bundle: unknown): Record<string, unknown>;
32
47
  /**
33
48
  * Runtime-neutral reader for built or received FHIR-like bundles.
34
49
  *
@@ -49,6 +64,10 @@ export declare class BundleReader {
49
64
  openEntry(index: number): this;
50
65
  /** Returns the resolved identifier for one entry array index when present. */
51
66
  getEntryIdentifierByArrayIndex(index: number): string | undefined;
67
+ /** Returns merged claims for one entry array index. */
68
+ getEntryClaimsByArrayIndex(index: number): Record<string, unknown>;
69
+ /** Returns merged claims for the currently opened entry. */
70
+ getActiveEntryClaims(): Record<string, unknown>;
52
71
  /** Returns the first entry array index whose resolved identifier matches the requested value. */
53
72
  getEntryIndexByIdentifier(identifier: string): number | undefined;
54
73
  /** Returns the active entry response status when present. */
@@ -2,6 +2,38 @@ import { getHighestIssueSeverity, isIssueSeverityCode, IssueSeverity, } from '..
2
2
  function cloneEntry(value) {
3
3
  return JSON.parse(JSON.stringify(value));
4
4
  }
5
+ function asRecord(value) {
6
+ return value && typeof value === 'object' ? value : {};
7
+ }
8
+ /**
9
+ * Returns the canonical claims view for one bundle entry array index.
10
+ *
11
+ * The helper accepts the full bundle-like object plus the entry position to
12
+ * inspect inside `bundle.data[]` or `bundle.entry[]`.
13
+ */
14
+ export function getClaimsInBundleEntryAt(bundle, index) {
15
+ const bundleRecord = asRecord(bundle);
16
+ const entries = Array.isArray(bundleRecord.data)
17
+ ? bundleRecord.data
18
+ : (Array.isArray(bundleRecord.entry) ? bundleRecord.entry : []);
19
+ if (!Number.isInteger(index) || index < 0 || index >= entries.length) {
20
+ return {};
21
+ }
22
+ const entryRecord = asRecord(entries[index]);
23
+ const resource = asRecord(entryRecord.resource);
24
+ const resourceMeta = asRecord(resource.meta);
25
+ return asRecord(resourceMeta.claims);
26
+ }
27
+ /**
28
+ * Returns the merged claims view for the first `data[]` or `entry[]` item in a
29
+ * bundle-like body.
30
+ *
31
+ * Use this for the common "one operation, one returned entry" flows when the
32
+ * caller does not want to manually navigate `body.data[0]`.
33
+ */
34
+ export function getClaimsInFirstDataEntry(bundle) {
35
+ return getClaimsInBundleEntryAt(bundle, 0);
36
+ }
5
37
  /**
6
38
  * Runtime-neutral reader for built or received FHIR-like bundles.
7
39
  *
@@ -48,6 +80,17 @@ export class BundleReader {
48
80
  }
49
81
  return this.resolveEntryIdentifier(entries[index]);
50
82
  }
83
+ /** Returns merged claims for one entry array index. */
84
+ getEntryClaimsByArrayIndex(index) {
85
+ return getClaimsInBundleEntryAt(this.bundle, index);
86
+ }
87
+ /** Returns merged claims for the currently opened entry. */
88
+ getActiveEntryClaims() {
89
+ if (this.activeEntryIndex === null) {
90
+ throw new Error('BundleReader does not have one active entry. Call openEntry(index) first.');
91
+ }
92
+ return this.getEntryClaimsByArrayIndex(this.activeEntryIndex);
93
+ }
51
94
  /** Returns the first entry array index whose resolved identifier matches the requested value. */
52
95
  getEntryIndexByIdentifier(identifier) {
53
96
  const normalizedIdentifier = normalizeOptionalString(identifier);