gdc-sdk-node-ts 2.4.30 → 2.4.32

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
@@ -649,7 +649,7 @@ modules below.
649
649
  - functions: `createOrganizationEmployeeWithDeps(...)`, `importIpsOrFhirAndUpdateIndexWithDeps(...)`, `upsertRelatedPersonAndPollWithDeps(...)`, `ingestCommunicationAndUpdateIndexWithDeps(...)`, `searchClinicalBundleWithDeps(...)`, `searchLatestIpsWithDeps(...)`, `grantProfessionalAccessWithDeps(...)`, `setDigitalTwinSecondaryUseConsentWithDeps(...)`, `purgeDigitalTwinSubjectLinkWithDeps(...)`
650
650
  - [`src/digital-twin.ts`](src/digital-twin.ts)
651
651
  - types: `DigitalTwinSearchInput`, `DigitalTwinSelectionInput`, `DigitalTwinResearchTag`, `DigitalTwinMaterializationInput`
652
- - functions: `searchDigitalTwinsWithDeps(...)`, `saveDigitalTwinSelectionWithDeps(...)`, `materializeDigitalTwinWithDeps(...)`
652
+ - functions: `createDigitalTwinSecondaryUseConsentIdentifier()`, `searchDigitalTwinsWithDeps(...)`, `saveDigitalTwinSelectionWithDeps(...)`, `materializeDigitalTwinWithDeps(...)`
653
653
  - [`src/orchestration/digital-twin-sdk.ts`](src/orchestration/digital-twin-sdk.ts)
654
654
  - class: `DigitalTwinSdk` (`requestSmartToken`, `search`, `saveSelection`, `materialize`)
655
655
  - [`src/session.ts`](src/session.ts)
@@ -3,6 +3,14 @@ import type { MetaTagCoding } from 'gdc-common-utils-ts/models/confidential-stor
3
3
  import type { RouteContext } from './individual-onboarding.js';
4
4
  import type { PollOptions, SubmitAndPollResult } from './orchestration/client-port.js';
5
5
  export type DigitalTwinFhirFormat = 'org.hl7.fhir.r4' | 'org.hl7.fhir.api';
6
+ /**
7
+ * Creates the opaque FHIR identifier for the provider-level secondary-use
8
+ * Consent. Call this exactly once when the server creates the subject's index
9
+ * enrollment, persist the result there, and reuse it for every permit/deny.
10
+ * It is intentionally random and must not be derived from a subject or tenant
11
+ * identifier.
12
+ */
13
+ export declare function createDigitalTwinSecondaryUseConsentIdentifier(): string;
6
14
  /** Returns whether a value can be used as a pseudonymous digital-twin subject. */
7
15
  export declare function isDigitalTwinSubjectId(value: unknown): value is string;
8
16
  /** Rejects operational DIDs and malformed or caller-invented subject shapes. */
@@ -3,6 +3,16 @@ import { randomUUID } from 'node:crypto';
3
3
  import { HealthcareDocumentTypes } from 'gdc-common-utils-ts/constants';
4
4
  import { CompositionClaim } from 'gdc-common-utils-ts/models';
5
5
  const DIGITAL_TWIN_SUBJECT_URN_UUID = /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
6
+ /**
7
+ * Creates the opaque FHIR identifier for the provider-level secondary-use
8
+ * Consent. Call this exactly once when the server creates the subject's index
9
+ * enrollment, persist the result there, and reuse it for every permit/deny.
10
+ * It is intentionally random and must not be derived from a subject or tenant
11
+ * identifier.
12
+ */
13
+ export function createDigitalTwinSecondaryUseConsentIdentifier() {
14
+ return `urn:uuid:${randomUUID()}`;
15
+ }
6
16
  /** Returns whether a value can be used as a pseudonymous digital-twin subject. */
7
17
  export function isDigitalTwinSubjectId(value) {
8
18
  return DIGITAL_TWIN_SUBJECT_URN_UUID.test(String(value || '').trim());
@@ -128,7 +128,9 @@ export declare class IndividualControllerSdk {
128
128
  /**
129
129
  * Enables or disables the subject's secondary-use digital-twin projection.
130
130
  * This is the canonical patient-side operation; application code must not
131
- * publish a canonical Composition directly into the research index.
131
+ * publish a canonical Composition directly into the research index. The
132
+ * caller reuses the server-owned identifier created once with
133
+ * `createDigitalTwinSecondaryUseConsentIdentifier()` during index enrollment.
132
134
  */
133
135
  setDigitalTwinSecondaryUseConsent(ctx: RouteContext, input: DigitalTwinSecondaryUseConsentInput): Promise<DigitalTwinSecondaryUseConsentResult>;
134
136
  /**
@@ -191,7 +191,9 @@ export class IndividualControllerSdk {
191
191
  /**
192
192
  * Enables or disables the subject's secondary-use digital-twin projection.
193
193
  * This is the canonical patient-side operation; application code must not
194
- * publish a canonical Composition directly into the research index.
194
+ * publish a canonical Composition directly into the research index. The
195
+ * caller reuses the server-owned identifier created once with
196
+ * `createDigitalTwinSecondaryUseConsentIdentifier()` during index enrollment.
195
197
  */
196
198
  setDigitalTwinSecondaryUseConsent(ctx, input) {
197
199
  assertFacadeCapability(this.capabilities, ActorCapabilities.IndividualGenerateDigitalTwin, ActorKinds.IndividualController, 'setDigitalTwinSecondaryUseConsent');
@@ -507,7 +507,11 @@ export type DigitalTwinSecondaryUseConsentInput = {
507
507
  /** Organization/tenant that provides and stores the subject's index. */
508
508
  indexProviderOrganizationDid: string;
509
509
  decision: 'permit' | 'deny';
510
- /** Server-owned FHIR Consent identifier. Never accept it from the browser. */
510
+ /**
511
+ * Server-owned FHIR Consent identifier. Create it once with
512
+ * `createDigitalTwinSecondaryUseConsentIdentifier()` in the index-enrollment
513
+ * transaction, persist it there and never accept it from the browser.
514
+ */
511
515
  consentIdentifier: string;
512
516
  consentDate?: string;
513
517
  dataType?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-sdk-node-ts",
3
- "version": "2.4.30",
3
+ "version": "2.4.32",
4
4
  "description": "Next-generation Node runtime package for the GDC SDK family",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Antifraud Services Inc.",