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.
Files changed (185) hide show
  1. package/README.md +18 -1
  2. package/dist/claims/claims-helpers-allergy-intolerance.d.ts +8 -0
  3. package/dist/claims/claims-helpers-allergy-intolerance.js +30 -12
  4. package/dist/claims/claims-helpers-condition.d.ts +8 -0
  5. package/dist/claims/claims-helpers-condition.js +30 -12
  6. package/dist/claims/claims-helpers-consent.d.ts +4 -0
  7. package/dist/claims/claims-helpers-consent.js +15 -1
  8. package/dist/claims/claims-helpers-diagnostic-report.d.ts +4 -0
  9. package/dist/claims/claims-helpers-diagnostic-report.js +17 -2
  10. package/dist/claims/claims-helpers-medication-statement.d.ts +10 -2
  11. package/dist/claims/claims-helpers-medication-statement.js +32 -14
  12. package/dist/constants/didcomm.d.ts +22 -0
  13. package/dist/constants/didcomm.js +22 -0
  14. package/dist/constants/fhir-resource-types.d.ts +2 -0
  15. package/dist/constants/fhir-resource-types.js +1 -0
  16. package/dist/constants/index.d.ts +1 -0
  17. package/dist/constants/index.js +1 -0
  18. package/dist/constants/lifecycle.d.ts +2 -0
  19. package/dist/constants/lifecycle.js +2 -0
  20. package/dist/constants/verifiable-credentials.d.ts +9 -0
  21. package/dist/constants/verifiable-credentials.js +9 -0
  22. package/dist/examples/bundle-didcomm-payload.d.ts +11 -0
  23. package/dist/examples/bundle-didcomm-payload.js +15 -0
  24. package/dist/examples/communication-attached-bundle-session.js +28 -27
  25. package/dist/examples/communication-didcomm-payload.d.ts +39 -0
  26. package/dist/examples/communication-didcomm-payload.js +44 -0
  27. package/dist/examples/consent-access.js +2 -1
  28. package/dist/examples/employee.d.ts +21 -0
  29. package/dist/examples/employee.js +21 -0
  30. package/dist/examples/index.d.ts +4 -0
  31. package/dist/examples/index.js +4 -0
  32. package/dist/examples/individual-controller.d.ts +27 -0
  33. package/dist/examples/individual-controller.js +28 -1
  34. package/dist/examples/inter-tenant-access-contract.js +3 -2
  35. package/dist/examples/ips-bundle.js +17 -16
  36. package/dist/examples/lifecycle.js +13 -11
  37. package/dist/examples/profile-manager-mem.d.ts +45 -0
  38. package/dist/examples/profile-manager-mem.js +30 -0
  39. package/dist/examples/related-person.d.ts +14 -0
  40. package/dist/examples/related-person.js +18 -4
  41. package/dist/examples/shared.d.ts +13 -3
  42. package/dist/examples/shared.js +14 -4
  43. package/dist/examples/vital-signs.js +1 -1
  44. package/dist/examples/wallet-mem.d.ts +38 -0
  45. package/dist/examples/wallet-mem.js +42 -0
  46. package/dist/index.d.ts +1 -0
  47. package/dist/index.js +1 -0
  48. package/dist/interfaces/IProfileOutboxRepository.d.ts +36 -0
  49. package/dist/interfaces/IProfileOutboxRepository.js +2 -0
  50. package/dist/interfaces/IWallet.d.ts +74 -0
  51. package/dist/interfaces/IWallet.js +2 -0
  52. package/dist/interfaces/IWalletQueue.d.ts +30 -0
  53. package/dist/interfaces/IWalletQueue.js +2 -0
  54. package/dist/interfaces/index.d.ts +8 -0
  55. package/dist/interfaces/index.js +8 -0
  56. package/dist/models/authority-resolution.d.ts +56 -0
  57. package/dist/models/authority-resolution.js +2 -0
  58. package/dist/models/bundle-editor-types.d.ts +89 -0
  59. package/dist/models/bundle-editor-types.js +45 -0
  60. package/dist/models/bundle.d.ts +5 -0
  61. package/dist/models/communication-attached-bundle-session.d.ts +195 -0
  62. package/dist/models/communication-attached-bundle-session.js +36 -0
  63. package/dist/models/confidential-storage.d.ts +2 -1
  64. package/dist/models/consent-rule.d.ts +11 -1
  65. package/dist/models/consent-rule.js +9 -1
  66. package/dist/models/index.d.ts +5 -0
  67. package/dist/models/index.js +5 -0
  68. package/dist/models/individual-onboarding.d.ts +18 -0
  69. package/dist/models/interoperable-claims/allergy-intolerance-claims.d.ts +12 -1
  70. package/dist/models/interoperable-claims/allergy-intolerance-claims.js +12 -1
  71. package/dist/models/interoperable-claims/condition-claims.d.ts +12 -1
  72. package/dist/models/interoperable-claims/condition-claims.js +12 -1
  73. package/dist/models/interoperable-claims/diagnostic-report-claims.d.ts +14 -4
  74. package/dist/models/interoperable-claims/diagnostic-report-claims.js +13 -3
  75. package/dist/models/interoperable-claims/document-reference-claims.d.ts +1 -0
  76. package/dist/models/interoperable-claims/document-reference-claims.js +3 -0
  77. package/dist/models/interoperable-claims/medication-statement-claims.d.ts +17 -0
  78. package/dist/models/interoperable-claims/medication-statement-claims.js +17 -0
  79. package/dist/models/profile-manager.d.ts +85 -0
  80. package/dist/models/profile-manager.js +2 -0
  81. package/dist/models/wallet.d.ts +59 -0
  82. package/dist/models/wallet.js +22 -0
  83. package/dist/utils/allergy-intolerance-entry-editor.d.ts +51 -0
  84. package/dist/utils/allergy-intolerance-entry-editor.js +55 -0
  85. package/dist/utils/authority-resolution.d.ts +37 -0
  86. package/dist/utils/authority-resolution.js +112 -0
  87. package/dist/utils/backend-message-manager-mem.d.ts +78 -0
  88. package/dist/utils/backend-message-manager-mem.js +238 -0
  89. package/dist/utils/bundle-didcomm-payload.d.ts +29 -0
  90. package/dist/utils/bundle-didcomm-payload.js +49 -0
  91. package/dist/utils/bundle-document-builder.d.ts +1 -0
  92. package/dist/utils/bundle-document-builder.js +134 -14
  93. package/dist/utils/bundle-editor-core.d.ts +181 -0
  94. package/dist/utils/bundle-editor-core.js +467 -0
  95. package/dist/utils/bundle-editor-helpers.d.ts +53 -0
  96. package/dist/utils/bundle-editor-helpers.js +146 -0
  97. package/dist/utils/bundle-editor-registry.d.ts +6 -0
  98. package/dist/utils/bundle-editor-registry.js +14 -0
  99. package/dist/utils/bundle-editor.d.ts +21 -722
  100. package/dist/utils/bundle-editor.js +21 -1601
  101. package/dist/utils/bundle-entry-editor.d.ts +96 -0
  102. package/dist/utils/bundle-entry-editor.js +305 -0
  103. package/dist/utils/bundle-query.d.ts +1 -0
  104. package/dist/utils/bundle-query.js +12 -3
  105. package/dist/utils/bundle-reader.d.ts +48 -0
  106. package/dist/utils/bundle-reader.js +175 -1
  107. package/dist/utils/care-plan-entry-editor.d.ts +43 -0
  108. package/dist/utils/care-plan-entry-editor.js +47 -0
  109. package/dist/utils/client-assertion.d.ts +38 -0
  110. package/dist/utils/client-assertion.js +113 -0
  111. package/dist/utils/clinical-impression-entry-editor.d.ts +43 -0
  112. package/dist/utils/clinical-impression-entry-editor.js +47 -0
  113. package/dist/utils/clinical-resource-entry-editor.d.ts +123 -0
  114. package/dist/utils/clinical-resource-entry-editor.js +296 -0
  115. package/dist/utils/communication-attached-bundle-session-helpers.d.ts +54 -0
  116. package/dist/utils/communication-attached-bundle-session-helpers.js +519 -0
  117. package/dist/utils/communication-attached-bundle-session.d.ts +87 -304
  118. package/dist/utils/communication-attached-bundle-session.js +175 -841
  119. package/dist/utils/communication-consent-access-editor.d.ts +85 -0
  120. package/dist/utils/communication-consent-access-editor.js +244 -0
  121. package/dist/utils/communication-didcomm-payload.d.ts +38 -0
  122. package/dist/utils/communication-didcomm-payload.js +85 -0
  123. package/dist/utils/communication-document-reference.d.ts +23 -0
  124. package/dist/utils/communication-document-reference.js +89 -0
  125. package/dist/utils/communication-editor.d.ts +53 -0
  126. package/dist/utils/communication-editor.js +97 -0
  127. package/dist/utils/condition-entry-editor.d.ts +30 -0
  128. package/dist/utils/condition-entry-editor.js +34 -0
  129. package/dist/utils/consent-claim-helpers.d.ts +4 -0
  130. package/dist/utils/consent-claim-helpers.js +15 -1
  131. package/dist/utils/coverage-entry-editor.d.ts +51 -0
  132. package/dist/utils/coverage-entry-editor.js +55 -0
  133. package/dist/utils/device-entry-editor.d.ts +59 -0
  134. package/dist/utils/device-entry-editor.js +63 -0
  135. package/dist/utils/device-use-statement-entry-editor.d.ts +43 -0
  136. package/dist/utils/device-use-statement-entry-editor.js +47 -0
  137. package/dist/utils/diagnostic-report-entry-editor.d.ts +74 -0
  138. package/dist/utils/diagnostic-report-entry-editor.js +136 -0
  139. package/dist/utils/did.d.ts +8 -0
  140. package/dist/utils/did.js +22 -0
  141. package/dist/utils/document-reference-entry-editor.d.ts +62 -0
  142. package/dist/utils/document-reference-entry-editor.js +66 -0
  143. package/dist/utils/employee-entry-editor.d.ts +36 -0
  144. package/dist/utils/employee-entry-editor.js +88 -0
  145. package/dist/utils/employee.d.ts +1 -0
  146. package/dist/utils/employee.js +2 -1
  147. package/dist/utils/encounter-entry-editor.d.ts +51 -0
  148. package/dist/utils/encounter-entry-editor.js +55 -0
  149. package/dist/utils/flag-entry-editor.d.ts +47 -0
  150. package/dist/utils/flag-entry-editor.js +51 -0
  151. package/dist/utils/immunization-entry-editor.d.ts +87 -0
  152. package/dist/utils/immunization-entry-editor.js +169 -0
  153. package/dist/utils/index.d.ts +15 -0
  154. package/dist/utils/index.js +15 -0
  155. package/dist/utils/individual-onboarding-acceptance-credential.d.ts +35 -0
  156. package/dist/utils/individual-onboarding-acceptance-credential.js +55 -0
  157. package/dist/utils/individual-smart.d.ts +59 -0
  158. package/dist/utils/individual-smart.js +135 -0
  159. package/dist/utils/medication-statement-entry-editor.d.ts +90 -0
  160. package/dist/utils/medication-statement-entry-editor.js +94 -0
  161. package/dist/utils/observation-component-entry-editor.d.ts +57 -0
  162. package/dist/utils/observation-component-entry-editor.js +105 -0
  163. package/dist/utils/observation-entry-editor.d.ts +29 -0
  164. package/dist/utils/observation-entry-editor.js +68 -0
  165. package/dist/utils/procedure-entry-editor.d.ts +71 -0
  166. package/dist/utils/procedure-entry-editor.js +75 -0
  167. package/dist/utils/professional-smart.d.ts +87 -0
  168. package/dist/utils/professional-smart.js +118 -4
  169. package/dist/utils/profile-manager-mem.d.ts +69 -0
  170. package/dist/utils/profile-manager-mem.js +79 -0
  171. package/dist/utils/profile-outbox-memory-repository.d.ts +34 -0
  172. package/dist/utils/profile-outbox-memory-repository.js +57 -0
  173. package/dist/utils/same-as.d.ts +40 -0
  174. package/dist/utils/same-as.js +72 -0
  175. package/dist/utils/unified-health-id.d.ts +51 -0
  176. package/dist/utils/unified-health-id.js +92 -0
  177. package/dist/utils/vital-sign-day-batch.d.ts +25 -0
  178. package/dist/utils/vital-sign-day-batch.js +115 -0
  179. package/dist/utils/vital-sign-entry-editor.d.ts +61 -0
  180. package/dist/utils/vital-sign-entry-editor.js +152 -0
  181. package/dist/utils/wallet-mem.d.ts +93 -0
  182. package/dist/utils/wallet-mem.js +277 -0
  183. package/dist/utils/wallet-memory-queue.d.ts +32 -0
  184. package/dist/utils/wallet-memory-queue.js +82 -0
  185. package/package.json +2 -1
@@ -6,7 +6,8 @@ import { CommunicationCategoryCodes } from '../constants/communication.js';
6
6
  import { DataspaceSectors } from '../constants/sectors.js';
7
7
  import { MedicationStatementClaim } from '../models/interoperable-claims/medication-statement-claims.js';
8
8
  import { EXAMPLE_COMMUNICATION_IDENTIFIER, EXAMPLE_CONSENT_DATE, EXAMPLE_CONSENT_IDENTIFIER, EXAMPLE_CONSENT_PERIOD_END, EXAMPLE_CONSENT_PERIOD_START, EXAMPLE_CONSENT_PURPOSE_TREATMENT, EXAMPLE_CONSENT_PURPOSE_EMERGENCY_TREATMENT, EXAMPLE_EMAIL_PROFESSIONAL, EXAMPLE_HEALTHCARE_ACTOR_ROLE_GENERALIST_MEDICAL_PRACTITIONER, EXAMPLE_HEALTHCARE_ACTOR_ROLE_PHYSICIAN, EXAMPLE_HEALTHCARE_JURISDICTION, EXAMPLE_IPS_BUNDLE_NOTE_TEXT, EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER, EXAMPLE_MEDICATION_STATEMENT_STATUS, EXAMPLE_MEDICATION_STATEMENT_TEXT, EXAMPLE_PROVIDER_ORGANIZATION_DID, EXAMPLE_SECONDARY_HEALTHCARE_JURISDICTION, EXAMPLE_SUBJECT_DID, } from './shared.js';
9
- import { CommunicationAttachedBundleSession, createConsentAccessEditor, } from '../utils/communication-attached-bundle-session.js';
9
+ import { CommunicationAttachedBundleSession, CommunicationClaimsContext, BundleEntryClaimsContext, } from '../utils/communication-attached-bundle-session.js';
10
+ import { createConsentAccessEditor, } from '../utils/communication-consent-access-editor.js';
10
11
  import { setCommunicationCategory, setCommunicationIdentifier, setCommunicationSubject, setCommunicationText, setCommunicationTopic, } from '../claims/claims-helpers-communication.js';
11
12
  import { setActorIdentifierList, setActorRoleList, setConsentDate, setConsentDecision, setConsentIdentifier, setConsentPeriodEnd, setConsentPeriodStart, setConsentSubject, setPurposeList, setSectionList, } from '../claims/claims-helpers-consent.js';
12
13
  import { setClaimValues } from '../claims/claim-list-helpers.js';
@@ -21,16 +22,16 @@ const CONSENT_BUNDLE_COMMUNICATION_TOPIC = HealthcareKindOfDocumentSections['LP1
21
22
  * - release active entry memory when finished
22
23
  */
23
24
  export function buildConsentEditingCommunicationSessionExample() {
24
- let communicationClaims = { '@context': 'org.hl7.fhir.r4' };
25
+ let communicationClaims = { '@context': CommunicationClaimsContext };
25
26
  communicationClaims = setCommunicationIdentifier(communicationClaims, EXAMPLE_COMMUNICATION_IDENTIFIER);
26
27
  communicationClaims = setCommunicationSubject(communicationClaims, EXAMPLE_SUBJECT_DID);
27
28
  communicationClaims = setCommunicationCategory(communicationClaims, CommunicationCategoryCodes.Notification.attributeValue);
28
29
  communicationClaims = setCommunicationTopic(communicationClaims, CONSENT_BUNDLE_COMMUNICATION_TOPIC);
29
30
  communicationClaims = setCommunicationText(communicationClaims, EXAMPLE_IPS_BUNDLE_NOTE_TEXT);
30
- const bundleEditor = new CommunicationAttachedBundleSession({
31
+ const consentBundleEditor = new CommunicationAttachedBundleSession({
31
32
  communicationClaims,
32
33
  });
33
- let consentClaims = { '@context': 'org.hl7.fhir.api' };
34
+ let consentClaims = { '@context': BundleEntryClaimsContext };
34
35
  consentClaims = setConsentDecision(consentClaims, ConsentDecisions.Permit);
35
36
  consentClaims = setConsentSubject(consentClaims, EXAMPLE_SUBJECT_DID);
36
37
  consentClaims = setConsentIdentifier(consentClaims, EXAMPLE_CONSENT_IDENTIFIER);
@@ -43,14 +44,14 @@ export function buildConsentEditingCommunicationSessionExample() {
43
44
  ]);
44
45
  consentClaims = setActorIdentifierList(consentClaims, [EXAMPLE_EMAIL_PROFESSIONAL]);
45
46
  consentClaims = setActorRoleList(consentClaims, [EXAMPLE_HEALTHCARE_ACTOR_ROLE_PHYSICIAN]);
46
- bundleEditor.upsertActiveConsentEntry({
47
+ consentBundleEditor.upsertActiveConsentEntry({
47
48
  claims: consentClaims,
48
49
  fullUrl: `urn:uuid:${EXAMPLE_CONSENT_IDENTIFIER}`,
49
50
  });
50
- bundleEditor.saveAndReleaseActiveEntry();
51
+ consentBundleEditor.saveAndReleaseActiveEntry();
51
52
  return {
52
- communicationClaims: bundleEditor.getCommunicationClaims(),
53
- bundleInMemory: bundleEditor.getBundleInMemory(),
53
+ communicationClaims: consentBundleEditor.getCommunicationClaims(),
54
+ bundleInMemory: consentBundleEditor.getBundleInMemory(),
54
55
  };
55
56
  }
56
57
  /**
@@ -60,17 +61,17 @@ export function buildConsentEditingCommunicationSessionExample() {
60
61
  * - apply save/release lifecycle consistently
61
62
  */
62
63
  export function buildMedicationEditingCommunicationSessionExample() {
63
- let communicationClaims = { '@context': 'org.hl7.fhir.r4' };
64
+ let communicationClaims = { '@context': CommunicationClaimsContext };
64
65
  communicationClaims = setCommunicationIdentifier(communicationClaims, EXAMPLE_COMMUNICATION_IDENTIFIER);
65
66
  communicationClaims = setCommunicationSubject(communicationClaims, EXAMPLE_SUBJECT_DID);
66
67
  communicationClaims = setCommunicationCategory(communicationClaims, CommunicationCategoryCodes.Reminder.attributeValue);
67
68
  communicationClaims = setCommunicationText(communicationClaims, EXAMPLE_IPS_BUNDLE_NOTE_TEXT);
68
- const bundleEditor = new CommunicationAttachedBundleSession({
69
+ const clinicalBundleEditor = new CommunicationAttachedBundleSession({
69
70
  communicationClaims,
70
71
  });
71
- bundleEditor.upsertActiveMedicationStatementEntry({
72
+ clinicalBundleEditor.upsertActiveMedicationStatementEntry({
72
73
  claims: {
73
- '@context': 'org.hl7.fhir.api',
74
+ '@context': BundleEntryClaimsContext,
74
75
  [MedicationStatementClaim.Identifier]: EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER,
75
76
  [MedicationStatementClaim.Subject]: EXAMPLE_SUBJECT_DID,
76
77
  [MedicationStatementClaim.Status]: EXAMPLE_MEDICATION_STATEMENT_STATUS,
@@ -78,10 +79,10 @@ export function buildMedicationEditingCommunicationSessionExample() {
78
79
  },
79
80
  fullUrl: `urn:uuid:${EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER}`,
80
81
  });
81
- bundleEditor.saveAndReleaseActiveEntry();
82
+ clinicalBundleEditor.saveAndReleaseActiveEntry();
82
83
  return {
83
- communicationClaims: bundleEditor.getCommunicationClaims(),
84
- bundleInMemory: bundleEditor.getBundleInMemory(),
84
+ communicationClaims: clinicalBundleEditor.getCommunicationClaims(),
85
+ bundleInMemory: clinicalBundleEditor.getBundleInMemory(),
85
86
  };
86
87
  }
87
88
  /**
@@ -93,7 +94,7 @@ export function buildMedicationEditingCommunicationSessionExample() {
93
94
  * the roundtrip keeps the same claims.
94
95
  */
95
96
  export function buildConsentPermissionTemplateImportExportSessionExample() {
96
- let communicationClaims = { '@context': 'org.hl7.fhir.r4' };
97
+ let communicationClaims = { '@context': CommunicationClaimsContext };
97
98
  communicationClaims = setCommunicationIdentifier(communicationClaims, EXAMPLE_COMMUNICATION_IDENTIFIER);
98
99
  communicationClaims = setCommunicationSubject(communicationClaims, EXAMPLE_SUBJECT_DID);
99
100
  communicationClaims = setCommunicationCategory(communicationClaims, CommunicationCategoryCodes.Notification.attributeValue);
@@ -127,7 +128,7 @@ export function buildConsentPermissionTemplateImportExportSessionExample() {
127
128
  ResourceTypesFhirR4.DocumentReference,
128
129
  ],
129
130
  };
130
- let consentClaims = { '@context': 'org.hl7.fhir.api' };
131
+ let consentClaims = { '@context': BundleEntryClaimsContext };
131
132
  consentClaims = setConsentDecision(consentClaims, templateDraft.decision);
132
133
  consentClaims = setConsentSubject(consentClaims, EXAMPLE_SUBJECT_DID);
133
134
  consentClaims = setConsentIdentifier(consentClaims, EXAMPLE_CONSENT_IDENTIFIER);
@@ -139,16 +140,16 @@ export function buildConsentPermissionTemplateImportExportSessionExample() {
139
140
  consentClaims = setActorRoleList(consentClaims, templateDraft.actorRoles);
140
141
  consentClaims = setSectionList(consentClaims, templateDraft.sections);
141
142
  consentClaims = setClaimValues(consentClaims, ClaimConsent.resourceType, templateDraft.resourceTypes);
142
- const bundleEditor = createConsentAccessEditor({
143
+ const consentBundleEditor = createConsentAccessEditor({
143
144
  communicationClaims,
144
145
  });
145
- bundleEditor.upsertActiveConsentEntry({
146
+ consentBundleEditor.upsertActiveConsentEntry({
146
147
  claims: consentClaims,
147
148
  fullUrl: `urn:uuid:${EXAMPLE_CONSENT_IDENTIFIER}`,
148
149
  });
149
- bundleEditor.saveAndReleaseActiveEntry();
150
+ consentBundleEditor.saveAndReleaseActiveEntry();
150
151
  const reloadedEditor = createConsentAccessEditor({
151
- communicationClaims: bundleEditor.getCommunicationClaims(),
152
+ communicationClaims: consentBundleEditor.getCommunicationClaims(),
152
153
  });
153
154
  reloadedEditor.selectActiveEntry({
154
155
  fullUrl: `urn:uuid:${EXAMPLE_CONSENT_IDENTIFIER}`,
@@ -171,7 +172,7 @@ export function buildConsentPermissionTemplateImportExportSessionExample() {
171
172
  * deterministic coverage and reusable fixtures.
172
173
  */
173
174
  export function buildSeparateConsentPermissionBundleExample() {
174
- let communicationClaims = { '@context': 'org.hl7.fhir.r4' };
175
+ let communicationClaims = { '@context': CommunicationClaimsContext };
175
176
  communicationClaims = setCommunicationIdentifier(communicationClaims, EXAMPLE_COMMUNICATION_IDENTIFIER);
176
177
  communicationClaims = setCommunicationSubject(communicationClaims, EXAMPLE_SUBJECT_DID);
177
178
  communicationClaims = setCommunicationCategory(communicationClaims, CommunicationCategoryCodes.Notification.attributeValue);
@@ -239,7 +240,7 @@ export function buildSeparateConsentPermissionBundleExample() {
239
240
  },
240
241
  ],
241
242
  });
242
- const bundleEditor = createConsentAccessEditor({
243
+ const consentBundleEditor = createConsentAccessEditor({
243
244
  communicationClaims,
244
245
  });
245
246
  const decisions = [
@@ -253,7 +254,7 @@ export function buildSeparateConsentPermissionBundleExample() {
253
254
  subject: EXAMPLE_SUBJECT_DID,
254
255
  fullUrl: `urn:uuid:${EXAMPLE_CONSENT_IDENTIFIER}-${index + 1}`,
255
256
  });
256
- bundleEditor.upsertActiveConsentEntry({
257
+ consentBundleEditor.upsertActiveConsentEntry({
257
258
  claims: {
258
259
  ...(consentEntry.resource?.meta?.claims || {}),
259
260
  },
@@ -261,10 +262,10 @@ export function buildSeparateConsentPermissionBundleExample() {
261
262
  type: consentEntry.type,
262
263
  });
263
264
  });
264
- bundleEditor.saveAndReleaseActiveEntry();
265
+ consentBundleEditor.saveAndReleaseActiveEntry();
265
266
  return {
266
267
  decisions,
267
- communicationClaims: bundleEditor.getCommunicationClaims(),
268
- bundleInMemory: bundleEditor.getBundleInMemory(),
268
+ communicationClaims: consentBundleEditor.getCommunicationClaims(),
269
+ bundleInMemory: consentBundleEditor.getBundleInMemory(),
269
270
  };
270
271
  }
@@ -0,0 +1,39 @@
1
+ import { AppointmentParticipantStatus, AppointmentStatus } from '../models/interoperable-claims/appointment-claims';
2
+ /**
3
+ * Shared synthetic DIDComm fixtures for Communication-attached bundle tests.
4
+ */
5
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_ISS: "did:web:portal.example.org";
6
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_AUD: "https://gateway.example.com/request";
7
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_JTI: "didcomm-communication-jti-001";
8
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_THID: "didcomm-communication-thread-001";
9
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_ENTRY_TYPE: "Communication-attached-bundle-v1.0";
10
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_TEXT: "IPS ingestion request";
11
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_ID: "urn:uuid:communication-example-001";
12
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_SUBJECT: string;
13
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_ATTACHMENT_CONTEXT: "org.hl7.fhir.api";
14
+ export declare const EXAMPLE_DIDCOMM_BUNDLE_ENTRY_CONTEXT: "org.hl7.fhir.api";
15
+ export declare const EXAMPLE_DIDCOMM_REPLY_AUD: "https://gateway.example.com/reply";
16
+ export declare const EXAMPLE_DIDCOMM_REPLY_JTI: "didcomm-communication-reply-jti-001";
17
+ export declare const EXAMPLE_DIDCOMM_REPLY_TYPE: "Communication-ack-v1.0";
18
+ export declare const EXAMPLE_DIDCOMM_REPLY_BODY_OK_KEY: "ok";
19
+ export declare const EXAMPLE_DIDCOMM_REPLY_BODY_RECEIVED_MEDICATION_IDENTIFIER_KEY: "receivedMedicationIdentifier";
20
+ export declare const EXAMPLE_DIDCOMM_REPLY_BODY_RECEIVED_DOCUMENT_IDENTIFIER_KEY: "receivedDocumentIdentifier";
21
+ export declare const EXAMPLE_DIDCOMM_ACK_TYPE: "Communication-ack-v1.0";
22
+ export declare const EXAMPLE_DIDCOMM_ACK_BODY_OK_KEY: "ok";
23
+ export declare const EXAMPLE_DIDCOMM_ACK_BODY_RECEIVED_MEDICATION_IDENTIFIER_KEY: "receivedMedicationIdentifier";
24
+ export declare const EXAMPLE_DIDCOMM_ACK_BODY_RECEIVED_DOCUMENT_IDENTIFIER_KEY: "receivedDocumentIdentifier";
25
+ export declare const EXAMPLE_APPOINTMENT_IDENTIFIER: "appointment-001";
26
+ export declare const EXAMPLE_APPOINTMENT_START: "2026-07-01T09:00:00Z";
27
+ export declare const EXAMPLE_APPOINTMENT_END: "2026-07-01T09:30:00Z";
28
+ export declare const EXAMPLE_APPOINTMENT_DESCRIPTION: "Medication follow-up visit.";
29
+ export declare const EXAMPLE_APPOINTMENT_PARTICIPANT_STATUS = AppointmentParticipantStatus.Accepted;
30
+ export declare const EXAMPLE_APPOINTMENT_CLAIMS: {
31
+ readonly '@context': "org.hl7.fhir.api";
32
+ readonly "Appointment.identifier": "appointment-001";
33
+ readonly "Appointment.status": AppointmentStatus.Booked;
34
+ readonly "Appointment.description": "Medication follow-up visit.";
35
+ readonly "Appointment.start": "2026-07-01T09:00:00Z";
36
+ readonly "Appointment.end": "2026-07-01T09:30:00Z";
37
+ readonly "Appointment.participant.actor": `${string},${string}`;
38
+ readonly "Appointment.participant.status": AppointmentParticipantStatus.Accepted;
39
+ };
@@ -0,0 +1,44 @@
1
+ // Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
+ import { DidcommAckBodyKeys, DidcommMessageTypes, } from '../constants/didcomm.js';
3
+ import { EXAMPLE_COMMUNICATION_IDENTIFIER, EXAMPLE_GATEWAY_PUBLIC_ORIGIN, EXAMPLE_IPS_BUNDLE_NOTE_TEXT, EXAMPLE_PROFESSIONAL_DID, EXAMPLE_SUBJECT_DID, } from './shared.js';
4
+ import { AppointmentClaim, AppointmentParticipantStatus, AppointmentStatus, } from '../models/interoperable-claims/appointment-claims.js';
5
+ import { BundleEntryClaimsContext, CommunicationClaimsContext, } from '../models/communication-attached-bundle-session.js';
6
+ import { CommunicationDidcommEntryTypes } from '../utils/communication-didcomm-payload.js';
7
+ /**
8
+ * Shared synthetic DIDComm fixtures for Communication-attached bundle tests.
9
+ */
10
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_ISS = 'did:web:portal.example.org';
11
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_AUD = `${EXAMPLE_GATEWAY_PUBLIC_ORIGIN}/request`;
12
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_JTI = 'didcomm-communication-jti-001';
13
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_THID = 'didcomm-communication-thread-001';
14
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_ENTRY_TYPE = CommunicationDidcommEntryTypes.AttachedBundle;
15
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_TEXT = EXAMPLE_IPS_BUNDLE_NOTE_TEXT;
16
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_ID = EXAMPLE_COMMUNICATION_IDENTIFIER;
17
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_SUBJECT = EXAMPLE_SUBJECT_DID;
18
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_ATTACHMENT_CONTEXT = CommunicationClaimsContext;
19
+ export const EXAMPLE_DIDCOMM_BUNDLE_ENTRY_CONTEXT = BundleEntryClaimsContext;
20
+ export const EXAMPLE_DIDCOMM_REPLY_AUD = `${EXAMPLE_GATEWAY_PUBLIC_ORIGIN}/reply`;
21
+ export const EXAMPLE_DIDCOMM_REPLY_JTI = 'didcomm-communication-reply-jti-001';
22
+ export const EXAMPLE_DIDCOMM_REPLY_TYPE = DidcommMessageTypes.CommunicationAck;
23
+ export const EXAMPLE_DIDCOMM_REPLY_BODY_OK_KEY = DidcommAckBodyKeys.Ok;
24
+ export const EXAMPLE_DIDCOMM_REPLY_BODY_RECEIVED_MEDICATION_IDENTIFIER_KEY = DidcommAckBodyKeys.ReceivedMedicationIdentifier;
25
+ export const EXAMPLE_DIDCOMM_REPLY_BODY_RECEIVED_DOCUMENT_IDENTIFIER_KEY = DidcommAckBodyKeys.ReceivedDocumentIdentifier;
26
+ export const EXAMPLE_DIDCOMM_ACK_TYPE = EXAMPLE_DIDCOMM_REPLY_TYPE;
27
+ export const EXAMPLE_DIDCOMM_ACK_BODY_OK_KEY = EXAMPLE_DIDCOMM_REPLY_BODY_OK_KEY;
28
+ export const EXAMPLE_DIDCOMM_ACK_BODY_RECEIVED_MEDICATION_IDENTIFIER_KEY = EXAMPLE_DIDCOMM_REPLY_BODY_RECEIVED_MEDICATION_IDENTIFIER_KEY;
29
+ export const EXAMPLE_DIDCOMM_ACK_BODY_RECEIVED_DOCUMENT_IDENTIFIER_KEY = EXAMPLE_DIDCOMM_REPLY_BODY_RECEIVED_DOCUMENT_IDENTIFIER_KEY;
30
+ export const EXAMPLE_APPOINTMENT_IDENTIFIER = 'appointment-001';
31
+ export const EXAMPLE_APPOINTMENT_START = '2026-07-01T09:00:00Z';
32
+ export const EXAMPLE_APPOINTMENT_END = '2026-07-01T09:30:00Z';
33
+ export const EXAMPLE_APPOINTMENT_DESCRIPTION = 'Medication follow-up visit.';
34
+ export const EXAMPLE_APPOINTMENT_PARTICIPANT_STATUS = AppointmentParticipantStatus.Accepted;
35
+ export const EXAMPLE_APPOINTMENT_CLAIMS = {
36
+ '@context': BundleEntryClaimsContext,
37
+ [AppointmentClaim.Identifier]: EXAMPLE_APPOINTMENT_IDENTIFIER,
38
+ [AppointmentClaim.Status]: AppointmentStatus.Booked,
39
+ [AppointmentClaim.Description]: EXAMPLE_APPOINTMENT_DESCRIPTION,
40
+ [AppointmentClaim.Start]: EXAMPLE_APPOINTMENT_START,
41
+ [AppointmentClaim.End]: EXAMPLE_APPOINTMENT_END,
42
+ [AppointmentClaim.ParticipantActor]: `${EXAMPLE_SUBJECT_DID},${EXAMPLE_PROFESSIONAL_DID}`,
43
+ [AppointmentClaim.ParticipantStatus]: EXAMPLE_APPOINTMENT_PARTICIPANT_STATUS,
44
+ };
@@ -1,6 +1,7 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
2
  import { HealthcareActorRoles, HealthcareBasicSections, HealthcareConsentPurposes, } from '../constants/healthcare.js';
3
3
  import { ClaimConsent } from '../models/consent-rule.js';
4
+ import { BundleEntryClaimsContext } from '../models/communication-attached-bundle-session.js';
4
5
  import { ResourceTypesFhirR4 } from '../constants/fhir-resource-types.js';
5
6
  import { EXAMPLE_CONSENT_DATE, EXAMPLE_CONSENT_PERIOD_END, EXAMPLE_EMAIL_PROFESSIONAL, EXAMPLE_EMAIL_RELATED_PERSON, EXAMPLE_HEALTHCARE_JURISDICTION, EXAMPLE_PROVIDER_ORGANIZATION_DID, EXAMPLE_RELATED_PERSON_ROLE, EXAMPLE_SUBJECT_DID, } from './shared.js';
6
7
  export const EXAMPLE_INDIVIDUAL_DID_WEB = EXAMPLE_SUBJECT_DID;
@@ -25,7 +26,7 @@ export const EXAMPLE_CONSENT_ACCESS_RELATED_PERSON_EMAIL = EXAMPLE_EMAIL_RELATED
25
26
  */
26
27
  function buildRule(input) {
27
28
  return {
28
- '@context': 'org.hl7.fhir.api',
29
+ '@context': BundleEntryClaimsContext,
29
30
  [ClaimConsent.identifier]: input.identifier,
30
31
  [ClaimConsent.subject]: EXAMPLE_INDIVIDUAL_DID_WEB,
31
32
  [ClaimConsent.actorIdentifier]: input.actorIdentifier,
@@ -20,6 +20,12 @@ export type ExampleEmployeeRecord = Readonly<{
20
20
  export declare const ExampleEmployeeEmails: Readonly<{
21
21
  readonly SharedProfessional: "shared.professional@example.org";
22
22
  }>;
23
+ export declare const ExampleEmployeeTelephones: Readonly<{
24
+ readonly SharedProfessional: "+34 600 111 222";
25
+ }>;
26
+ export declare const ExampleEmployeeCredentialMaterials: Readonly<{
27
+ readonly SharedProfessionalSigningKid: "did:key:z6Mkt2p7vKov6R6By7QjFv2F5x8f4H9g2m3c4n5p6q7r8s9t#z6Mkt2p7vKov6R6By7QjFv2F5x8f4H9g2m3c4n5p6q7r8s9t";
28
+ }>;
23
29
  export declare const ExampleEmployeeRoles: Readonly<{
24
30
  readonly Controller: "ISCO-08|1120";
25
31
  readonly Doctor: "ISCO-08|2211";
@@ -46,6 +52,21 @@ export declare const EXAMPLE_EMPLOYEE_DIRECTORY_RECORDS: readonly [Readonly<{
46
52
  role: string;
47
53
  status: "active" | "inactive" | "purged";
48
54
  }>];
55
+ /**
56
+ * Canonical professional identity fixture reused by SMART/OpenID4VP tests and
57
+ * SDK facade helpers.
58
+ *
59
+ * The public continuity alias is intentionally the employee email; phone is
60
+ * kept separate so callers can hash/project it into
61
+ * `org.schema.Person.telephone` without overloading `sameAs`.
62
+ */
63
+ export declare const EXAMPLE_PROFESSIONAL_IDENTITY: Readonly<{
64
+ readonly actorDid: string;
65
+ readonly role: string;
66
+ readonly email: string;
67
+ readonly telephone: "+34 600 111 222";
68
+ readonly credentialMaterial: "did:key:z6Mkt2p7vKov6R6By7QjFv2F5x8f4H9g2m3c4n5p6q7r8s9t#z6Mkt2p7vKov6R6By7QjFv2F5x8f4H9g2m3c4n5p6q7r8s9t";
69
+ }>;
49
70
  export declare function buildExampleEmployeeClaims(record: ExampleEmployeeRecord): Readonly<Record<string, string>>;
50
71
  /**
51
72
  * Canonical employee search/list response body reused by runtime and doc tests.
@@ -2,6 +2,12 @@ import { ClaimsPersonSchemaorg } from '../constants/schemaorg.js';
2
2
  export const ExampleEmployeeEmails = Object.freeze({
3
3
  SharedProfessional: 'shared.professional@example.org',
4
4
  });
5
+ export const ExampleEmployeeTelephones = Object.freeze({
6
+ SharedProfessional: '+34 600 111 222',
7
+ });
8
+ export const ExampleEmployeeCredentialMaterials = Object.freeze({
9
+ SharedProfessionalSigningKid: 'did:key:z6Mkt2p7vKov6R6By7QjFv2F5x8f4H9g2m3c4n5p6q7r8s9t#z6Mkt2p7vKov6R6By7QjFv2F5x8f4H9g2m3c4n5p6q7r8s9t',
10
+ });
5
11
  export const ExampleEmployeeRoles = Object.freeze({
6
12
  Controller: 'ISCO-08|1120',
7
13
  Doctor: 'ISCO-08|2211',
@@ -32,6 +38,21 @@ export const EXAMPLE_EMPLOYEE_DIRECTORY_RECORDS = Object.freeze([
32
38
  EXAMPLE_EMPLOYEE_DOCTOR_ACTIVE,
33
39
  EXAMPLE_EMPLOYEE_DOCTOR_PURGED_HISTORICAL,
34
40
  ]);
41
+ /**
42
+ * Canonical professional identity fixture reused by SMART/OpenID4VP tests and
43
+ * SDK facade helpers.
44
+ *
45
+ * The public continuity alias is intentionally the employee email; phone is
46
+ * kept separate so callers can hash/project it into
47
+ * `org.schema.Person.telephone` without overloading `sameAs`.
48
+ */
49
+ export const EXAMPLE_PROFESSIONAL_IDENTITY = Object.freeze({
50
+ actorDid: EXAMPLE_EMPLOYEE_DOCTOR_ACTIVE.identifier,
51
+ role: EXAMPLE_EMPLOYEE_DOCTOR_ACTIVE.role,
52
+ email: EXAMPLE_EMPLOYEE_DOCTOR_ACTIVE.email,
53
+ telephone: ExampleEmployeeTelephones.SharedProfessional,
54
+ credentialMaterial: ExampleEmployeeCredentialMaterials.SharedProfessionalSigningKid,
55
+ });
35
56
  export function buildExampleEmployeeClaims(record) {
36
57
  return Object.freeze({
37
58
  '@context': 'org.schema',
@@ -20,6 +20,10 @@ export * from './lifecycle';
20
20
  export * from './api-flow-examples';
21
21
  export * from './contract-examples';
22
22
  export * from './communication-attached-bundle-session';
23
+ export * from './bundle-didcomm-payload';
23
24
  export * from './communication-bundle-document-request';
25
+ export * from './communication-didcomm-payload';
24
26
  export * from './ips-bundle';
25
27
  export * from './vital-signs';
28
+ export * from './wallet-mem';
29
+ export * from './profile-manager-mem';
@@ -20,6 +20,10 @@ export * from './lifecycle.js';
20
20
  export * from './api-flow-examples.js';
21
21
  export * from './contract-examples.js';
22
22
  export * from './communication-attached-bundle-session.js';
23
+ export * from './bundle-didcomm-payload.js';
23
24
  export * from './communication-bundle-document-request.js';
25
+ export * from './communication-didcomm-payload.js';
24
26
  export * from './ips-bundle.js';
25
27
  export * from './vital-signs.js';
28
+ export * from './wallet-mem.js';
29
+ export * from './profile-manager-mem.js';
@@ -52,6 +52,33 @@ export declare const EXAMPLE_INDIVIDUAL_ORGANIZATION_ORDER_RESPONSE: {
52
52
  readonly attempts: 1;
53
53
  };
54
54
  };
55
+ export declare const EXAMPLE_INDIVIDUAL_CONTROLLER_IDENTITY: Readonly<{
56
+ readonly actorDid: "did:web:people.acme.org:controllers:primary";
57
+ readonly subjectDid: string;
58
+ readonly relationship: "v3-RoleCode|RESPRSN";
59
+ readonly authorityBasis: "parental-authority";
60
+ readonly email: "ana.parent@example.org";
61
+ readonly telephone: "+34000000001";
62
+ readonly credentialMaterial: "did:web:people.acme.org:controllers:primary#signing-key-1";
63
+ readonly evidence: readonly [{
64
+ readonly type: readonly ["DocumentVerification"];
65
+ readonly evidenceDocument: "LibroDeFamilia";
66
+ readonly verifier: "did:web:kyc.example.org";
67
+ }];
68
+ }>;
69
+ export declare const EXAMPLE_INDIVIDUAL_SUBJECT_IDENTITY: Readonly<{
70
+ readonly subjectDid: string;
71
+ readonly sameAs: "mailto:subject.guardian.record@example.org";
72
+ readonly telephone: "+34000000001";
73
+ readonly evidence: readonly [{
74
+ readonly type: readonly ["DocumentVerification"];
75
+ readonly evidenceDocument: "DNI";
76
+ readonly verifier: "did:web:kyc.example.org";
77
+ }];
78
+ readonly additionalCredentialSubject: {
79
+ readonly alternateName: "Ana";
80
+ };
81
+ }>;
55
82
  export declare const EXAMPLE_CONSENT_GRANT_INPUT: {
56
83
  readonly actor: "did:web:practitioner.example,ES";
57
84
  readonly actorRole: "physician";
@@ -1,5 +1,5 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- import { EXAMPLE_API_ORGANIZATION_DID, EXAMPLE_CLINICAL_CODE_PROBLEM, EXAMPLE_CLINICAL_DATE_RANGE, EXAMPLE_CLINICAL_SECTION_ALLERGIES, EXAMPLE_CLINICAL_SECTION_PATIENT_SUMMARY, EXAMPLE_CONSENT_PURPOSE_TREATMENT, EXAMPLE_EMAIL_CONTROLLER_INDIVIDUAL, EXAMPLE_GENERIC_SUBJECT_DID, EXAMPLE_HEALTHCARE_ACTOR_ROLE_PHYSICIAN, EXAMPLE_HEALTHCARE_JURISDICTION, EXAMPLE_HEALTHCARE_ROLE_PHYSICIAN_TEXT, EXAMPLE_PRACTITIONER_DID, EXAMPLE_PROFESSIONAL_DID, EXAMPLE_SUBJECT_DID, } from './shared.js';
2
+ import { EXAMPLE_CONTROLLER_DID, EXAMPLE_API_ORGANIZATION_DID, EXAMPLE_CLINICAL_CODE_PROBLEM, EXAMPLE_CLINICAL_DATE_RANGE, EXAMPLE_CLINICAL_SECTION_ALLERGIES, EXAMPLE_CLINICAL_SECTION_PATIENT_SUMMARY, EXAMPLE_CONSENT_PURPOSE_TREATMENT, EXAMPLE_EMAIL_CONTROLLER_INDIVIDUAL, EXAMPLE_GENERIC_SUBJECT_DID, EXAMPLE_HEALTHCARE_ACTOR_ROLE_PHYSICIAN, EXAMPLE_HEALTHCARE_JURISDICTION, EXAMPLE_HEALTHCARE_ROLE_PHYSICIAN_TEXT, EXAMPLE_PRACTITIONER_DID, EXAMPLE_PROFESSIONAL_DID, EXAMPLE_SUBJECT_DID, EXAMPLE_FORM_CONTROLLER_PHONE, } from './shared.js';
3
3
  export const EXAMPLE_INDIVIDUAL_ORGANIZATION_START_INPUT = {
4
4
  alternateName: 'ana',
5
5
  controllerEmail: EXAMPLE_EMAIL_CONTROLLER_INDIVIDUAL,
@@ -21,6 +21,33 @@ export const EXAMPLE_INDIVIDUAL_ORGANIZATION_ORDER_RESPONSE = {
21
21
  submit: { status: 202, body: {} },
22
22
  poll: { status: 200, body: {}, attempts: 1 },
23
23
  };
24
+ export const EXAMPLE_INDIVIDUAL_CONTROLLER_IDENTITY = Object.freeze({
25
+ actorDid: EXAMPLE_CONTROLLER_DID,
26
+ subjectDid: EXAMPLE_SUBJECT_DID,
27
+ relationship: 'v3-RoleCode|RESPRSN',
28
+ authorityBasis: 'parental-authority',
29
+ email: EXAMPLE_EMAIL_CONTROLLER_INDIVIDUAL,
30
+ telephone: EXAMPLE_FORM_CONTROLLER_PHONE,
31
+ credentialMaterial: `${EXAMPLE_CONTROLLER_DID}#signing-key-1`,
32
+ evidence: [{
33
+ type: ['DocumentVerification'],
34
+ evidenceDocument: 'LibroDeFamilia',
35
+ verifier: 'did:web:kyc.example.org',
36
+ }],
37
+ });
38
+ export const EXAMPLE_INDIVIDUAL_SUBJECT_IDENTITY = Object.freeze({
39
+ subjectDid: EXAMPLE_SUBJECT_DID,
40
+ sameAs: 'mailto:subject.guardian.record@example.org',
41
+ telephone: EXAMPLE_FORM_CONTROLLER_PHONE,
42
+ evidence: [{
43
+ type: ['DocumentVerification'],
44
+ evidenceDocument: 'DNI',
45
+ verifier: 'did:web:kyc.example.org',
46
+ }],
47
+ additionalCredentialSubject: {
48
+ alternateName: 'Ana',
49
+ },
50
+ });
24
51
  export const EXAMPLE_CONSENT_GRANT_INPUT = {
25
52
  actor: `${EXAMPLE_PRACTITIONER_DID},${EXAMPLE_HEALTHCARE_JURISDICTION}`,
26
53
  actorRole: EXAMPLE_HEALTHCARE_ROLE_PHYSICIAN_TEXT,
@@ -3,6 +3,7 @@ import { ServiceCapability } from '../constants/service-capabilities.js';
3
3
  import { DataspaceSectors } from '../constants/sectors.js';
4
4
  import { ClaimConsent } from '../models/consent-rule.js';
5
5
  import { ClaimInterTenantAccessContract } from '../models/inter-tenant-access-contract.js';
6
+ import { BundleEntryClaimsContext } from '../models/communication-attached-bundle-session.js';
6
7
  import { buildInterTenantAccessContractCredential, buildInterTenantAccessContractResource, getInterTenantAccessContractBlockchainReference, } from '../utils/inter-tenant-access-contract.js';
7
8
  import { buildMemberAuthorizationUrn, buildOrganizationAuthorizationUrn, } from '../utils/organization-authorization-urn.js';
8
9
  import { EXAMPLE_API_ORGANIZATION_DID, EXAMPLE_CONTROLLER_DID, EXAMPLE_HEALTHCARE_ACTOR_ROLE_PHYSICIAN, EXAMPLE_JURISDICTION, EXAMPLE_RESEARCH_API_ORGANIZATION_DID, EXAMPLE_RESEARCH_CONTROLLER_DID, EXAMPLE_RESEARCH_TENANT_IDENTIFIER, EXAMPLE_SECTOR, EXAMPLE_TENANT_IDENTIFIER, } from './shared.js';
@@ -105,7 +106,7 @@ export const EXAMPLE_INTER_TENANT_ACCESS_CONTRACT_CONTEXT_WITH_URNS = Object.fre
105
106
  * reference that was or will be anchored on-chain
106
107
  */
107
108
  export const EXAMPLE_INTER_TENANT_EMPLOYEE_CONTRACT_AUTHORIZATION_CONSENT = Object.freeze({
108
- '@context': 'org.hl7.fhir.api',
109
+ '@context': BundleEntryClaimsContext,
109
110
  [ClaimConsent.identifier]: 'urn:uuid:employee-contract-authorization-001',
110
111
  [ClaimConsent.subject]: EXAMPLE_INTER_TENANT_ACCESS_CONTRACT_CONSUMER_ORGANIZATION_URN,
111
112
  [ClaimConsent.actorIdentifier]: EXAMPLE_INTER_TENANT_ACCESS_CONTRACT_CONSUMER_MEMBER_URN,
@@ -119,7 +120,7 @@ export const EXAMPLE_INTER_TENANT_EMPLOYEE_CONTRACT_AUTHORIZATION_CONSENT = Obje
119
120
  [ClaimConsent.periodEnd]: EXAMPLE_INTER_TENANT_ACCESS_CONTRACT_VALID_UNTIL,
120
121
  });
121
122
  export const EXAMPLE_INTER_TENANT_PROVIDER_CONTRACT_AUTHORIZATION_CONSENT = Object.freeze({
122
- '@context': 'org.hl7.fhir.api',
123
+ '@context': BundleEntryClaimsContext,
123
124
  [ClaimConsent.identifier]: 'urn:uuid:provider-contract-authorization-001',
124
125
  [ClaimConsent.subject]: EXAMPLE_INTER_TENANT_ACCESS_CONTRACT_PROVIDER_ORGANIZATION_URN,
125
126
  [ClaimConsent.actorIdentifier]: EXAMPLE_INTER_TENANT_ACCESS_CONTRACT_CONSUMER_ORGANIZATION_URN,
@@ -6,6 +6,7 @@ import { AllergyIntoleranceClaim } from '../models/interoperable-claims/allergy-
6
6
  import { CommunicationClaim } from '../models/interoperable-claims/communication-claims.js';
7
7
  import { ConditionClaim } from '../models/interoperable-claims/condition-claims.js';
8
8
  import { MedicationStatementClaim } from '../models/interoperable-claims/medication-statement-claims.js';
9
+ import { BundleEntryClaimsContext, CommunicationClaimsContext, } from '../models/communication-attached-bundle-session.js';
9
10
  import { EXAMPLE_COMMUNICATION_IDENTIFIER, EXAMPLE_DOCUMENT_REFERENCE_CONTENT_TYPE_PDF, EXAMPLE_DOCUMENT_REFERENCE_DATE, EXAMPLE_DOCUMENT_REFERENCE_DESCRIPTION, EXAMPLE_DOCUMENT_REFERENCE_IDENTIFIER, EXAMPLE_DOCUMENT_REFERENCE_URL, EXAMPLE_IPS_BUNDLE_NOTE_TEXT, EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER, EXAMPLE_MEDICATION_STATEMENT_STATUS, EXAMPLE_MEDICATION_STATEMENT_TEXT, EXAMPLE_SUBJECT_DID, } from './shared.js';
10
11
  import { toClinicalResourceCardViews, toClinicalResourceCommonViews, } from '../utils/clinical-resource-view.js';
11
12
  import { CommunicationAttachedBundleSession } from '../utils/communication-attached-bundle-session.js';
@@ -14,18 +15,18 @@ import { CommunicationAttachedBundleSession } from '../utils/communication-attac
14
15
  * authored as `resource.meta.claims`.
15
16
  */
16
17
  export function buildIpsClinicalHistoryBundleExample() {
17
- const bundleEditor = new CommunicationAttachedBundleSession({
18
+ const clinicalBundleEditor = new CommunicationAttachedBundleSession({
18
19
  communicationClaims: {
19
- '@context': 'org.hl7.fhir.r4',
20
+ '@context': CommunicationClaimsContext,
20
21
  [CommunicationClaim.Identifier]: EXAMPLE_COMMUNICATION_IDENTIFIER,
21
22
  [CommunicationClaim.Subject]: EXAMPLE_SUBJECT_DID,
22
23
  [CommunicationClaim.Category]: CommunicationCategoryCodes.Notification.claim,
23
24
  [CommunicationClaim.Text]: EXAMPLE_IPS_BUNDLE_NOTE_TEXT,
24
25
  },
25
26
  });
26
- bundleEditor.upsertActiveAllergyIntoleranceEntry({
27
+ clinicalBundleEditor.upsertActiveAllergyIntoleranceEntry({
27
28
  claims: {
28
- '@context': 'org.hl7.fhir.api',
29
+ '@context': BundleEntryClaimsContext,
29
30
  [AllergyIntoleranceClaim.Identifier]: 'allergy-1',
30
31
  [AllergyIntoleranceClaim.Subject]: EXAMPLE_SUBJECT_DID,
31
32
  [AllergyIntoleranceClaim.Code]: 'http://snomed.info/sct|227493005',
@@ -37,9 +38,9 @@ export function buildIpsClinicalHistoryBundleExample() {
37
38
  },
38
39
  fullUrl: 'urn:uuid:allergy-1',
39
40
  });
40
- bundleEditor.upsertActiveConditionEntry({
41
+ clinicalBundleEditor.upsertActiveConditionEntry({
41
42
  claims: {
42
- '@context': 'org.hl7.fhir.api',
43
+ '@context': BundleEntryClaimsContext,
43
44
  [ConditionClaim.Identifier]: 'condition-1',
44
45
  [ConditionClaim.Subject]: EXAMPLE_SUBJECT_DID,
45
46
  [ConditionClaim.Code]: 'http://snomed.info/sct|44054006',
@@ -51,9 +52,9 @@ export function buildIpsClinicalHistoryBundleExample() {
51
52
  },
52
53
  fullUrl: 'urn:uuid:condition-1',
53
54
  });
54
- bundleEditor.upsertActiveMedicationStatementEntry({
55
+ clinicalBundleEditor.upsertActiveMedicationStatementEntry({
55
56
  claims: {
56
- '@context': 'org.hl7.fhir.api',
57
+ '@context': BundleEntryClaimsContext,
57
58
  [MedicationStatementClaim.Identifier]: EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER,
58
59
  [MedicationStatementClaim.Subject]: EXAMPLE_SUBJECT_DID,
59
60
  [MedicationStatementClaim.Category]: HealthcareBasicSections.HistoryOfMedicationUse.attributeValue,
@@ -63,17 +64,17 @@ export function buildIpsClinicalHistoryBundleExample() {
63
64
  },
64
65
  fullUrl: `urn:uuid:${EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER}`,
65
66
  });
66
- bundleEditor.addContainedDocumentToActiveEntry({
67
+ clinicalBundleEditor.addContainedDocumentToActiveEntry({
67
68
  identifier: EXAMPLE_DOCUMENT_REFERENCE_IDENTIFIER,
68
69
  attachmentContentType: EXAMPLE_DOCUMENT_REFERENCE_CONTENT_TYPE_PDF,
69
70
  attachmentUrl: EXAMPLE_DOCUMENT_REFERENCE_URL,
70
71
  description: EXAMPLE_DOCUMENT_REFERENCE_DESCRIPTION,
71
72
  date: EXAMPLE_DOCUMENT_REFERENCE_DATE,
72
73
  });
73
- bundleEditor.saveAndReleaseActiveEntry();
74
+ clinicalBundleEditor.saveAndReleaseActiveEntry();
74
75
  return {
75
- communicationClaims: bundleEditor.getCommunicationClaims(),
76
- bundleInMemory: bundleEditor.getBundleInMemory(),
76
+ communicationClaims: clinicalBundleEditor.getCommunicationClaims(),
77
+ bundleInMemory: clinicalBundleEditor.getBundleInMemory(),
77
78
  };
78
79
  }
79
80
  /**
@@ -82,22 +83,22 @@ export function buildIpsClinicalHistoryBundleExample() {
82
83
  */
83
84
  export function buildIpsBundleFrontCardsExample() {
84
85
  const { communicationClaims, bundleInMemory } = buildIpsClinicalHistoryBundleExample();
85
- const bundleEditor = new CommunicationAttachedBundleSession({
86
+ const clinicalBundleEditor = new CommunicationAttachedBundleSession({
86
87
  communicationClaims,
87
88
  initialBundle: bundleInMemory,
88
89
  });
89
90
  return {
90
91
  communicationClaims,
91
92
  bundleInMemory,
92
- medicationEntryIds: bundleEditor.getResourceIds({
93
+ medicationEntryIds: clinicalBundleEditor.getResourceIds({
93
94
  sections: [HealthcareBasicSections.HistoryOfMedicationUse.attributeValue],
94
95
  resourceTypes: [ResourceTypesFhirR4.MedicationStatement],
95
96
  }),
96
- allergyEntryIds: bundleEditor.getResourceIds({
97
+ allergyEntryIds: clinicalBundleEditor.getResourceIds({
97
98
  sections: [HealthcareBasicSections.AllergiesAndIntolerances.attributeValue],
98
99
  resourceTypes: [ResourceTypesFhirR4.AllergyIntolerance],
99
100
  }),
100
- conditionEntryIds: bundleEditor.getResourceIds({
101
+ conditionEntryIds: clinicalBundleEditor.getResourceIds({
101
102
  sections: [HealthcareBasicSections.ProblemList.attributeValue],
102
103
  resourceTypes: [ResourceTypesFhirR4.Condition],
103
104
  }),