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,136 @@
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.js';
9
+ import { DiagnosticReportClaim } from '../models/interoperable-claims/diagnostic-report-claims.js';
10
+ import { BundleEditableResourceTypes } from '../models/bundle-editor-types.js';
11
+ import { registerBundleEntryEditor } from './bundle-editor-registry.js';
12
+ /**
13
+ * Typed editor for one staged DiagnosticReport resource entry.
14
+ *
15
+ * Use this surface when the frontend or BFF needs to stage one report with
16
+ * links to results, specimen references, or one rendered attachment.
17
+ */
18
+ export class DiagnosticReportEntryEditor extends ClinicalResourceEntryEditor {
19
+ /** Overrides the canonical identifier when import or migration logic needs one explicit public id. */
20
+ setIdentifier(identifier) {
21
+ return this.setIdentifierValue(DiagnosticReportClaim.Identifier, identifier);
22
+ }
23
+ /** Returns the canonical identifier currently exposed for this report. */
24
+ getIdentifier() {
25
+ return this.getIdentifierValue(DiagnosticReportClaim.Identifier);
26
+ }
27
+ /** Ensures the entry has one synchronized canonical identifier across public claim, `resource.id`, and `fullUrl`. */
28
+ ensureIdentifier() {
29
+ return this.ensureIdentifierValue(DiagnosticReportClaim.Identifier);
30
+ }
31
+ /** Sets the subject or patient reference for this report. */
32
+ setSubject(subject) {
33
+ return this.setSubjectClaims(DiagnosticReportClaim.Subject, DiagnosticReportClaim.Patient, subject);
34
+ }
35
+ /** Returns the subject or patient reference for this report. */
36
+ getSubject() {
37
+ return this.getSubjectClaims(DiagnosticReportClaim.Subject, DiagnosticReportClaim.Patient);
38
+ }
39
+ /** Sets the report status. */
40
+ setStatus(status) {
41
+ return this.setScalarClaim(DiagnosticReportClaim.Status, status);
42
+ }
43
+ /** Returns the report status. */
44
+ getStatus() {
45
+ return this.getScalarClaim(DiagnosticReportClaim.Status);
46
+ }
47
+ /** Sets the report date or effective time. */
48
+ setDate(date) {
49
+ return this.setScalarClaim(DiagnosticReportClaim.Date, date);
50
+ }
51
+ /** Returns the report date or effective time. */
52
+ getDate() {
53
+ return this.getScalarClaim(DiagnosticReportClaim.Date);
54
+ }
55
+ /** Sets the report category. */
56
+ setCategory(category) {
57
+ return this.setScalarClaim(DiagnosticReportClaim.Category, category);
58
+ }
59
+ /** Returns the report category. */
60
+ getCategory() {
61
+ return this.getScalarClaim(DiagnosticReportClaim.Category);
62
+ }
63
+ /** Sets the main report code. */
64
+ setCode(code) {
65
+ return this.setScalarClaim(DiagnosticReportClaim.Code, code);
66
+ }
67
+ /** Returns the main report code. */
68
+ getCode() {
69
+ return this.getScalarClaim(DiagnosticReportClaim.Code);
70
+ }
71
+ /** Sets the encounter reference linked to this report. */
72
+ setEncounter(reference) {
73
+ return this.setScalarClaim(DiagnosticReportClaim.Encounter, reference);
74
+ }
75
+ /** Returns the encounter reference linked to this report. */
76
+ getEncounter() {
77
+ return this.getScalarClaim(DiagnosticReportClaim.Encounter);
78
+ }
79
+ /** Replaces the performer reference list. */
80
+ setPerformerList(references) {
81
+ return this.setCsvClaimList(DiagnosticReportClaim.Performer, references);
82
+ }
83
+ /** Returns the performer reference list. */
84
+ getPerformerList() {
85
+ return this.getCsvClaimList(DiagnosticReportClaim.Performer);
86
+ }
87
+ /** Replaces the result reference list, often Observation references. */
88
+ setResultList(references) {
89
+ return this.setCsvClaimList(DiagnosticReportClaim.Result, references);
90
+ }
91
+ /** Returns the result reference list. */
92
+ getResultList() {
93
+ return this.getCsvClaimList(DiagnosticReportClaim.Result);
94
+ }
95
+ /** Replaces the specimen reference list. */
96
+ setSpecimenList(references) {
97
+ return this.setCsvClaimList(DiagnosticReportClaim.Specimen, references);
98
+ }
99
+ /** Returns the specimen reference list. */
100
+ getSpecimenList() {
101
+ return this.getCsvClaimList(DiagnosticReportClaim.Specimen);
102
+ }
103
+ /** @deprecated Use the shared contained-resource reference surface on `ClinicalResourceEntryEditor`. */
104
+ setContainedDocumentIdentifierList(identifiers) {
105
+ return this.setCsvClaimList(DiagnosticReportClaim.ContainedDocuments, identifiers);
106
+ }
107
+ /** @deprecated Use the shared contained-resource reference surface on `ClinicalResourceEntryEditor`. */
108
+ getContainedDocumentIdentifierList() {
109
+ return this.getCsvClaimList(DiagnosticReportClaim.ContainedDocuments);
110
+ }
111
+ /** Sets the MIME type for one attached presented form. */
112
+ setPresentedFormContentType(contentType) {
113
+ return this.setScalarClaim(DiagnosticReportClaim.PresentedFormContentType, contentType);
114
+ }
115
+ /** Returns the MIME type for the attached presented form. */
116
+ getPresentedFormContentType() {
117
+ return this.getScalarClaim(DiagnosticReportClaim.PresentedFormContentType);
118
+ }
119
+ /** Sets the inline base64 payload for one attached presented form. */
120
+ setPresentedFormData(data) {
121
+ return this.setScalarClaim(DiagnosticReportClaim.PresentedFormData, data);
122
+ }
123
+ /** Returns the inline base64 payload for the attached presented form. */
124
+ getPresentedFormData() {
125
+ return this.getScalarClaim(DiagnosticReportClaim.PresentedFormData);
126
+ }
127
+ /** Sets the external URL for one attached presented form. */
128
+ setPresentedFormUrl(url) {
129
+ return this.setScalarClaim(DiagnosticReportClaim.PresentedFormUrl, url);
130
+ }
131
+ /** Returns the external URL for the attached presented form. */
132
+ getPresentedFormUrl() {
133
+ return this.getScalarClaim(DiagnosticReportClaim.PresentedFormUrl);
134
+ }
135
+ }
136
+ registerBundleEntryEditor(BundleEditableResourceTypes.diagnosticReport, DiagnosticReportEntryEditor);
@@ -59,6 +59,14 @@ export declare function createHostedDidWeb(hostDidWeb: string, tenantId: string,
59
59
  version: string;
60
60
  sector: string;
61
61
  }): string;
62
+ /**
63
+ * Extracts the tenant identifier from one hosted `did:web`.
64
+ *
65
+ * This is a compatibility helper for places that still receive a full hosted
66
+ * DID where a route tenant id is expected. It only returns the tenant segment
67
+ * used by the hosted organization form.
68
+ */
69
+ export declare function extractTenantIdFromHostedDidWeb(did: string): string | undefined;
62
70
  /**
63
71
  * Builds the canonical hosted provider DID root used by hosted tenant services.
64
72
  *
package/dist/utils/did.js CHANGED
@@ -111,6 +111,28 @@ export function createHostedDidWeb(hostDidWeb, tenantId, context) {
111
111
  const didPath = `cds-${context.jurisdiction}:${context.version}:${context.sector}`;
112
112
  return `did:web:${hostPart}:${tenantId}:${didPath}`;
113
113
  }
114
+ /**
115
+ * Extracts the tenant identifier from one hosted `did:web`.
116
+ *
117
+ * This is a compatibility helper for places that still receive a full hosted
118
+ * DID where a route tenant id is expected. It only returns the tenant segment
119
+ * used by the hosted organization form.
120
+ */
121
+ export function extractTenantIdFromHostedDidWeb(did) {
122
+ const normalizedDid = String(did || '').trim();
123
+ if (!normalizedDid.startsWith('did:web:')) {
124
+ return undefined;
125
+ }
126
+ const didParts = normalizedDid.slice('did:web:'.length).split(':');
127
+ if (didParts.length < 2) {
128
+ return undefined;
129
+ }
130
+ const tenantId = String(didParts[1] || '').trim();
131
+ if (!tenantId || /^cds-/i.test(tenantId)) {
132
+ return undefined;
133
+ }
134
+ return decodeURIComponent(tenantId);
135
+ }
114
136
  /**
115
137
  * Builds the canonical hosted provider DID root used by hosted tenant services.
116
138
  *
@@ -0,0 +1,62 @@
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 DocumentReference resource entry.
11
+ *
12
+ * Use this surface when the frontend needs to attach one PDF, image, VC, or
13
+ * other document-like payload to a clinical document or Communication flow.
14
+ */
15
+ export declare class DocumentReferenceEntryEditor 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 document entry. */
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 reference for the attached document. */
23
+ setSubject(subject?: string | null): this;
24
+ /** Returns the subject reference for the attached document. */
25
+ getSubject(): string | undefined;
26
+ /** Sets the coded document type. */
27
+ setType(value?: string | null): this;
28
+ /** Returns the coded document type. */
29
+ getType(): string | undefined;
30
+ /** Sets the document category. */
31
+ setCategory(value?: string | null): this;
32
+ /** Returns the document category. */
33
+ getCategory(): string | undefined;
34
+ /** Sets the MIME type of the attached payload, such as PDF or image content. */
35
+ setContentType(value?: string | null): this;
36
+ /** Returns the MIME type of the attached payload. */
37
+ getContentType(): string | undefined;
38
+ /** Sets the inline base64 payload when the document travels inside the bundle. */
39
+ setContentData(value?: string | null): this;
40
+ /** Returns the inline base64 payload when present. */
41
+ getContentData(): string | undefined;
42
+ /** Sets the content hash or CID-like value used for integrity and external retrieval. */
43
+ setContentHash(value?: string | null): this;
44
+ /** Returns the content hash or CID-like value. */
45
+ getContentHash(): string | undefined;
46
+ /** Sets the external location/URL when the payload is not embedded inline. */
47
+ setLocation(value?: string | null): this;
48
+ /** Returns the external location/URL when present. */
49
+ getLocation(): string | undefined;
50
+ /** Sets the user-facing description for the attached document. */
51
+ setDescription(value?: string | null): this;
52
+ /** Returns the user-facing description for the attached document. */
53
+ getDescription(): string | undefined;
54
+ /** Sets the document date. */
55
+ setDate(value?: string | null): this;
56
+ /** Returns the document date. */
57
+ getDate(): string | undefined;
58
+ /** Sets the document author reference. */
59
+ setAuthor(value?: string | null): this;
60
+ /** Returns the document author reference. */
61
+ getAuthor(): string | undefined;
62
+ }
@@ -0,0 +1,66 @@
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.js';
9
+ import { DocumentReferenceClaim } from '../models/interoperable-claims/document-reference-claims.js';
10
+ import { BundleEditableResourceTypes } from '../models/bundle-editor-types.js';
11
+ import { registerBundleEntryEditor } from './bundle-editor-registry.js';
12
+ /**
13
+ * Typed editor for one staged DocumentReference resource entry.
14
+ *
15
+ * Use this surface when the frontend needs to attach one PDF, image, VC, or
16
+ * other document-like payload to a clinical document or Communication flow.
17
+ */
18
+ export class DocumentReferenceEntryEditor extends ClinicalResourceEntryEditor {
19
+ /** Overrides the canonical identifier when import or migration logic needs one explicit public id. */
20
+ setIdentifier(identifier) { return this.setIdentifierValue(DocumentReferenceClaim.Identifier, identifier); }
21
+ /** Returns the canonical identifier currently exposed for this document entry. */
22
+ getIdentifier() { return this.getIdentifierValue(DocumentReferenceClaim.Identifier); }
23
+ /** Ensures the entry has one synchronized canonical identifier across public claim, `resource.id`, and `fullUrl`. */
24
+ ensureIdentifier() { return this.ensureIdentifierValue(DocumentReferenceClaim.Identifier); }
25
+ /** Sets the subject reference for the attached document. */
26
+ setSubject(subject) { return this.setScalarClaim(DocumentReferenceClaim.Subject, subject); }
27
+ /** Returns the subject reference for the attached document. */
28
+ getSubject() { return this.getScalarClaim(DocumentReferenceClaim.Subject); }
29
+ /** Sets the coded document type. */
30
+ setType(value) { return this.setScalarClaim(DocumentReferenceClaim.Type, value); }
31
+ /** Returns the coded document type. */
32
+ getType() { return this.getScalarClaim(DocumentReferenceClaim.Type); }
33
+ /** Sets the document category. */
34
+ setCategory(value) { return this.setScalarClaim(DocumentReferenceClaim.Category, value); }
35
+ /** Returns the document category. */
36
+ getCategory() { return this.getScalarClaim(DocumentReferenceClaim.Category); }
37
+ /** Sets the MIME type of the attached payload, such as PDF or image content. */
38
+ setContentType(value) { return this.setScalarClaim(DocumentReferenceClaim.ContentType, value); }
39
+ /** Returns the MIME type of the attached payload. */
40
+ getContentType() { return this.getScalarClaim(DocumentReferenceClaim.ContentType); }
41
+ /** Sets the inline base64 payload when the document travels inside the bundle. */
42
+ setContentData(value) { return this.setScalarClaim(DocumentReferenceClaim.ContentData, value); }
43
+ /** Returns the inline base64 payload when present. */
44
+ getContentData() { return this.getScalarClaim(DocumentReferenceClaim.ContentData); }
45
+ /** Sets the content hash or CID-like value used for integrity and external retrieval. */
46
+ setContentHash(value) { return this.setScalarClaim(DocumentReferenceClaim.ContentHash, value); }
47
+ /** Returns the content hash or CID-like value. */
48
+ getContentHash() { return this.getScalarClaim(DocumentReferenceClaim.ContentHash); }
49
+ /** Sets the external location/URL when the payload is not embedded inline. */
50
+ setLocation(value) { return this.setScalarClaim(DocumentReferenceClaim.Location, value); }
51
+ /** Returns the external location/URL when present. */
52
+ getLocation() { return this.getScalarClaim(DocumentReferenceClaim.Location); }
53
+ /** Sets the user-facing description for the attached document. */
54
+ setDescription(value) { return this.setScalarClaim(DocumentReferenceClaim.Description, value); }
55
+ /** Returns the user-facing description for the attached document. */
56
+ getDescription() { return this.getScalarClaim(DocumentReferenceClaim.Description); }
57
+ /** Sets the document date. */
58
+ setDate(value) { return this.setScalarClaim(DocumentReferenceClaim.Date, value); }
59
+ /** Returns the document date. */
60
+ getDate() { return this.getScalarClaim(DocumentReferenceClaim.Date); }
61
+ /** Sets the document author reference. */
62
+ setAuthor(value) { return this.setScalarClaim(DocumentReferenceClaim.Author, value); }
63
+ /** Returns the document author reference. */
64
+ getAuthor() { return this.getScalarClaim(DocumentReferenceClaim.Author); }
65
+ }
66
+ registerBundleEntryEditor(BundleEditableResourceTypes.documentReference, DocumentReferenceEntryEditor);
@@ -0,0 +1,36 @@
1
+ import { BundleEntryEditor } from './bundle-entry-editor';
2
+ /**
3
+ * Typed editor for one staged Employee resource entry.
4
+ *
5
+ * Use this when a caller needs to stage one employee row with claims-first
6
+ * accessors in a bundle authoring flow.
7
+ */
8
+ export declare class EmployeeEntryEditor extends BundleEntryEditor {
9
+ /**
10
+ * Writes the canonical employee identifier.
11
+ *
12
+ * The identifier is synchronized across:
13
+ * - `entry.fullUrl`
14
+ * - `resource.id`
15
+ * - `org.schema.Person.identifier`
16
+ */
17
+ setIdentifier(identifier?: string | null): this;
18
+ /** Reads the canonical employee identifier from claims, resource id, or fullUrl. */
19
+ getIdentifier(): string | undefined;
20
+ /** Ensures the employee entry carries one canonical `urn:uuid:*` identifier. */
21
+ ensureIdentifier(): string;
22
+ /** Writes the canonical employee email claim on this entry. */
23
+ setEmail(email: string): this;
24
+ /** Reads the canonical employee email claim from this entry. */
25
+ getEmail(): string | undefined;
26
+ /** Writes the canonical employee occupational role claim on this entry. */
27
+ setRole(role: string): this;
28
+ /** Reads the canonical employee occupational role claim from this entry. */
29
+ getRole(): string | undefined;
30
+ /** Writes the canonical employee `worksFor` claim on this entry. */
31
+ setWorksFor(worksFor: string): this;
32
+ /** Writes the canonical employee `memberOf` claim on this entry. */
33
+ setMemberOf(memberOf: string): this;
34
+ /** Writes the canonical employee organization tax id claim on this entry. */
35
+ setMemberOfOrgTaxId(taxId: string): this;
36
+ }
@@ -0,0 +1,88 @@
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 { ClaimsPersonSchemaorg } from '../constants/schemaorg.js';
9
+ import { BundleEditableResourceTypes } from '../models/bundle-editor-types.js';
10
+ import { createCanonicalIdentifierUrn, normalizeOptionalIdentifier } from './bundle-editor-helpers.js';
11
+ import { BundleEntryEditor } from './bundle-entry-editor.js';
12
+ import { registerBundleEntryEditor } from './bundle-editor-registry.js';
13
+ /**
14
+ * Typed editor for one staged Employee resource entry.
15
+ *
16
+ * Use this when a caller needs to stage one employee row with claims-first
17
+ * accessors in a bundle authoring flow.
18
+ */
19
+ export class EmployeeEntryEditor extends BundleEntryEditor {
20
+ /**
21
+ * Writes the canonical employee identifier.
22
+ *
23
+ * The identifier is synchronized across:
24
+ * - `entry.fullUrl`
25
+ * - `resource.id`
26
+ * - `org.schema.Person.identifier`
27
+ */
28
+ setIdentifier(identifier) {
29
+ const normalized = normalizeOptionalIdentifier(identifier);
30
+ if (!normalized) {
31
+ this.removeClaim(ClaimsPersonSchemaorg.identifier);
32
+ this.setResourceId(undefined);
33
+ this.setFullUrl(undefined);
34
+ return this;
35
+ }
36
+ this.setClaim(ClaimsPersonSchemaorg.identifier, normalized);
37
+ this.setResourceId(normalized);
38
+ this.setFullUrl(normalized);
39
+ return this;
40
+ }
41
+ /** Reads the canonical employee identifier from claims, resource id, or fullUrl. */
42
+ getIdentifier() {
43
+ return normalizeOptionalIdentifier(this.getClaim(ClaimsPersonSchemaorg.identifier)
44
+ || this.getResourceId()
45
+ || this.getFullUrl());
46
+ }
47
+ /** Ensures the employee entry carries one canonical `urn:uuid:*` identifier. */
48
+ ensureIdentifier() {
49
+ const existing = this.getIdentifier();
50
+ if (existing) {
51
+ return existing;
52
+ }
53
+ const generated = createCanonicalIdentifierUrn();
54
+ this.setIdentifier(generated);
55
+ return generated;
56
+ }
57
+ /** Writes the canonical employee email claim on this entry. */
58
+ setEmail(email) {
59
+ return this.setClaim(ClaimsPersonSchemaorg.email, String(email).trim());
60
+ }
61
+ /** Reads the canonical employee email claim from this entry. */
62
+ getEmail() {
63
+ const email = this.getClaim(ClaimsPersonSchemaorg.email);
64
+ return typeof email === 'string' && email.trim() ? email.trim() : undefined;
65
+ }
66
+ /** Writes the canonical employee occupational role claim on this entry. */
67
+ setRole(role) {
68
+ return this.setClaim(ClaimsPersonSchemaorg.hasOccupationalRoleValue, String(role).trim());
69
+ }
70
+ /** Reads the canonical employee occupational role claim from this entry. */
71
+ getRole() {
72
+ const role = this.getClaim(ClaimsPersonSchemaorg.hasOccupationalRoleValue);
73
+ return typeof role === 'string' && role.trim() ? role.trim() : undefined;
74
+ }
75
+ /** Writes the canonical employee `worksFor` claim on this entry. */
76
+ setWorksFor(worksFor) {
77
+ return this.setClaim(ClaimsPersonSchemaorg.worksFor, String(worksFor).trim());
78
+ }
79
+ /** Writes the canonical employee `memberOf` claim on this entry. */
80
+ setMemberOf(memberOf) {
81
+ return this.setClaim(ClaimsPersonSchemaorg.memberOf, String(memberOf).trim());
82
+ }
83
+ /** Writes the canonical employee organization tax id claim on this entry. */
84
+ setMemberOfOrgTaxId(taxId) {
85
+ return this.setClaim(ClaimsPersonSchemaorg.memberOfOrgTaxId, String(taxId).trim());
86
+ }
87
+ }
88
+ registerBundleEntryEditor(BundleEditableResourceTypes.employee, EmployeeEntryEditor);
@@ -68,6 +68,7 @@ export declare const EmployeeResourceTypes: Readonly<{
68
68
  export declare const EmployeeBatchEntryTypes: Readonly<{
69
69
  readonly create: "Employee-create-request-v1.0";
70
70
  readonly disable: "Employee-disable-request-v1.0";
71
+ readonly update: "Employee-update-request-v1.0";
71
72
  readonly search: "Employee-search-request-v1.0";
72
73
  readonly purge: "Employee-purge-request-v1.0";
73
74
  }>;
@@ -24,6 +24,7 @@ export const EmployeeResourceTypes = Object.freeze({
24
24
  export const EmployeeBatchEntryTypes = Object.freeze({
25
25
  create: 'Employee-create-request-v1.0',
26
26
  disable: 'Employee-disable-request-v1.0',
27
+ update: 'Employee-update-request-v1.0',
27
28
  search: 'Employee-search-request-v1.0',
28
29
  purge: 'Employee-purge-request-v1.0',
29
30
  });
@@ -57,7 +58,7 @@ function inferEmployeeEntryType(method) {
57
58
  return EmployeeBatchEntryTypes.disable;
58
59
  case 'PUT':
59
60
  case 'PATCH':
60
- return 'Employee-update-request-v1.0';
61
+ return EmployeeBatchEntryTypes.update;
61
62
  case 'GET':
62
63
  return EmployeeBatchEntryTypes.search;
63
64
  case 'POST':
@@ -0,0 +1,51 @@
1
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor';
2
+ /**
3
+ * Typed editor for one staged Encounter resource entry.
4
+ *
5
+ * Use this when a caller needs to stage one encounter row with claims-first
6
+ * accessors in a bundle authoring flow.
7
+ */
8
+ export declare class EncounterEntryEditor extends ClinicalResourceEntryEditor {
9
+ /** Writes the canonical encounter identifier. */
10
+ setIdentifier(identifier?: string | null): this;
11
+ /** Reads the canonical encounter identifier. */
12
+ getIdentifier(): string | undefined;
13
+ /** Ensures the encounter 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 encounter status. */
20
+ setStatus(value?: string | null): this;
21
+ /** Reads the encounter status. */
22
+ getStatus(): string | undefined;
23
+ /** Writes the encounter class. */
24
+ setClass(value?: string | null): this;
25
+ /** Reads the encounter class. */
26
+ getClass(): string | undefined;
27
+ /** Writes the encounter type. */
28
+ setType(value?: string | null): this;
29
+ /** Reads the encounter type. */
30
+ getType(): string | undefined;
31
+ /** Writes the participant list. */
32
+ setParticipantList(values: readonly string[]): this;
33
+ /** Reads the participant list. */
34
+ getParticipantList(): string[];
35
+ /** Writes the service-provider reference. */
36
+ setServiceProvider(value?: string | null): this;
37
+ /** Reads the service-provider reference. */
38
+ getServiceProvider(): string | undefined;
39
+ /** Writes the encounter start date/time. */
40
+ setPeriodStart(value?: string | null): this;
41
+ /** Reads the encounter start date/time. */
42
+ getPeriodStart(): string | undefined;
43
+ /** Writes the encounter end date/time. */
44
+ setPeriodEnd(value?: string | null): this;
45
+ /** Reads the encounter end date/time. */
46
+ getPeriodEnd(): string | undefined;
47
+ /** Writes the reason code. */
48
+ setReasonCode(value?: string | null): this;
49
+ /** Reads the reason code. */
50
+ getReasonCode(): string | undefined;
51
+ }
@@ -0,0 +1,55 @@
1
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor.js';
2
+ import { EncounterClaim } from '../models/interoperable-claims/encounter-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 Encounter resource entry.
7
+ *
8
+ * Use this when a caller needs to stage one encounter row with claims-first
9
+ * accessors in a bundle authoring flow.
10
+ */
11
+ export class EncounterEntryEditor extends ClinicalResourceEntryEditor {
12
+ /** Writes the canonical encounter identifier. */
13
+ setIdentifier(identifier) { return this.setIdentifierValue(EncounterClaim.Identifier, identifier); }
14
+ /** Reads the canonical encounter identifier. */
15
+ getIdentifier() { return this.getIdentifierValue(EncounterClaim.Identifier); }
16
+ /** Ensures the encounter entry has one canonical `urn:uuid:*` identifier. */
17
+ ensureIdentifier() { return this.ensureIdentifierValue(EncounterClaim.Identifier); }
18
+ /** Writes the subject/patient reference. */
19
+ setSubject(subject) { return this.setSubjectClaims(EncounterClaim.Subject, EncounterClaim.Patient, subject); }
20
+ /** Reads the subject/patient reference. */
21
+ getSubject() { return this.getSubjectClaims(EncounterClaim.Subject, EncounterClaim.Patient); }
22
+ /** Writes the encounter status. */
23
+ setStatus(value) { return this.setScalarClaim(EncounterClaim.Status, value); }
24
+ /** Reads the encounter status. */
25
+ getStatus() { return this.getScalarClaim(EncounterClaim.Status); }
26
+ /** Writes the encounter class. */
27
+ setClass(value) { return this.setScalarClaim(EncounterClaim.Class, value); }
28
+ /** Reads the encounter class. */
29
+ getClass() { return this.getScalarClaim(EncounterClaim.Class); }
30
+ /** Writes the encounter type. */
31
+ setType(value) { return this.setScalarClaim(EncounterClaim.Type, value); }
32
+ /** Reads the encounter type. */
33
+ getType() { return this.getScalarClaim(EncounterClaim.Type); }
34
+ /** Writes the participant list. */
35
+ setParticipantList(values) { return this.setCsvClaimList(EncounterClaim.Participant, values); }
36
+ /** Reads the participant list. */
37
+ getParticipantList() { return this.getCsvClaimList(EncounterClaim.Participant); }
38
+ /** Writes the service-provider reference. */
39
+ setServiceProvider(value) { return this.setScalarClaim(EncounterClaim.ServiceProvider, value); }
40
+ /** Reads the service-provider reference. */
41
+ getServiceProvider() { return this.getScalarClaim(EncounterClaim.ServiceProvider); }
42
+ /** Writes the encounter start date/time. */
43
+ setPeriodStart(value) { return this.setScalarClaim(EncounterClaim.PeriodStart, value); }
44
+ /** Reads the encounter start date/time. */
45
+ getPeriodStart() { return this.getScalarClaim(EncounterClaim.PeriodStart); }
46
+ /** Writes the encounter end date/time. */
47
+ setPeriodEnd(value) { return this.setScalarClaim(EncounterClaim.PeriodEnd, value); }
48
+ /** Reads the encounter end date/time. */
49
+ getPeriodEnd() { return this.getScalarClaim(EncounterClaim.PeriodEnd); }
50
+ /** Writes the reason code. */
51
+ setReasonCode(value) { return this.setScalarClaim(EncounterClaim.ReasonCode, value); }
52
+ /** Reads the reason code. */
53
+ getReasonCode() { return this.getScalarClaim(EncounterClaim.ReasonCode); }
54
+ }
55
+ registerBundleEntryEditor(BundleEditableResourceTypes.encounter, EncounterEntryEditor);
@@ -0,0 +1,47 @@
1
+ import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor';
2
+ /**
3
+ * Typed editor for one staged Flag resource entry.
4
+ *
5
+ * Use this when a caller needs to stage one flag row with claims-first
6
+ * accessors in a bundle authoring flow.
7
+ */
8
+ export declare class FlagEntryEditor extends ClinicalResourceEntryEditor {
9
+ /** Writes the canonical flag identifier. */
10
+ setIdentifier(identifier?: string | null): this;
11
+ /** Reads the canonical flag identifier. */
12
+ getIdentifier(): string | undefined;
13
+ /** Ensures the flag 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 flag status. */
20
+ setStatus(value?: string | null): this;
21
+ /** Reads the flag status. */
22
+ getStatus(): string | undefined;
23
+ /** Writes the flag category. */
24
+ setCategory(value?: string | null): this;
25
+ /** Reads the flag category. */
26
+ getCategory(): string | undefined;
27
+ /** Writes the flag code. */
28
+ setCode(value?: string | null): this;
29
+ /** Reads the flag code. */
30
+ getCode(): string | undefined;
31
+ /** Writes the flag date. */
32
+ setDate(value?: string | null): this;
33
+ /** Reads the flag date. */
34
+ getDate(): string | undefined;
35
+ /** Writes the linked encounter reference. */
36
+ setEncounter(value?: string | null): this;
37
+ /** Reads the linked encounter reference. */
38
+ getEncounter(): string | undefined;
39
+ /** Writes the flag period start. */
40
+ setPeriodStart(value?: string | null): this;
41
+ /** Reads the flag period start. */
42
+ getPeriodStart(): string | undefined;
43
+ /** Writes the flag period end. */
44
+ setPeriodEnd(value?: string | null): this;
45
+ /** Reads the flag period end. */
46
+ getPeriodEnd(): string | undefined;
47
+ }