gdc-common-utils-ts 1.20.1 → 1.21.0

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 (73) hide show
  1. package/README.md +2 -2
  2. package/dist/claims/claims-helpers-related-person.d.ts +14 -0
  3. package/dist/claims/claims-helpers-related-person.js +28 -0
  4. package/dist/constants/Schemas.d.ts +3 -0
  5. package/dist/constants/Schemas.js +3 -0
  6. package/dist/constants/fhir-code-systems.d.ts +1 -0
  7. package/dist/constants/fhir-code-systems.js +1 -0
  8. package/dist/constants/index.d.ts +3 -0
  9. package/dist/constants/index.js +3 -0
  10. package/dist/constants/individual-sections.d.ts +210 -0
  11. package/dist/constants/individual-sections.js +35 -0
  12. package/dist/constants/lifecycle.d.ts +17 -0
  13. package/dist/constants/lifecycle.js +18 -0
  14. package/dist/constants/observation-category.d.ts +72 -0
  15. package/dist/constants/observation-category.js +30 -0
  16. package/dist/constants/schemaorg.d.ts +4 -0
  17. package/dist/constants/schemaorg.js +4 -0
  18. package/dist/constants/vital-signs.d.ts +2 -17
  19. package/dist/constants/vital-signs.js +1 -6
  20. package/dist/convert/convert-observation.d.ts +20 -2
  21. package/dist/convert/convert-observation.js +80 -9
  22. package/dist/examples/index.d.ts +1 -0
  23. package/dist/examples/index.js +1 -0
  24. package/dist/examples/license.d.ts +161 -0
  25. package/dist/examples/license.js +136 -7
  26. package/dist/examples/lifecycle.d.ts +44 -0
  27. package/dist/examples/lifecycle.js +25 -0
  28. package/dist/examples/related-person.d.ts +348 -0
  29. package/dist/examples/related-person.js +184 -2
  30. package/dist/examples/shared.d.ts +94 -8
  31. package/dist/examples/shared.js +113 -17
  32. package/dist/examples/vital-signs.d.ts +56 -0
  33. package/dist/examples/vital-signs.js +159 -0
  34. package/dist/models/indexing.d.ts +68 -6
  35. package/dist/models/indexing.js +294 -11
  36. package/dist/models/interoperable-claims/observation-claims.d.ts +253 -1
  37. package/dist/models/interoperable-claims/observation-claims.js +249 -3
  38. package/dist/models/urlPath.d.ts +3 -1
  39. package/dist/models/urlPath.js +2 -0
  40. package/dist/utils/bundle-document-builder.js +22 -4
  41. package/dist/utils/bundle-editor.d.ts +105 -2
  42. package/dist/utils/bundle-editor.js +282 -2
  43. package/dist/utils/clinical-resource-converters.d.ts +4 -4
  44. package/dist/utils/clinical-resource-converters.js +5 -5
  45. package/dist/utils/communication-attached-bundle-session.d.ts +11 -0
  46. package/dist/utils/communication-attached-bundle-session.js +29 -0
  47. package/dist/utils/consent-lifecycle-result-reader.d.ts +24 -0
  48. package/dist/utils/consent-lifecycle-result-reader.js +27 -0
  49. package/dist/utils/employee.d.ts +25 -0
  50. package/dist/utils/employee.js +57 -0
  51. package/dist/utils/gw-core-path.d.ts +24 -0
  52. package/dist/utils/gw-core-path.js +21 -0
  53. package/dist/utils/index.d.ts +10 -0
  54. package/dist/utils/index.js +10 -0
  55. package/dist/utils/individual-bundle-vault.d.ts +144 -0
  56. package/dist/utils/individual-bundle-vault.js +455 -0
  57. package/dist/utils/individual-organization-lifecycle.d.ts +104 -0
  58. package/dist/utils/individual-organization-lifecycle.js +179 -0
  59. package/dist/utils/interoperable-resource-operation.d.ts +158 -0
  60. package/dist/utils/interoperable-resource-operation.js +244 -0
  61. package/dist/utils/license-commercial-search.d.ts +118 -0
  62. package/dist/utils/license-commercial-search.js +228 -0
  63. package/dist/utils/license-list-search.d.ts +105 -0
  64. package/dist/utils/license-list-search.js +209 -0
  65. package/dist/utils/license-offer-order.d.ts +107 -0
  66. package/dist/utils/license-offer-order.js +262 -0
  67. package/dist/utils/license.d.ts +6 -0
  68. package/dist/utils/license.js +6 -0
  69. package/dist/utils/lifecycle-result-reader.d.ts +33 -0
  70. package/dist/utils/lifecycle-result-reader.js +99 -0
  71. package/dist/utils/related-person-list.d.ts +20 -0
  72. package/dist/utils/related-person-list.js +54 -0
  73. package/package.json +2 -1
package/README.md CHANGED
@@ -123,7 +123,7 @@ The `convert` export exposes resource-specific FHIR R4 conversion helpers such a
123
123
 
124
124
  - `medicationStatementFlatToFhirR4`
125
125
  - `medicationStatementFhirR4ToFlat`
126
- - `observationFlatToFhirR4`
126
+ - `observationFromFlatToFhirR4`
127
127
  - `documentReferenceFlatToFhirR4`
128
128
  - `compositionFlatToFhirR4`
129
129
 
@@ -132,7 +132,7 @@ Example:
132
132
  ```ts
133
133
  import {
134
134
  medicationStatementFlatToFhirR4,
135
- observationFhirR4ToFlat,
135
+ observationToFlatFhirR4,
136
136
  } from 'gdc-common-utils-ts/convert';
137
137
  ```
138
138
 
@@ -6,3 +6,17 @@ export declare function addRelatedPersonClaimList(claims: RelatedPersonInteroper
6
6
  export declare function removeRelatedPersonClaimList(claims: RelatedPersonInteroperableClaims, claimKey: string, values: string | readonly string[]): RelatedPersonInteroperableClaims;
7
7
  export declare function getRelatedPersonIdentifier(claims: RelatedPersonInteroperableClaims): string;
8
8
  export declare function setRelatedPersonIdentifier(claims: RelatedPersonInteroperableClaims, value: string): RelatedPersonInteroperableClaims;
9
+ /**
10
+ * Returns the current active flag as a boolean when present.
11
+ *
12
+ * Interoperability note:
13
+ * some callers persist the flag as a real boolean while others may carry the
14
+ * transport value as `"true"` / `"false"`. This helper normalizes both
15
+ * shapes.
16
+ */
17
+ export declare function getRelatedPersonActive(claims: RelatedPersonInteroperableClaims): boolean | undefined;
18
+ /**
19
+ * Sets the canonical active flag used by the current `RelatedPerson` lifecycle
20
+ * helpers.
21
+ */
22
+ export declare function setRelatedPersonActive(claims: RelatedPersonInteroperableClaims, value: boolean): RelatedPersonInteroperableClaims;
@@ -18,3 +18,31 @@ export function getRelatedPersonIdentifier(claims) {
18
18
  export function setRelatedPersonIdentifier(claims, value) {
19
19
  return { ...claims, [RelatedPersonClaim.Identifier]: normalizeClaimScalar(value) };
20
20
  }
21
+ /**
22
+ * Returns the current active flag as a boolean when present.
23
+ *
24
+ * Interoperability note:
25
+ * some callers persist the flag as a real boolean while others may carry the
26
+ * transport value as `"true"` / `"false"`. This helper normalizes both
27
+ * shapes.
28
+ */
29
+ export function getRelatedPersonActive(claims) {
30
+ const value = claims[RelatedPersonClaim.Active];
31
+ if (typeof value === 'boolean')
32
+ return value;
33
+ if (typeof value === 'string') {
34
+ const normalized = value.trim().toLowerCase();
35
+ if (normalized === 'true')
36
+ return true;
37
+ if (normalized === 'false')
38
+ return false;
39
+ }
40
+ return undefined;
41
+ }
42
+ /**
43
+ * Sets the canonical active flag used by the current `RelatedPerson` lifecycle
44
+ * helpers.
45
+ */
46
+ export function setRelatedPersonActive(claims, value) {
47
+ return { ...claims, [RelatedPersonClaim.Active]: value };
48
+ }
@@ -22,11 +22,13 @@ export type Section = typeof Section[keyof typeof Section];
22
22
  export declare const Format: {
23
23
  readonly SCHEMA: "org.schema";
24
24
  readonly FHIR_API: "org.hl7.fhir.api";
25
+ readonly FHIR_R4: "org.hl7.fhir.r4";
25
26
  };
26
27
  export type Format = typeof Format[keyof typeof Format];
27
28
  export declare const Resource: {
28
29
  readonly PERSON: "Person";
29
30
  readonly RELATED_PERSON: "RelatedPerson";
31
+ readonly LICENSE: "License";
30
32
  readonly EMPLOYEE: "Employee";
31
33
  readonly EMPLOYEE_ROLE: "EmployeeRole";
32
34
  readonly PRACTITIONER: "Practitioner";
@@ -40,6 +42,7 @@ export declare const JobAction: {
40
42
  readonly BATCH: "_batch";
41
43
  readonly CREATE: "_create";
42
44
  readonly DISCOVERY: "_discovery";
45
+ readonly SEARCH: "_search";
43
46
  };
44
47
  export type JobAction = typeof JobAction[keyof typeof JobAction];
45
48
  export declare const knownDomainsReversed: readonly ["org.schema", "org.hl7.fhir", "org.ilo.isco", "net.openid"];
@@ -23,10 +23,12 @@ export const Section = {
23
23
  export const Format = {
24
24
  SCHEMA: 'org.schema',
25
25
  FHIR_API: 'org.hl7.fhir.api',
26
+ FHIR_R4: 'org.hl7.fhir.r4',
26
27
  };
27
28
  export const Resource = {
28
29
  PERSON: 'Person',
29
30
  RELATED_PERSON: 'RelatedPerson',
31
+ LICENSE: 'License',
30
32
  EMPLOYEE: 'Employee',
31
33
  EMPLOYEE_ROLE: 'EmployeeRole',
32
34
  PRACTITIONER: 'Practitioner',
@@ -39,6 +41,7 @@ export const JobAction = {
39
41
  BATCH: '_batch',
40
42
  CREATE: '_create',
41
43
  DISCOVERY: '_discovery',
44
+ SEARCH: '_search',
42
45
  };
43
46
  export const knownDomainsReversed = [
44
47
  'org.schema',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  export declare const FhirCodeSystems: Readonly<{
8
8
  readonly Loinc: "http://loinc.org";
9
+ readonly SnomedCt: "http://snomed.info/sct";
9
10
  readonly Ucum: "http://unitsofmeasure.org";
10
11
  readonly CommunicationCategory: "http://terminology.hl7.org/CodeSystem/communication-category";
11
12
  readonly ObservationCategory: "http://terminology.hl7.org/CodeSystem/observation-category";
@@ -6,6 +6,7 @@
6
6
  */
7
7
  export const FhirCodeSystems = Object.freeze({
8
8
  Loinc: 'http://loinc.org',
9
+ SnomedCt: 'http://snomed.info/sct',
9
10
  Ucum: 'http://unitsofmeasure.org',
10
11
  CommunicationCategory: 'http://terminology.hl7.org/CodeSystem/communication-category',
11
12
  ObservationCategory: 'http://terminology.hl7.org/CodeSystem/observation-category',
@@ -15,6 +15,7 @@ export * from './healthcare';
15
15
  export * from './permission-templates';
16
16
  export * from './vital-signs';
17
17
  export * from './network';
18
+ export * from './observation-category';
18
19
  export * from './sectors';
19
20
  export * from './smart';
20
21
  export * from './permission-templates';
@@ -23,3 +24,5 @@ export * from './urn';
23
24
  export * from './verifiable-credentials';
24
25
  export * from './identity-gender';
25
26
  export * from './identity-identifiers';
27
+ export * from './individual-sections';
28
+ export * from './lifecycle';
@@ -15,6 +15,7 @@ export * from './healthcare.js';
15
15
  export * from './permission-templates.js';
16
16
  export * from './vital-signs.js';
17
17
  export * from './network.js';
18
+ export * from './observation-category.js';
18
19
  export * from './sectors.js';
19
20
  export * from './smart.js';
20
21
  export * from './permission-templates.js';
@@ -23,3 +24,5 @@ export * from './urn.js';
23
24
  export * from './verifiable-credentials.js';
24
25
  export * from './identity-gender.js';
25
26
  export * from './identity-identifiers.js';
27
+ export * from './individual-sections.js';
28
+ export * from './lifecycle.js';
@@ -0,0 +1,210 @@
1
+ export type IndividualSectionDescriptor = Readonly<{
2
+ code: string;
3
+ attributeValue: string;
4
+ titleEn: string;
5
+ }>;
6
+ export declare const IndividualSectionSystems: Readonly<{
7
+ readonly Logical: "urn:gdc:individual-section";
8
+ }>;
9
+ export declare const IndividualLogicalSections: Readonly<{
10
+ readonly Composition: Readonly<{
11
+ code: string;
12
+ attributeValue: string;
13
+ titleEn: string;
14
+ }>;
15
+ readonly Communications: Readonly<{
16
+ code: string;
17
+ attributeValue: string;
18
+ titleEn: string;
19
+ }>;
20
+ readonly Consents: Readonly<{
21
+ code: string;
22
+ attributeValue: string;
23
+ titleEn: string;
24
+ }>;
25
+ readonly Appointments: Readonly<{
26
+ code: string;
27
+ attributeValue: string;
28
+ titleEn: string;
29
+ }>;
30
+ readonly Encounters: Readonly<{
31
+ code: string;
32
+ attributeValue: string;
33
+ titleEn: string;
34
+ }>;
35
+ readonly Documents: Readonly<{
36
+ code: string;
37
+ attributeValue: string;
38
+ titleEn: string;
39
+ }>;
40
+ readonly Observations: Readonly<{
41
+ code: string;
42
+ attributeValue: string;
43
+ titleEn: string;
44
+ }>;
45
+ readonly DiagnosticReports: Readonly<{
46
+ code: string;
47
+ attributeValue: string;
48
+ titleEn: string;
49
+ }>;
50
+ readonly RelatedPersons: Readonly<{
51
+ code: string;
52
+ attributeValue: string;
53
+ titleEn: string;
54
+ }>;
55
+ readonly Coverage: Readonly<{
56
+ code: string;
57
+ attributeValue: string;
58
+ titleEn: string;
59
+ }>;
60
+ }>;
61
+ export declare const IndividualClinicalSections: Readonly<{
62
+ readonly AllergiesAndIntolerances: Readonly<{
63
+ system: typeof import("..").LOINC_SYSTEM_URL;
64
+ code: string;
65
+ attributeValue: string;
66
+ claim: string;
67
+ i18nKey: `org.loinc.${string}`;
68
+ titleEn?: string;
69
+ }>;
70
+ readonly Conditions: Readonly<{
71
+ system: typeof import("..").LOINC_SYSTEM_URL;
72
+ code: string;
73
+ attributeValue: string;
74
+ claim: string;
75
+ i18nKey: `org.loinc.${string}`;
76
+ titleEn?: string;
77
+ }>;
78
+ readonly Immunizations: Readonly<{
79
+ system: typeof import("..").LOINC_SYSTEM_URL;
80
+ code: string;
81
+ attributeValue: string;
82
+ claim: string;
83
+ i18nKey: `org.loinc.${string}`;
84
+ titleEn?: string;
85
+ }>;
86
+ readonly Medications: Readonly<{
87
+ system: typeof import("..").LOINC_SYSTEM_URL;
88
+ code: string;
89
+ attributeValue: string;
90
+ claim: string;
91
+ i18nKey: `org.loinc.${string}`;
92
+ titleEn?: string;
93
+ }>;
94
+ readonly Procedures: Readonly<{
95
+ system: typeof import("..").LOINC_SYSTEM_URL;
96
+ code: string;
97
+ attributeValue: string;
98
+ claim: string;
99
+ i18nKey: `org.loinc.${string}`;
100
+ titleEn?: string;
101
+ }>;
102
+ readonly VitalSigns: Readonly<{
103
+ system: typeof import("..").LOINC_SYSTEM_URL;
104
+ code: string;
105
+ attributeValue: string;
106
+ claim: string;
107
+ i18nKey: `org.loinc.${string}`;
108
+ titleEn?: string;
109
+ }>;
110
+ }>;
111
+ export declare const IndividualAllSections: Readonly<{
112
+ readonly AllergiesAndIntolerances: Readonly<{
113
+ system: typeof import("..").LOINC_SYSTEM_URL;
114
+ code: string;
115
+ attributeValue: string;
116
+ claim: string;
117
+ i18nKey: `org.loinc.${string}`;
118
+ titleEn?: string;
119
+ }>;
120
+ readonly Conditions: Readonly<{
121
+ system: typeof import("..").LOINC_SYSTEM_URL;
122
+ code: string;
123
+ attributeValue: string;
124
+ claim: string;
125
+ i18nKey: `org.loinc.${string}`;
126
+ titleEn?: string;
127
+ }>;
128
+ readonly Immunizations: Readonly<{
129
+ system: typeof import("..").LOINC_SYSTEM_URL;
130
+ code: string;
131
+ attributeValue: string;
132
+ claim: string;
133
+ i18nKey: `org.loinc.${string}`;
134
+ titleEn?: string;
135
+ }>;
136
+ readonly Medications: Readonly<{
137
+ system: typeof import("..").LOINC_SYSTEM_URL;
138
+ code: string;
139
+ attributeValue: string;
140
+ claim: string;
141
+ i18nKey: `org.loinc.${string}`;
142
+ titleEn?: string;
143
+ }>;
144
+ readonly Procedures: Readonly<{
145
+ system: typeof import("..").LOINC_SYSTEM_URL;
146
+ code: string;
147
+ attributeValue: string;
148
+ claim: string;
149
+ i18nKey: `org.loinc.${string}`;
150
+ titleEn?: string;
151
+ }>;
152
+ readonly VitalSigns: Readonly<{
153
+ system: typeof import("..").LOINC_SYSTEM_URL;
154
+ code: string;
155
+ attributeValue: string;
156
+ claim: string;
157
+ i18nKey: `org.loinc.${string}`;
158
+ titleEn?: string;
159
+ }>;
160
+ readonly Composition: Readonly<{
161
+ code: string;
162
+ attributeValue: string;
163
+ titleEn: string;
164
+ }>;
165
+ readonly Communications: Readonly<{
166
+ code: string;
167
+ attributeValue: string;
168
+ titleEn: string;
169
+ }>;
170
+ readonly Consents: Readonly<{
171
+ code: string;
172
+ attributeValue: string;
173
+ titleEn: string;
174
+ }>;
175
+ readonly Appointments: Readonly<{
176
+ code: string;
177
+ attributeValue: string;
178
+ titleEn: string;
179
+ }>;
180
+ readonly Encounters: Readonly<{
181
+ code: string;
182
+ attributeValue: string;
183
+ titleEn: string;
184
+ }>;
185
+ readonly Documents: Readonly<{
186
+ code: string;
187
+ attributeValue: string;
188
+ titleEn: string;
189
+ }>;
190
+ readonly Observations: Readonly<{
191
+ code: string;
192
+ attributeValue: string;
193
+ titleEn: string;
194
+ }>;
195
+ readonly DiagnosticReports: Readonly<{
196
+ code: string;
197
+ attributeValue: string;
198
+ titleEn: string;
199
+ }>;
200
+ readonly RelatedPersons: Readonly<{
201
+ code: string;
202
+ attributeValue: string;
203
+ titleEn: string;
204
+ }>;
205
+ readonly Coverage: Readonly<{
206
+ code: string;
207
+ attributeValue: string;
208
+ titleEn: string;
209
+ }>;
210
+ }>;
@@ -0,0 +1,35 @@
1
+ import { HealthcareCoreSections } from './healthcare.js';
2
+ function defineSection(code, titleEn) {
3
+ return Object.freeze({
4
+ code,
5
+ attributeValue: `urn:gdc:individual-section|${code}`,
6
+ titleEn,
7
+ });
8
+ }
9
+ export const IndividualSectionSystems = Object.freeze({
10
+ Logical: 'urn:gdc:individual-section',
11
+ });
12
+ export const IndividualLogicalSections = Object.freeze({
13
+ Composition: defineSection('composition', 'Individual composition index'),
14
+ Communications: defineSection('communications', 'Communications'),
15
+ Consents: defineSection('consents', 'Consents'),
16
+ Appointments: defineSection('appointments', 'Appointments'),
17
+ Encounters: defineSection('encounters', 'Encounters'),
18
+ Documents: defineSection('documents', 'Documents'),
19
+ Observations: defineSection('observations', 'Observations'),
20
+ DiagnosticReports: defineSection('diagnostic-reports', 'Diagnostic reports'),
21
+ RelatedPersons: defineSection('related-persons', 'Related persons'),
22
+ Coverage: defineSection('coverage', 'Coverage'),
23
+ });
24
+ export const IndividualClinicalSections = Object.freeze({
25
+ AllergiesAndIntolerances: HealthcareCoreSections.AllergiesAndIntolerances,
26
+ Conditions: HealthcareCoreSections.ProblemList,
27
+ Immunizations: HealthcareCoreSections.Immunizations,
28
+ Medications: HealthcareCoreSections.HistoryOfMedicationUse,
29
+ Procedures: HealthcareCoreSections.Procedures,
30
+ VitalSigns: HealthcareCoreSections.VitalSigns,
31
+ });
32
+ export const IndividualAllSections = Object.freeze({
33
+ ...IndividualLogicalSections,
34
+ ...IndividualClinicalSections,
35
+ });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Shared interoperability contexts reused by examples, readers, and SDK
3
+ * adapters so they do not re-hardcode protocol-family strings inline.
4
+ */
5
+ export declare const InteroperableContext: Readonly<{
6
+ readonly FhirApi: "org.hl7.fhir.api";
7
+ readonly FhirR4: "org.hl7.fhir.r4";
8
+ readonly Schema: "org.schema";
9
+ }>;
10
+ /**
11
+ * Stable request type ids reused by lifecycle examples and SDK runtime
12
+ * adapters for the currently deployed GW CORE contract.
13
+ */
14
+ export declare const LifecycleRequestType: Readonly<{
15
+ readonly RelatedPersonDisable: "RelatedPerson-disable-request-v1.0";
16
+ readonly RelatedPersonPurge: "RelatedPerson-purge-request-v1.0";
17
+ }>;
@@ -0,0 +1,18 @@
1
+ import { Format } from './Schemas.js';
2
+ /**
3
+ * Shared interoperability contexts reused by examples, readers, and SDK
4
+ * adapters so they do not re-hardcode protocol-family strings inline.
5
+ */
6
+ export const InteroperableContext = Object.freeze({
7
+ FhirApi: Format.FHIR_API,
8
+ FhirR4: Format.FHIR_R4,
9
+ Schema: Format.SCHEMA,
10
+ });
11
+ /**
12
+ * Stable request type ids reused by lifecycle examples and SDK runtime
13
+ * adapters for the currently deployed GW CORE contract.
14
+ */
15
+ export const LifecycleRequestType = Object.freeze({
16
+ RelatedPersonDisable: 'RelatedPerson-disable-request-v1.0',
17
+ RelatedPersonPurge: 'RelatedPerson-purge-request-v1.0',
18
+ });
@@ -0,0 +1,72 @@
1
+ export type CodingDescriptor = Readonly<{
2
+ system: string;
3
+ code: string;
4
+ display?: string;
5
+ claim: string;
6
+ }>;
7
+ /**
8
+ * Canonical `Observation.category` descriptors.
9
+ *
10
+ * Source:
11
+ * - HL7 Terminology Observation Category code system:
12
+ * https://terminology.hl7.org/7.1.0/CodeSystem-observation-category.html
13
+ *
14
+ * Keep category in `Observation.category`.
15
+ * Do not store category codes in `Observation.value-concept-*`.
16
+ */
17
+ export declare const ObservationCategoryCodes: Readonly<{
18
+ readonly SocialHistory: Readonly<{
19
+ system: string;
20
+ code: string;
21
+ display?: string;
22
+ claim: string;
23
+ }>;
24
+ readonly VitalSigns: Readonly<{
25
+ system: string;
26
+ code: string;
27
+ display?: string;
28
+ claim: string;
29
+ }>;
30
+ readonly Imaging: Readonly<{
31
+ system: string;
32
+ code: string;
33
+ display?: string;
34
+ claim: string;
35
+ }>;
36
+ readonly Laboratory: Readonly<{
37
+ system: string;
38
+ code: string;
39
+ display?: string;
40
+ claim: string;
41
+ }>;
42
+ readonly Procedure: Readonly<{
43
+ system: string;
44
+ code: string;
45
+ display?: string;
46
+ claim: string;
47
+ }>;
48
+ readonly Survey: Readonly<{
49
+ system: string;
50
+ code: string;
51
+ display?: string;
52
+ claim: string;
53
+ }>;
54
+ readonly Exam: Readonly<{
55
+ system: string;
56
+ code: string;
57
+ display?: string;
58
+ claim: string;
59
+ }>;
60
+ readonly Therapy: Readonly<{
61
+ system: string;
62
+ code: string;
63
+ display?: string;
64
+ claim: string;
65
+ }>;
66
+ readonly Activity: Readonly<{
67
+ system: string;
68
+ code: string;
69
+ display?: string;
70
+ claim: string;
71
+ }>;
72
+ }>;
@@ -0,0 +1,30 @@
1
+ import { FhirCodeSystems } from './fhir-code-systems.js';
2
+ function defineCoding(system, code, display) {
3
+ return Object.freeze({
4
+ system,
5
+ code,
6
+ display,
7
+ claim: `${system}|${code}`,
8
+ });
9
+ }
10
+ /**
11
+ * Canonical `Observation.category` descriptors.
12
+ *
13
+ * Source:
14
+ * - HL7 Terminology Observation Category code system:
15
+ * https://terminology.hl7.org/7.1.0/CodeSystem-observation-category.html
16
+ *
17
+ * Keep category in `Observation.category`.
18
+ * Do not store category codes in `Observation.value-concept-*`.
19
+ */
20
+ export const ObservationCategoryCodes = Object.freeze({
21
+ SocialHistory: defineCoding(FhirCodeSystems.ObservationCategory, 'social-history', 'Social History'),
22
+ VitalSigns: defineCoding(FhirCodeSystems.ObservationCategory, 'vital-signs', 'Vital Signs'),
23
+ Imaging: defineCoding(FhirCodeSystems.ObservationCategory, 'imaging', 'Imaging'),
24
+ Laboratory: defineCoding(FhirCodeSystems.ObservationCategory, 'laboratory', 'Laboratory'),
25
+ Procedure: defineCoding(FhirCodeSystems.ObservationCategory, 'procedure', 'Procedure'),
26
+ Survey: defineCoding(FhirCodeSystems.ObservationCategory, 'survey', 'Survey'),
27
+ Exam: defineCoding(FhirCodeSystems.ObservationCategory, 'exam', 'Exam'),
28
+ Therapy: defineCoding(FhirCodeSystems.ObservationCategory, 'therapy', 'Therapy'),
29
+ Activity: defineCoding(FhirCodeSystems.ObservationCategory, 'activity', 'Activity'),
30
+ });
@@ -124,6 +124,10 @@ export declare enum ClaimsIndividualProductSchemaorg {
124
124
  serialNumber = "org.schema.IndividualProduct.serialNumber"
125
125
  }
126
126
  export declare enum ClaimsOrderSchemaorg {
127
+ acceptedOfferIdentifier = "org.schema.Order.acceptedOffer.identifier",
128
+ partOfInvoice = "org.schema.Order.partOfInvoice",
129
+ paymentMethod = "org.schema.Order.paymentMethod",
130
+ paymentUrl = "org.schema.Order.paymentUrl",
127
131
  orderedItemServiceType = "org.schema.Order.orderedItem.serviceType"
128
132
  }
129
133
  /** For Employees (and Employee Role, but no PII) and customers / related persons.
@@ -131,6 +131,10 @@ export var ClaimsIndividualProductSchemaorg;
131
131
  })(ClaimsIndividualProductSchemaorg || (ClaimsIndividualProductSchemaorg = {}));
132
132
  export var ClaimsOrderSchemaorg;
133
133
  (function (ClaimsOrderSchemaorg) {
134
+ ClaimsOrderSchemaorg["acceptedOfferIdentifier"] = "org.schema.Order.acceptedOffer.identifier";
135
+ ClaimsOrderSchemaorg["partOfInvoice"] = "org.schema.Order.partOfInvoice";
136
+ ClaimsOrderSchemaorg["paymentMethod"] = "org.schema.Order.paymentMethod";
137
+ ClaimsOrderSchemaorg["paymentUrl"] = "org.schema.Order.paymentUrl";
134
138
  ClaimsOrderSchemaorg["orderedItemServiceType"] = "org.schema.Order.orderedItem.serviceType";
135
139
  })(ClaimsOrderSchemaorg || (ClaimsOrderSchemaorg = {}));
136
140
  /** For Employees (and Employee Role, but no PII) and customers / related persons.
@@ -1,20 +1,5 @@
1
- export type CodingDescriptor = Readonly<{
2
- system: string;
3
- code: string;
4
- display?: string;
5
- claim: string;
6
- }>;
7
- /**
8
- * Canonical `Observation.category` descriptors for vital-sign observations.
9
- */
10
- export declare const ObservationCategoryCodes: Readonly<{
11
- readonly VitalSigns: Readonly<{
12
- system: string;
13
- code: string;
14
- display?: string;
15
- claim: string;
16
- }>;
17
- }>;
1
+ export { ObservationCategoryCodes } from './observation-category';
2
+ export type { CodingDescriptor } from './observation-category';
18
3
  /**
19
4
  * Canonical LOINC descriptors for the currently supported Vital Signs.
20
5
  */
@@ -1,4 +1,5 @@
1
1
  import { FhirCodeSystems } from './fhir-code-systems.js';
2
+ export { ObservationCategoryCodes } from './observation-category.js';
2
3
  function defineCoding(system, code, display) {
3
4
  return Object.freeze({
4
5
  system,
@@ -7,12 +8,6 @@ function defineCoding(system, code, display) {
7
8
  claim: `${system}|${code}`,
8
9
  });
9
10
  }
10
- /**
11
- * Canonical `Observation.category` descriptors for vital-sign observations.
12
- */
13
- export const ObservationCategoryCodes = Object.freeze({
14
- VitalSigns: defineCoding(FhirCodeSystems.ObservationCategory, 'vital-signs', 'Vital Signs'),
15
- });
16
11
  /**
17
12
  * Canonical LOINC descriptors for the currently supported Vital Signs.
18
13
  */
@@ -1,3 +1,21 @@
1
1
  import type { FhirResource, FlatClaims } from './convert-shared';
2
- export declare function observationFlatToFhirR4(claims: FlatClaims): FhirResource;
3
- export declare function observationFhirR4ToFlat(resource: FhirResource): FlatClaims;
2
+ /**
3
+ * Converts flat editable Observation claims into a FHIR R4 Observation.
4
+ *
5
+ * Naming convention:
6
+ * - place the concrete FHIR version suffix at the end of the helper name
7
+ * - prefer `observationFromFlatToFhirR4` / `observationToFlatFhirR4`
8
+ * - avoid `observationFhirR4ToFlat`
9
+ */
10
+ export declare function observationFromFlatToFhirR4(claims: FlatClaims): FhirResource;
11
+ /**
12
+ * Converts a FHIR R4 Observation into the flat editable claims contract.
13
+ *
14
+ * `Observation.category` stays in `Observation.category`.
15
+ * Coded result values belong in `Observation.value-concept-*`.
16
+ */
17
+ export declare function observationToFlatFhirR4(resource: FhirResource): FlatClaims;
18
+ /** @deprecated Prefer `observationFromFlatToFhirR4`. */
19
+ export declare const observationFlatToFhirR4: typeof observationFromFlatToFhirR4;
20
+ /** @deprecated Prefer `observationToFlatFhirR4`. */
21
+ export declare const observationFhirR4ToFlat: typeof observationToFlatFhirR4;