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
@@ -0,0 +1,97 @@
1
+ // Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
+ import { CommunicationClaimsContext, } from '../models/communication-attached-bundle-session.js';
3
+ import { BundleReader } from './bundle-reader.js';
4
+ import { CommunicationAttachedBundleSession } from './communication-attached-bundle-session.js';
5
+ import { getCommunicationClaimsListFromDidcommPayload, getFirstCommunicationClaimsFromDidcommPayload, } from './communication-didcomm-payload.js';
6
+ import { CommunicationClaim } from '../models/interoperable-claims/communication-claims.js';
7
+ /**
8
+ * Public high-level editor for one delivery `Communication`.
9
+ *
10
+ * Teaching contract:
11
+ * - use this name in tutorials when the caller is authoring one outer
12
+ * `Communication`
13
+ * - keep `CommunicationAttachedBundleSession` as the lower-level compatibility
14
+ * implementation detail underneath
15
+ */
16
+ export class CommunicationEditor extends CommunicationAttachedBundleSession {
17
+ constructor(options = {}) {
18
+ super({
19
+ ...options,
20
+ communicationClaims: {
21
+ '@context': CommunicationClaimsContext,
22
+ ...(options.communicationClaims || {}),
23
+ },
24
+ });
25
+ }
26
+ /** Materializes one immutable snapshot of the current Communication claims. */
27
+ done() {
28
+ return this.getCommunicationClaims();
29
+ }
30
+ /** Returns one reader over the current Communication snapshot. */
31
+ toReader() {
32
+ return new CommunicationReader(this.getCommunicationClaims());
33
+ }
34
+ }
35
+ /**
36
+ * Public high-level reader for one delivery `Communication`.
37
+ */
38
+ export class CommunicationReader {
39
+ session;
40
+ constructor(communicationClaims) {
41
+ this.session = new CommunicationAttachedBundleSession({ communicationClaims });
42
+ }
43
+ /** Reads the first delivery `Communication` carried in one DIDComm/plain payload. */
44
+ static fromDidcommPayload(payload) {
45
+ return new CommunicationReader(getFirstCommunicationClaimsFromDidcommPayload(payload));
46
+ }
47
+ /** Reads every delivery `Communication` carried in one DIDComm/plain payload. */
48
+ static listFromDidcommPayload(payload) {
49
+ return getCommunicationClaimsListFromDidcommPayload(payload)
50
+ .map((communicationClaims) => new CommunicationReader(communicationClaims));
51
+ }
52
+ getCommunicationClaims() {
53
+ return this.session.getCommunicationClaims();
54
+ }
55
+ getCommunicationIdentifier() {
56
+ return this.session.getCommunicationIdentifier();
57
+ }
58
+ getCommunicationSubject() {
59
+ return this.session.getCommunicationSubject();
60
+ }
61
+ getCommunicationCategoryList() {
62
+ return this.session.getCommunicationCategoryList();
63
+ }
64
+ getCommunicationTopic() {
65
+ return this.session.getCommunicationTopic();
66
+ }
67
+ getCommunicationText() {
68
+ return this.session.getCommunicationText();
69
+ }
70
+ getAttachmentContentType() {
71
+ return String(this.getCommunicationClaims()[CommunicationClaim.ContentAttachmentType] || '').trim();
72
+ }
73
+ getAttachmentTitle() {
74
+ return String(this.getCommunicationClaims()[CommunicationClaim.ContentAttachmentTitle] || '').trim();
75
+ }
76
+ getAttachmentUrl() {
77
+ return String(this.getCommunicationClaims()[CommunicationClaim.ContentAttachmentUrl] || '').trim();
78
+ }
79
+ getAttachmentDataBase64() {
80
+ return String(this.getCommunicationClaims()[CommunicationClaim.ContentAttachmentData] || '').trim();
81
+ }
82
+ getAttachedBundle() {
83
+ return this.session.getAttachedBundle();
84
+ }
85
+ getAttachedBundleReader() {
86
+ return new BundleReader(this.getAttachedBundle());
87
+ }
88
+ getAttachedBundleResourceIds(filters = {}) {
89
+ return this.getAttachedBundleReader().getResourceIds(filters);
90
+ }
91
+ getAttachedBundleEntriesByIds(resourceIds) {
92
+ return this.getAttachedBundleReader().getEntriesByIds(resourceIds);
93
+ }
94
+ getAttachedBundleEntryUrl(resourceId) {
95
+ return this.getAttachedBundleReader().getEntryUrl(resourceId);
96
+ }
97
+ }
@@ -0,0 +1,30 @@
1
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor';
2
+ /**
3
+ * Typed editor for one staged Condition resource entry.
4
+ *
5
+ * Use this when a caller needs to stage one condition row with claims-first
6
+ * accessors in a bundle authoring flow.
7
+ */
8
+ export declare class ConditionEntryEditor extends ClinicalResourceEntryEditor {
9
+ setIdentifier(identifier?: string | null): this;
10
+ getIdentifier(): string | undefined;
11
+ ensureIdentifier(): string;
12
+ setSubject(subject?: string | null): this;
13
+ getSubject(): string | undefined;
14
+ setCode(code?: string | null): this;
15
+ getCode(): string | undefined;
16
+ setClinicalStatus(status?: string | null): this;
17
+ getClinicalStatus(): string | undefined;
18
+ setVerificationStatus(status?: string | null): this;
19
+ getVerificationStatus(): string | undefined;
20
+ setCategory(category?: string | null): this;
21
+ getCategory(): string | undefined;
22
+ setSeverity(severity?: string | null): this;
23
+ getSeverity(): string | undefined;
24
+ setOnsetDateTime(value?: string | null): this;
25
+ getOnsetDateTime(): string | undefined;
26
+ setRecorder(reference?: string | null): this;
27
+ getRecorder(): string | undefined;
28
+ setContainedDocumentIdentifierList(identifiers: readonly string[]): this;
29
+ getContainedDocumentIdentifierList(): string[];
30
+ }
@@ -0,0 +1,34 @@
1
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor.js';
2
+ import { ConditionClaim } from '../models/interoperable-claims/condition-claims.js';
3
+ import { BundleEditableResourceTypes } from '../models/bundle-editor-types.js';
4
+ import { registerBundleEntryEditor } from './bundle-editor-registry.js';
5
+ /**
6
+ * Typed editor for one staged Condition resource entry.
7
+ *
8
+ * Use this when a caller needs to stage one condition row with claims-first
9
+ * accessors in a bundle authoring flow.
10
+ */
11
+ export class ConditionEntryEditor extends ClinicalResourceEntryEditor {
12
+ setIdentifier(identifier) { return this.setIdentifierValue(ConditionClaim.Identifier, identifier); }
13
+ getIdentifier() { return this.getIdentifierValue(ConditionClaim.Identifier); }
14
+ ensureIdentifier() { return this.ensureIdentifierValue(ConditionClaim.Identifier); }
15
+ setSubject(subject) { return this.setSubjectClaims(ConditionClaim.Subject, ConditionClaim.Subject, subject); }
16
+ getSubject() { return this.getSubjectClaims(ConditionClaim.Subject, ConditionClaim.Subject); }
17
+ setCode(code) { return this.setScalarClaim(ConditionClaim.Code, code); }
18
+ getCode() { return this.getScalarClaim(ConditionClaim.Code); }
19
+ setClinicalStatus(status) { return this.setScalarClaim(ConditionClaim.ClinicalStatus, status); }
20
+ getClinicalStatus() { return this.getScalarClaim(ConditionClaim.ClinicalStatus); }
21
+ setVerificationStatus(status) { return this.setScalarClaim(ConditionClaim.VerificationStatus, status); }
22
+ getVerificationStatus() { return this.getScalarClaim(ConditionClaim.VerificationStatus); }
23
+ setCategory(category) { return this.setScalarClaim(ConditionClaim.Category, category); }
24
+ getCategory() { return this.getScalarClaim(ConditionClaim.Category); }
25
+ setSeverity(severity) { return this.setScalarClaim(ConditionClaim.Severity, severity); }
26
+ getSeverity() { return this.getScalarClaim(ConditionClaim.Severity); }
27
+ setOnsetDateTime(value) { return this.setScalarClaim(ConditionClaim.OnsetDateTime, value); }
28
+ getOnsetDateTime() { return this.getScalarClaim(ConditionClaim.OnsetDateTime); }
29
+ setRecorder(reference) { return this.setScalarClaim(ConditionClaim.Recorder, reference); }
30
+ getRecorder() { return this.getScalarClaim(ConditionClaim.Recorder); }
31
+ setContainedDocumentIdentifierList(identifiers) { return this.setCsvClaimList(ConditionClaim.ContainedDocuments, identifiers); }
32
+ getContainedDocumentIdentifierList() { return this.getCsvClaimList(ConditionClaim.ContainedDocuments); }
33
+ }
34
+ registerBundleEntryEditor(BundleEditableResourceTypes.condition, ConditionEntryEditor);
@@ -77,9 +77,13 @@ export declare function removeSectors(claims: InteroperableClaims, values: strin
77
77
  * Returns linked DocumentReference identifiers carried by the consent.
78
78
  */
79
79
  export declare function getContainedDocumentIdentifierList(claims: InteroperableClaims): string[];
80
+ export declare function getContainedResourceReferenceList(claims: InteroperableClaims): string[];
80
81
  export declare function setContainedDocumentIdentifierList(claims: InteroperableClaims, values: string | readonly string[]): InteroperableClaims;
82
+ export declare function setContainedResourceReferenceList(claims: InteroperableClaims, values: string | readonly string[]): InteroperableClaims;
81
83
  export declare function addContainedDocumentIdentifierList(claims: InteroperableClaims, values: string | readonly string[]): InteroperableClaims;
82
84
  export declare function removeContainedDocumentIdentifierList(claims: InteroperableClaims, values: string | readonly string[]): InteroperableClaims;
85
+ export declare function addContainedResourceReferenceList(claims: InteroperableClaims, values: string | readonly string[]): InteroperableClaims;
86
+ export declare function removeContainedResourceReferenceList(claims: InteroperableClaims, values: string | readonly string[]): InteroperableClaims;
83
87
  /**
84
88
  * Reads the canonical consent date claim.
85
89
  */
@@ -167,13 +167,20 @@ export function removeSectors(claims, values) {
167
167
  */
168
168
  export function getContainedDocumentIdentifierList(claims) {
169
169
  return uniqueCsvLists([
170
+ getClaimValues(claims, ClaimConsent.containedReferenceList),
170
171
  getClaimValues(claims, ClaimConsent.containedDocuments),
171
172
  getClaimValues(claims, ClaimConsent.attachmentContentIds),
172
173
  ]);
173
174
  }
175
+ export function getContainedResourceReferenceList(claims) {
176
+ return getContainedDocumentIdentifierList(claims);
177
+ }
174
178
  export function setContainedDocumentIdentifierList(claims, values) {
175
179
  return setContainedDocuments(claims, values);
176
180
  }
181
+ export function setContainedResourceReferenceList(claims, values) {
182
+ return setContainedDocuments(claims, values);
183
+ }
177
184
  export function addContainedDocumentIdentifierList(claims, values) {
178
185
  return setContainedDocuments(claims, uniqueCsvLists([
179
186
  getContainedDocumentIdentifierList(claims),
@@ -186,11 +193,18 @@ export function removeContainedDocumentIdentifierList(claims, values) {
186
193
  .filter(Boolean));
187
194
  return setContainedDocuments(claims, getContainedDocumentIdentifierList(claims).filter((item) => !toRemove.has(item)));
188
195
  }
196
+ export function addContainedResourceReferenceList(claims, values) {
197
+ return addContainedDocumentIdentifierList(claims, values);
198
+ }
199
+ export function removeContainedResourceReferenceList(claims, values) {
200
+ return removeContainedDocumentIdentifierList(claims, values);
201
+ }
189
202
  function setContainedDocuments(claims, values) {
190
- const next = setClaimValues(claims, ClaimConsent.containedDocuments, values);
203
+ const next = setClaimValues(claims, ClaimConsent.containedReferenceList, values);
191
204
  const cleaned = {
192
205
  ...next,
193
206
  };
207
+ delete cleaned[ClaimConsent.containedDocuments];
194
208
  delete cleaned[ClaimConsent.attachmentContentIds];
195
209
  return cleaned;
196
210
  }
@@ -0,0 +1,51 @@
1
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor';
2
+ /**
3
+ * Typed editor for one staged Coverage resource entry.
4
+ *
5
+ * Use this when a caller needs to stage one coverage row with claims-first
6
+ * accessors in a bundle authoring flow.
7
+ */
8
+ export declare class CoverageEntryEditor extends ClinicalResourceEntryEditor {
9
+ /** Writes the canonical coverage identifier. */
10
+ setIdentifier(identifier?: string | null): this;
11
+ /** Reads the canonical coverage identifier. */
12
+ getIdentifier(): string | undefined;
13
+ /** Ensures the coverage entry has one canonical `urn:uuid:*` identifier. */
14
+ ensureIdentifier(): string;
15
+ /** Writes the coverage status. */
16
+ setStatus(value?: string | null): this;
17
+ /** Reads the coverage status. */
18
+ getStatus(): string | undefined;
19
+ /** Writes the coverage type. */
20
+ setType(value?: string | null): this;
21
+ /** Reads the coverage type. */
22
+ getType(): string | undefined;
23
+ /** Writes the policy-holder reference. */
24
+ setPolicyHolder(value?: string | null): this;
25
+ /** Reads the policy-holder reference. */
26
+ getPolicyHolder(): string | undefined;
27
+ /** Writes the subscriber reference. */
28
+ setSubscriber(value?: string | null): this;
29
+ /** Reads the subscriber reference. */
30
+ getSubscriber(): string | undefined;
31
+ /** Writes the beneficiary reference. */
32
+ setBeneficiary(value?: string | null): this;
33
+ /** Reads the beneficiary reference. */
34
+ getBeneficiary(): string | undefined;
35
+ /** Writes the subscriber relationship. */
36
+ setRelationship(value?: string | null): this;
37
+ /** Reads the subscriber relationship. */
38
+ getRelationship(): string | undefined;
39
+ /** Writes the coverage period start. */
40
+ setPeriodStart(value?: string | null): this;
41
+ /** Reads the coverage period start. */
42
+ getPeriodStart(): string | undefined;
43
+ /** Writes the coverage period end. */
44
+ setPeriodEnd(value?: string | null): this;
45
+ /** Reads the coverage period end. */
46
+ getPeriodEnd(): string | undefined;
47
+ /** Writes the payor list. */
48
+ setPayorList(values: readonly string[]): this;
49
+ /** Reads the payor list. */
50
+ getPayorList(): string[];
51
+ }
@@ -0,0 +1,55 @@
1
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor.js';
2
+ import { CoverageClaim } from '../models/interoperable-claims/coverage-claims.js';
3
+ import { BundleEditableResourceTypes } from '../models/bundle-editor-types.js';
4
+ import { registerBundleEntryEditor } from './bundle-editor-registry.js';
5
+ /**
6
+ * Typed editor for one staged Coverage resource entry.
7
+ *
8
+ * Use this when a caller needs to stage one coverage row with claims-first
9
+ * accessors in a bundle authoring flow.
10
+ */
11
+ export class CoverageEntryEditor extends ClinicalResourceEntryEditor {
12
+ /** Writes the canonical coverage identifier. */
13
+ setIdentifier(identifier) { return this.setIdentifierValue(CoverageClaim.Identifier, identifier); }
14
+ /** Reads the canonical coverage identifier. */
15
+ getIdentifier() { return this.getIdentifierValue(CoverageClaim.Identifier); }
16
+ /** Ensures the coverage entry has one canonical `urn:uuid:*` identifier. */
17
+ ensureIdentifier() { return this.ensureIdentifierValue(CoverageClaim.Identifier); }
18
+ /** Writes the coverage status. */
19
+ setStatus(value) { return this.setScalarClaim(CoverageClaim.Status, value); }
20
+ /** Reads the coverage status. */
21
+ getStatus() { return this.getScalarClaim(CoverageClaim.Status); }
22
+ /** Writes the coverage type. */
23
+ setType(value) { return this.setScalarClaim(CoverageClaim.Type, value); }
24
+ /** Reads the coverage type. */
25
+ getType() { return this.getScalarClaim(CoverageClaim.Type); }
26
+ /** Writes the policy-holder reference. */
27
+ setPolicyHolder(value) { return this.setScalarClaim(CoverageClaim.PolicyHolder, value); }
28
+ /** Reads the policy-holder reference. */
29
+ getPolicyHolder() { return this.getScalarClaim(CoverageClaim.PolicyHolder); }
30
+ /** Writes the subscriber reference. */
31
+ setSubscriber(value) { return this.setScalarClaim(CoverageClaim.Subscriber, value); }
32
+ /** Reads the subscriber reference. */
33
+ getSubscriber() { return this.getScalarClaim(CoverageClaim.Subscriber); }
34
+ /** Writes the beneficiary reference. */
35
+ setBeneficiary(value) { return this.setScalarClaim(CoverageClaim.Beneficiary, value); }
36
+ /** Reads the beneficiary reference. */
37
+ getBeneficiary() { return this.getScalarClaim(CoverageClaim.Beneficiary); }
38
+ /** Writes the subscriber relationship. */
39
+ setRelationship(value) { return this.setScalarClaim(CoverageClaim.Relationship, value); }
40
+ /** Reads the subscriber relationship. */
41
+ getRelationship() { return this.getScalarClaim(CoverageClaim.Relationship); }
42
+ /** Writes the coverage period start. */
43
+ setPeriodStart(value) { return this.setScalarClaim(CoverageClaim.PeriodStart, value); }
44
+ /** Reads the coverage period start. */
45
+ getPeriodStart() { return this.getScalarClaim(CoverageClaim.PeriodStart); }
46
+ /** Writes the coverage period end. */
47
+ setPeriodEnd(value) { return this.setScalarClaim(CoverageClaim.PeriodEnd, value); }
48
+ /** Reads the coverage period end. */
49
+ getPeriodEnd() { return this.getScalarClaim(CoverageClaim.PeriodEnd); }
50
+ /** Writes the payor list. */
51
+ setPayorList(values) { return this.setCsvClaimList(CoverageClaim.Payor, values); }
52
+ /** Reads the payor list. */
53
+ getPayorList() { return this.getCsvClaimList(CoverageClaim.Payor); }
54
+ }
55
+ registerBundleEntryEditor(BundleEditableResourceTypes.coverage, CoverageEntryEditor);
@@ -0,0 +1,59 @@
1
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor';
2
+ /**
3
+ * Typed editor for one staged Device resource entry.
4
+ *
5
+ * Use this when a caller needs to stage one device row with claims-first
6
+ * accessors in a bundle authoring flow.
7
+ */
8
+ export declare class DeviceEntryEditor extends ClinicalResourceEntryEditor {
9
+ /** Writes the canonical device identifier. */
10
+ setIdentifier(identifier?: string | null): this;
11
+ /** Reads the canonical device identifier. */
12
+ getIdentifier(): string | undefined;
13
+ /** Ensures the device entry has one canonical `urn:uuid:*` identifier. */
14
+ ensureIdentifier(): string;
15
+ /** Writes the patient reference for the device. */
16
+ setPatient(value?: string | null): this;
17
+ /** Reads the patient reference for the device. */
18
+ getPatient(): string | undefined;
19
+ /** Writes the device status. */
20
+ setStatus(value?: string | null): this;
21
+ /** Reads the device status. */
22
+ getStatus(): string | undefined;
23
+ /** Writes the device type. */
24
+ setType(value?: string | null): this;
25
+ /** Reads the device type. */
26
+ getType(): string | undefined;
27
+ /** Writes the manufacturer reference. */
28
+ setManufacturer(value?: string | null): this;
29
+ /** Reads the manufacturer reference. */
30
+ getManufacturer(): string | undefined;
31
+ /** Writes the model. */
32
+ setModel(value?: string | null): this;
33
+ /** Reads the model. */
34
+ getModel(): string | undefined;
35
+ /** Writes the human-readable device name. */
36
+ setDeviceName(value?: string | null): this;
37
+ /** Reads the human-readable device name. */
38
+ getDeviceName(): string | undefined;
39
+ /** Writes the serial number. */
40
+ setSerialNumber(value?: string | null): this;
41
+ /** Reads the serial number. */
42
+ getSerialNumber(): string | undefined;
43
+ /** Writes the owning organization. */
44
+ setOrganization(value?: string | null): this;
45
+ /** Reads the owning organization. */
46
+ getOrganization(): string | undefined;
47
+ /** Writes the location reference. */
48
+ setLocation(value?: string | null): this;
49
+ /** Reads the location reference. */
50
+ getLocation(): string | undefined;
51
+ /** Writes the URL reference. */
52
+ setUrl(value?: string | null): this;
53
+ /** Reads the URL reference. */
54
+ getUrl(): string | undefined;
55
+ /** Writes the note text. */
56
+ setNote(value?: string | null): this;
57
+ /** Reads the note text. */
58
+ getNote(): string | undefined;
59
+ }
@@ -0,0 +1,63 @@
1
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor.js';
2
+ import { DeviceClaim } from '../models/interoperable-claims/device-claims.js';
3
+ import { BundleEditableResourceTypes } from '../models/bundle-editor-types.js';
4
+ import { registerBundleEntryEditor } from './bundle-editor-registry.js';
5
+ /**
6
+ * Typed editor for one staged Device resource entry.
7
+ *
8
+ * Use this when a caller needs to stage one device row with claims-first
9
+ * accessors in a bundle authoring flow.
10
+ */
11
+ export class DeviceEntryEditor extends ClinicalResourceEntryEditor {
12
+ /** Writes the canonical device identifier. */
13
+ setIdentifier(identifier) { return this.setIdentifierValue(DeviceClaim.Identifier, identifier); }
14
+ /** Reads the canonical device identifier. */
15
+ getIdentifier() { return this.getIdentifierValue(DeviceClaim.Identifier); }
16
+ /** Ensures the device entry has one canonical `urn:uuid:*` identifier. */
17
+ ensureIdentifier() { return this.ensureIdentifierValue(DeviceClaim.Identifier); }
18
+ /** Writes the patient reference for the device. */
19
+ setPatient(value) { return this.setScalarClaim(DeviceClaim.Patient, value); }
20
+ /** Reads the patient reference for the device. */
21
+ getPatient() { return this.getScalarClaim(DeviceClaim.Patient); }
22
+ /** Writes the device status. */
23
+ setStatus(value) { return this.setScalarClaim(DeviceClaim.Status, value); }
24
+ /** Reads the device status. */
25
+ getStatus() { return this.getScalarClaim(DeviceClaim.Status); }
26
+ /** Writes the device type. */
27
+ setType(value) { return this.setScalarClaim(DeviceClaim.Type, value); }
28
+ /** Reads the device type. */
29
+ getType() { return this.getScalarClaim(DeviceClaim.Type); }
30
+ /** Writes the manufacturer reference. */
31
+ setManufacturer(value) { return this.setScalarClaim(DeviceClaim.Manufacturer, value); }
32
+ /** Reads the manufacturer reference. */
33
+ getManufacturer() { return this.getScalarClaim(DeviceClaim.Manufacturer); }
34
+ /** Writes the model. */
35
+ setModel(value) { return this.setScalarClaim(DeviceClaim.Model, value); }
36
+ /** Reads the model. */
37
+ getModel() { return this.getScalarClaim(DeviceClaim.Model); }
38
+ /** Writes the human-readable device name. */
39
+ setDeviceName(value) { return this.setScalarClaim(DeviceClaim.DeviceName, value); }
40
+ /** Reads the human-readable device name. */
41
+ getDeviceName() { return this.getScalarClaim(DeviceClaim.DeviceName); }
42
+ /** Writes the serial number. */
43
+ setSerialNumber(value) { return this.setScalarClaim(DeviceClaim.SerialNumber, value); }
44
+ /** Reads the serial number. */
45
+ getSerialNumber() { return this.getScalarClaim(DeviceClaim.SerialNumber); }
46
+ /** Writes the owning organization. */
47
+ setOrganization(value) { return this.setScalarClaim(DeviceClaim.Organization, value); }
48
+ /** Reads the owning organization. */
49
+ getOrganization() { return this.getScalarClaim(DeviceClaim.Organization); }
50
+ /** Writes the location reference. */
51
+ setLocation(value) { return this.setScalarClaim(DeviceClaim.Location, value); }
52
+ /** Reads the location reference. */
53
+ getLocation() { return this.getScalarClaim(DeviceClaim.Location); }
54
+ /** Writes the URL reference. */
55
+ setUrl(value) { return this.setScalarClaim(DeviceClaim.Url, value); }
56
+ /** Reads the URL reference. */
57
+ getUrl() { return this.getScalarClaim(DeviceClaim.Url); }
58
+ /** Writes the note text. */
59
+ setNote(value) { return this.setScalarClaim(DeviceClaim.Note, value); }
60
+ /** Reads the note text. */
61
+ getNote() { return this.getScalarClaim(DeviceClaim.Note); }
62
+ }
63
+ registerBundleEntryEditor(BundleEditableResourceTypes.device, DeviceEntryEditor);
@@ -0,0 +1,43 @@
1
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor';
2
+ /**
3
+ * Typed editor for one staged DeviceUseStatement resource entry.
4
+ *
5
+ * Use this when a caller needs to stage one device-use row with claims-first
6
+ * accessors in a bundle authoring flow.
7
+ */
8
+ export declare class DeviceUseStatementEntryEditor extends ClinicalResourceEntryEditor {
9
+ /** Writes the canonical device-use identifier. */
10
+ setIdentifier(identifier?: string | null): this;
11
+ /** Reads the canonical device-use identifier. */
12
+ getIdentifier(): string | undefined;
13
+ /** Ensures the device-use entry has one canonical `urn:uuid:*` identifier. */
14
+ ensureIdentifier(): string;
15
+ /** Writes the subject/patient reference. */
16
+ setSubject(subject?: string | null): this;
17
+ /** Reads the subject/patient reference. */
18
+ getSubject(): string | undefined;
19
+ /** Writes the device-use status. */
20
+ setStatus(value?: string | null): this;
21
+ /** Reads the device-use status. */
22
+ getStatus(): string | undefined;
23
+ /** Writes the linked device reference. */
24
+ setDevice(value?: string | null): this;
25
+ /** Reads the linked device reference. */
26
+ getDevice(): string | undefined;
27
+ /** Writes the recorded-on date. */
28
+ setRecordedOn(value?: string | null): this;
29
+ /** Reads the recorded-on date. */
30
+ getRecordedOn(): string | undefined;
31
+ /** Writes the timing date/time. */
32
+ setTimingDateTime(value?: string | null): this;
33
+ /** Reads the timing date/time. */
34
+ getTimingDateTime(): string | undefined;
35
+ /** Writes the reason code. */
36
+ setReasonCode(value?: string | null): this;
37
+ /** Reads the reason code. */
38
+ getReasonCode(): string | undefined;
39
+ /** Writes the source reference. */
40
+ setSource(value?: string | null): this;
41
+ /** Reads the source reference. */
42
+ getSource(): string | undefined;
43
+ }
@@ -0,0 +1,47 @@
1
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor.js';
2
+ import { DeviceUseStatementClaim } from '../models/interoperable-claims/device-use-statement-claims.js';
3
+ import { BundleEditableResourceTypes } from '../models/bundle-editor-types.js';
4
+ import { registerBundleEntryEditor } from './bundle-editor-registry.js';
5
+ /**
6
+ * Typed editor for one staged DeviceUseStatement resource entry.
7
+ *
8
+ * Use this when a caller needs to stage one device-use row with claims-first
9
+ * accessors in a bundle authoring flow.
10
+ */
11
+ export class DeviceUseStatementEntryEditor extends ClinicalResourceEntryEditor {
12
+ /** Writes the canonical device-use identifier. */
13
+ setIdentifier(identifier) { return this.setIdentifierValue(DeviceUseStatementClaim.Identifier, identifier); }
14
+ /** Reads the canonical device-use identifier. */
15
+ getIdentifier() { return this.getIdentifierValue(DeviceUseStatementClaim.Identifier); }
16
+ /** Ensures the device-use entry has one canonical `urn:uuid:*` identifier. */
17
+ ensureIdentifier() { return this.ensureIdentifierValue(DeviceUseStatementClaim.Identifier); }
18
+ /** Writes the subject/patient reference. */
19
+ setSubject(subject) { return this.setSubjectClaims(DeviceUseStatementClaim.Subject, DeviceUseStatementClaim.Subject, subject); }
20
+ /** Reads the subject/patient reference. */
21
+ getSubject() { return this.getSubjectClaims(DeviceUseStatementClaim.Subject, DeviceUseStatementClaim.Subject); }
22
+ /** Writes the device-use status. */
23
+ setStatus(value) { return this.setScalarClaim(DeviceUseStatementClaim.Status, value); }
24
+ /** Reads the device-use status. */
25
+ getStatus() { return this.getScalarClaim(DeviceUseStatementClaim.Status); }
26
+ /** Writes the linked device reference. */
27
+ setDevice(value) { return this.setScalarClaim(DeviceUseStatementClaim.Device, value); }
28
+ /** Reads the linked device reference. */
29
+ getDevice() { return this.getScalarClaim(DeviceUseStatementClaim.Device); }
30
+ /** Writes the recorded-on date. */
31
+ setRecordedOn(value) { return this.setScalarClaim(DeviceUseStatementClaim.RecordedOn, value); }
32
+ /** Reads the recorded-on date. */
33
+ getRecordedOn() { return this.getScalarClaim(DeviceUseStatementClaim.RecordedOn); }
34
+ /** Writes the timing date/time. */
35
+ setTimingDateTime(value) { return this.setScalarClaim(DeviceUseStatementClaim.TimingDateTime, value); }
36
+ /** Reads the timing date/time. */
37
+ getTimingDateTime() { return this.getScalarClaim(DeviceUseStatementClaim.TimingDateTime); }
38
+ /** Writes the reason code. */
39
+ setReasonCode(value) { return this.setScalarClaim(DeviceUseStatementClaim.ReasonCode, value); }
40
+ /** Reads the reason code. */
41
+ getReasonCode() { return this.getScalarClaim(DeviceUseStatementClaim.ReasonCode); }
42
+ /** Writes the source reference. */
43
+ setSource(value) { return this.setScalarClaim(DeviceUseStatementClaim.Source, value); }
44
+ /** Reads the source reference. */
45
+ getSource() { return this.getScalarClaim(DeviceUseStatementClaim.Source); }
46
+ }
47
+ registerBundleEntryEditor(BundleEditableResourceTypes.deviceUseStatement, DeviceUseStatementEntryEditor);
@@ -0,0 +1,74 @@
1
+ /**
2
+ * File discipline note:
3
+ * - Read `ARCHITECTURE.md` and `CONTRIBUTING.md` before changing this module.
4
+ * - Keep exactly one exported class per file.
5
+ * - Keep this file focused on one typed editor surface.
6
+ * - Move shared helpers to reusable helper/base modules instead of duplicating logic here.
7
+ */
8
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor';
9
+ /**
10
+ * Typed editor for one staged DiagnosticReport resource entry.
11
+ *
12
+ * Use this surface when the frontend or BFF needs to stage one report with
13
+ * links to results, specimen references, or one rendered attachment.
14
+ */
15
+ export declare class DiagnosticReportEntryEditor extends ClinicalResourceEntryEditor {
16
+ /** Overrides the canonical identifier when import or migration logic needs one explicit public id. */
17
+ setIdentifier(identifier?: string | null): this;
18
+ /** Returns the canonical identifier currently exposed for this report. */
19
+ getIdentifier(): string | undefined;
20
+ /** Ensures the entry has one synchronized canonical identifier across public claim, `resource.id`, and `fullUrl`. */
21
+ ensureIdentifier(): string;
22
+ /** Sets the subject or patient reference for this report. */
23
+ setSubject(subject?: string | null): this;
24
+ /** Returns the subject or patient reference for this report. */
25
+ getSubject(): string | undefined;
26
+ /** Sets the report status. */
27
+ setStatus(status?: string | null): this;
28
+ /** Returns the report status. */
29
+ getStatus(): string | undefined;
30
+ /** Sets the report date or effective time. */
31
+ setDate(date?: string | null): this;
32
+ /** Returns the report date or effective time. */
33
+ getDate(): string | undefined;
34
+ /** Sets the report category. */
35
+ setCategory(category?: string | null): this;
36
+ /** Returns the report category. */
37
+ getCategory(): string | undefined;
38
+ /** Sets the main report code. */
39
+ setCode(code?: string | null): this;
40
+ /** Returns the main report code. */
41
+ getCode(): string | undefined;
42
+ /** Sets the encounter reference linked to this report. */
43
+ setEncounter(reference?: string | null): this;
44
+ /** Returns the encounter reference linked to this report. */
45
+ getEncounter(): string | undefined;
46
+ /** Replaces the performer reference list. */
47
+ setPerformerList(references: readonly string[]): this;
48
+ /** Returns the performer reference list. */
49
+ getPerformerList(): string[];
50
+ /** Replaces the result reference list, often Observation references. */
51
+ setResultList(references: readonly string[]): this;
52
+ /** Returns the result reference list. */
53
+ getResultList(): string[];
54
+ /** Replaces the specimen reference list. */
55
+ setSpecimenList(references: readonly string[]): this;
56
+ /** Returns the specimen reference list. */
57
+ getSpecimenList(): string[];
58
+ /** @deprecated Use the shared contained-resource reference surface on `ClinicalResourceEntryEditor`. */
59
+ setContainedDocumentIdentifierList(identifiers: readonly string[]): this;
60
+ /** @deprecated Use the shared contained-resource reference surface on `ClinicalResourceEntryEditor`. */
61
+ getContainedDocumentIdentifierList(): string[];
62
+ /** Sets the MIME type for one attached presented form. */
63
+ setPresentedFormContentType(contentType?: string | null): this;
64
+ /** Returns the MIME type for the attached presented form. */
65
+ getPresentedFormContentType(): string | undefined;
66
+ /** Sets the inline base64 payload for one attached presented form. */
67
+ setPresentedFormData(data?: string | null): this;
68
+ /** Returns the inline base64 payload for the attached presented form. */
69
+ getPresentedFormData(): string | undefined;
70
+ /** Sets the external URL for one attached presented form. */
71
+ setPresentedFormUrl(url?: string | null): this;
72
+ /** Returns the external URL for the attached presented form. */
73
+ getPresentedFormUrl(): string | undefined;
74
+ }