gdc-common-utils-ts 2.3.26 → 2.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/claims/claims-helpers-related-person.js +0 -1
- package/dist/convert/convert-care-plan.js +25 -1
- package/dist/convert/convert-condition.js +12 -0
- package/dist/convert/convert-consent.js +59 -13
- package/dist/convert/convert-device-use-statement.js +3 -1
- package/dist/convert/convert-immunization.js +12 -2
- package/dist/convert/convert-medication-statement.js +35 -1
- package/dist/convert/convert-observation.js +43 -2
- package/dist/convert/convert-practitioner-role.d.ts +1 -1
- package/dist/convert/convert-practitioner-role.js +41 -13
- package/dist/convert/convert-shared.js +1 -1
- package/dist/examples/communication-didcomm-payload.d.ts +2 -2
- package/dist/examples/related-person.d.ts +9 -9
- package/dist/models/consent-rule.d.ts +8 -1
- package/dist/models/consent-rule.js +8 -1
- package/dist/models/indexing.d.ts +5 -5
- package/dist/models/interoperable-claims/appointment-claims.d.ts +57 -57
- package/dist/models/interoperable-claims/appointment-claims.js +31 -32
- package/dist/models/interoperable-claims/appointment-response-claims.d.ts +11 -11
- package/dist/models/interoperable-claims/appointment-response-claims.js +11 -11
- package/dist/models/interoperable-claims/care-plan-claims.d.ts +11 -0
- package/dist/models/interoperable-claims/care-plan-claims.js +11 -0
- package/dist/models/interoperable-claims/clinical-impression-claims.d.ts +1 -1
- package/dist/models/interoperable-claims/clinical-impression-claims.js +1 -1
- package/dist/models/interoperable-claims/condition-claims.d.ts +2 -0
- package/dist/models/interoperable-claims/condition-claims.js +2 -0
- package/dist/models/interoperable-claims/device-use-statement-claims.d.ts +3 -2
- package/dist/models/interoperable-claims/device-use-statement-claims.js +3 -2
- package/dist/models/interoperable-claims/document-reference-claims.d.ts +1 -1
- package/dist/models/interoperable-claims/document-reference-claims.js +1 -1
- package/dist/models/interoperable-claims/immunization-claims.d.ts +4 -0
- package/dist/models/interoperable-claims/immunization-claims.js +4 -0
- package/dist/models/interoperable-claims/medication-statement-claims.d.ts +6 -0
- package/dist/models/interoperable-claims/medication-statement-claims.js +6 -0
- package/dist/models/interoperable-claims/observation-claims.d.ts +12 -4
- package/dist/models/interoperable-claims/observation-claims.js +10 -2
- package/dist/models/interoperable-claims/practitioner-role-claims.d.ts +9 -0
- package/dist/models/interoperable-claims/practitioner-role-claims.js +9 -0
- package/dist/models/interoperable-claims/related-person-claims.d.ts +3 -2
- package/dist/models/interoperable-claims/related-person-claims.js +3 -2
- package/dist/models/params.d.ts +1 -1
- package/dist/utils/bundle-document-builder.js +37 -16
- package/dist/utils/bundle-entry-editor.d.ts +13 -0
- package/dist/utils/bundle-entry-editor.js +18 -0
- package/dist/utils/clinical-resource-converters.js +6 -4
- package/dist/utils/clinical-resource-view.d.ts +55 -0
- package/dist/utils/clinical-resource-view.js +137 -1
- package/dist/utils/communication-bundle-document-request.js +1 -1
- package/dist/utils/communication-fhir-r4.js +1 -1
- package/dist/utils/fhir-api-claim-helpers.d.ts +2 -0
- package/dist/utils/fhir-api-claim-helpers.js +16 -0
- package/dist/utils/ips-bundle-claims.d.ts +3 -4
- package/dist/utils/ips-bundle-claims.js +7 -7
- package/dist/utils/medication-statement-entry-editor.js +10 -10
- package/dist/utils/observation-component-entry-editor.d.ts +2 -2
- package/dist/utils/observation-component-entry-editor.js +2 -2
- package/package.json +1 -1
|
@@ -17,10 +17,9 @@ export type FhirMetaTagCoding = Readonly<{
|
|
|
17
17
|
display?: string;
|
|
18
18
|
}>;
|
|
19
19
|
/**
|
|
20
|
-
* Removes the
|
|
20
|
+
* Removes the version-independent FHIR API context from a flattened claim key.
|
|
21
21
|
*
|
|
22
22
|
* Examples:
|
|
23
|
-
* - `org.hl7.fhir.r4.Immunization.vaccine-code` -> `Immunization.vaccine-code`
|
|
24
23
|
* - `org.hl7.fhir.api.MedicationStatement.subject` -> `MedicationStatement.subject`
|
|
25
24
|
* - `Consent.identifier` -> `Consent.identifier`
|
|
26
25
|
*/
|
|
@@ -35,8 +34,8 @@ export declare function extractResourceMetaClaimsFromBundle(bundle: BundleLike):
|
|
|
35
34
|
/**
|
|
36
35
|
* Builds FHIR `meta.tag[]` codings from a flat claims record.
|
|
37
36
|
*
|
|
38
|
-
* The generated `code`
|
|
39
|
-
*
|
|
37
|
+
* The generated `code` removes the sole valid FHIR claims context,
|
|
38
|
+
* `org.hl7.fhir.api`, so UI/frontends receive the canonical short key.
|
|
40
39
|
*/
|
|
41
40
|
export declare function createFhirMetaTagsFromClaims(claims: Record<string, unknown>, options?: Readonly<{
|
|
42
41
|
system?: string;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
2
|
export const DEFAULT_META_CLAIM_TAG_SYSTEM = 'urn:gdc:fhir:meta-claim';
|
|
3
3
|
/**
|
|
4
|
-
* Removes the
|
|
4
|
+
* Removes the version-independent FHIR API context from a flattened claim key.
|
|
5
5
|
*
|
|
6
6
|
* Examples:
|
|
7
|
-
* - `org.hl7.fhir.r4.Immunization.vaccine-code` -> `Immunization.vaccine-code`
|
|
8
7
|
* - `org.hl7.fhir.api.MedicationStatement.subject` -> `MedicationStatement.subject`
|
|
9
8
|
* - `Consent.identifier` -> `Consent.identifier`
|
|
10
9
|
*/
|
|
@@ -12,9 +11,10 @@ export function toVersionAgnosticMetaClaimKey(claimKey) {
|
|
|
12
11
|
const raw = String(claimKey || '').trim();
|
|
13
12
|
if (!raw)
|
|
14
13
|
return '';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
if (raw.startsWith('org.hl7.fhir.') && !raw.startsWith('org.hl7.fhir.api.')) {
|
|
15
|
+
throw new Error('FHIR claims require @context org.hl7.fhir.api.');
|
|
16
|
+
}
|
|
17
|
+
return raw.replace(/^org\.hl7\.fhir\.api\./i, '');
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Extracts all `resource.meta.claims` blocks from a FHIR/JSON:API bundle.
|
|
@@ -35,8 +35,8 @@ export function extractResourceMetaClaimsFromBundle(bundle) {
|
|
|
35
35
|
/**
|
|
36
36
|
* Builds FHIR `meta.tag[]` codings from a flat claims record.
|
|
37
37
|
*
|
|
38
|
-
* The generated `code`
|
|
39
|
-
*
|
|
38
|
+
* The generated `code` removes the sole valid FHIR claims context,
|
|
39
|
+
* `org.hl7.fhir.api`, so UI/frontends receive the canonical short key.
|
|
40
40
|
*/
|
|
41
41
|
export function createFhirMetaTagsFromClaims(claims, options) {
|
|
42
42
|
const system = String(options?.system || DEFAULT_META_CLAIM_TAG_SYSTEM).trim();
|
|
@@ -63,25 +63,25 @@ export class MedicationStatementEntryEditor extends ClinicalResourceEntryEditor
|
|
|
63
63
|
/** Returns the medication category/section tags. */
|
|
64
64
|
getCategoryList() { return this.getCsvClaimList(MedicationStatementClaim.Category); }
|
|
65
65
|
/** Sets the numeric dose quantity value. */
|
|
66
|
-
setDoseQuantityValue(value) { return this.setNumberClaim(
|
|
66
|
+
setDoseQuantityValue(value) { return this.setNumberClaim(MedicationStatementClaim.DoseQuantityValue, value); }
|
|
67
67
|
/** Returns the numeric dose quantity value. */
|
|
68
|
-
getDoseQuantityValue() { return this.getNumberClaim(
|
|
68
|
+
getDoseQuantityValue() { return this.getNumberClaim(MedicationStatementClaim.DoseQuantityValue); }
|
|
69
69
|
/** Sets the dose quantity unit token. */
|
|
70
|
-
setDoseQuantityUnit(value) { return this.setScalarClaim(
|
|
70
|
+
setDoseQuantityUnit(value) { return this.setScalarClaim(MedicationStatementClaim.DoseQuantityUnit, value); }
|
|
71
71
|
/** Returns the dose quantity unit token. */
|
|
72
|
-
getDoseQuantityUnit() { return this.getScalarClaim(
|
|
72
|
+
getDoseQuantityUnit() { return this.getScalarClaim(MedicationStatementClaim.DoseQuantityUnit); }
|
|
73
73
|
/** Sets the timing frequency for structured dosage authoring. */
|
|
74
|
-
setTimingFrequency(value) { return this.setNumberClaim(
|
|
74
|
+
setTimingFrequency(value) { return this.setNumberClaim(MedicationStatementClaim.TimingFrequency, value); }
|
|
75
75
|
/** Returns the timing frequency. */
|
|
76
|
-
getTimingFrequency() { return this.getNumberClaim(
|
|
76
|
+
getTimingFrequency() { return this.getNumberClaim(MedicationStatementClaim.TimingFrequency); }
|
|
77
77
|
/** Sets the timing period for structured dosage authoring. */
|
|
78
|
-
setTimingPeriod(value) { return this.setNumberClaim(
|
|
78
|
+
setTimingPeriod(value) { return this.setNumberClaim(MedicationStatementClaim.TimingPeriod, value); }
|
|
79
79
|
/** Returns the timing period. */
|
|
80
|
-
getTimingPeriod() { return this.getNumberClaim(
|
|
80
|
+
getTimingPeriod() { return this.getNumberClaim(MedicationStatementClaim.TimingPeriod); }
|
|
81
81
|
/** Sets the timing period unit token. */
|
|
82
|
-
setTimingPeriodUnit(value) { return this.setScalarClaim(
|
|
82
|
+
setTimingPeriodUnit(value) { return this.setScalarClaim(MedicationStatementClaim.TimingPeriodUnit, value); }
|
|
83
83
|
/** Returns the timing period unit token. */
|
|
84
|
-
getTimingPeriodUnit() { return this.getScalarClaim(
|
|
84
|
+
getTimingPeriodUnit() { return this.getScalarClaim(MedicationStatementClaim.TimingPeriodUnit); }
|
|
85
85
|
/** Marks whether this dosage is `as needed`. */
|
|
86
86
|
setDosageAsNeeded(value) { return this.setBooleanClaim(MedicationStatementClaimsFhirApiExtended.DosageAsNeeded, value); }
|
|
87
87
|
/** Returns whether this dosage is `as needed`. */
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* - Move shared helpers to reusable helper/base modules instead of duplicating logic here.
|
|
7
7
|
*/
|
|
8
8
|
import { type CodingDescriptor } from '../constants/vital-signs';
|
|
9
|
-
import {
|
|
9
|
+
import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor';
|
|
10
10
|
/**
|
|
11
11
|
* Typed editor for one staged ObservationComponent resource entry.
|
|
12
12
|
*
|
|
13
13
|
* Keep this surface thin and claim-focused so 101 tests can teach one
|
|
14
14
|
* resource at a time without exposing bundle-internal plumbing.
|
|
15
15
|
*/
|
|
16
|
-
export declare class ObservationComponentEntryEditor extends
|
|
16
|
+
export declare class ObservationComponentEntryEditor extends ClinicalResourceEntryEditor {
|
|
17
17
|
setCode(code: CodingDescriptor | string): this;
|
|
18
18
|
getCode(): string | undefined;
|
|
19
19
|
setCodeSystem(system: string): this;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ObservationClaim } from '../models/interoperable-claims/observation-claims.js';
|
|
2
2
|
import { normalizeOptionalIdentifier } from './bundle-editor-helpers.js';
|
|
3
|
-
import {
|
|
3
|
+
import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor.js';
|
|
4
4
|
/**
|
|
5
5
|
* Typed editor for one staged ObservationComponent resource entry.
|
|
6
6
|
*
|
|
7
7
|
* Keep this surface thin and claim-focused so 101 tests can teach one
|
|
8
8
|
* resource at a time without exposing bundle-internal plumbing.
|
|
9
9
|
*/
|
|
10
|
-
export class ObservationComponentEntryEditor extends
|
|
10
|
+
export class ObservationComponentEntryEditor extends ClinicalResourceEntryEditor {
|
|
11
11
|
setCode(code) {
|
|
12
12
|
const token = typeof code === 'string' ? code.trim() : code.claim;
|
|
13
13
|
this.setClaim(ObservationClaim.Code, token);
|