fhir-data-utils-ts 0.6.5 → 0.6.7

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/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
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
+ Bind every schema to its canonical section in the shared IPS all-sections
12
+ document so portals can update the Composition without duplicating LOINC
13
+ section codes.
14
+
5
15
  - Recover neutral SHC and EU DGC QR prefix classification from the later UHC
6
16
  data-utility lineage, with exported repository-safe `*.data.ts` examples.
7
17
  Recognition explicitly provides no decoding, verification or authorization.
@@ -3,3 +3,4 @@ export * from './appointment-communication.data.js';
3
3
  export * from './encounter-transfer.data.js';
4
4
  export * from './ips-all-sections.data.js';
5
5
  export * from './health-credential-qr.data.js';
6
+ export * from './ips-clinical-artifact-schemas.data.js';
@@ -3,3 +3,4 @@ export * from './appointment-communication.data.js';
3
3
  export * from './encounter-transfer.data.js';
4
4
  export * from './ips-all-sections.data.js';
5
5
  export * from './health-credential-qr.data.js';
6
+ export * from './ips-clinical-artifact-schemas.data.js';
@@ -1,4 +1,13 @@
1
1
  /** Repository-safe synthetic IPS document used by portal demos and visual tests. */
2
+ /** Primary IPS section placement for the minimum shared clinical authoring forms. */
3
+ export declare const FHIR_IPS_PRIMARY_AUTHORING_SECTION_CODE_BY_RESOURCE_TYPE: Readonly<{
4
+ readonly Condition: "11450-4";
5
+ readonly AllergyIntolerance: "48765-2";
6
+ readonly MedicationStatement: "10160-0";
7
+ readonly Immunization: "11369-6";
8
+ readonly Procedure: "47519-4";
9
+ readonly Observation: "8716-3";
10
+ }>;
2
11
  /**
3
12
  * Complete synthetic IPS screen fixture.
4
13
  *
@@ -20,6 +20,15 @@ const sectionDefinitions = Object.freeze([
20
20
  ['10162-6', 'Pregnancy history', 'Observation', 'Not pregnant'],
21
21
  ['18776-5', 'Plan of care', 'CarePlan', 'Emergency follow-up plan'],
22
22
  ]);
23
+ /** Primary IPS section placement for the minimum shared clinical authoring forms. */
24
+ export const FHIR_IPS_PRIMARY_AUTHORING_SECTION_CODE_BY_RESOURCE_TYPE = Object.freeze({
25
+ Condition: sectionDefinitions[0][0],
26
+ AllergyIntolerance: sectionDefinitions[1][0],
27
+ MedicationStatement: sectionDefinitions[2][0],
28
+ Immunization: sectionDefinitions[3][0],
29
+ Procedure: sectionDefinitions[5][0],
30
+ Observation: sectionDefinitions[7][0],
31
+ });
23
32
  function concept(text, code) {
24
33
  return { text, coding: [{ system: SNOMED_SYSTEM, code, display: text }] };
25
34
  }
@@ -0,0 +1,26 @@
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
+ sectionCode: string;
13
+ requiredClaims: readonly string[];
14
+ optionalClaims: readonly string[];
15
+ /** Source-text claims for which a user may explicitly confirm a terminology candidate. */
16
+ terminologyTextClaims: readonly string[];
17
+ }>;
18
+ /**
19
+ * Minimum reusable IPS authoring surface for Personal and Professional portals.
20
+ *
21
+ * These data-only schemas contain claim keys, not UI labels, authorization or
22
+ * transport policy. Human and veterinary portals use the same core resource
23
+ * contracts; a veterinary terminology adapter may additionally receive the
24
+ * subject taxonomy without changing the stored FHIR claim names.
25
+ */
26
+ export declare const FHIR_IPS_CLINICAL_ARTIFACT_SCHEMAS: Readonly<Record<FhirIpsClinicalArtifactType, FhirIpsClinicalArtifactSchema>>;
@@ -0,0 +1,68 @@
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
+ import { FHIR_IPS_PRIMARY_AUTHORING_SECTION_CODE_BY_RESOURCE_TYPE } from './ips-all-sections.data.js';
9
+ export const FhirIpsClinicalArtifactTypes = Object.freeze({
10
+ AllergyIntolerance: 'AllergyIntolerance',
11
+ MedicationStatement: 'MedicationStatement',
12
+ Immunization: 'Immunization',
13
+ Condition: 'Condition',
14
+ Procedure: 'Procedure',
15
+ Observation: 'Observation',
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 const FHIR_IPS_CLINICAL_ARTIFACT_SCHEMAS = Object.freeze({
26
+ [FhirIpsClinicalArtifactTypes.AllergyIntolerance]: Object.freeze({
27
+ resourceType: FhirIpsClinicalArtifactTypes.AllergyIntolerance,
28
+ sectionCode: FHIR_IPS_PRIMARY_AUTHORING_SECTION_CODE_BY_RESOURCE_TYPE.AllergyIntolerance,
29
+ requiredClaims: Object.freeze([AllergyIntoleranceClaim.CodeText, AllergyIntoleranceClaim.ClinicalStatus]),
30
+ optionalClaims: Object.freeze([AllergyIntoleranceClaim.Code, AllergyIntoleranceClaim.CodeDisplay, AllergyIntoleranceClaim.Category, AllergyIntoleranceClaim.VerificationStatus, AllergyIntoleranceClaim.Criticality, AllergyIntoleranceClaim.OnsetDateTime, AllergyIntoleranceClaim.Recorder]),
31
+ terminologyTextClaims: Object.freeze([AllergyIntoleranceClaim.CodeText]),
32
+ }),
33
+ [FhirIpsClinicalArtifactTypes.MedicationStatement]: Object.freeze({
34
+ resourceType: FhirIpsClinicalArtifactTypes.MedicationStatement,
35
+ sectionCode: FHIR_IPS_PRIMARY_AUTHORING_SECTION_CODE_BY_RESOURCE_TYPE.MedicationStatement,
36
+ requiredClaims: Object.freeze([MedicationStatementClaim.CodeText, MedicationStatementClaim.Status]),
37
+ optionalClaims: Object.freeze([MedicationStatementClaim.Code, MedicationStatementClaim.CodeDisplay, MedicationStatementClaim.Category, MedicationStatementClaim.Effective, MedicationStatementClaim.DosageInstruction, MedicationStatementClaim.DosageRoute, MedicationStatementClaim.TimingFrequency, MedicationStatementClaim.TimingPeriod, MedicationStatementClaim.TimingPeriodUnit, MedicationStatementClaim.Note]),
38
+ terminologyTextClaims: Object.freeze([MedicationStatementClaim.CodeText]),
39
+ }),
40
+ [FhirIpsClinicalArtifactTypes.Immunization]: Object.freeze({
41
+ resourceType: FhirIpsClinicalArtifactTypes.Immunization,
42
+ sectionCode: FHIR_IPS_PRIMARY_AUTHORING_SECTION_CODE_BY_RESOURCE_TYPE.Immunization,
43
+ requiredClaims: Object.freeze([ImmunizationClaim.VaccineCodeText, ImmunizationClaim.Status]),
44
+ 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]),
45
+ terminologyTextClaims: Object.freeze([ImmunizationClaim.VaccineCodeText, ImmunizationClaim.TargetDiseaseText]),
46
+ }),
47
+ [FhirIpsClinicalArtifactTypes.Condition]: Object.freeze({
48
+ resourceType: FhirIpsClinicalArtifactTypes.Condition,
49
+ sectionCode: FHIR_IPS_PRIMARY_AUTHORING_SECTION_CODE_BY_RESOURCE_TYPE.Condition,
50
+ requiredClaims: Object.freeze([ConditionClaim.CodeText, ConditionClaim.ClinicalStatus]),
51
+ optionalClaims: Object.freeze([ConditionClaim.Code, ConditionClaim.CodeDisplay, ConditionClaim.Category, ConditionClaim.VerificationStatus, ConditionClaim.Severity, ConditionClaim.OnsetDateTime, ConditionClaim.RecordedDate, ConditionClaim.Asserter, ConditionClaim.Recorder]),
52
+ terminologyTextClaims: Object.freeze([ConditionClaim.CodeText]),
53
+ }),
54
+ [FhirIpsClinicalArtifactTypes.Procedure]: Object.freeze({
55
+ resourceType: FhirIpsClinicalArtifactTypes.Procedure,
56
+ sectionCode: FHIR_IPS_PRIMARY_AUTHORING_SECTION_CODE_BY_RESOURCE_TYPE.Procedure,
57
+ requiredClaims: Object.freeze([ProcedureClaim.CodeText, ProcedureClaim.Status]),
58
+ optionalClaims: Object.freeze([ProcedureClaim.Code, ProcedureClaim.CodeDisplay, ProcedureClaim.Date, ProcedureClaim.Performer, ProcedureClaim.Location, ProcedureClaim.BodySite, ProcedureClaim.ReasonCode, ProcedureClaim.ReasonReference, ProcedureClaim.Note]),
59
+ terminologyTextClaims: Object.freeze([ProcedureClaim.CodeText]),
60
+ }),
61
+ [FhirIpsClinicalArtifactTypes.Observation]: Object.freeze({
62
+ resourceType: FhirIpsClinicalArtifactTypes.Observation,
63
+ sectionCode: FHIR_IPS_PRIMARY_AUTHORING_SECTION_CODE_BY_RESOURCE_TYPE.Observation,
64
+ requiredClaims: Object.freeze([ObservationClaim.Category, ObservationClaim.CodeText, ObservationClaim.Status]),
65
+ 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]),
66
+ terminologyTextClaims: Object.freeze([ObservationClaim.CodeText]),
67
+ }),
68
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fhir-data-utils-ts",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "FHIR-version-neutral flat-claim and SearchParameter data utilities",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",