gdc-common-utils-ts 2.1.0 → 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 -0
- 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.js +4 -2
- package/dist/examples/communication-attached-bundle-session.js +27 -27
- package/dist/examples/communication-didcomm-payload.d.ts +8 -4
- package/dist/examples/communication-didcomm-payload.js +17 -11
- 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/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.js +2 -1
- package/dist/examples/related-person.d.ts +14 -0
- package/dist/examples/related-person.js +18 -4
- package/dist/examples/shared.d.ts +12 -3
- package/dist/examples/shared.js +13 -4
- package/dist/examples/vital-signs.js +1 -1
- package/dist/examples/wallet-mem.js +4 -2
- 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 +6 -4
- package/dist/models/communication-attached-bundle-session.js +6 -4
- 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 +2 -0
- package/dist/models/index.js +2 -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 +13 -2
- package/dist/models/interoperable-claims/diagnostic-report-claims.js +12 -1
- 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/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 +11 -0
- package/dist/utils/backend-message-manager-mem.js +11 -0
- package/dist/utils/bundle-didcomm-payload.js +3 -2
- 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.js +8 -6
- package/dist/utils/communication-attached-bundle-session.d.ts +29 -3
- package/dist/utils/communication-attached-bundle-session.js +62 -3
- package/dist/utils/communication-didcomm-payload.d.ts +5 -0
- package/dist/utils/communication-didcomm-payload.js +28 -18
- 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 +7 -0
- package/dist/utils/index.js +7 -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/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/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,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
|
+
import { DidcommMessageTypes } from '../constants/didcomm.js';
|
|
2
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';
|
|
3
4
|
/**
|
|
4
5
|
* Shared synthetic fixtures for low-level profile/message-manager tests.
|
|
@@ -9,7 +10,7 @@ export const EXAMPLE_PROFILE_MANAGER_MEM_DID = 'did:web:portal.example.org';
|
|
|
9
10
|
export const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DID = 'did:web:gw.example.org';
|
|
10
11
|
export const EXAMPLE_PROFILE_MANAGER_MEM_DISPLAY_NAME = 'Portal BFF Profile';
|
|
11
12
|
export const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DISPLAY_NAME = 'GW Proxy Profile';
|
|
12
|
-
export const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_TYPE =
|
|
13
|
+
export const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_TYPE = DidcommMessageTypes.CommunicationResponse;
|
|
13
14
|
export const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_NOTE = 'Gateway acknowledged the queued communication.';
|
|
14
15
|
export const EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_REPLY_AUD = 'https://portal.example.org/reply';
|
|
15
16
|
export const EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_INBOX_AUD = 'https://portal.example.org/inbox';
|
|
@@ -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";
|
|
@@ -607,7 +615,7 @@ export declare function buildExampleCommunicationIngestionPayload({ subjectDid,
|
|
|
607
615
|
export declare function buildExampleDocumentReferenceSearchPayload(subjectDid?: string): {
|
|
608
616
|
thid: string;
|
|
609
617
|
body: {
|
|
610
|
-
resourceType:
|
|
618
|
+
resourceType: "Bundle";
|
|
611
619
|
type: string;
|
|
612
620
|
entry: {
|
|
613
621
|
request: {
|
|
@@ -623,8 +631,9 @@ export declare function buildExampleLiveMedicationCases(seed?: number): ExampleL
|
|
|
623
631
|
* Builds a minimal IPS `Bundle.type=document` containing one
|
|
624
632
|
* `MedicationStatement` under the `History of medication use` section.
|
|
625
633
|
*
|
|
626
|
-
* This
|
|
627
|
-
*
|
|
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.
|
|
628
637
|
*/
|
|
629
638
|
export declare function buildExampleMedicationIpsDocumentBundle(input: ExampleMedicationIpsDocumentBundleInput): ExampleMedicationIpsDocumentBundle;
|
|
630
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';
|
|
@@ -590,7 +598,7 @@ export function buildExampleDocumentReferenceSearchPayload(subjectDid = EXAMPLE_
|
|
|
590
598
|
return {
|
|
591
599
|
thid: 'search-documentreference-example',
|
|
592
600
|
body: {
|
|
593
|
-
resourceType:
|
|
601
|
+
resourceType: ResourceTypesFhirR4.Bundle,
|
|
594
602
|
type: 'batch',
|
|
595
603
|
entry: [
|
|
596
604
|
{
|
|
@@ -640,8 +648,9 @@ export function buildExampleLiveMedicationCases(seed = Date.now()) {
|
|
|
640
648
|
* Builds a minimal IPS `Bundle.type=document` containing one
|
|
641
649
|
* `MedicationStatement` under the `History of medication use` section.
|
|
642
650
|
*
|
|
643
|
-
* This
|
|
644
|
-
*
|
|
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.
|
|
645
654
|
*/
|
|
646
655
|
export function buildExampleMedicationIpsDocumentBundle(input) {
|
|
647
656
|
const subjectDid = input.subjectDid || EXAMPLE_SUBJECT_DID;
|
|
@@ -702,7 +711,7 @@ export function buildExampleMedicationIpsDocumentBundle(input) {
|
|
|
702
711
|
},
|
|
703
712
|
{
|
|
704
713
|
resource: {
|
|
705
|
-
resourceType:
|
|
714
|
+
resourceType: ResourceTypesFhirR4.Patient,
|
|
706
715
|
id: `patient-${input.medication.identifier}`,
|
|
707
716
|
},
|
|
708
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),
|
|
@@ -1,4 +1,6 @@
|
|
|
1
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';
|
|
2
4
|
import { WalletMessagePriorities } from '../models/wallet.js';
|
|
3
5
|
/**
|
|
4
6
|
* Reusable synthetic wallet fixtures for docs and tests.
|
|
@@ -12,7 +14,7 @@ export const EXAMPLE_WALLET_ENTITY_ID_RECIPIENT = 'wallet-entity-recipient-001';
|
|
|
12
14
|
export const EXAMPLE_WALLET_MESSAGE_ID_EMERGENCY = 'wallet-message-emergency-001';
|
|
13
15
|
export const EXAMPLE_WALLET_MESSAGE_ID_NORMAL = 'wallet-message-normal-001';
|
|
14
16
|
export const EXAMPLE_WALLET_THREAD_ID = 'wallet-thread-001';
|
|
15
|
-
export const EXAMPLE_WALLET_PAYLOAD_TYPE =
|
|
17
|
+
export const EXAMPLE_WALLET_PAYLOAD_TYPE = DidcommMessageTypes.CommunicationBundleSubmit;
|
|
16
18
|
export const EXAMPLE_WALLET_CREATED_AT = '2026-06-30T10:00:00.000Z';
|
|
17
19
|
export const EXAMPLE_WALLET_CONTENT_NOTE = 'Medication bundle ready for DIDComm transport.';
|
|
18
20
|
export const EXAMPLE_WALLET_FAILURE_MESSAGE = 'Gateway temporary failure.';
|
|
@@ -31,7 +33,7 @@ export const EXAMPLE_WALLET_MESSAGE_PAYLOAD = {
|
|
|
31
33
|
id: 'wallet-entry-001',
|
|
32
34
|
type: EXAMPLE_WALLET_PAYLOAD_TYPE,
|
|
33
35
|
resource: {
|
|
34
|
-
resourceType:
|
|
36
|
+
resourceType: ResourceTypesFhirR4.Communication,
|
|
35
37
|
note: [{ text: EXAMPLE_WALLET_CONTENT_NOTE }],
|
|
36
38
|
},
|
|
37
39
|
},
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export type AuthorityResolutionSource = 'catalog' | 'metadata' | 'cache' | 'legacy';
|
|
2
|
+
export type AuthorityResolutionMatch = 'tenant-context' | 'subject-did' | 'subject-same-as' | 'authority-did' | 'authority-base-url';
|
|
3
|
+
/**
|
|
4
|
+
* Runtime-neutral request shape used to resolve which authority/host is
|
|
5
|
+
* responsible for one tenant or subject identifier.
|
|
6
|
+
*
|
|
7
|
+
* Design rule:
|
|
8
|
+
* - business callers should prefer `tenantId + jurisdiction + sector`
|
|
9
|
+
* - callers may additionally provide `subjectDid` or `subjectSameAs` when that
|
|
10
|
+
* is the only identifier already known
|
|
11
|
+
* - `authorityDidWeb` and `authorityBaseUrl` are optional technical hints, not
|
|
12
|
+
* the preferred business inputs
|
|
13
|
+
*/
|
|
14
|
+
export type AuthorityResolutionInput = Readonly<{
|
|
15
|
+
tenantId?: string;
|
|
16
|
+
jurisdiction?: string;
|
|
17
|
+
sector?: string;
|
|
18
|
+
version?: string;
|
|
19
|
+
subjectDid?: string;
|
|
20
|
+
subjectSameAs?: string;
|
|
21
|
+
authorityDidWeb?: string;
|
|
22
|
+
authorityBaseUrl?: string;
|
|
23
|
+
metadataUrl?: string;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* One published or preloaded authority catalog entry.
|
|
27
|
+
*
|
|
28
|
+
* The current minimal contract is intentionally small:
|
|
29
|
+
* - enough to route to one host/ICA quickly
|
|
30
|
+
* - enough to derive the hosted tenant DID when tenant context is known
|
|
31
|
+
* - enough to match by public subject alias prefixes in future registries
|
|
32
|
+
*/
|
|
33
|
+
export type AuthorityCatalogRecord = Readonly<{
|
|
34
|
+
authorityDidWeb: string;
|
|
35
|
+
authorityBaseUrl?: string;
|
|
36
|
+
tenantDidWeb?: string;
|
|
37
|
+
tenantId?: string;
|
|
38
|
+
jurisdiction?: string;
|
|
39
|
+
version?: string;
|
|
40
|
+
sector?: string;
|
|
41
|
+
metadataUrl?: string;
|
|
42
|
+
subjectDidPrefixes?: readonly string[];
|
|
43
|
+
subjectSameAsPrefixes?: readonly string[];
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Normalized authority resolution output returned by shared discovery helpers.
|
|
47
|
+
*/
|
|
48
|
+
export type AuthorityResolution = Readonly<{
|
|
49
|
+
authorityDidWeb: string;
|
|
50
|
+
authorityBaseUrl?: string;
|
|
51
|
+
tenantDidWeb?: string;
|
|
52
|
+
metadataUrl?: string;
|
|
53
|
+
source: AuthorityResolutionSource;
|
|
54
|
+
matchedBy: AuthorityResolutionMatch;
|
|
55
|
+
record?: AuthorityCatalogRecord;
|
|
56
|
+
}>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type BundleEntry, type BundleJsonApi, type BundleRequest } from './bundle';
|
|
2
|
+
import { EmployeeBundleOperations, type EmployeeClaims } from '../utils/employee';
|
|
3
|
+
import type { BundleEntryEditor } from '../utils/bundle-entry-editor';
|
|
4
|
+
import type { EmployeeEntryEditor } from '../utils/employee-entry-editor';
|
|
5
|
+
import type { VitalSignEntryEditor } from '../utils/vital-sign-entry-editor';
|
|
6
|
+
import type { ObservationEntryEditor } from '../utils/observation-entry-editor';
|
|
7
|
+
import type { AllergyIntoleranceEntryEditor } from '../utils/allergy-intolerance-entry-editor';
|
|
8
|
+
import type { ConditionEntryEditor } from '../utils/condition-entry-editor';
|
|
9
|
+
import type { MedicationStatementEntryEditor } from '../utils/medication-statement-entry-editor';
|
|
10
|
+
import type { DocumentReferenceEntryEditor } from '../utils/document-reference-entry-editor';
|
|
11
|
+
import type { CarePlanEntryEditor } from '../utils/care-plan-entry-editor';
|
|
12
|
+
import type { FlagEntryEditor } from '../utils/flag-entry-editor';
|
|
13
|
+
import type { ClinicalImpressionEntryEditor } from '../utils/clinical-impression-entry-editor';
|
|
14
|
+
import type { DeviceEntryEditor } from '../utils/device-entry-editor';
|
|
15
|
+
import type { DeviceUseStatementEntryEditor } from '../utils/device-use-statement-entry-editor';
|
|
16
|
+
import type { EncounterEntryEditor } from '../utils/encounter-entry-editor';
|
|
17
|
+
import type { CoverageEntryEditor } from '../utils/coverage-entry-editor';
|
|
18
|
+
import type { ImmunizationEntryEditor } from '../utils/immunization-entry-editor';
|
|
19
|
+
import type { ProcedureEntryEditor } from '../utils/procedure-entry-editor';
|
|
20
|
+
import type { DiagnosticReportEntryEditor } from '../utils/diagnostic-report-entry-editor';
|
|
21
|
+
export type BundleOperation = (typeof EmployeeBundleOperations)[keyof typeof EmployeeBundleOperations];
|
|
22
|
+
/** Resource types that the shared bundle editors currently know how to open as typed entry editors. */
|
|
23
|
+
export declare const BundleEditableResourceTypes: Readonly<{
|
|
24
|
+
readonly employee: "Employee";
|
|
25
|
+
readonly consent: "Consent";
|
|
26
|
+
readonly observation: "Observation";
|
|
27
|
+
readonly vitalSign: "Observation";
|
|
28
|
+
readonly allergyIntolerance: "AllergyIntolerance";
|
|
29
|
+
readonly condition: "Condition";
|
|
30
|
+
readonly medicationStatement: "MedicationStatement";
|
|
31
|
+
readonly documentReference: "DocumentReference";
|
|
32
|
+
readonly carePlan: "CarePlan";
|
|
33
|
+
readonly flag: "Flag";
|
|
34
|
+
readonly clinicalImpression: "ClinicalImpression";
|
|
35
|
+
readonly device: "Device";
|
|
36
|
+
readonly deviceUseStatement: "DeviceUseStatement";
|
|
37
|
+
readonly encounter: "Encounter";
|
|
38
|
+
readonly coverage: "Coverage";
|
|
39
|
+
readonly immunization: "Immunization";
|
|
40
|
+
readonly procedure: "Procedure";
|
|
41
|
+
readonly diagnosticReport: "DiagnosticReport";
|
|
42
|
+
}>;
|
|
43
|
+
export type AllowedResourceType = string;
|
|
44
|
+
/** Mutable staged entry shape kept inside `BundleEditor` before final materialization. */
|
|
45
|
+
export type BuiltBundleEntry = {
|
|
46
|
+
type: string;
|
|
47
|
+
request: {
|
|
48
|
+
method: BundleRequest['method'];
|
|
49
|
+
url?: string;
|
|
50
|
+
};
|
|
51
|
+
resource: {
|
|
52
|
+
resourceType: string;
|
|
53
|
+
id?: string;
|
|
54
|
+
meta: {
|
|
55
|
+
claims: EmployeeClaims;
|
|
56
|
+
};
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
};
|
|
59
|
+
fullUrl?: string;
|
|
60
|
+
};
|
|
61
|
+
export declare const BundleTypes: Readonly<{
|
|
62
|
+
readonly batch: "batch";
|
|
63
|
+
readonly document: "document";
|
|
64
|
+
readonly collection: "collection";
|
|
65
|
+
readonly transaction: "transaction";
|
|
66
|
+
}>;
|
|
67
|
+
export type BundleType = (typeof BundleTypes)[keyof typeof BundleTypes];
|
|
68
|
+
/** Canonical validation issues returned by `BundleEditor.validateDocumentAuthoring()`. */
|
|
69
|
+
export declare const BundleEditorValidationIssues: Readonly<{
|
|
70
|
+
readonly DocumentModeRequired: "BundleEditor must be in document mode before document validation.";
|
|
71
|
+
readonly CompositionSubjectRequired: "Composition.subject is required before document transport.";
|
|
72
|
+
readonly CompositionTypeRequired: "Composition.type is required before document transport.";
|
|
73
|
+
readonly CompositionTitleRequired: "Composition.title is required before document transport.";
|
|
74
|
+
readonly CompositionDateRequired: "Composition.date is required before document transport.";
|
|
75
|
+
readonly CompositionAuthorRequired: "Composition.author is required before document transport.";
|
|
76
|
+
readonly DocumentEntryRequired: "Bundle.document requires at least one staged resource entry.";
|
|
77
|
+
}>;
|
|
78
|
+
export type BundleEditorValidationIssue = typeof BundleEditorValidationIssues[keyof typeof BundleEditorValidationIssues];
|
|
79
|
+
/** Convenience alias for the in-memory JSON-API-like bundle shape returned by `buildJsonApi()`. */
|
|
80
|
+
export type BundleJsonApiShape = BundleJsonApi<BundleEntry>;
|
|
81
|
+
/**
|
|
82
|
+
* Type-level mapping from `BundleEditableResourceTypes.*` to the concrete
|
|
83
|
+
* editor class returned by `newEntryAs(...)` / `newContainedResourceAs(...)`.
|
|
84
|
+
*
|
|
85
|
+
* This exists so callers get the correct chainable editor surface from the
|
|
86
|
+
* resource type they requested, instead of falling back to the generic
|
|
87
|
+
* `BundleEntryEditor` API.
|
|
88
|
+
*/
|
|
89
|
+
export type ResourceTypeEntryEditor<T extends AllowedResourceType> = T extends typeof BundleEditableResourceTypes.employee ? EmployeeEntryEditor : T extends typeof BundleEditableResourceTypes.vitalSign ? VitalSignEntryEditor : T extends typeof BundleEditableResourceTypes.observation ? ObservationEntryEditor : T extends typeof BundleEditableResourceTypes.allergyIntolerance ? AllergyIntoleranceEntryEditor : T extends typeof BundleEditableResourceTypes.condition ? ConditionEntryEditor : T extends typeof BundleEditableResourceTypes.medicationStatement ? MedicationStatementEntryEditor : T extends typeof BundleEditableResourceTypes.documentReference ? DocumentReferenceEntryEditor : T extends typeof BundleEditableResourceTypes.carePlan ? CarePlanEntryEditor : T extends typeof BundleEditableResourceTypes.flag ? FlagEntryEditor : T extends typeof BundleEditableResourceTypes.clinicalImpression ? ClinicalImpressionEntryEditor : T extends typeof BundleEditableResourceTypes.device ? DeviceEntryEditor : T extends typeof BundleEditableResourceTypes.deviceUseStatement ? DeviceUseStatementEntryEditor : T extends typeof BundleEditableResourceTypes.encounter ? EncounterEntryEditor : T extends typeof BundleEditableResourceTypes.coverage ? CoverageEntryEditor : T extends typeof BundleEditableResourceTypes.immunization ? ImmunizationEntryEditor : T extends typeof BundleEditableResourceTypes.procedure ? ProcedureEntryEditor : T extends typeof BundleEditableResourceTypes.diagnosticReport ? DiagnosticReportEntryEditor : BundleEntryEditor;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File discipline note:
|
|
3
|
+
* - Read `ARCHITECTURE.md` and `CONTRIBUTING.md` before changing this module.
|
|
4
|
+
* - This file owns only exported bundle-editor types and constants.
|
|
5
|
+
* - Do not move helper implementations or class logic here.
|
|
6
|
+
*/
|
|
7
|
+
import { ResourceTypesFhirR4 } from '../constants/fhir-resource-types.js';
|
|
8
|
+
import { EmployeeResourceTypes, } from '../utils/employee.js';
|
|
9
|
+
/** Resource types that the shared bundle editors currently know how to open as typed entry editors. */
|
|
10
|
+
export const BundleEditableResourceTypes = Object.freeze({
|
|
11
|
+
employee: EmployeeResourceTypes.employee,
|
|
12
|
+
consent: ResourceTypesFhirR4.Consent,
|
|
13
|
+
observation: ResourceTypesFhirR4.Observation,
|
|
14
|
+
vitalSign: ResourceTypesFhirR4.Observation,
|
|
15
|
+
allergyIntolerance: ResourceTypesFhirR4.AllergyIntolerance,
|
|
16
|
+
condition: ResourceTypesFhirR4.Condition,
|
|
17
|
+
medicationStatement: ResourceTypesFhirR4.MedicationStatement,
|
|
18
|
+
documentReference: ResourceTypesFhirR4.DocumentReference,
|
|
19
|
+
carePlan: ResourceTypesFhirR4.CarePlan,
|
|
20
|
+
flag: ResourceTypesFhirR4.Flag,
|
|
21
|
+
clinicalImpression: ResourceTypesFhirR4.ClinicalImpression,
|
|
22
|
+
device: ResourceTypesFhirR4.Device,
|
|
23
|
+
deviceUseStatement: ResourceTypesFhirR4.DeviceUseStatement,
|
|
24
|
+
encounter: ResourceTypesFhirR4.Encounter,
|
|
25
|
+
coverage: ResourceTypesFhirR4.Coverage,
|
|
26
|
+
immunization: ResourceTypesFhirR4.Immunization,
|
|
27
|
+
procedure: ResourceTypesFhirR4.Procedure,
|
|
28
|
+
diagnosticReport: ResourceTypesFhirR4.DiagnosticReport,
|
|
29
|
+
});
|
|
30
|
+
export const BundleTypes = Object.freeze({
|
|
31
|
+
batch: 'batch',
|
|
32
|
+
document: 'document',
|
|
33
|
+
collection: 'collection',
|
|
34
|
+
transaction: 'transaction',
|
|
35
|
+
});
|
|
36
|
+
/** Canonical validation issues returned by `BundleEditor.validateDocumentAuthoring()`. */
|
|
37
|
+
export const BundleEditorValidationIssues = Object.freeze({
|
|
38
|
+
DocumentModeRequired: 'BundleEditor must be in document mode before document validation.',
|
|
39
|
+
CompositionSubjectRequired: 'Composition.subject is required before document transport.',
|
|
40
|
+
CompositionTypeRequired: 'Composition.type is required before document transport.',
|
|
41
|
+
CompositionTitleRequired: 'Composition.title is required before document transport.',
|
|
42
|
+
CompositionDateRequired: 'Composition.date is required before document transport.',
|
|
43
|
+
CompositionAuthorRequired: 'Composition.author is required before document transport.',
|
|
44
|
+
DocumentEntryRequired: 'Bundle.document requires at least one staged resource entry.',
|
|
45
|
+
});
|
package/dist/models/bundle.d.ts
CHANGED
|
@@ -176,6 +176,11 @@ export type BundleEntry = {
|
|
|
176
176
|
* const responseBundle: BundleJsonApi<BundleEntry | ErrorEntry> = { ... };
|
|
177
177
|
*/
|
|
178
178
|
export interface BundleJsonApi<T = BundleEntry | ErrorEntry> {
|
|
179
|
+
id?: string;
|
|
180
|
+
meta?: {
|
|
181
|
+
claims?: Record<string, any>;
|
|
182
|
+
[key: string]: any;
|
|
183
|
+
};
|
|
179
184
|
data: T[];
|
|
180
185
|
resourceType: 'Bundle';
|
|
181
186
|
total?: number;
|
|
@@ -16,11 +16,13 @@ export type CommunicationAttachedBundleSessionOptions = Readonly<{
|
|
|
16
16
|
* Canonical `@context` for outer `Communication` claim payloads.
|
|
17
17
|
*
|
|
18
18
|
* Rationale:
|
|
19
|
-
* -
|
|
20
|
-
* -
|
|
21
|
-
*
|
|
19
|
+
* - this value belongs to canonical claims, not to `resource.resourceType`
|
|
20
|
+
* - `resource.resourceType = Communication` may later be projected as FHIR R4
|
|
21
|
+
* - but `resource.meta.claims['@context']` should stay version-agnostic
|
|
22
22
|
*/
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const CommunicationClaimsContext: "org.hl7.fhir.api";
|
|
24
|
+
/** @deprecated Prefer `CommunicationClaimsContext`. */
|
|
25
|
+
export declare const CommunicationAttachmentClaimsContext: "org.hl7.fhir.api";
|
|
24
26
|
/**
|
|
25
27
|
* Canonical `@context` for bundle entry `resource.meta.claims`.
|
|
26
28
|
*
|
|
@@ -4,11 +4,13 @@ import { Format } from '../constants/Schemas.js';
|
|
|
4
4
|
* Canonical `@context` for outer `Communication` claim payloads.
|
|
5
5
|
*
|
|
6
6
|
* Rationale:
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
*
|
|
7
|
+
* - this value belongs to canonical claims, not to `resource.resourceType`
|
|
8
|
+
* - `resource.resourceType = Communication` may later be projected as FHIR R4
|
|
9
|
+
* - but `resource.meta.claims['@context']` should stay version-agnostic
|
|
10
10
|
*/
|
|
11
|
-
export const
|
|
11
|
+
export const CommunicationClaimsContext = Format.FHIR_API;
|
|
12
|
+
/** @deprecated Prefer `CommunicationClaimsContext`. */
|
|
13
|
+
export const CommunicationAttachmentClaimsContext = CommunicationClaimsContext;
|
|
12
14
|
/**
|
|
13
15
|
* Canonical `@context` for bundle entry `resource.meta.claims`.
|
|
14
16
|
*
|
|
@@ -134,6 +134,7 @@ export interface ConfidentialBlobInfo {
|
|
|
134
134
|
contentType?: string;
|
|
135
135
|
}
|
|
136
136
|
export interface ConfidentialStorageDoc {
|
|
137
|
+
/** Vault primary key for the persisted confidential record. Keep this as an opaque technical id; HMAC is reserved for indexed attributes, not for the document key itself. */
|
|
137
138
|
id: string;
|
|
138
139
|
status: string;
|
|
139
140
|
/**
|
|
@@ -149,7 +150,7 @@ export interface ConfidentialStorageDoc {
|
|
|
149
150
|
chunks?: number;
|
|
150
151
|
/** A number that MUST be incremented each time the document is updated. */
|
|
151
152
|
sequence: number;
|
|
152
|
-
/** Contains an array of indexed attributes protected with HMAC for blind queries. */
|
|
153
|
+
/** Contains an array of indexed attributes protected with HMAC for blind queries. This is the place for blind-search protection, not `id`. */
|
|
153
154
|
indexed?: IndexedData;
|
|
154
155
|
/** The main, potentially encrypted, content of the document. */
|
|
155
156
|
content?: Record<string, any>;
|
|
@@ -16,9 +16,17 @@ export declare enum ClaimConsent {
|
|
|
16
16
|
'identifier' = "Consent.identifier",
|
|
17
17
|
'eventBasedOn' = "Consent.event-basedon",
|
|
18
18
|
'sourceReference' = "Consent.source-reference",
|
|
19
|
+
'containedReferenceList' = "Consent.contained-reference-list",
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use `containedReferenceList`.
|
|
22
|
+
*/
|
|
23
|
+
'containedResourceList' = "Consent.contained-resource-list",
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use `containedReferenceList`.
|
|
26
|
+
*/
|
|
19
27
|
'containedDocuments' = "Consent.contained-documents",
|
|
20
28
|
/**
|
|
21
|
-
* @deprecated Use `
|
|
29
|
+
* @deprecated Use `containedReferenceList`.
|
|
22
30
|
*/
|
|
23
31
|
'attachmentContentIds' = "Consent.attachment-content-ids",
|
|
24
32
|
'attachmentContentType' = "Consent.attachment-contenttype",
|
|
@@ -128,6 +136,8 @@ export interface ConsentRule {
|
|
|
128
136
|
* Derived from the `org.hl7.fhir.api.Consent.identifier` claim.
|
|
129
137
|
*/
|
|
130
138
|
'Consent.identifier': string;
|
|
139
|
+
'Consent.contained-reference-list'?: string;
|
|
140
|
+
'Consent.contained-resource-list'?: string;
|
|
131
141
|
'Consent.contained-documents'?: string;
|
|
132
142
|
'Consent.attachment-content-ids'?: string;
|
|
133
143
|
'Consent.attachment-contenttype'?: string;
|