gdc-sdk-node-ts 2.4.44 → 2.5.0
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 +2 -1
- package/dist/gateway-active-consent-provider.d.ts +2 -1
- package/dist/gateway-active-consent-provider.js +2 -2
- package/dist/orchestration/individual-controller-sdk.d.ts +6 -1
- package/dist/orchestration/individual-controller-sdk.js +12 -2
- package/dist/resource-operations.d.ts +12 -1
- package/dist/resource-operations.js +12 -1
- package/package.json +3 -3
- package/dist/organization-registration-authorization.d.ts +0 -16
- package/dist/organization-registration-authorization.js +0 -34
package/README.md
CHANGED
|
@@ -702,7 +702,8 @@ modules below.
|
|
|
702
702
|
- [`NodeHttpClient.submitCommunicationAndPoll(...)`](src/node-runtime-client.ts)
|
|
703
703
|
- [`NodeHttpClient.searchClinicalBundle(...)`](src/node-runtime-client.ts)
|
|
704
704
|
- [`NodeHttpClient.updateClinicalSection(...)`](src/node-runtime-client.ts) for
|
|
705
|
-
one explicit section carried by a batch
|
|
705
|
+
one explicit section carried by a batch Communication; its typed entries may
|
|
706
|
+
mix `.create()`, `.update()` and exact authored `.delete()` operations
|
|
706
707
|
- [`NodeHttpClient.updateClinicalSummary(...)`](src/node-runtime-client.ts) for
|
|
707
708
|
a Composition-first multi-section document
|
|
708
709
|
- [`NodeHttpClient.searchLatestIps(...)`](src/node-runtime-client.ts)
|
|
@@ -2,6 +2,7 @@ import { type ConsentRule } from 'gdc-common-utils-ts/models/consent-rule';
|
|
|
2
2
|
import type { ActiveConsentProvider } from 'gdc-sdk-core-ts';
|
|
3
3
|
import type { RouteContext } from './individual-onboarding.js';
|
|
4
4
|
import { type NodeRuntimeClient } from './orchestration/client-port.js';
|
|
5
|
+
import type { SubjectConsentSearchInput } from './resource-operations.js';
|
|
5
6
|
/**
|
|
6
7
|
* GW-backed implementation of the runtime-neutral ActiveConsentProvider.
|
|
7
8
|
*
|
|
@@ -13,7 +14,7 @@ export declare class GatewayActiveConsentProvider implements ActiveConsentProvid
|
|
|
13
14
|
private readonly routeContext;
|
|
14
15
|
constructor(client: NodeRuntimeClient, routeContext: RouteContext);
|
|
15
16
|
/** Loads and normalizes the active Consent rules owned by one subject. */
|
|
16
|
-
getActiveConsentsForSubject(subject: string): Promise<ConsentRule[]>;
|
|
17
|
+
getActiveConsentsForSubject(subject: string, filters?: Omit<SubjectConsentSearchInput, 'subject' | 'pollOptions'>): Promise<ConsentRule[]>;
|
|
17
18
|
}
|
|
18
19
|
/** Extracts canonical Consent claim maps from current GW Bundle wrappers. */
|
|
19
20
|
export declare function extractConsentRules(value: unknown): ConsentRule[];
|
|
@@ -14,12 +14,12 @@ export class GatewayActiveConsentProvider {
|
|
|
14
14
|
this.routeContext = routeContext;
|
|
15
15
|
}
|
|
16
16
|
/** Loads and normalizes the active Consent rules owned by one subject. */
|
|
17
|
-
async getActiveConsentsForSubject(subject) {
|
|
17
|
+
async getActiveConsentsForSubject(subject, filters = {}) {
|
|
18
18
|
const normalizedSubject = String(subject || '').trim();
|
|
19
19
|
if (!normalizedSubject.startsWith('did:')) {
|
|
20
20
|
throw new Error('Active Consent lookup requires a subject DID.');
|
|
21
21
|
}
|
|
22
|
-
const result = await requireClientMethod(this.client, 'searchSubjectConsents')(this.routeContext, { subject: normalizedSubject });
|
|
22
|
+
const result = await requireClientMethod(this.client, 'searchSubjectConsents')(this.routeContext, { subject: normalizedSubject, ...filters });
|
|
23
23
|
return extractConsentRules(result.poll.body)
|
|
24
24
|
.filter((rule) => isConsentRuleActive(rule, { subject: normalizedSubject }));
|
|
25
25
|
}
|
|
@@ -94,7 +94,12 @@ export declare class IndividualControllerSdk {
|
|
|
94
94
|
* Ingests a FHIR `Communication` and waits for indexing.
|
|
95
95
|
*/
|
|
96
96
|
ingestCommunicationAndUpdateIndex(ctx: RouteContext, input: CommunicationIngestionInput): Promise<SubmitAndPollResult>;
|
|
97
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Updates one exact clinical section through a section-scoped batch.
|
|
99
|
+
* Entries choose their own operation, so one call may create one resource
|
|
100
|
+
* and delete another with `.delete()` and optional `.ifMatch(versionId)`.
|
|
101
|
+
* DELETE entries contain no resource body.
|
|
102
|
+
*/
|
|
98
103
|
updateClinicalSection(ctx: RouteContext, input: ClinicalSectionUpdateInput): Promise<SubmitAndPollResult>;
|
|
99
104
|
/** Updates the multi-section summary through a Composition-first document. */
|
|
100
105
|
updateClinicalSummary(ctx: RouteContext, input: ClinicalSummaryUpdateInput): Promise<SubmitAndPollResult>;
|
|
@@ -142,7 +142,12 @@ export class IndividualControllerSdk {
|
|
|
142
142
|
assertFacadeCapability(this.capabilities, ActorCapabilities.IndividualIngestCommunication, ActorKinds.IndividualController, 'ingestCommunicationAndUpdateIndex');
|
|
143
143
|
return requireClientMethod(this.client, 'ingestCommunicationAndUpdateIndex')(ctx, input);
|
|
144
144
|
}
|
|
145
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* Updates one exact clinical section through a section-scoped batch.
|
|
147
|
+
* Entries choose their own operation, so one call may create one resource
|
|
148
|
+
* and delete another with `.delete()` and optional `.ifMatch(versionId)`.
|
|
149
|
+
* DELETE entries contain no resource body.
|
|
150
|
+
*/
|
|
146
151
|
updateClinicalSection(ctx, input) {
|
|
147
152
|
assertFacadeCapability(this.capabilities, ActorCapabilities.IndividualIngestCommunication, ActorKinds.IndividualController, 'updateClinicalSection');
|
|
148
153
|
return requireClientMethod(this.client, 'updateClinicalSection')(ctx, input);
|
|
@@ -216,7 +221,12 @@ export class IndividualControllerSdk {
|
|
|
216
221
|
async getDigitalTwinSecondaryUseConsentStatus(ctx, input) {
|
|
217
222
|
assertFacadeCapability(this.capabilities, ActorCapabilities.IndividualGenerateDigitalTwin, ActorKinds.IndividualController, 'getDigitalTwinSecondaryUseConsentStatus');
|
|
218
223
|
const consents = await new GatewayActiveConsentProvider(this.client, ctx)
|
|
219
|
-
.getActiveConsentsForSubject(input.subjectDid
|
|
224
|
+
.getActiveConsentsForSubject(input.subjectDid, {
|
|
225
|
+
actorIdentifier: input.indexProviderOrganizationDid,
|
|
226
|
+
purpose: HealthcareConsentPurposes.Research,
|
|
227
|
+
action: ServiceCapability.DigitalTwinReader,
|
|
228
|
+
sourceReference: input.researchUseReference,
|
|
229
|
+
});
|
|
220
230
|
const researchUseReference = String(input.researchUseReference || '').trim();
|
|
221
231
|
if (!researchUseReference)
|
|
222
232
|
throw new Error('researchUseReference is required to identify the portal, software or study consent.');
|
|
@@ -291,7 +291,14 @@ type ClinicalUpdateRuntimeOptions = Readonly<{
|
|
|
291
291
|
intervalMs?: number;
|
|
292
292
|
};
|
|
293
293
|
}>;
|
|
294
|
-
/**
|
|
294
|
+
/**
|
|
295
|
+
* Updates exactly one clinical section through a scoped batch/collection.
|
|
296
|
+
* A `Bundle.type = batch` may mix typed create, update, and delete entries.
|
|
297
|
+
* A delete targets `ResourceType/id`, carries no resource body, and may use
|
|
298
|
+
* `ifMatch` for optimistic concurrency. GW authorizes it against the creator
|
|
299
|
+
* DID plus the caller's linked verified login identity; contact identifiers
|
|
300
|
+
* are never written into the clinical resource.
|
|
301
|
+
*/
|
|
295
302
|
export type ClinicalSectionUpdateInput = ClinicalSectionUpdateCommunicationInput & ClinicalUpdateRuntimeOptions;
|
|
296
303
|
/** Updates one complete multi-section clinical summary document. */
|
|
297
304
|
export type ClinicalSummaryUpdateInput = ClinicalUpdateCommunicationInput & ClinicalUpdateRuntimeOptions;
|
|
@@ -535,6 +542,10 @@ export type DigitalTwinSubjectLinkPurgeResult = SubmitAndPollResult;
|
|
|
535
542
|
/** Input for reading the subject-owned Consent records through its individual aggregate. */
|
|
536
543
|
export type SubjectConsentSearchInput = Readonly<{
|
|
537
544
|
subject: string;
|
|
545
|
+
actorIdentifier?: string;
|
|
546
|
+
purpose?: string;
|
|
547
|
+
action?: string;
|
|
548
|
+
sourceReference?: string;
|
|
538
549
|
pollOptions?: {
|
|
539
550
|
timeoutMs?: number;
|
|
540
551
|
intervalMs?: number;
|
|
@@ -877,9 +877,20 @@ export async function searchSubjectConsentsWithDeps(routeCtx, input, deps) {
|
|
|
877
877
|
throw new Error('Consent search requires a subject DID.');
|
|
878
878
|
}
|
|
879
879
|
const format = 'org.hl7.fhir.r4';
|
|
880
|
+
const optionalParameters = [
|
|
881
|
+
['actor-identifier', input.actorIdentifier],
|
|
882
|
+
['purpose', input.purpose],
|
|
883
|
+
['action', input.action],
|
|
884
|
+
['source-reference', input.sourceReference],
|
|
885
|
+
];
|
|
880
886
|
const parameters = {
|
|
881
887
|
resourceType: 'Parameters',
|
|
882
|
-
parameter: [
|
|
888
|
+
parameter: [
|
|
889
|
+
{ name: 'subject', valueString: subject },
|
|
890
|
+
...optionalParameters
|
|
891
|
+
.map(([name, rawValue]) => ({ name, valueString: String(rawValue || '').trim() }))
|
|
892
|
+
.filter((parameter) => parameter.valueString),
|
|
893
|
+
],
|
|
883
894
|
};
|
|
884
895
|
const thid = `subject-consent-search-${createRuntimeUuid()}`;
|
|
885
896
|
const communication = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdc-sdk-node-ts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
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.",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"test:e2e:live-gw:clean": "bash ./scripts/run-live-gw-clean.sh"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"gdc-common-utils-ts": "2.
|
|
42
|
-
"gdc-sdk-core-ts": "
|
|
41
|
+
"gdc-common-utils-ts": "2.6.0",
|
|
42
|
+
"gdc-sdk-core-ts": "2.4.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^20.14.10",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { VerifiableCredentialV2 } from 'gdc-common-utils-ts/models/verifiable-credential';
|
|
2
|
-
import type { IWallet, WalletExecutionContext, WalletKeySelection } from 'gdc-sdk-core-ts';
|
|
3
|
-
/** Input required to add one human-authorizer proof to the out-of-band VC. */
|
|
4
|
-
export type SignOrganizationRegistrationAuthorizationInput = Readonly<{
|
|
5
|
-
credential: VerifiableCredentialV2;
|
|
6
|
-
wallet: IWallet;
|
|
7
|
-
context: WalletExecutionContext;
|
|
8
|
-
key: WalletKeySelection;
|
|
9
|
-
verificationMethod: string;
|
|
10
|
-
createdAt?: string;
|
|
11
|
-
}>;
|
|
12
|
-
/**
|
|
13
|
-
* Adds one detached JWS proof made by the already-unlocked professional
|
|
14
|
-
* profile. The browser never receives the private key or clear wallet seed.
|
|
15
|
-
*/
|
|
16
|
-
export declare function signOrganizationRegistrationAuthorizationCredential(input: SignOrganizationRegistrationAuthorizationInput): Promise<VerifiableCredentialV2>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { canonicalizeOrganizationRegistrationAuthorizationCredential, } from 'gdc-common-utils-ts/utils/organization-registration-authorization';
|
|
2
|
-
/**
|
|
3
|
-
* Adds one detached JWS proof made by the already-unlocked professional
|
|
4
|
-
* profile. The browser never receives the private key or clear wallet seed.
|
|
5
|
-
*/
|
|
6
|
-
export async function signOrganizationRegistrationAuthorizationCredential(input) {
|
|
7
|
-
if (!input.wallet.signDetachedJws) {
|
|
8
|
-
throw new Error('Wallet does not support detached organization authorization proofs.');
|
|
9
|
-
}
|
|
10
|
-
const verificationMethod = String(input.verificationMethod || '').trim();
|
|
11
|
-
if (!verificationMethod)
|
|
12
|
-
throw new Error('Organization authorization proof requires verificationMethod.');
|
|
13
|
-
const payload = canonicalizeOrganizationRegistrationAuthorizationCredential(input.credential);
|
|
14
|
-
const jws = await input.wallet.signDetachedJws(input.context, {
|
|
15
|
-
payload,
|
|
16
|
-
header: { typ: 'application/vc+ld+json' },
|
|
17
|
-
key: input.key,
|
|
18
|
-
});
|
|
19
|
-
const existingProofs = Array.isArray(input.credential.proof)
|
|
20
|
-
? input.credential.proof
|
|
21
|
-
: input.credential.proof
|
|
22
|
-
? [input.credential.proof]
|
|
23
|
-
: [];
|
|
24
|
-
return {
|
|
25
|
-
...input.credential,
|
|
26
|
-
proof: [...existingProofs, {
|
|
27
|
-
type: 'JsonWebSignature2020',
|
|
28
|
-
created: input.createdAt || new Date().toISOString(),
|
|
29
|
-
proofPurpose: 'contractAgreement',
|
|
30
|
-
verificationMethod,
|
|
31
|
-
jws,
|
|
32
|
-
}],
|
|
33
|
-
};
|
|
34
|
-
}
|