gdc-common-utils-ts 2.3.11 → 2.3.13

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 CHANGED
@@ -40,18 +40,6 @@ Shared TypeScript utilities for GDC client and connector code. This package prov
40
40
 
41
41
  It is intentionally not a full backend orchestration layer.
42
42
 
43
- ## Prior Work
44
-
45
- Part of the FHIR conversion layer in this repository builds on earlier work
46
- from the Universal Health Chain repository:
47
-
48
- - `uhc-fhir-utils-ts`
49
- - https://github.com/Universal-Health-Chain/uhc-fhir-utils-ts
50
-
51
- The current `src/convert` and `src/claims` layers adapt and extend that prior
52
- work to the claims-first contracts, IPS bundle workflows, and package
53
- boundaries used in `gdc-common-utils-ts`.
54
-
55
43
  ## Non-Negotiable Conventions
56
44
 
57
45
  - FHIR SearchParameter names must use canonical FHIR naming (lowercase, with `-` when defined by FHIR).
@@ -15,8 +15,10 @@ export declare const DataCollectionIds: Readonly<{
15
15
  readonly conditions: "conditions";
16
16
  readonly consents: "consents";
17
17
  readonly diagnosticReports: "diagnostic-reports";
18
+ readonly deviceUseStatements: "device-use-statements";
18
19
  readonly documentReferences: "document-references";
19
20
  readonly encounters: "encounters";
21
+ readonly flags: "flags";
20
22
  readonly imagingStudies: "imaging-studies";
21
23
  readonly immunizations: "immunizations";
22
24
  readonly medications: "medications";
@@ -43,7 +45,9 @@ export declare const FhirResourceTypeDataCollections: Readonly<{
43
45
  readonly Condition: "conditions";
44
46
  readonly Consent: "consents";
45
47
  readonly DiagnosticReport: "diagnostic-reports";
48
+ readonly DeviceUseStatement: "device-use-statements";
46
49
  readonly Encounter: "encounters";
50
+ readonly Flag: "flags";
47
51
  readonly ImagingStudy: "imaging-studies";
48
52
  readonly Immunization: "immunizations";
49
53
  readonly MedicationStatement: "medications";
@@ -17,8 +17,10 @@ export const DataCollectionIds = Object.freeze({
17
17
  conditions: 'conditions',
18
18
  consents: 'consents',
19
19
  diagnosticReports: 'diagnostic-reports',
20
+ deviceUseStatements: 'device-use-statements',
20
21
  documentReferences: 'document-references',
21
22
  encounters: 'encounters',
23
+ flags: 'flags',
22
24
  imagingStudies: 'imaging-studies',
23
25
  immunizations: 'immunizations',
24
26
  medications: 'medications',
@@ -51,8 +53,8 @@ export const HealthcareSummarySectionDataCollections = Object.freeze({
51
53
  [HealthcareSummarySections.HistoryOfPastIllness.attributeValue]: Object.freeze([DataCollectionIds.conditions]),
52
54
  [HealthcareSummarySections.PregnancyHistory.attributeValue]: Object.freeze([DataCollectionIds.observations]),
53
55
  [HealthcareSummarySections.GoalsAndPreferences.attributeValue]: Object.freeze([DataCollectionIds.consents]),
54
- [HealthcareSummarySections.Alert.attributeValue]: Object.freeze([]),
55
- [HealthcareSummarySections.MedicalDevices.attributeValue]: Object.freeze([]),
56
+ [HealthcareSummarySections.Alert.attributeValue]: Object.freeze([DataCollectionIds.flags]),
57
+ [HealthcareSummarySections.MedicalDevices.attributeValue]: Object.freeze([DataCollectionIds.deviceUseStatements]),
56
58
  });
57
59
  /**
58
60
  * Canonical FHIR R4 resource family -> collection mapping for normalized
@@ -65,7 +67,9 @@ export const FhirResourceTypeDataCollections = Object.freeze({
65
67
  [ResourceTypesFhirR4.Condition]: DataCollectionIds.conditions,
66
68
  [ResourceTypesFhirR4.Consent]: DataCollectionIds.consents,
67
69
  [ResourceTypesFhirR4.DiagnosticReport]: DataCollectionIds.diagnosticReports,
70
+ [ResourceTypesFhirR4.DeviceUseStatement]: DataCollectionIds.deviceUseStatements,
68
71
  [ResourceTypesFhirR4.Encounter]: DataCollectionIds.encounters,
72
+ [ResourceTypesFhirR4.Flag]: DataCollectionIds.flags,
69
73
  [ResourceTypesFhirR4.ImagingStudy]: DataCollectionIds.imagingStudies,
70
74
  [ResourceTypesFhirR4.Immunization]: DataCollectionIds.immunizations,
71
75
  [ResourceTypesFhirR4.MedicationStatement]: DataCollectionIds.medications,
@@ -10,7 +10,12 @@ export function deviceUseStatementFlatToFhirR4(claims) {
10
10
  resourceType: 'DeviceUseStatement',
11
11
  identifier: claims[DeviceUseStatementClaim.Identifier] ? [{ value: claims[DeviceUseStatementClaim.Identifier] }] : undefined,
12
12
  subject: { reference: subject },
13
- device: { reference: device },
13
+ device: {
14
+ reference: device,
15
+ ...(claims[DeviceUseStatementClaim.DeviceDisplay]
16
+ ? { display: claims[DeviceUseStatementClaim.DeviceDisplay] }
17
+ : {}),
18
+ },
14
19
  status,
15
20
  recordedOn: claims[DeviceUseStatementClaim.RecordedOn],
16
21
  timingDateTime: claims[DeviceUseStatementClaim.TimingDateTime],
@@ -21,6 +26,7 @@ export function deviceUseStatementFhirR4ToFlat(resource) {
21
26
  [DeviceUseStatementClaim.Identifier]: resource.identifier?.[0]?.value,
22
27
  [DeviceUseStatementClaim.Subject]: resource.subject?.reference,
23
28
  [DeviceUseStatementClaim.Device]: resource.device?.reference,
29
+ [DeviceUseStatementClaim.DeviceDisplay]: resource.device?.display,
24
30
  [DeviceUseStatementClaim.Status]: resource.status,
25
31
  [DeviceUseStatementClaim.RecordedOn]: resource.recordedOn,
26
32
  [DeviceUseStatementClaim.TimingDateTime]: resource.timingDateTime,
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * CORE canonical examples in this file avoid phone-specific subject/controller
5
5
  * fields unless the flow truly requires them. Telephone-driven notification or
6
- * consent targeting is treated as an extension concern (for example UNID GW),
6
+ * consent targeting is treated as an extension concern,
7
7
  * not a CORE GW contract requirement.
8
8
  *
9
9
  * Semantic split:
@@ -46,7 +46,7 @@ export interface DeviceLicense {
46
46
  * Organization that owns this seat pool.
47
47
  *
48
48
  * This is essential for hosted individual organizations because many
49
- * households can share one UNID tenant vault. It is distinct from
49
+ * households can share one tenant vault. It is distinct from
50
50
  * `subjectId`, which identifies the member currently assigned to the seat.
51
51
  */
52
52
  ownerOrganizationId?: string;
@@ -5,7 +5,6 @@
5
5
  * This model aligns with FHIR R5 conventions (using `note.text` instead of `comment`)
6
6
  * for forward compatibility and consistency with other resources like Communication.
7
7
  *
8
- * @basedon https://github.com/Universal-Health-Chain/uhc-fhir-utils-ts/blob/main/src/models/templates/Appointment.template.model.ts
9
8
  */
10
9
  /**
11
10
  * Contains claims representing fields specific to the FHIR R4/R5 data model for an Appointment.
@@ -6,7 +6,6 @@
6
6
  * This model aligns with FHIR R5 conventions (using `note.text` instead of `comment`)
7
7
  * for forward compatibility and consistency with other resources like Communication.
8
8
  *
9
- * @basedon https://github.com/Universal-Health-Chain/uhc-fhir-utils-ts/blob/main/src/models/templates/Appointment.template.model.ts
10
9
  */
11
10
  /**
12
11
  * Contains claims representing fields specific to the FHIR R4/R5 data model for an Appointment.
@@ -4,6 +4,7 @@ export declare const DeviceUseStatementClaim: {
4
4
  readonly Subject: "DeviceUseStatement.subject";
5
5
  readonly Status: "DeviceUseStatement.status";
6
6
  readonly Device: "DeviceUseStatement.device";
7
+ readonly DeviceDisplay: "DeviceUseStatement.device-display";
7
8
  readonly RecordedOn: "DeviceUseStatement.recordedon";
8
9
  readonly TimingDateTime: "DeviceUseStatement.timing-datetime";
9
10
  readonly ReasonCode: "DeviceUseStatement.reasoncode";
@@ -6,6 +6,7 @@ export const DeviceUseStatementClaim = {
6
6
  Subject: 'DeviceUseStatement.subject',
7
7
  Status: 'DeviceUseStatement.status',
8
8
  Device: 'DeviceUseStatement.device',
9
+ DeviceDisplay: 'DeviceUseStatement.device-display',
9
10
  RecordedOn: 'DeviceUseStatement.recordedon',
10
11
  TimingDateTime: 'DeviceUseStatement.timing-datetime',
11
12
  ReasonCode: 'DeviceUseStatement.reasoncode',
@@ -16,6 +17,7 @@ export const DeviceUseStatementClaimSpecs = [
16
17
  { key: DeviceUseStatementClaim.Subject, meaning: 'Patient subject reference.', example: 'Patient/pat-123' },
17
18
  { key: DeviceUseStatementClaim.Status, meaning: 'Use statement status.', example: 'active' },
18
19
  { key: DeviceUseStatementClaim.Device, meaning: 'Device reference.', example: 'Device/dev-777' },
20
+ { key: DeviceUseStatementClaim.DeviceDisplay, meaning: 'Human-readable device name accompanying the reference.', example: 'Hip prosthesis' },
19
21
  { key: DeviceUseStatementClaim.RecordedOn, meaning: 'Record creation date/time.', example: '2026-03-01T12:00:00Z' },
20
22
  { key: DeviceUseStatementClaim.TimingDateTime, meaning: 'When the use happened.', example: '2026-03-01T08:00:00Z' },
21
23
  { key: DeviceUseStatementClaim.ReasonCode, meaning: 'Reason code for use.', example: 'http://snomed.info/sct|182840001' },
@@ -2,7 +2,7 @@ import { EvidenceDocumentDLT } from "./oidc4ida.document.model";
2
2
  import { EvidenceElectronicRecordDLT } from "./oidc4ida.electronicRecord.model";
3
3
  /** W3C Evidence for VCs can be generated by the API from some OpenID evidence stored on blockchain.
4
4
  * See EBSI v2: https://ec.europa.eu/digital-building-blocks/wikis/display/EBSIDOC/Verifiable+Attestation
5
- * - id: OPTIONAL. If present, it MUST contain a URL that points to where more information about this instance of evidence can be found (e.g.: urn:unid:uhc:vc:xyz or e.g.: "https://example.edu/evidence/f2aeec97-fc0d-42bf-8ca7-0548192dxyzab")
5
+ * - id: OPTIONAL. If present, it MUST contain a URL that points to where more information about this instance of evidence can be found (e.g. `urn:example:vc:xyz`).
6
6
  * - type: REQUIRED. Defines the evidence type, e.g.: ["DocumentVerification"], ["id_document"], ["utility_bill"], ["qes"]
7
7
  * - verifier: REQUIRED. Defines entity that has verified documents before Verifiable Attestation issuance, e.g.: "https://example.edu/issuers/14"
8
8
  * - evidenceDocument: REQUIRED. Defines document(s) which have been verified before Verifiable Attestation issuance, e.g.: "DriversLicense" (TODO: can be used HL7 instead?). QUESTION: Should it be the universal ID instead a description? RESPONSE: No, because it is linked to a credentialSubject within a credential
@@ -12,12 +12,12 @@
12
12
  export class IVaultRepository {
13
13
  }
14
14
  // ---------------------------------------------------------------------------
15
- // Server/multi-tenant extension — used by GW nodes (gdc-unid-node-ts, gwtemplate-node-ts)
15
+ // Server/multi-tenant extension — used by GW node implementations.
16
16
  //
17
17
  // Adds multi-vault management, sections, history, and purge operations
18
18
  // needed by server-side vault repositories (Firestore, Postgres, Mem-backend).
19
19
  //
20
- // TODO: migrate gdc-unid-node-ts and gwtemplate-node-ts vault.repository.ts
20
+ // TODO: migrate GW vault.repository.ts implementations
21
21
  // to extend this interface once storage-sdk-firestore-ts and
22
22
  // storage-sdk-postgres-ts are created as separate packages.
23
23
  // ---------------------------------------------------------------------------
@@ -8,7 +8,7 @@ import { IVaultRepository, VaultQuery } from './IVaultRepository';
8
8
  * - Short-lived runtime contexts (transient sessions)
9
9
  *
10
10
  * Each instance is independent — instantiate one per actor/session context
11
- * (e.g. one per CallSid in uhc-unid-chat-node) and discard on cleanup.
11
+ * (e.g. one per channel session) and discard on cleanup.
12
12
  *
13
13
  * TODO: For text channels with persistent sessions, use:
14
14
  * - storage-sdk-firestore-ts → FirestoreVaultRepository (Google Cloud)
@@ -9,7 +9,7 @@ import { IVaultRepository } from './IVaultRepository.js';
9
9
  * - Short-lived runtime contexts (transient sessions)
10
10
  *
11
11
  * Each instance is independent — instantiate one per actor/session context
12
- * (e.g. one per CallSid in uhc-unid-chat-node) and discard on cleanup.
12
+ * (e.g. one per channel session) and discard on cleanup.
13
13
  *
14
14
  * TODO: For text channels with persistent sessions, use:
15
15
  * - storage-sdk-firestore-ts → FirestoreVaultRepository (Google Cloud)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "2.3.11",
3
+ "version": "2.3.13",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -22,8 +22,9 @@
22
22
  "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
23
23
  "build": "npm run clean && tsc -p tsconfig.build.json && node patch-esm-imports.mjs",
24
24
  "verify:dist": "node scripts/verify-dist-syntax.mjs",
25
+ "check:product-neutrality": "node scripts/check-product-neutrality.mjs",
25
26
  "prepack": "npm run verify:dist",
26
- "prepublishOnly": "npm run typecheck && npm test -- --watchman=false && npm run build"
27
+ "prepublishOnly": "npm run check:product-neutrality && npm run typecheck && npm test -- --watchman=false && npm run build"
27
28
  },
28
29
  "main": "./dist/index.js",
29
30
  "types": "./dist/index.d.ts",