fhir-data-utils-ts 0.6.4 → 0.6.6
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/.codex/skills/govern-fhir-data-utilities/SKILL.md +5 -0
- package/CHANGELOG.md +11 -0
- package/dist/data/health-credential-qr.data.d.ts +7 -0
- package/dist/data/health-credential-qr.data.js +7 -0
- package/dist/data/index.d.ts +2 -0
- package/dist/data/index.js +2 -0
- package/dist/data/ips-clinical-artifact-schemas.data.d.ts +25 -0
- package/dist/data/ips-clinical-artifact-schemas.data.js +61 -0
- package/dist/health-credential-qr.d.ts +15 -0
- package/dist/health-credential-qr.js +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/docs/UHC_FHIR_UTILS_MIGRATION.md +9 -0
- package/package.json +5 -1
|
@@ -15,6 +15,11 @@ description: Complete or audit migrations, claim catalogs, converters, builders,
|
|
|
15
15
|
authorization and product policy in their owning services or sector packages.
|
|
16
16
|
4. Define every flat key once in its owning named catalog. Import that symbol in
|
|
17
17
|
converters, builders, tests and examples; never repeat a claim-path literal.
|
|
18
|
+
5. For SHC and DGC archaeology, treat `uhc-helpers-typescript` as the early
|
|
19
|
+
flow source, the later UHC common models/data/common/crypto split as the
|
|
20
|
+
preferred implementation evidence, and `gdc-common-utils-ts` as its later
|
|
21
|
+
consolidation. Do not copy an earlier helper when a later governed contract
|
|
22
|
+
exists.
|
|
18
23
|
|
|
19
24
|
## Separate catalogs, adapters and builders
|
|
20
25
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Export data-only, coverage-excluded authoring schemas for the six minimum IPS
|
|
6
|
+
resource families used by shared Personal and Professional forms:
|
|
7
|
+
AllergyIntolerance, MedicationStatement, Immunization, Condition, Procedure
|
|
8
|
+
and Observation. Every field reuses its owning flat-claim catalog, records
|
|
9
|
+
the terminology-enabled source-text claims and remains neutral between human
|
|
10
|
+
and veterinary subjects.
|
|
11
|
+
|
|
12
|
+
- Recover neutral SHC and EU DGC QR prefix classification from the later UHC
|
|
13
|
+
data-utility lineage, with exported repository-safe `*.data.ts` examples.
|
|
14
|
+
Recognition explicitly provides no decoding, verification or authorization.
|
|
15
|
+
|
|
5
16
|
- Export one repository-safe, telephone-free IPS demo document with all sixteen
|
|
6
17
|
clinical sections from the explicit `fhir-data-utils-ts/data` entry point so
|
|
7
18
|
product portals and visual tests share the same typed source data.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Repository-safe non-clinical examples for classification tests and portal hints. */
|
|
2
|
+
export declare const HEALTH_CREDENTIAL_QR_EXAMPLES: Readonly<{
|
|
3
|
+
smartHealthCard: "shc:/123456";
|
|
4
|
+
europeanDigitalCertificate: "HC1:DEMO";
|
|
5
|
+
norwegianDigitalCertificate: "NO1:DEMO";
|
|
6
|
+
nonCredentialIdentifier: "urn:uuid:00000000-0000-4000-8000-000000000001";
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Repository-safe non-clinical examples for classification tests and portal hints. */
|
|
2
|
+
export const HEALTH_CREDENTIAL_QR_EXAMPLES = Object.freeze({
|
|
3
|
+
smartHealthCard: 'shc:/123456',
|
|
4
|
+
europeanDigitalCertificate: 'HC1:DEMO',
|
|
5
|
+
norwegianDigitalCertificate: 'NO1:DEMO',
|
|
6
|
+
nonCredentialIdentifier: 'urn:uuid:00000000-0000-4000-8000-000000000001',
|
|
7
|
+
});
|
package/dist/data/index.d.ts
CHANGED
package/dist/data/index.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const FhirIpsClinicalArtifactTypes: Readonly<{
|
|
2
|
+
readonly AllergyIntolerance: "AllergyIntolerance";
|
|
3
|
+
readonly MedicationStatement: "MedicationStatement";
|
|
4
|
+
readonly Immunization: "Immunization";
|
|
5
|
+
readonly Condition: "Condition";
|
|
6
|
+
readonly Procedure: "Procedure";
|
|
7
|
+
readonly Observation: "Observation";
|
|
8
|
+
}>;
|
|
9
|
+
export type FhirIpsClinicalArtifactType = typeof FhirIpsClinicalArtifactTypes[keyof typeof FhirIpsClinicalArtifactTypes];
|
|
10
|
+
export type FhirIpsClinicalArtifactSchema = Readonly<{
|
|
11
|
+
resourceType: FhirIpsClinicalArtifactType;
|
|
12
|
+
requiredClaims: readonly string[];
|
|
13
|
+
optionalClaims: readonly string[];
|
|
14
|
+
/** Source-text claims for which a user may explicitly confirm a terminology candidate. */
|
|
15
|
+
terminologyTextClaims: readonly string[];
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Minimum reusable IPS authoring surface for Personal and Professional portals.
|
|
19
|
+
*
|
|
20
|
+
* These data-only schemas contain claim keys, not UI labels, authorization or
|
|
21
|
+
* transport policy. Human and veterinary portals use the same core resource
|
|
22
|
+
* contracts; a veterinary terminology adapter may additionally receive the
|
|
23
|
+
* subject taxonomy without changing the stored FHIR claim names.
|
|
24
|
+
*/
|
|
25
|
+
export declare const FHIR_IPS_CLINICAL_ARTIFACT_SCHEMAS: Readonly<Record<FhirIpsClinicalArtifactType, FhirIpsClinicalArtifactSchema>>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Copyright 2026 Connecting Solution & Applications Ltd under the Apache License, Version 2.0.
|
|
2
|
+
import { AllergyIntoleranceClaim } from '../claims/allergy-intolerance-claims.js';
|
|
3
|
+
import { ConditionClaim } from '../claims/condition-claims.js';
|
|
4
|
+
import { ImmunizationClaim } from '../claims/immunization-claims.js';
|
|
5
|
+
import { MedicationStatementClaim } from '../claims/medication-statement-claims.js';
|
|
6
|
+
import { ProcedureClaim } from '../claims/procedure-claims.js';
|
|
7
|
+
import { ObservationClaim } from '../observation-claims.js';
|
|
8
|
+
export const FhirIpsClinicalArtifactTypes = Object.freeze({
|
|
9
|
+
AllergyIntolerance: 'AllergyIntolerance',
|
|
10
|
+
MedicationStatement: 'MedicationStatement',
|
|
11
|
+
Immunization: 'Immunization',
|
|
12
|
+
Condition: 'Condition',
|
|
13
|
+
Procedure: 'Procedure',
|
|
14
|
+
Observation: 'Observation',
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Minimum reusable IPS authoring surface for Personal and Professional portals.
|
|
18
|
+
*
|
|
19
|
+
* These data-only schemas contain claim keys, not UI labels, authorization or
|
|
20
|
+
* transport policy. Human and veterinary portals use the same core resource
|
|
21
|
+
* contracts; a veterinary terminology adapter may additionally receive the
|
|
22
|
+
* subject taxonomy without changing the stored FHIR claim names.
|
|
23
|
+
*/
|
|
24
|
+
export const FHIR_IPS_CLINICAL_ARTIFACT_SCHEMAS = Object.freeze({
|
|
25
|
+
[FhirIpsClinicalArtifactTypes.AllergyIntolerance]: Object.freeze({
|
|
26
|
+
resourceType: FhirIpsClinicalArtifactTypes.AllergyIntolerance,
|
|
27
|
+
requiredClaims: Object.freeze([AllergyIntoleranceClaim.CodeText, AllergyIntoleranceClaim.ClinicalStatus]),
|
|
28
|
+
optionalClaims: Object.freeze([AllergyIntoleranceClaim.Code, AllergyIntoleranceClaim.CodeDisplay, AllergyIntoleranceClaim.Category, AllergyIntoleranceClaim.VerificationStatus, AllergyIntoleranceClaim.Criticality, AllergyIntoleranceClaim.OnsetDateTime, AllergyIntoleranceClaim.Recorder]),
|
|
29
|
+
terminologyTextClaims: Object.freeze([AllergyIntoleranceClaim.CodeText]),
|
|
30
|
+
}),
|
|
31
|
+
[FhirIpsClinicalArtifactTypes.MedicationStatement]: Object.freeze({
|
|
32
|
+
resourceType: FhirIpsClinicalArtifactTypes.MedicationStatement,
|
|
33
|
+
requiredClaims: Object.freeze([MedicationStatementClaim.CodeText, MedicationStatementClaim.Status]),
|
|
34
|
+
optionalClaims: Object.freeze([MedicationStatementClaim.Code, MedicationStatementClaim.CodeDisplay, MedicationStatementClaim.Category, MedicationStatementClaim.Effective, MedicationStatementClaim.DosageInstruction, MedicationStatementClaim.DosageRoute, MedicationStatementClaim.TimingFrequency, MedicationStatementClaim.TimingPeriod, MedicationStatementClaim.TimingPeriodUnit, MedicationStatementClaim.Note]),
|
|
35
|
+
terminologyTextClaims: Object.freeze([MedicationStatementClaim.CodeText]),
|
|
36
|
+
}),
|
|
37
|
+
[FhirIpsClinicalArtifactTypes.Immunization]: Object.freeze({
|
|
38
|
+
resourceType: FhirIpsClinicalArtifactTypes.Immunization,
|
|
39
|
+
requiredClaims: Object.freeze([ImmunizationClaim.VaccineCodeText, ImmunizationClaim.Status]),
|
|
40
|
+
optionalClaims: Object.freeze([ImmunizationClaim.VaccineCode, ImmunizationClaim.VaccineCodeDisplay, ImmunizationClaim.Date, ImmunizationClaim.LotNumber, ImmunizationClaim.DoseSequence, ImmunizationClaim.Manufacturer, ImmunizationClaim.Performer, ImmunizationClaim.Location, ImmunizationClaim.Route, ImmunizationClaim.RouteDisplay, ImmunizationClaim.Site, ImmunizationClaim.SiteDisplay, ImmunizationClaim.Series, ImmunizationClaim.TargetDisease, ImmunizationClaim.TargetDiseaseText, ImmunizationClaim.TargetDiseaseDisplay, ImmunizationClaim.ReactionDate, ImmunizationClaim.Note]),
|
|
41
|
+
terminologyTextClaims: Object.freeze([ImmunizationClaim.VaccineCodeText, ImmunizationClaim.TargetDiseaseText]),
|
|
42
|
+
}),
|
|
43
|
+
[FhirIpsClinicalArtifactTypes.Condition]: Object.freeze({
|
|
44
|
+
resourceType: FhirIpsClinicalArtifactTypes.Condition,
|
|
45
|
+
requiredClaims: Object.freeze([ConditionClaim.CodeText, ConditionClaim.ClinicalStatus]),
|
|
46
|
+
optionalClaims: Object.freeze([ConditionClaim.Code, ConditionClaim.CodeDisplay, ConditionClaim.Category, ConditionClaim.VerificationStatus, ConditionClaim.Severity, ConditionClaim.OnsetDateTime, ConditionClaim.RecordedDate, ConditionClaim.Asserter, ConditionClaim.Recorder]),
|
|
47
|
+
terminologyTextClaims: Object.freeze([ConditionClaim.CodeText]),
|
|
48
|
+
}),
|
|
49
|
+
[FhirIpsClinicalArtifactTypes.Procedure]: Object.freeze({
|
|
50
|
+
resourceType: FhirIpsClinicalArtifactTypes.Procedure,
|
|
51
|
+
requiredClaims: Object.freeze([ProcedureClaim.CodeText, ProcedureClaim.Status]),
|
|
52
|
+
optionalClaims: Object.freeze([ProcedureClaim.Code, ProcedureClaim.CodeDisplay, ProcedureClaim.Date, ProcedureClaim.Performer, ProcedureClaim.Location, ProcedureClaim.BodySite, ProcedureClaim.ReasonCode, ProcedureClaim.ReasonReference, ProcedureClaim.Note]),
|
|
53
|
+
terminologyTextClaims: Object.freeze([ProcedureClaim.CodeText]),
|
|
54
|
+
}),
|
|
55
|
+
[FhirIpsClinicalArtifactTypes.Observation]: Object.freeze({
|
|
56
|
+
resourceType: FhirIpsClinicalArtifactTypes.Observation,
|
|
57
|
+
requiredClaims: Object.freeze([ObservationClaim.Category, ObservationClaim.CodeText, ObservationClaim.Status]),
|
|
58
|
+
optionalClaims: Object.freeze([ObservationClaim.Code, ObservationClaim.CodeDisplay, ObservationClaim.Date, ObservationClaim.EffectiveDateTime, ObservationClaim.Performer, ObservationClaim.Method, ObservationClaim.Specimen, ObservationClaim.Device, ObservationClaim.ValueQuantityNumber, ObservationClaim.ValueQuantityUnit, ObservationClaim.ValueString, ObservationClaim.ValueConcept, ObservationClaim.ReferenceRangeLowNumber, ObservationClaim.ReferenceRangeHighNumber, ObservationClaim.ReferenceRangeUnit, ObservationClaim.ReferenceRangeText, ObservationClaim.Note]),
|
|
59
|
+
terminologyTextClaims: Object.freeze([ObservationClaim.CodeText]),
|
|
60
|
+
}),
|
|
61
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const HealthCredentialQrPayloadKinds: Readonly<{
|
|
2
|
+
readonly SmartHealthCard: "smart-health-card";
|
|
3
|
+
readonly DigitalGreenCertificate: "digital-green-certificate";
|
|
4
|
+
readonly Unknown: "unknown";
|
|
5
|
+
}>;
|
|
6
|
+
export type HealthCredentialQrPayloadKind = typeof HealthCredentialQrPayloadKinds[keyof typeof HealthCredentialQrPayloadKinds];
|
|
7
|
+
export type HealthCredentialQrClassification = Readonly<{
|
|
8
|
+
kind: HealthCredentialQrPayloadKind;
|
|
9
|
+
value: string;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Recognizes the wire prefix only. This function does not decode, verify,
|
|
13
|
+
* authorize, trust or persist the credential or any embedded FHIR resource.
|
|
14
|
+
*/
|
|
15
|
+
export declare function classifyHealthCredentialQrPayload(value: unknown): HealthCredentialQrClassification;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const HealthCredentialQrPayloadKinds = Object.freeze({
|
|
2
|
+
SmartHealthCard: 'smart-health-card',
|
|
3
|
+
DigitalGreenCertificate: 'digital-green-certificate',
|
|
4
|
+
Unknown: 'unknown',
|
|
5
|
+
});
|
|
6
|
+
/**
|
|
7
|
+
* Recognizes the wire prefix only. This function does not decode, verify,
|
|
8
|
+
* authorize, trust or persist the credential or any embedded FHIR resource.
|
|
9
|
+
*/
|
|
10
|
+
export function classifyHealthCredentialQrPayload(value) {
|
|
11
|
+
const normalized = String(value ?? '').trim();
|
|
12
|
+
const upper = normalized.toUpperCase();
|
|
13
|
+
if (normalized.toLowerCase().startsWith('shc:/'))
|
|
14
|
+
return Object.freeze({ kind: HealthCredentialQrPayloadKinds.SmartHealthCard, value: normalized });
|
|
15
|
+
if (upper.startsWith('HC1:') || upper.startsWith('NO1:'))
|
|
16
|
+
return Object.freeze({ kind: HealthCredentialQrPayloadKinds.DigitalGreenCertificate, value: normalized });
|
|
17
|
+
return Object.freeze({ kind: HealthCredentialQrPayloadKinds.Unknown, value: normalized });
|
|
18
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -5,6 +5,14 @@ this package. Its useful behavior must be recovered behind neutral, typed and
|
|
|
5
5
|
version-explicit contracts. Its product branding, obsolete security choices
|
|
6
6
|
and transport assumptions must not be copied.
|
|
7
7
|
|
|
8
|
+
The wider historical lineage began with early helpers in
|
|
9
|
+
`uhc-helpers-typescript`, was then split and improved across
|
|
10
|
+
`uhc-common-models-typescript`, `uhc-common-utils-typescript`,
|
|
11
|
+
`data-utils-typescript` and the crypto utilities, and later contributed to
|
|
12
|
+
`gdc-common-utils-ts`. For SHC and DGC, the later split packages are the
|
|
13
|
+
preferred behavioural and type evidence; the early helper remains UI-flow
|
|
14
|
+
evidence only.
|
|
15
|
+
|
|
8
16
|
## Migration rules
|
|
9
17
|
|
|
10
18
|
1. Add the smallest failing contract test here before porting behavior.
|
|
@@ -43,6 +51,7 @@ and transport assumptions must not be copied.
|
|
|
43
51
|
| `gdc-common-utils-ts` converters | Every product-neutral R4/R5 converter present there; Observation component writing was corrected to use a resource graph | Network, persistence and authorization orchestration |
|
|
44
52
|
| `uhc-fhir-utils-typescript` models | ATC/FHIR/LOINC/SNOMED model types, all resource search parameter enums and template interfaces, strict replacement FHIR primitives | Embedded terminology JSON is not authoritative data |
|
|
45
53
|
| `uhc-fhir-utils-typescript` helpers | Coding/token, Identifier, Reference, Quantity, telecom, RelatedPerson search projection and non-mutating Bundle traversal/classification/reference lookup | Message transport, SHA-1 writers, COVID-era product presets and mutation-heavy manager facades |
|
|
54
|
+
| Later UHC data/common packages | SHC and EU DGC QR prefix classification plus repository-safe examples | Signature verification, issuer trust, credential import and authorization remain separate future contracts |
|
|
46
55
|
| `uhc-fhir-utils-typescript` imaging | DICOMDIR structural types only | Byte parsing and pixel extraction require a separately versioned imaging package |
|
|
47
56
|
| `sos-data-utils-ts` | Cross-sector terminology contract and fixtures, Immunization graph and reminder planning | SOS authorization, repository and emergency policy |
|
|
48
57
|
| `vet-data-utils-ts` | Product-neutral FHIR R5 Group and ResearchStudy contracts/search projections | Animal identity, veterinary sections, species, insurance, payment and other Vet policy |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fhir-data-utils-ts",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "FHIR-version-neutral flat-claim and SearchParameter data utilities",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -107,6 +107,10 @@
|
|
|
107
107
|
"types": "./dist/healthcare-service-specialty-map.d.ts",
|
|
108
108
|
"default": "./dist/healthcare-service-specialty-map.js"
|
|
109
109
|
},
|
|
110
|
+
"./health-credential-qr": {
|
|
111
|
+
"types": "./dist/health-credential-qr.d.ts",
|
|
112
|
+
"default": "./dist/health-credential-qr.js"
|
|
113
|
+
},
|
|
110
114
|
"./research-study-r5": {
|
|
111
115
|
"types": "./dist/research-study-r5.d.ts",
|
|
112
116
|
"default": "./dist/research-study-r5.js"
|