gdc-common-utils-ts 2.3.10 → 2.3.12

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).
@@ -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.
@@ -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)
@@ -110,6 +110,20 @@ export declare class ClinicalResourceEntryEditor extends BundleEntryEditor {
110
110
  setLanguage(value?: string | null): this;
111
111
  /** Returns the generic `<ResourceType>.language` flat claim when present. */
112
112
  getLanguage(): string | undefined;
113
+ /**
114
+ * Assigns the resource to one or more Composition sections.
115
+ *
116
+ * Section placement is document structure, not the resource's clinical
117
+ * category. `BundleEditor.buildDocument()` consumes this
118
+ * `<ResourceType>.section` claim to create `Composition.section.entry`
119
+ * references without overloading fields such as
120
+ * `AllergyIntolerance.category`.
121
+ */
122
+ setSectionList(sectionCodes: readonly string[]): this;
123
+ /** Returns the explicit Composition section codes staged for this resource. */
124
+ getSectionList(): string[];
125
+ /** Adds one Composition section code while preserving existing assignments. */
126
+ addSection(sectionCode: string): this;
113
127
  /** Stores the generic `<ResourceType>.user-selected` flag used by self-managed user flows. */
114
128
  setUserSelected(value?: boolean | null): this;
115
129
  /** Returns the generic `<ResourceType>.user-selected` flag when present. */
@@ -279,6 +279,29 @@ export class ClinicalResourceEntryEditor extends BundleEntryEditor {
279
279
  getLanguage() {
280
280
  return this.getScalarClaim(this.getResourceScopedClaimKey('language'));
281
281
  }
282
+ /**
283
+ * Assigns the resource to one or more Composition sections.
284
+ *
285
+ * Section placement is document structure, not the resource's clinical
286
+ * category. `BundleEditor.buildDocument()` consumes this
287
+ * `<ResourceType>.section` claim to create `Composition.section.entry`
288
+ * references without overloading fields such as
289
+ * `AllergyIntolerance.category`.
290
+ */
291
+ setSectionList(sectionCodes) {
292
+ return this.setCsvClaimList(this.getResourceScopedClaimKey('section'), sectionCodes);
293
+ }
294
+ /** Returns the explicit Composition section codes staged for this resource. */
295
+ getSectionList() {
296
+ return this.getCsvClaimList(this.getResourceScopedClaimKey('section'));
297
+ }
298
+ /** Adds one Composition section code while preserving existing assignments. */
299
+ addSection(sectionCode) {
300
+ const normalized = String(sectionCode || '').trim();
301
+ return normalized
302
+ ? this.setSectionList([...new Set([...this.getSectionList(), normalized])])
303
+ : this;
304
+ }
282
305
  /** Stores the generic `<ResourceType>.user-selected` flag used by self-managed user flows. */
283
306
  setUserSelected(value) {
284
307
  return this.setBooleanClaim(this.getResourceScopedClaimKey('user-selected'), value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "2.3.10",
3
+ "version": "2.3.12",
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",