gdc-common-utils-ts 2.0.18 → 2.2.2
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 +18 -1
- package/dist/claims/claims-helpers-allergy-intolerance.d.ts +8 -0
- package/dist/claims/claims-helpers-allergy-intolerance.js +30 -12
- package/dist/claims/claims-helpers-condition.d.ts +8 -0
- package/dist/claims/claims-helpers-condition.js +30 -12
- package/dist/claims/claims-helpers-consent.d.ts +4 -0
- package/dist/claims/claims-helpers-consent.js +15 -1
- package/dist/claims/claims-helpers-diagnostic-report.d.ts +4 -0
- package/dist/claims/claims-helpers-diagnostic-report.js +17 -2
- package/dist/claims/claims-helpers-medication-statement.d.ts +10 -2
- package/dist/claims/claims-helpers-medication-statement.js +32 -14
- package/dist/constants/didcomm.d.ts +22 -0
- package/dist/constants/didcomm.js +22 -0
- package/dist/constants/fhir-resource-types.d.ts +2 -0
- package/dist/constants/fhir-resource-types.js +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/lifecycle.d.ts +2 -0
- package/dist/constants/lifecycle.js +2 -0
- package/dist/constants/verifiable-credentials.d.ts +9 -0
- package/dist/constants/verifiable-credentials.js +9 -0
- package/dist/examples/bundle-didcomm-payload.d.ts +11 -0
- package/dist/examples/bundle-didcomm-payload.js +15 -0
- package/dist/examples/communication-attached-bundle-session.js +28 -27
- package/dist/examples/communication-didcomm-payload.d.ts +39 -0
- package/dist/examples/communication-didcomm-payload.js +44 -0
- package/dist/examples/consent-access.js +2 -1
- package/dist/examples/employee.d.ts +21 -0
- package/dist/examples/employee.js +21 -0
- package/dist/examples/index.d.ts +4 -0
- package/dist/examples/index.js +4 -0
- package/dist/examples/individual-controller.d.ts +27 -0
- package/dist/examples/individual-controller.js +28 -1
- package/dist/examples/inter-tenant-access-contract.js +3 -2
- package/dist/examples/ips-bundle.js +17 -16
- package/dist/examples/lifecycle.js +13 -11
- package/dist/examples/profile-manager-mem.d.ts +45 -0
- package/dist/examples/profile-manager-mem.js +30 -0
- package/dist/examples/related-person.d.ts +14 -0
- package/dist/examples/related-person.js +18 -4
- package/dist/examples/shared.d.ts +13 -3
- package/dist/examples/shared.js +14 -4
- package/dist/examples/vital-signs.js +1 -1
- package/dist/examples/wallet-mem.d.ts +38 -0
- package/dist/examples/wallet-mem.js +42 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/interfaces/IProfileOutboxRepository.d.ts +36 -0
- package/dist/interfaces/IProfileOutboxRepository.js +2 -0
- package/dist/interfaces/IWallet.d.ts +74 -0
- package/dist/interfaces/IWallet.js +2 -0
- package/dist/interfaces/IWalletQueue.d.ts +30 -0
- package/dist/interfaces/IWalletQueue.js +2 -0
- package/dist/interfaces/index.d.ts +8 -0
- package/dist/interfaces/index.js +8 -0
- package/dist/models/authority-resolution.d.ts +56 -0
- package/dist/models/authority-resolution.js +2 -0
- package/dist/models/bundle-editor-types.d.ts +89 -0
- package/dist/models/bundle-editor-types.js +45 -0
- package/dist/models/bundle.d.ts +5 -0
- package/dist/models/communication-attached-bundle-session.d.ts +195 -0
- package/dist/models/communication-attached-bundle-session.js +36 -0
- package/dist/models/confidential-storage.d.ts +2 -1
- package/dist/models/consent-rule.d.ts +11 -1
- package/dist/models/consent-rule.js +9 -1
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +5 -0
- package/dist/models/individual-onboarding.d.ts +18 -0
- package/dist/models/interoperable-claims/allergy-intolerance-claims.d.ts +12 -1
- package/dist/models/interoperable-claims/allergy-intolerance-claims.js +12 -1
- package/dist/models/interoperable-claims/condition-claims.d.ts +12 -1
- package/dist/models/interoperable-claims/condition-claims.js +12 -1
- package/dist/models/interoperable-claims/diagnostic-report-claims.d.ts +14 -4
- package/dist/models/interoperable-claims/diagnostic-report-claims.js +13 -3
- package/dist/models/interoperable-claims/document-reference-claims.d.ts +1 -0
- package/dist/models/interoperable-claims/document-reference-claims.js +3 -0
- package/dist/models/interoperable-claims/medication-statement-claims.d.ts +17 -0
- package/dist/models/interoperable-claims/medication-statement-claims.js +17 -0
- package/dist/models/profile-manager.d.ts +85 -0
- package/dist/models/profile-manager.js +2 -0
- package/dist/models/wallet.d.ts +59 -0
- package/dist/models/wallet.js +22 -0
- package/dist/utils/allergy-intolerance-entry-editor.d.ts +51 -0
- package/dist/utils/allergy-intolerance-entry-editor.js +55 -0
- package/dist/utils/authority-resolution.d.ts +37 -0
- package/dist/utils/authority-resolution.js +112 -0
- package/dist/utils/backend-message-manager-mem.d.ts +78 -0
- package/dist/utils/backend-message-manager-mem.js +238 -0
- package/dist/utils/bundle-didcomm-payload.d.ts +29 -0
- package/dist/utils/bundle-didcomm-payload.js +49 -0
- package/dist/utils/bundle-document-builder.d.ts +1 -0
- package/dist/utils/bundle-document-builder.js +134 -14
- package/dist/utils/bundle-editor-core.d.ts +181 -0
- package/dist/utils/bundle-editor-core.js +467 -0
- package/dist/utils/bundle-editor-helpers.d.ts +53 -0
- package/dist/utils/bundle-editor-helpers.js +146 -0
- package/dist/utils/bundle-editor-registry.d.ts +6 -0
- package/dist/utils/bundle-editor-registry.js +14 -0
- package/dist/utils/bundle-editor.d.ts +21 -722
- package/dist/utils/bundle-editor.js +21 -1601
- package/dist/utils/bundle-entry-editor.d.ts +96 -0
- package/dist/utils/bundle-entry-editor.js +305 -0
- package/dist/utils/bundle-query.d.ts +1 -0
- package/dist/utils/bundle-query.js +12 -3
- package/dist/utils/bundle-reader.d.ts +48 -0
- package/dist/utils/bundle-reader.js +175 -1
- package/dist/utils/care-plan-entry-editor.d.ts +43 -0
- package/dist/utils/care-plan-entry-editor.js +47 -0
- package/dist/utils/client-assertion.d.ts +38 -0
- package/dist/utils/client-assertion.js +113 -0
- package/dist/utils/clinical-impression-entry-editor.d.ts +43 -0
- package/dist/utils/clinical-impression-entry-editor.js +47 -0
- package/dist/utils/clinical-resource-entry-editor.d.ts +123 -0
- package/dist/utils/clinical-resource-entry-editor.js +296 -0
- package/dist/utils/communication-attached-bundle-session-helpers.d.ts +54 -0
- package/dist/utils/communication-attached-bundle-session-helpers.js +519 -0
- package/dist/utils/communication-attached-bundle-session.d.ts +87 -304
- package/dist/utils/communication-attached-bundle-session.js +175 -841
- package/dist/utils/communication-consent-access-editor.d.ts +85 -0
- package/dist/utils/communication-consent-access-editor.js +244 -0
- package/dist/utils/communication-didcomm-payload.d.ts +38 -0
- package/dist/utils/communication-didcomm-payload.js +85 -0
- package/dist/utils/communication-document-reference.d.ts +23 -0
- package/dist/utils/communication-document-reference.js +89 -0
- package/dist/utils/communication-editor.d.ts +53 -0
- package/dist/utils/communication-editor.js +97 -0
- package/dist/utils/condition-entry-editor.d.ts +30 -0
- package/dist/utils/condition-entry-editor.js +34 -0
- package/dist/utils/consent-claim-helpers.d.ts +4 -0
- package/dist/utils/consent-claim-helpers.js +15 -1
- package/dist/utils/coverage-entry-editor.d.ts +51 -0
- package/dist/utils/coverage-entry-editor.js +55 -0
- package/dist/utils/device-entry-editor.d.ts +59 -0
- package/dist/utils/device-entry-editor.js +63 -0
- package/dist/utils/device-use-statement-entry-editor.d.ts +43 -0
- package/dist/utils/device-use-statement-entry-editor.js +47 -0
- package/dist/utils/diagnostic-report-entry-editor.d.ts +74 -0
- package/dist/utils/diagnostic-report-entry-editor.js +136 -0
- package/dist/utils/did.d.ts +8 -0
- package/dist/utils/did.js +22 -0
- package/dist/utils/document-reference-entry-editor.d.ts +62 -0
- package/dist/utils/document-reference-entry-editor.js +66 -0
- package/dist/utils/employee-entry-editor.d.ts +36 -0
- package/dist/utils/employee-entry-editor.js +88 -0
- package/dist/utils/employee.d.ts +1 -0
- package/dist/utils/employee.js +2 -1
- package/dist/utils/encounter-entry-editor.d.ts +51 -0
- package/dist/utils/encounter-entry-editor.js +55 -0
- package/dist/utils/flag-entry-editor.d.ts +47 -0
- package/dist/utils/flag-entry-editor.js +51 -0
- package/dist/utils/immunization-entry-editor.d.ts +87 -0
- package/dist/utils/immunization-entry-editor.js +169 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.js +15 -0
- package/dist/utils/individual-onboarding-acceptance-credential.d.ts +35 -0
- package/dist/utils/individual-onboarding-acceptance-credential.js +55 -0
- package/dist/utils/individual-smart.d.ts +59 -0
- package/dist/utils/individual-smart.js +135 -0
- package/dist/utils/medication-statement-entry-editor.d.ts +90 -0
- package/dist/utils/medication-statement-entry-editor.js +94 -0
- package/dist/utils/observation-component-entry-editor.d.ts +57 -0
- package/dist/utils/observation-component-entry-editor.js +105 -0
- package/dist/utils/observation-entry-editor.d.ts +29 -0
- package/dist/utils/observation-entry-editor.js +68 -0
- package/dist/utils/procedure-entry-editor.d.ts +71 -0
- package/dist/utils/procedure-entry-editor.js +75 -0
- package/dist/utils/professional-smart.d.ts +87 -0
- package/dist/utils/professional-smart.js +118 -4
- package/dist/utils/profile-manager-mem.d.ts +69 -0
- package/dist/utils/profile-manager-mem.js +79 -0
- package/dist/utils/profile-outbox-memory-repository.d.ts +34 -0
- package/dist/utils/profile-outbox-memory-repository.js +57 -0
- package/dist/utils/same-as.d.ts +40 -0
- package/dist/utils/same-as.js +72 -0
- package/dist/utils/unified-health-id.d.ts +51 -0
- package/dist/utils/unified-health-id.js +92 -0
- package/dist/utils/vital-sign-day-batch.d.ts +25 -0
- package/dist/utils/vital-sign-day-batch.js +115 -0
- package/dist/utils/vital-sign-entry-editor.d.ts +61 -0
- package/dist/utils/vital-sign-entry-editor.js +152 -0
- package/dist/utils/wallet-mem.d.ts +93 -0
- package/dist/utils/wallet-mem.js +277 -0
- package/dist/utils/wallet-memory-queue.d.ts +32 -0
- package/dist/utils/wallet-memory-queue.js +82 -0
- package/package.json +2 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
2
|
import { ClaimsOrganizationSchemaorg, ClaimsPersonSchemaorg, } from '../constants/schemaorg.js';
|
|
3
3
|
import { LifecycleRequestType } from '../constants/lifecycle.js';
|
|
4
|
+
import { ResourceTypesFhirR4 } from '../constants/fhir-resource-types.js';
|
|
4
5
|
import { ClaimConsent } from '../models/consent-rule.js';
|
|
6
|
+
import { BundleEntryClaimsContext } from '../models/communication-attached-bundle-session.js';
|
|
5
7
|
import { IndividualOrganizationLifecycleEditor, IndividualOrganizationLifecycleOperations, } from '../utils/individual-organization-lifecycle.js';
|
|
6
8
|
import { EXAMPLE_EMAIL_CONTROLLER_INDIVIDUAL, EXAMPLE_EMAIL_CONTROLLER_ORG, EXAMPLE_CLINICAL_SECTION_ALLERGIES, EXAMPLE_CONSENT_PURPOSE_TREATMENT, EXAMPLE_HEALTHCARE_ACTOR_ROLE_PHYSICIAN, EXAMPLE_JURISDICTION, EXAMPLE_SECTOR, EXAMPLE_TENANT_IDENTIFIER, } from './shared.js';
|
|
7
9
|
/**
|
|
@@ -16,8 +18,8 @@ export const EXAMPLE_LIFECYCLE_OPERATIONS = {
|
|
|
16
18
|
disable: 'disable',
|
|
17
19
|
delete: 'delete',
|
|
18
20
|
};
|
|
19
|
-
export const EXAMPLE_INDIVIDUAL_ORGANIZATION_DISABLE_REQUEST_TYPE =
|
|
20
|
-
export const EXAMPLE_INDIVIDUAL_ORGANIZATION_PURGE_REQUEST_TYPE =
|
|
21
|
+
export const EXAMPLE_INDIVIDUAL_ORGANIZATION_DISABLE_REQUEST_TYPE = LifecycleRequestType.IndividualOrganizationDisable;
|
|
22
|
+
export const EXAMPLE_INDIVIDUAL_ORGANIZATION_PURGE_REQUEST_TYPE = LifecycleRequestType.IndividualOrganizationPurge;
|
|
21
23
|
export const EXAMPLE_TENANT_ENABLE_REQUEST_TYPE = LifecycleRequestType.TenantEnable;
|
|
22
24
|
export const EXAMPLE_TENANT_DISABLE_REQUEST_TYPE = LifecycleRequestType.TenantDisable;
|
|
23
25
|
export const EXAMPLE_TENANT_PURGE_REQUEST_TYPE = LifecycleRequestType.TenantPurge;
|
|
@@ -107,7 +109,7 @@ export const EXAMPLE_EMPLOYEE_DELETE_MESSAGE = {
|
|
|
107
109
|
};
|
|
108
110
|
export const EXAMPLE_TENANT_ENABLE_MESSAGE = {
|
|
109
111
|
operation: EXAMPLE_LIFECYCLE_OPERATIONS.enable,
|
|
110
|
-
resourceType:
|
|
112
|
+
resourceType: ResourceTypesFhirR4.Organization,
|
|
111
113
|
routeContext: {
|
|
112
114
|
tenantId: 'host',
|
|
113
115
|
jurisdiction: EXAMPLE_JURISDICTION,
|
|
@@ -122,7 +124,7 @@ export const EXAMPLE_TENANT_ENABLE_MESSAGE = {
|
|
|
122
124
|
};
|
|
123
125
|
export const EXAMPLE_TENANT_DISABLE_MESSAGE = {
|
|
124
126
|
operation: EXAMPLE_LIFECYCLE_OPERATIONS.disable,
|
|
125
|
-
resourceType:
|
|
127
|
+
resourceType: ResourceTypesFhirR4.Organization,
|
|
126
128
|
routeContext: {
|
|
127
129
|
tenantId: 'host',
|
|
128
130
|
jurisdiction: EXAMPLE_JURISDICTION,
|
|
@@ -142,7 +144,7 @@ export const EXAMPLE_TENANT_DISABLE_MESSAGE = {
|
|
|
142
144
|
};
|
|
143
145
|
export const EXAMPLE_TENANT_DELETE_MESSAGE = {
|
|
144
146
|
operation: EXAMPLE_LIFECYCLE_OPERATIONS.delete,
|
|
145
|
-
resourceType:
|
|
147
|
+
resourceType: ResourceTypesFhirR4.Organization,
|
|
146
148
|
routeContext: {
|
|
147
149
|
tenantId: 'host',
|
|
148
150
|
jurisdiction: EXAMPLE_JURISDICTION,
|
|
@@ -234,14 +236,14 @@ export const EXAMPLE_INDIVIDUAL_ORGANIZATION_PURGE_PAYLOAD = new IndividualOrgan
|
|
|
234
236
|
.buildCurrentGwPayload();
|
|
235
237
|
export const EXAMPLE_CONSENT_ENABLE_MESSAGE = {
|
|
236
238
|
operation: EXAMPLE_LIFECYCLE_OPERATIONS.enable,
|
|
237
|
-
resourceType:
|
|
239
|
+
resourceType: ResourceTypesFhirR4.Consent,
|
|
238
240
|
routeContext: {
|
|
239
241
|
tenantId: EXAMPLE_TENANT_IDENTIFIER,
|
|
240
242
|
jurisdiction: EXAMPLE_JURISDICTION,
|
|
241
243
|
sector: EXAMPLE_SECTOR,
|
|
242
244
|
},
|
|
243
245
|
claims: {
|
|
244
|
-
'@context':
|
|
246
|
+
'@context': BundleEntryClaimsContext,
|
|
245
247
|
[ClaimConsent.identifier]: EXAMPLE_LIFECYCLE_PLACEHOLDERS.consentIdentifier,
|
|
246
248
|
[ClaimConsent.subject]: EXAMPLE_LIFECYCLE_PLACEHOLDERS.individualSubjectDid,
|
|
247
249
|
[ClaimConsent.actorIdentifier]: EXAMPLE_LIFECYCLE_PLACEHOLDERS.consentActorIdentifier,
|
|
@@ -253,14 +255,14 @@ export const EXAMPLE_CONSENT_ENABLE_MESSAGE = {
|
|
|
253
255
|
};
|
|
254
256
|
export const EXAMPLE_CONSENT_DISABLE_MESSAGE = {
|
|
255
257
|
operation: EXAMPLE_LIFECYCLE_OPERATIONS.disable,
|
|
256
|
-
resourceType:
|
|
258
|
+
resourceType: ResourceTypesFhirR4.Consent,
|
|
257
259
|
routeContext: {
|
|
258
260
|
tenantId: EXAMPLE_TENANT_IDENTIFIER,
|
|
259
261
|
jurisdiction: EXAMPLE_JURISDICTION,
|
|
260
262
|
sector: EXAMPLE_SECTOR,
|
|
261
263
|
},
|
|
262
264
|
claims: {
|
|
263
|
-
'@context':
|
|
265
|
+
'@context': BundleEntryClaimsContext,
|
|
264
266
|
[ClaimConsent.identifier]: EXAMPLE_LIFECYCLE_PLACEHOLDERS.consentIdentifier,
|
|
265
267
|
[ClaimConsent.subject]: EXAMPLE_LIFECYCLE_PLACEHOLDERS.individualSubjectDid,
|
|
266
268
|
[ClaimConsent.actorIdentifier]: EXAMPLE_LIFECYCLE_PLACEHOLDERS.consentActorIdentifier,
|
|
@@ -272,14 +274,14 @@ export const EXAMPLE_CONSENT_DISABLE_MESSAGE = {
|
|
|
272
274
|
};
|
|
273
275
|
export const EXAMPLE_CONSENT_DELETE_MESSAGE = {
|
|
274
276
|
operation: EXAMPLE_LIFECYCLE_OPERATIONS.delete,
|
|
275
|
-
resourceType:
|
|
277
|
+
resourceType: ResourceTypesFhirR4.Consent,
|
|
276
278
|
routeContext: {
|
|
277
279
|
tenantId: EXAMPLE_TENANT_IDENTIFIER,
|
|
278
280
|
jurisdiction: EXAMPLE_JURISDICTION,
|
|
279
281
|
sector: EXAMPLE_SECTOR,
|
|
280
282
|
},
|
|
281
283
|
claims: {
|
|
282
|
-
'@context':
|
|
284
|
+
'@context': BundleEntryClaimsContext,
|
|
283
285
|
[ClaimConsent.identifier]: EXAMPLE_LIFECYCLE_PLACEHOLDERS.consentIdentifier,
|
|
284
286
|
[ClaimConsent.subject]: EXAMPLE_LIFECYCLE_PLACEHOLDERS.individualSubjectDid,
|
|
285
287
|
[ClaimConsent.actorIdentifier]: EXAMPLE_LIFECYCLE_PLACEHOLDERS.consentActorIdentifier,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared synthetic fixtures for low-level profile/message-manager tests.
|
|
3
|
+
*/
|
|
4
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_PROFILE_ID: "wallet-entity-sender-001";
|
|
5
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_PROFILE_ID: "wallet-entity-recipient-001";
|
|
6
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_DID: "did:web:portal.example.org";
|
|
7
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DID: "did:web:gw.example.org";
|
|
8
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_DISPLAY_NAME: "Portal BFF Profile";
|
|
9
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DISPLAY_NAME: "GW Proxy Profile";
|
|
10
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_TYPE: "Communication-response-v1.0";
|
|
11
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_NOTE: "Gateway acknowledged the queued communication.";
|
|
12
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_REPLY_AUD: "https://portal.example.org/reply";
|
|
13
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_INBOX_AUD: "https://portal.example.org/inbox";
|
|
14
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_PRIORITY_NORMAL: "normal";
|
|
15
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_PRIORITY_EMERGENCY: "emergency";
|
|
16
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_PAYLOAD: {
|
|
17
|
+
readonly iss: "did:web:gw.example.org";
|
|
18
|
+
readonly aud: "https://portal.example.org/inbox";
|
|
19
|
+
readonly jti: "gateway-response-jti-001";
|
|
20
|
+
readonly thid: "wallet-thread-001";
|
|
21
|
+
readonly type: "Communication-response-v1.0";
|
|
22
|
+
readonly body: {
|
|
23
|
+
readonly ok: true;
|
|
24
|
+
readonly note: "Gateway acknowledged the queued communication.";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const EXAMPLE_PROFILE_MANAGER_MEM_REQUEST_PAYLOAD: {
|
|
28
|
+
readonly iss: "did:web:sender.example.org";
|
|
29
|
+
readonly aud: "https://gw.example.org/submit";
|
|
30
|
+
readonly jti: "wallet-jti-001";
|
|
31
|
+
readonly thid: "wallet-thread-001";
|
|
32
|
+
readonly type: "Communication-bundle-submit-v1.0";
|
|
33
|
+
readonly body: {
|
|
34
|
+
readonly data: readonly [{
|
|
35
|
+
readonly id: "wallet-entry-001";
|
|
36
|
+
readonly type: "Communication-bundle-submit-v1.0";
|
|
37
|
+
readonly resource: {
|
|
38
|
+
readonly resourceType: "Communication";
|
|
39
|
+
readonly note: readonly [{
|
|
40
|
+
readonly text: "Medication bundle ready for DIDComm transport.";
|
|
41
|
+
}];
|
|
42
|
+
};
|
|
43
|
+
}];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
+
import { DidcommMessageTypes } from '../constants/didcomm.js';
|
|
3
|
+
import { EXAMPLE_WALLET_ENTITY_ID_RECIPIENT, EXAMPLE_WALLET_ENTITY_ID_SENDER, EXAMPLE_WALLET_MESSAGE_PAYLOAD, EXAMPLE_WALLET_PRIORITY_EMERGENCY, EXAMPLE_WALLET_PRIORITY_NORMAL, EXAMPLE_WALLET_THREAD_ID, } from './wallet-mem.js';
|
|
4
|
+
/**
|
|
5
|
+
* Shared synthetic fixtures for low-level profile/message-manager tests.
|
|
6
|
+
*/
|
|
7
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_PROFILE_ID = EXAMPLE_WALLET_ENTITY_ID_SENDER;
|
|
8
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_PROFILE_ID = EXAMPLE_WALLET_ENTITY_ID_RECIPIENT;
|
|
9
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_DID = 'did:web:portal.example.org';
|
|
10
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DID = 'did:web:gw.example.org';
|
|
11
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_DISPLAY_NAME = 'Portal BFF Profile';
|
|
12
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DISPLAY_NAME = 'GW Proxy Profile';
|
|
13
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_TYPE = DidcommMessageTypes.CommunicationResponse;
|
|
14
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_NOTE = 'Gateway acknowledged the queued communication.';
|
|
15
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_REPLY_AUD = 'https://portal.example.org/reply';
|
|
16
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_INBOX_AUD = 'https://portal.example.org/inbox';
|
|
17
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_PRIORITY_NORMAL = EXAMPLE_WALLET_PRIORITY_NORMAL;
|
|
18
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_PRIORITY_EMERGENCY = EXAMPLE_WALLET_PRIORITY_EMERGENCY;
|
|
19
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_PAYLOAD = {
|
|
20
|
+
iss: EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DID,
|
|
21
|
+
aud: EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_INBOX_AUD,
|
|
22
|
+
jti: 'gateway-response-jti-001',
|
|
23
|
+
thid: EXAMPLE_WALLET_THREAD_ID,
|
|
24
|
+
type: EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_TYPE,
|
|
25
|
+
body: {
|
|
26
|
+
ok: true,
|
|
27
|
+
note: EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_NOTE,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_REQUEST_PAYLOAD = EXAMPLE_WALLET_MESSAGE_PAYLOAD;
|
|
@@ -7,6 +7,20 @@ export declare const EXAMPLE_RELATED_PERSON_PURGE_REQUEST_TYPE: "RelatedPerson-p
|
|
|
7
7
|
export declare const EXAMPLE_RELATED_PERSON_INTERNAL_RESOURCE_ID: "related-person-internal-001";
|
|
8
8
|
export declare const EXAMPLE_RELATED_PERSON_SEARCH_URL: string;
|
|
9
9
|
export declare const EXAMPLE_RELATED_PERSON_DISPLAY_NAME: "Jose Example";
|
|
10
|
+
export declare const EXAMPLE_INDIVIDUAL_MEMBER_IDENTITY: Readonly<{
|
|
11
|
+
readonly actorDid: string;
|
|
12
|
+
readonly subjectDid: string;
|
|
13
|
+
readonly relationship: "v3-RoleCode|RESPRSN";
|
|
14
|
+
readonly authorityBasis: "family-book";
|
|
15
|
+
readonly email: "parent.guardian@example.org";
|
|
16
|
+
readonly telephone: "+34000000001";
|
|
17
|
+
readonly credentialMaterial: `${string}#signing-key-1`;
|
|
18
|
+
readonly evidence: readonly [{
|
|
19
|
+
readonly type: readonly ["DocumentVerification"];
|
|
20
|
+
readonly evidenceDocument: "LibroDeFamilia";
|
|
21
|
+
readonly verifier: "did:web:kyc.example.org";
|
|
22
|
+
}];
|
|
23
|
+
}>;
|
|
10
24
|
/**
|
|
11
25
|
* Minimal semantic input used by SDK helpers to disable one subject-side
|
|
12
26
|
* relationship record through the identifier-first lifecycle contract.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { RelatedPersonClaim } from '../models/interoperable-claims/related-person-claims.js';
|
|
3
3
|
import { ResourceTypesFhirR4 } from '../constants/fhir-resource-types.js';
|
|
4
4
|
import { HL7_CODING_SYSTEM_V3_ROLE_CODE } from '../constants/hl7-roles.js';
|
|
5
|
-
import { EXAMPLE_INTEROPERABLE_CONTEXT_FHIR_API, EXAMPLE_EMAIL_RELATED_PERSON, EXAMPLE_RELATED_PERSON_ACTIVE_NAME, EXAMPLE_RELATED_PERSON_IDENTIFIER, EXAMPLE_RELATED_PERSON_INACTIVE_EMAIL, EXAMPLE_RELATED_PERSON_INACTIVE_IDENTIFIER, EXAMPLE_RELATED_PERSON_INACTIVE_NAME, EXAMPLE_RELATED_PERSON_INACTIVE_RELATIONSHIP, EXAMPLE_RELATED_PERSON_ROLE, EXAMPLE_SUBJECT_DID, } from './shared.js';
|
|
5
|
+
import { EXAMPLE_INTEROPERABLE_CONTEXT_FHIR_API, EXAMPLE_EMAIL_RELATED_PERSON, EXAMPLE_FORM_CONTROLLER_PHONE, EXAMPLE_RELATED_PERSON_MEMBER_DID, EXAMPLE_RELATED_PERSON_ACTIVE_NAME, EXAMPLE_RELATED_PERSON_IDENTIFIER, EXAMPLE_RELATED_PERSON_INACTIVE_EMAIL, EXAMPLE_RELATED_PERSON_INACTIVE_IDENTIFIER, EXAMPLE_RELATED_PERSON_INACTIVE_NAME, EXAMPLE_RELATED_PERSON_INACTIVE_RELATIONSHIP, EXAMPLE_RELATED_PERSON_ROLE, EXAMPLE_SUBJECT_DID, } from './shared.js';
|
|
6
6
|
import { createInteroperableResourceOperationEditor, InteroperableOperationMethods, buildInteroperableSearchPath, InteroperableLifecycleStatuses, } from '../utils/interoperable-resource-operation.js';
|
|
7
7
|
import { LifecycleRequestType } from '../constants/lifecycle.js';
|
|
8
8
|
/**
|
|
@@ -14,6 +14,20 @@ export const EXAMPLE_RELATED_PERSON_PURGE_REQUEST_TYPE = LifecycleRequestType.Re
|
|
|
14
14
|
export const EXAMPLE_RELATED_PERSON_INTERNAL_RESOURCE_ID = 'related-person-internal-001';
|
|
15
15
|
export const EXAMPLE_RELATED_PERSON_SEARCH_URL = buildInteroperableSearchPath(EXAMPLE_RELATED_PERSON_RESOURCE_TYPE);
|
|
16
16
|
export const EXAMPLE_RELATED_PERSON_DISPLAY_NAME = EXAMPLE_RELATED_PERSON_ACTIVE_NAME;
|
|
17
|
+
export const EXAMPLE_INDIVIDUAL_MEMBER_IDENTITY = Object.freeze({
|
|
18
|
+
actorDid: EXAMPLE_RELATED_PERSON_MEMBER_DID,
|
|
19
|
+
subjectDid: EXAMPLE_SUBJECT_DID,
|
|
20
|
+
relationship: EXAMPLE_RELATED_PERSON_ROLE,
|
|
21
|
+
authorityBasis: 'family-book',
|
|
22
|
+
email: EXAMPLE_EMAIL_RELATED_PERSON,
|
|
23
|
+
telephone: EXAMPLE_FORM_CONTROLLER_PHONE,
|
|
24
|
+
credentialMaterial: `${EXAMPLE_RELATED_PERSON_MEMBER_DID}#signing-key-1`,
|
|
25
|
+
evidence: [{
|
|
26
|
+
type: ['DocumentVerification'],
|
|
27
|
+
evidenceDocument: 'LibroDeFamilia',
|
|
28
|
+
verifier: 'did:web:kyc.example.org',
|
|
29
|
+
}],
|
|
30
|
+
});
|
|
17
31
|
/**
|
|
18
32
|
* Minimal semantic input used by SDK helpers to disable one subject-side
|
|
19
33
|
* relationship record through the identifier-first lifecycle contract.
|
|
@@ -59,7 +73,7 @@ export const EXAMPLE_RELATED_PERSON_DISABLE_BUNDLE_ENTRY = {
|
|
|
59
73
|
export const EXAMPLE_RELATED_PERSON_DISABLE_BUNDLE_PAYLOAD = {
|
|
60
74
|
thid: 'relatedperson-disable-example-001',
|
|
61
75
|
body: {
|
|
62
|
-
resourceType:
|
|
76
|
+
resourceType: ResourceTypesFhirR4.Bundle,
|
|
63
77
|
type: 'batch',
|
|
64
78
|
entry: [EXAMPLE_RELATED_PERSON_DISABLE_BUNDLE_ENTRY],
|
|
65
79
|
},
|
|
@@ -83,7 +97,7 @@ export const EXAMPLE_RELATED_PERSON_PURGE_BUNDLE_ENTRY = {
|
|
|
83
97
|
export const EXAMPLE_RELATED_PERSON_PURGE_BUNDLE_PAYLOAD = {
|
|
84
98
|
thid: 'relatedperson-purge-example-001',
|
|
85
99
|
body: {
|
|
86
|
-
resourceType:
|
|
100
|
+
resourceType: ResourceTypesFhirR4.Bundle,
|
|
87
101
|
type: 'batch',
|
|
88
102
|
entry: [EXAMPLE_RELATED_PERSON_PURGE_BUNDLE_ENTRY],
|
|
89
103
|
},
|
|
@@ -98,7 +112,7 @@ export const EXAMPLE_RELATED_PERSON_PURGE_BUNDLE_PAYLOAD = {
|
|
|
98
112
|
export const EXAMPLE_RELATED_PERSON_UPSERT_BUNDLE_PAYLOAD = {
|
|
99
113
|
thid: 'relatedperson-upsert-example-001',
|
|
100
114
|
body: {
|
|
101
|
-
resourceType:
|
|
115
|
+
resourceType: ResourceTypesFhirR4.Bundle,
|
|
102
116
|
type: 'batch',
|
|
103
117
|
entry: [{
|
|
104
118
|
resource: {
|
|
@@ -217,17 +217,20 @@ export declare const EXAMPLE_CONTENT_TYPE_FHIR_JSON: "application/fhir+json";
|
|
|
217
217
|
export declare const EXAMPLE_IPS_BUNDLE_ATTACHMENT_TITLE: "IPS Document Bundle";
|
|
218
218
|
export declare const EXAMPLE_BUNDLE_RESOURCE_TYPE: "Bundle";
|
|
219
219
|
export declare const EXAMPLE_BUNDLE_TYPE_BATCH: "batch";
|
|
220
|
+
export declare const EXAMPLE_BUNDLE_TYPE_DOCUMENT: "document";
|
|
220
221
|
export declare const EXAMPLE_MEDICATION_STATEMENT_UUID: "urn:uuid:medication-statement-example-001";
|
|
221
222
|
export declare const EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER: "urn:uuid:medication-statement-example-001";
|
|
222
223
|
export declare const EXAMPLE_MEDICATION_STATEMENT_STATUS: "active";
|
|
223
224
|
export declare const EXAMPLE_MEDICATION_STATEMENT_CODE: "http://www.nlm.nih.gov/research/umls/rxnorm|313782";
|
|
224
225
|
export declare const EXAMPLE_MEDICATION_STATEMENT_TEXT: "atorvastatin 20 mg oral tablet";
|
|
226
|
+
export declare const EXAMPLE_MEDICATION_STATEMENT_TEXT_CORRECTED: "atorvastatin 20 mg oral tablet - corrected text";
|
|
225
227
|
export declare const EXAMPLE_DOCUMENT_REFERENCE_IDENTIFIER: "docref-example-001";
|
|
226
228
|
export declare const EXAMPLE_DOCUMENT_REFERENCE_IDENTIFIER_SECONDARY: "docref-example-002";
|
|
227
229
|
export declare const EXAMPLE_DOCUMENT_REFERENCE_CONTENT_TYPE_PDF: "application/pdf";
|
|
228
230
|
export declare const EXAMPLE_DOCUMENT_REFERENCE_URL: "https://example.org/prescription.pdf";
|
|
229
231
|
export declare const EXAMPLE_DOCUMENT_REFERENCE_DESCRIPTION: "Prescription PDF";
|
|
230
232
|
export declare const EXAMPLE_DOCUMENT_REFERENCE_DATE: "2026-06-12T10:00:00Z";
|
|
233
|
+
export declare const EXAMPLE_DOCUMENT_REFERENCE_DATA_BASE64: string;
|
|
231
234
|
export declare const EXAMPLE_CLINICAL_EVENT_DATE_TIME: "2026-06-01T10:00:00Z";
|
|
232
235
|
export declare const EXAMPLE_VITAL_SIGNS_EFFECTIVE_DATE_TIME: "2026-06-11T08:30:00Z";
|
|
233
236
|
export declare const EXAMPLE_VITAL_SIGNS_PANEL_DATE_TIME: "2026-06-11T09:00:00Z";
|
|
@@ -239,6 +242,11 @@ export declare const EXAMPLE_VAULT_QUATERNARY_DATE_TIME: "2026-06-11T13:00:00Z";
|
|
|
239
242
|
export declare const EXAMPLE_VAULT_CONDITION_DATE_TIME: "2026-06-11T14:00:00Z";
|
|
240
243
|
export declare const EXAMPLE_DOCUMENT_REFERENCE_CONTENT_HASH: "z-document-reference-example-hash";
|
|
241
244
|
export declare const EXAMPLE_DOCUMENT_REFERENCE_LANGUAGE: "en";
|
|
245
|
+
export declare const EXAMPLE_COMPOSITION_IDENTIFIER_MEDICATION_DOCUMENT: "urn:uuid:composition-medication-document-001";
|
|
246
|
+
export declare const EXAMPLE_COMPOSITION_TITLE_MEDICATION_DOCUMENT: "Medication document authored from the self-managed frontend";
|
|
247
|
+
export declare const EXAMPLE_COMPOSITION_DATE_MEDICATION_DOCUMENT: "2026-07-06T10:15:00Z";
|
|
248
|
+
export declare const EXAMPLE_COMMUNICATION_TOPIC_MEDICATION_DOCUMENT: "medication-document";
|
|
249
|
+
export declare const EXAMPLE_COMMUNICATION_TEXT_MEDICATION_DOCUMENT_READY: "One corrected medication document ready to travel.";
|
|
242
250
|
export declare const EXAMPLE_CONSENT_ATTACHMENT_CONTENT_TYPE: "application/pdf";
|
|
243
251
|
export declare const EXAMPLE_CONSENT_ATTACHMENT_DATA_BASE64: "JVBERi0xLjQKJUZha2UgY29uc2VudCBQREYgZm9yIGxvY2FsIHNtb2tlIHRlc3QK";
|
|
244
252
|
export declare const EXAMPLE_CONTENT_ADDRESSED_CONSENT_IDENTIFIER: "zQmYwAPJzv5CZsnAzt8auVZRnGi2C31WnH8D9N6A7h7vY2";
|
|
@@ -292,6 +300,7 @@ export declare const EXAMPLE_OBSERVATION_PANEL_IDENTIFIER: "urn:uuid:observation
|
|
|
292
300
|
export declare const EXAMPLE_OBSERVATION_COMPONENT_IDENTIFIER: "urn:uuid:observation-component-example-001";
|
|
293
301
|
export declare const EXAMPLE_OBSERVATION_COMPONENT_IDENTIFIER_SECONDARY: "urn:uuid:observation-component-example-002";
|
|
294
302
|
export declare const EXAMPLE_IPS_COMPOSITION_IDENTIFIER: "ips-composition";
|
|
303
|
+
export declare const EXAMPLE_APPOINTMENT_RESPONSE_IDENTIFIER: "appointment-response-example-001";
|
|
295
304
|
export declare const EXAMPLE_CONDITION_IDENTIFIER: "condition-example-001";
|
|
296
305
|
export declare const EXAMPLE_VITAL_SIGNS_NOTE: "Measured after rest.";
|
|
297
306
|
export declare const EXAMPLE_FHIR_STATUS_FINAL: "final";
|
|
@@ -606,7 +615,7 @@ export declare function buildExampleCommunicationIngestionPayload({ subjectDid,
|
|
|
606
615
|
export declare function buildExampleDocumentReferenceSearchPayload(subjectDid?: string): {
|
|
607
616
|
thid: string;
|
|
608
617
|
body: {
|
|
609
|
-
resourceType:
|
|
618
|
+
resourceType: "Bundle";
|
|
610
619
|
type: string;
|
|
611
620
|
entry: {
|
|
612
621
|
request: {
|
|
@@ -622,8 +631,9 @@ export declare function buildExampleLiveMedicationCases(seed?: number): ExampleL
|
|
|
622
631
|
* Builds a minimal IPS `Bundle.type=document` containing one
|
|
623
632
|
* `MedicationStatement` under the `History of medication use` section.
|
|
624
633
|
*
|
|
625
|
-
* This
|
|
626
|
-
*
|
|
634
|
+
* This is a shared fixture/secondary setup helper for transport demos and
|
|
635
|
+
* tests. The canonical step-by-step authoring walkthrough lives in the IPS
|
|
636
|
+
* bundle-editor tests, not here.
|
|
627
637
|
*/
|
|
628
638
|
export declare function buildExampleMedicationIpsDocumentBundle(input: ExampleMedicationIpsDocumentBundleInput): ExampleMedicationIpsDocumentBundle;
|
|
629
639
|
export type ExampleHostedTenantRouteContext = Readonly<{
|
package/dist/examples/shared.js
CHANGED
|
@@ -260,17 +260,20 @@ export const EXAMPLE_CONTENT_TYPE_FHIR_JSON = 'application/fhir+json';
|
|
|
260
260
|
export const EXAMPLE_IPS_BUNDLE_ATTACHMENT_TITLE = 'IPS Document Bundle';
|
|
261
261
|
export const EXAMPLE_BUNDLE_RESOURCE_TYPE = 'Bundle';
|
|
262
262
|
export const EXAMPLE_BUNDLE_TYPE_BATCH = 'batch';
|
|
263
|
+
export const EXAMPLE_BUNDLE_TYPE_DOCUMENT = 'document';
|
|
263
264
|
export const EXAMPLE_MEDICATION_STATEMENT_UUID = 'urn:uuid:medication-statement-example-001';
|
|
264
265
|
export const EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER = EXAMPLE_MEDICATION_STATEMENT_UUID;
|
|
265
266
|
export const EXAMPLE_MEDICATION_STATEMENT_STATUS = 'active';
|
|
266
267
|
export const EXAMPLE_MEDICATION_STATEMENT_CODE = 'http://www.nlm.nih.gov/research/umls/rxnorm|313782';
|
|
267
268
|
export const EXAMPLE_MEDICATION_STATEMENT_TEXT = 'atorvastatin 20 mg oral tablet';
|
|
269
|
+
export const EXAMPLE_MEDICATION_STATEMENT_TEXT_CORRECTED = 'atorvastatin 20 mg oral tablet - corrected text';
|
|
268
270
|
export const EXAMPLE_DOCUMENT_REFERENCE_IDENTIFIER = 'docref-example-001';
|
|
269
271
|
export const EXAMPLE_DOCUMENT_REFERENCE_IDENTIFIER_SECONDARY = 'docref-example-002';
|
|
270
272
|
export const EXAMPLE_DOCUMENT_REFERENCE_CONTENT_TYPE_PDF = 'application/pdf';
|
|
271
273
|
export const EXAMPLE_DOCUMENT_REFERENCE_URL = 'https://example.org/prescription.pdf';
|
|
272
274
|
export const EXAMPLE_DOCUMENT_REFERENCE_DESCRIPTION = 'Prescription PDF';
|
|
273
275
|
export const EXAMPLE_DOCUMENT_REFERENCE_DATE = '2026-06-12T10:00:00Z';
|
|
276
|
+
export const EXAMPLE_DOCUMENT_REFERENCE_DATA_BASE64 = Buffer.from('example-medication-leaflet', 'utf8').toString('base64');
|
|
274
277
|
export const EXAMPLE_CLINICAL_EVENT_DATE_TIME = '2026-06-01T10:00:00Z';
|
|
275
278
|
export const EXAMPLE_VITAL_SIGNS_EFFECTIVE_DATE_TIME = '2026-06-11T08:30:00Z';
|
|
276
279
|
export const EXAMPLE_VITAL_SIGNS_PANEL_DATE_TIME = '2026-06-11T09:00:00Z';
|
|
@@ -282,6 +285,11 @@ export const EXAMPLE_VAULT_QUATERNARY_DATE_TIME = '2026-06-11T13:00:00Z';
|
|
|
282
285
|
export const EXAMPLE_VAULT_CONDITION_DATE_TIME = '2026-06-11T14:00:00Z';
|
|
283
286
|
export const EXAMPLE_DOCUMENT_REFERENCE_CONTENT_HASH = 'z-document-reference-example-hash';
|
|
284
287
|
export const EXAMPLE_DOCUMENT_REFERENCE_LANGUAGE = 'en';
|
|
288
|
+
export const EXAMPLE_COMPOSITION_IDENTIFIER_MEDICATION_DOCUMENT = 'urn:uuid:composition-medication-document-001';
|
|
289
|
+
export const EXAMPLE_COMPOSITION_TITLE_MEDICATION_DOCUMENT = 'Medication document authored from the self-managed frontend';
|
|
290
|
+
export const EXAMPLE_COMPOSITION_DATE_MEDICATION_DOCUMENT = '2026-07-06T10:15:00Z';
|
|
291
|
+
export const EXAMPLE_COMMUNICATION_TOPIC_MEDICATION_DOCUMENT = 'medication-document';
|
|
292
|
+
export const EXAMPLE_COMMUNICATION_TEXT_MEDICATION_DOCUMENT_READY = 'One corrected medication document ready to travel.';
|
|
285
293
|
export const EXAMPLE_CONSENT_ATTACHMENT_CONTENT_TYPE = EXAMPLE_DOCUMENT_REFERENCE_CONTENT_TYPE_PDF;
|
|
286
294
|
export const EXAMPLE_CONSENT_ATTACHMENT_DATA_BASE64 = 'JVBERi0xLjQKJUZha2UgY29uc2VudCBQREYgZm9yIGxvY2FsIHNtb2tlIHRlc3QK';
|
|
287
295
|
export const EXAMPLE_CONTENT_ADDRESSED_CONSENT_IDENTIFIER = 'zQmYwAPJzv5CZsnAzt8auVZRnGi2C31WnH8D9N6A7h7vY2';
|
|
@@ -335,6 +343,7 @@ export const EXAMPLE_OBSERVATION_PANEL_IDENTIFIER = 'urn:uuid:observation-panel-
|
|
|
335
343
|
export const EXAMPLE_OBSERVATION_COMPONENT_IDENTIFIER = 'urn:uuid:observation-component-example-001';
|
|
336
344
|
export const EXAMPLE_OBSERVATION_COMPONENT_IDENTIFIER_SECONDARY = 'urn:uuid:observation-component-example-002';
|
|
337
345
|
export const EXAMPLE_IPS_COMPOSITION_IDENTIFIER = 'ips-composition';
|
|
346
|
+
export const EXAMPLE_APPOINTMENT_RESPONSE_IDENTIFIER = 'appointment-response-example-001';
|
|
338
347
|
export const EXAMPLE_CONDITION_IDENTIFIER = 'condition-example-001';
|
|
339
348
|
export const EXAMPLE_VITAL_SIGNS_NOTE = 'Measured after rest.';
|
|
340
349
|
export const EXAMPLE_FHIR_STATUS_FINAL = 'final';
|
|
@@ -589,7 +598,7 @@ export function buildExampleDocumentReferenceSearchPayload(subjectDid = EXAMPLE_
|
|
|
589
598
|
return {
|
|
590
599
|
thid: 'search-documentreference-example',
|
|
591
600
|
body: {
|
|
592
|
-
resourceType:
|
|
601
|
+
resourceType: ResourceTypesFhirR4.Bundle,
|
|
593
602
|
type: 'batch',
|
|
594
603
|
entry: [
|
|
595
604
|
{
|
|
@@ -639,8 +648,9 @@ export function buildExampleLiveMedicationCases(seed = Date.now()) {
|
|
|
639
648
|
* Builds a minimal IPS `Bundle.type=document` containing one
|
|
640
649
|
* `MedicationStatement` under the `History of medication use` section.
|
|
641
650
|
*
|
|
642
|
-
* This
|
|
643
|
-
*
|
|
651
|
+
* This is a shared fixture/secondary setup helper for transport demos and
|
|
652
|
+
* tests. The canonical step-by-step authoring walkthrough lives in the IPS
|
|
653
|
+
* bundle-editor tests, not here.
|
|
644
654
|
*/
|
|
645
655
|
export function buildExampleMedicationIpsDocumentBundle(input) {
|
|
646
656
|
const subjectDid = input.subjectDid || EXAMPLE_SUBJECT_DID;
|
|
@@ -701,7 +711,7 @@ export function buildExampleMedicationIpsDocumentBundle(input) {
|
|
|
701
711
|
},
|
|
702
712
|
{
|
|
703
713
|
resource: {
|
|
704
|
-
resourceType:
|
|
714
|
+
resourceType: ResourceTypesFhirR4.Patient,
|
|
705
715
|
id: `patient-${input.medication.identifier}`,
|
|
706
716
|
},
|
|
707
717
|
},
|
|
@@ -115,7 +115,7 @@ export function buildVitalSignObservationEntry(input) {
|
|
|
115
115
|
*/
|
|
116
116
|
export function buildExampleVitalSignsObservationBundle() {
|
|
117
117
|
return {
|
|
118
|
-
resourceType:
|
|
118
|
+
resourceType: ResourceTypesFhirR4.Bundle,
|
|
119
119
|
type: 'collection',
|
|
120
120
|
data: [
|
|
121
121
|
buildVitalSignObservationEntry(EXAMPLE_VITAL_SIGN_HEART_RATE_INPUT),
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable synthetic wallet fixtures for docs and tests.
|
|
3
|
+
*
|
|
4
|
+
* Rule:
|
|
5
|
+
* - wallet-related tests must import these values instead of re-hardcoding
|
|
6
|
+
* queue ids, entity ids, thread ids, or payload strings inline
|
|
7
|
+
*/
|
|
8
|
+
export declare const EXAMPLE_WALLET_ENTITY_ID_SENDER: "wallet-entity-sender-001";
|
|
9
|
+
export declare const EXAMPLE_WALLET_ENTITY_ID_RECIPIENT: "wallet-entity-recipient-001";
|
|
10
|
+
export declare const EXAMPLE_WALLET_MESSAGE_ID_EMERGENCY: "wallet-message-emergency-001";
|
|
11
|
+
export declare const EXAMPLE_WALLET_MESSAGE_ID_NORMAL: "wallet-message-normal-001";
|
|
12
|
+
export declare const EXAMPLE_WALLET_THREAD_ID: "wallet-thread-001";
|
|
13
|
+
export declare const EXAMPLE_WALLET_PAYLOAD_TYPE: "Communication-bundle-submit-v1.0";
|
|
14
|
+
export declare const EXAMPLE_WALLET_CREATED_AT: "2026-06-30T10:00:00.000Z";
|
|
15
|
+
export declare const EXAMPLE_WALLET_CONTENT_NOTE: "Medication bundle ready for DIDComm transport.";
|
|
16
|
+
export declare const EXAMPLE_WALLET_FAILURE_MESSAGE: "Gateway temporary failure.";
|
|
17
|
+
export declare const EXAMPLE_WALLET_PROTECTED_DOC_ID: "wallet-doc-001";
|
|
18
|
+
export declare const EXAMPLE_WALLET_PRIORITY_EMERGENCY: "emergency";
|
|
19
|
+
export declare const EXAMPLE_WALLET_PRIORITY_NORMAL: "normal";
|
|
20
|
+
export declare const EXAMPLE_WALLET_MESSAGE_PAYLOAD: {
|
|
21
|
+
readonly iss: "did:web:sender.example.org";
|
|
22
|
+
readonly aud: "https://gw.example.org/submit";
|
|
23
|
+
readonly jti: "wallet-jti-001";
|
|
24
|
+
readonly thid: "wallet-thread-001";
|
|
25
|
+
readonly type: "Communication-bundle-submit-v1.0";
|
|
26
|
+
readonly body: {
|
|
27
|
+
readonly data: readonly [{
|
|
28
|
+
readonly id: "wallet-entry-001";
|
|
29
|
+
readonly type: "Communication-bundle-submit-v1.0";
|
|
30
|
+
readonly resource: {
|
|
31
|
+
readonly resourceType: "Communication";
|
|
32
|
+
readonly note: readonly [{
|
|
33
|
+
readonly text: "Medication bundle ready for DIDComm transport.";
|
|
34
|
+
}];
|
|
35
|
+
};
|
|
36
|
+
}];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
+
import { DidcommMessageTypes } from '../constants/didcomm.js';
|
|
3
|
+
import { ResourceTypesFhirR4 } from '../constants/fhir-resource-types.js';
|
|
4
|
+
import { WalletMessagePriorities } from '../models/wallet.js';
|
|
5
|
+
/**
|
|
6
|
+
* Reusable synthetic wallet fixtures for docs and tests.
|
|
7
|
+
*
|
|
8
|
+
* Rule:
|
|
9
|
+
* - wallet-related tests must import these values instead of re-hardcoding
|
|
10
|
+
* queue ids, entity ids, thread ids, or payload strings inline
|
|
11
|
+
*/
|
|
12
|
+
export const EXAMPLE_WALLET_ENTITY_ID_SENDER = 'wallet-entity-sender-001';
|
|
13
|
+
export const EXAMPLE_WALLET_ENTITY_ID_RECIPIENT = 'wallet-entity-recipient-001';
|
|
14
|
+
export const EXAMPLE_WALLET_MESSAGE_ID_EMERGENCY = 'wallet-message-emergency-001';
|
|
15
|
+
export const EXAMPLE_WALLET_MESSAGE_ID_NORMAL = 'wallet-message-normal-001';
|
|
16
|
+
export const EXAMPLE_WALLET_THREAD_ID = 'wallet-thread-001';
|
|
17
|
+
export const EXAMPLE_WALLET_PAYLOAD_TYPE = DidcommMessageTypes.CommunicationBundleSubmit;
|
|
18
|
+
export const EXAMPLE_WALLET_CREATED_AT = '2026-06-30T10:00:00.000Z';
|
|
19
|
+
export const EXAMPLE_WALLET_CONTENT_NOTE = 'Medication bundle ready for DIDComm transport.';
|
|
20
|
+
export const EXAMPLE_WALLET_FAILURE_MESSAGE = 'Gateway temporary failure.';
|
|
21
|
+
export const EXAMPLE_WALLET_PROTECTED_DOC_ID = 'wallet-doc-001';
|
|
22
|
+
export const EXAMPLE_WALLET_PRIORITY_EMERGENCY = WalletMessagePriorities.Emergency;
|
|
23
|
+
export const EXAMPLE_WALLET_PRIORITY_NORMAL = WalletMessagePriorities.Normal;
|
|
24
|
+
export const EXAMPLE_WALLET_MESSAGE_PAYLOAD = {
|
|
25
|
+
iss: 'did:web:sender.example.org',
|
|
26
|
+
aud: 'https://gw.example.org/submit',
|
|
27
|
+
jti: 'wallet-jti-001',
|
|
28
|
+
thid: EXAMPLE_WALLET_THREAD_ID,
|
|
29
|
+
type: EXAMPLE_WALLET_PAYLOAD_TYPE,
|
|
30
|
+
body: {
|
|
31
|
+
data: [
|
|
32
|
+
{
|
|
33
|
+
id: 'wallet-entry-001',
|
|
34
|
+
type: EXAMPLE_WALLET_PAYLOAD_TYPE,
|
|
35
|
+
resource: {
|
|
36
|
+
resourceType: ResourceTypesFhirR4.Communication,
|
|
37
|
+
note: [{ text: EXAMPLE_WALLET_CONTENT_NOTE }],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export * from './examples/index.js';
|
|
|
7
7
|
export * from './hmac.js';
|
|
8
8
|
export * from './i18n/clinical-sections.i18n.js';
|
|
9
9
|
export * from './i18n/role-codes.i18n.js';
|
|
10
|
+
export * from './interfaces/index.js';
|
|
10
11
|
export * from './models/index.js';
|
|
11
12
|
export * from './storage/index.js';
|
|
12
13
|
export * from './utils/index.js';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BackendMessageResponseRecord, ProfileOutboxMessageRecord } from '../models/profile-manager';
|
|
2
|
+
/**
|
|
3
|
+
* Runtime-neutral repository for profile-scoped outbox history and decoded
|
|
4
|
+
* responses.
|
|
5
|
+
*
|
|
6
|
+
* Separation rule:
|
|
7
|
+
* - `IWalletQueue` controls ordering and mutable pending state
|
|
8
|
+
* - `IProfileOutboxRepository` preserves historical records and decoded
|
|
9
|
+
* responses that the profile/runtime may want to inspect later
|
|
10
|
+
*/
|
|
11
|
+
export interface IProfileOutboxRepository {
|
|
12
|
+
/**
|
|
13
|
+
* Stores one immutable message history record.
|
|
14
|
+
*/
|
|
15
|
+
putMessage(record: ProfileOutboxMessageRecord): Promise<ProfileOutboxMessageRecord>;
|
|
16
|
+
/**
|
|
17
|
+
* Returns one historical message record by id.
|
|
18
|
+
*/
|
|
19
|
+
getMessage(messageId: string): Promise<ProfileOutboxMessageRecord | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* Lists all historical message records.
|
|
22
|
+
*/
|
|
23
|
+
listMessages(): Promise<ProfileOutboxMessageRecord[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Stores one decoded response record.
|
|
26
|
+
*/
|
|
27
|
+
putResponse(record: BackendMessageResponseRecord): Promise<BackendMessageResponseRecord>;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the latest decoded response for one thread id.
|
|
30
|
+
*/
|
|
31
|
+
getLatestResponseByThreadId(thid: string): Promise<BackendMessageResponseRecord | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Lists all decoded responses.
|
|
34
|
+
*/
|
|
35
|
+
listResponses(): Promise<BackendMessageResponseRecord[]>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { WalletEnqueueMessageInput, WalletManagedEntityDescriptor, WalletQueuedMessage } from '../models/wallet';
|
|
2
|
+
import type { JWK, JwkSet } from '../models/jwk';
|
|
3
|
+
/**
|
|
4
|
+
* Shared wallet contract reused by tests, apps, frontend adapters, and simple
|
|
5
|
+
* backend or BFF flows.
|
|
6
|
+
*
|
|
7
|
+
* Backward-compatibility rule:
|
|
8
|
+
* - the legacy methods (`provisionKeys`, `digest`,
|
|
9
|
+
* `protectConfidentialData`, `unprotectConfidentialData`, `unpack`) remain
|
|
10
|
+
* the stable minimum contract expected by older consumers
|
|
11
|
+
* - richer transport and queue helpers are optional so older platform-specific
|
|
12
|
+
* adapters do not need to implement them immediately
|
|
13
|
+
*/
|
|
14
|
+
export interface IWallet {
|
|
15
|
+
/**
|
|
16
|
+
* Provisions or retrieves the wallet key set for one logical entity.
|
|
17
|
+
*/
|
|
18
|
+
provisionKeys(entityId: string): Promise<JwkSet>;
|
|
19
|
+
/**
|
|
20
|
+
* Computes one digest string using the provided algorithm name.
|
|
21
|
+
*/
|
|
22
|
+
digest(data: string, algorithm: string): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Protects one local document for confidential at-rest storage.
|
|
25
|
+
*/
|
|
26
|
+
protectConfidentialData(doc: unknown, entityId?: string): Promise<unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* Unprotects one local confidential document.
|
|
29
|
+
*/
|
|
30
|
+
unprotectConfidentialData(doc: unknown, entityId?: string): Promise<unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* Unpacks one transport message into business content plus JOSE metadata.
|
|
33
|
+
*/
|
|
34
|
+
unpack?(packedMessage: string, entityId?: string): Promise<{
|
|
35
|
+
content: unknown;
|
|
36
|
+
meta: Record<string, unknown>;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Packs one business payload for one recipient public key.
|
|
40
|
+
*/
|
|
41
|
+
pack?(content: Record<string, unknown>, recipientJwk: JWK, entityId: string): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Returns the public keys currently provisioned for one entity.
|
|
44
|
+
*/
|
|
45
|
+
getPublicKeys?(entityId: string): Promise<WalletManagedEntityDescriptor>;
|
|
46
|
+
/**
|
|
47
|
+
* Signs one JSON payload into a compact JWS.
|
|
48
|
+
*/
|
|
49
|
+
signCompactJws?(entityId: string, claims: Record<string, unknown>): Promise<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Builds one compact JWE for the provided recipient.
|
|
52
|
+
*/
|
|
53
|
+
buildCompactJwe?(entityId: string, plaintext: string | Uint8Array, recipientJwk: JWK, contentType?: string): Promise<string>;
|
|
54
|
+
/**
|
|
55
|
+
* Enqueues one local outbound message with an optional priority.
|
|
56
|
+
*/
|
|
57
|
+
enqueueMessage?(input: WalletEnqueueMessageInput): Promise<WalletQueuedMessage>;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the next pending message without mutating queue state.
|
|
60
|
+
*/
|
|
61
|
+
peekNextMessage?(): Promise<WalletQueuedMessage | undefined>;
|
|
62
|
+
/**
|
|
63
|
+
* Marks one message as delivered.
|
|
64
|
+
*/
|
|
65
|
+
markMessageDelivered?(messageId: string): Promise<WalletQueuedMessage>;
|
|
66
|
+
/**
|
|
67
|
+
* Marks one message as failed.
|
|
68
|
+
*/
|
|
69
|
+
markMessageFailed?(messageId: string, errorMessage: string): Promise<WalletQueuedMessage>;
|
|
70
|
+
/**
|
|
71
|
+
* Lists all locally tracked queued messages.
|
|
72
|
+
*/
|
|
73
|
+
listMessages?(): Promise<WalletQueuedMessage[]>;
|
|
74
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { WalletEnqueueMessageInput, WalletQueuedMessage } from '../models/wallet';
|
|
2
|
+
/**
|
|
3
|
+
* Runtime-neutral queue/outbox contract for low-level wallet-backed message
|
|
4
|
+
* scheduling.
|
|
5
|
+
*
|
|
6
|
+
* Design intent:
|
|
7
|
+
* - `common-utils` provides the contract plus one in-memory implementation
|
|
8
|
+
* - BFF/server runtimes may later plug Redis, Google, filesystem, or database
|
|
9
|
+
* adapters without changing `WalletMem`
|
|
10
|
+
* - mobile/native runtimes may plug SQLite-backed outbox adapters
|
|
11
|
+
*/
|
|
12
|
+
export interface IWalletQueue {
|
|
13
|
+
/**
|
|
14
|
+
* Enqueues one outbound message and returns the stored queued record.
|
|
15
|
+
*/
|
|
16
|
+
enqueue(input: WalletEnqueueMessageInput): Promise<WalletQueuedMessage>;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the next pending message according to queue ordering rules without
|
|
19
|
+
* mutating queue state.
|
|
20
|
+
*/
|
|
21
|
+
peekNextPending(): Promise<WalletQueuedMessage | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* Updates one queued message by identifier and returns the stored result.
|
|
24
|
+
*/
|
|
25
|
+
update(messageId: string, patch: Partial<WalletQueuedMessage>): Promise<WalletQueuedMessage>;
|
|
26
|
+
/**
|
|
27
|
+
* Lists all queued messages in current processing order.
|
|
28
|
+
*/
|
|
29
|
+
list(): Promise<WalletQueuedMessage[]>;
|
|
30
|
+
}
|