gdc-common-utils-ts 1.14.9 → 1.14.13

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 (258) hide show
  1. package/README.md +55 -2
  2. package/dist/claims/claim-list-helpers.d.ts +21 -0
  3. package/dist/claims/claim-list-helpers.js +50 -0
  4. package/dist/claims/claims-helpers-allergy-intolerance.d.ts +10 -0
  5. package/dist/claims/claims-helpers-allergy-intolerance.js +47 -0
  6. package/dist/claims/claims-helpers-appointment-response.d.ts +8 -0
  7. package/dist/claims/claims-helpers-appointment-response.js +20 -0
  8. package/dist/claims/claims-helpers-appointment.d.ts +10 -0
  9. package/dist/claims/claims-helpers-appointment.js +26 -0
  10. package/dist/claims/claims-helpers-care-plan.d.ts +8 -0
  11. package/dist/claims/claims-helpers-care-plan.js +20 -0
  12. package/dist/claims/claims-helpers-clinical-impression.d.ts +10 -0
  13. package/dist/claims/claims-helpers-clinical-impression.js +26 -0
  14. package/dist/claims/claims-helpers-communication.d.ts +17 -0
  15. package/dist/claims/claims-helpers-communication.js +57 -0
  16. package/dist/claims/claims-helpers-composition.d.ts +12 -0
  17. package/dist/claims/claims-helpers-composition.js +32 -0
  18. package/dist/claims/claims-helpers-condition.d.ts +10 -0
  19. package/dist/claims/claims-helpers-condition.js +47 -0
  20. package/dist/claims/claims-helpers-consent.d.ts +112 -0
  21. package/dist/claims/claims-helpers-consent.js +271 -0
  22. package/dist/claims/claims-helpers-coverage.d.ts +10 -0
  23. package/dist/claims/claims-helpers-coverage.js +26 -0
  24. package/dist/claims/claims-helpers-device-use-statement.d.ts +8 -0
  25. package/dist/claims/claims-helpers-device-use-statement.js +20 -0
  26. package/dist/claims/claims-helpers-device.d.ts +8 -0
  27. package/dist/claims/claims-helpers-device.js +20 -0
  28. package/dist/claims/claims-helpers-diagnostic-report.d.ts +12 -0
  29. package/dist/claims/claims-helpers-diagnostic-report.js +32 -0
  30. package/dist/claims/claims-helpers-document-reference.d.ts +8 -0
  31. package/dist/claims/claims-helpers-document-reference.js +20 -0
  32. package/dist/claims/claims-helpers-encounter.d.ts +10 -0
  33. package/dist/claims/claims-helpers-encounter.js +26 -0
  34. package/dist/claims/claims-helpers-flag.d.ts +8 -0
  35. package/dist/claims/claims-helpers-flag.js +20 -0
  36. package/dist/claims/claims-helpers-immunization.d.ts +8 -0
  37. package/dist/claims/claims-helpers-immunization.js +20 -0
  38. package/dist/claims/claims-helpers-location.d.ts +10 -0
  39. package/dist/claims/claims-helpers-location.js +26 -0
  40. package/dist/claims/claims-helpers-medication-statement.d.ts +88 -0
  41. package/dist/claims/claims-helpers-medication-statement.js +259 -0
  42. package/dist/claims/claims-helpers-observation.d.ts +8 -0
  43. package/dist/claims/claims-helpers-observation.js +20 -0
  44. package/dist/claims/claims-helpers-organization.d.ts +12 -0
  45. package/dist/claims/claims-helpers-organization.js +32 -0
  46. package/dist/claims/claims-helpers-procedure.d.ts +8 -0
  47. package/dist/claims/claims-helpers-procedure.js +20 -0
  48. package/dist/claims/claims-helpers-related-person.d.ts +8 -0
  49. package/dist/claims/claims-helpers-related-person.js +20 -0
  50. package/dist/claims/index.d.ts +24 -0
  51. package/dist/claims/index.js +24 -0
  52. package/dist/constants/fhir-resource-types.d.ts +16 -0
  53. package/dist/constants/fhir-resource-types.js +8 -0
  54. package/dist/convert/convert-allergy-intolerance.d.ts +3 -0
  55. package/dist/convert/convert-allergy-intolerance.js +34 -0
  56. package/dist/convert/convert-appointment-response.d.ts +3 -0
  57. package/dist/convert/convert-appointment-response.js +32 -0
  58. package/dist/convert/convert-appointment.d.ts +3 -0
  59. package/dist/convert/convert-appointment.js +61 -0
  60. package/dist/convert/convert-care-plan.d.ts +3 -0
  61. package/dist/convert/convert-care-plan.js +58 -0
  62. package/dist/convert/convert-clinical-impression.d.ts +3 -0
  63. package/dist/convert/convert-clinical-impression.js +42 -0
  64. package/dist/convert/convert-composition.d.ts +3 -0
  65. package/dist/convert/convert-composition.js +35 -0
  66. package/dist/convert/convert-condition.d.ts +3 -0
  67. package/dist/convert/convert-condition.js +24 -0
  68. package/dist/convert/convert-coverage.d.ts +3 -0
  69. package/dist/convert/convert-coverage.js +51 -0
  70. package/dist/convert/convert-device-use-statement.d.ts +3 -0
  71. package/dist/convert/convert-device-use-statement.js +28 -0
  72. package/dist/convert/convert-device.d.ts +3 -0
  73. package/dist/convert/convert-device.js +37 -0
  74. package/dist/convert/convert-diagnostic-report.d.ts +3 -0
  75. package/dist/convert/convert-diagnostic-report.js +55 -0
  76. package/dist/convert/convert-document-reference.d.ts +3 -0
  77. package/dist/convert/convert-document-reference.js +35 -0
  78. package/dist/convert/convert-encounter.d.ts +3 -0
  79. package/dist/convert/convert-encounter.js +68 -0
  80. package/dist/convert/convert-flag.d.ts +3 -0
  81. package/dist/convert/convert-flag.js +34 -0
  82. package/dist/convert/convert-immunization.d.ts +3 -0
  83. package/dist/convert/convert-immunization.js +56 -0
  84. package/dist/convert/convert-location.d.ts +3 -0
  85. package/dist/convert/convert-location.js +44 -0
  86. package/dist/convert/convert-medication-statement.d.ts +3 -0
  87. package/dist/convert/convert-medication-statement.js +64 -0
  88. package/dist/convert/convert-observation.d.ts +3 -0
  89. package/dist/convert/convert-observation.js +57 -0
  90. package/dist/convert/convert-organization.d.ts +3 -0
  91. package/dist/convert/convert-organization.js +39 -0
  92. package/dist/convert/convert-procedure.d.ts +3 -0
  93. package/dist/convert/convert-procedure.js +50 -0
  94. package/dist/convert/convert-related-person.d.ts +3 -0
  95. package/dist/convert/convert-related-person.js +31 -0
  96. package/dist/convert/convert-shared.d.ts +34 -0
  97. package/dist/convert/convert-shared.js +179 -0
  98. package/dist/convert/index.d.ts +22 -0
  99. package/dist/convert/index.js +22 -0
  100. package/dist/examples/communication-bundle-document-request.js +2 -2
  101. package/dist/examples/communication-bundle-session.js +2 -2
  102. package/dist/examples/shared.d.ts +21 -2
  103. package/dist/examples/shared.js +74 -1
  104. package/dist/index.d.ts +2 -0
  105. package/dist/index.js +2 -0
  106. package/dist/models/bundle.d.ts +13 -1
  107. package/dist/models/interoperable-claims/appointment-claims.d.ts +23 -1
  108. package/dist/models/interoperable-claims/appointment-claims.js +22 -1
  109. package/dist/models/interoperable-claims/appointment-response-claims.d.ts +14 -0
  110. package/dist/models/interoperable-claims/appointment-response-claims.js +13 -0
  111. package/dist/models/interoperable-claims/care-plan-claims.d.ts +24 -0
  112. package/dist/models/interoperable-claims/care-plan-claims.js +44 -0
  113. package/dist/models/interoperable-claims/clinical-impression-claims.d.ts +17 -0
  114. package/dist/models/interoperable-claims/clinical-impression-claims.js +30 -0
  115. package/dist/models/interoperable-claims/coverage-claims.d.ts +16 -0
  116. package/dist/models/interoperable-claims/coverage-claims.js +28 -0
  117. package/dist/models/interoperable-claims/device-claims.d.ts +18 -0
  118. package/dist/models/interoperable-claims/device-claims.js +32 -0
  119. package/dist/models/interoperable-claims/diagnostic-report-claims.d.ts +2 -2
  120. package/dist/models/interoperable-claims/diagnostic-report-claims.js +1 -1
  121. package/dist/models/interoperable-claims/encounter-claims.d.ts +18 -0
  122. package/dist/models/interoperable-claims/encounter-claims.js +32 -0
  123. package/dist/models/interoperable-claims/flag-claims.d.ts +16 -0
  124. package/dist/models/interoperable-claims/flag-claims.js +28 -0
  125. package/dist/models/interoperable-claims/immunization-claims.d.ts +23 -0
  126. package/dist/models/interoperable-claims/immunization-claims.js +42 -0
  127. package/dist/models/interoperable-claims/index.d.ts +12 -0
  128. package/dist/models/interoperable-claims/index.js +12 -0
  129. package/dist/models/interoperable-claims/location-claims.d.ts +22 -0
  130. package/dist/models/interoperable-claims/location-claims.js +34 -0
  131. package/dist/models/interoperable-claims/observation-claims.d.ts +26 -0
  132. package/dist/models/interoperable-claims/observation-claims.js +48 -0
  133. package/dist/models/interoperable-claims/organization-claims.d.ts +18 -0
  134. package/dist/models/interoperable-claims/organization-claims.js +27 -0
  135. package/dist/models/interoperable-claims/procedure-claims.d.ts +22 -0
  136. package/dist/models/interoperable-claims/procedure-claims.js +40 -0
  137. package/dist/models/interoperable-claims/related-person-claims.d.ts +14 -0
  138. package/dist/models/interoperable-claims/related-person-claims.js +24 -0
  139. package/dist/utils/appointment-claim-helpers.d.ts +10 -0
  140. package/dist/utils/appointment-claim-helpers.js +26 -0
  141. package/dist/utils/appointment-response-claim-helpers.d.ts +8 -0
  142. package/dist/utils/appointment-response-claim-helpers.js +20 -0
  143. package/dist/utils/bundle-document-builder.d.ts +36 -0
  144. package/dist/utils/bundle-document-builder.js +311 -0
  145. package/dist/utils/claims-helpers-allergy-intolerance.d.ts +1 -0
  146. package/dist/utils/claims-helpers-allergy-intolerance.js +1 -0
  147. package/dist/utils/claims-helpers-appointment-response.d.ts +1 -0
  148. package/dist/utils/claims-helpers-appointment-response.js +1 -0
  149. package/dist/utils/claims-helpers-appointment.d.ts +1 -0
  150. package/dist/utils/claims-helpers-appointment.js +1 -0
  151. package/dist/utils/claims-helpers-care-plan.d.ts +1 -0
  152. package/dist/utils/claims-helpers-care-plan.js +1 -0
  153. package/dist/utils/claims-helpers-clinical-impression.d.ts +1 -0
  154. package/dist/utils/claims-helpers-clinical-impression.js +1 -0
  155. package/dist/utils/claims-helpers-communication.d.ts +1 -0
  156. package/dist/utils/claims-helpers-communication.js +1 -0
  157. package/dist/utils/claims-helpers-composition.d.ts +1 -0
  158. package/dist/utils/claims-helpers-composition.js +1 -0
  159. package/dist/utils/claims-helpers-condition.d.ts +1 -0
  160. package/dist/utils/claims-helpers-condition.js +1 -0
  161. package/dist/utils/claims-helpers-consent.d.ts +1 -0
  162. package/dist/utils/claims-helpers-consent.js +1 -0
  163. package/dist/utils/claims-helpers-coverage.d.ts +1 -0
  164. package/dist/utils/claims-helpers-coverage.js +1 -0
  165. package/dist/utils/claims-helpers-device-use-statement.d.ts +1 -0
  166. package/dist/utils/claims-helpers-device-use-statement.js +1 -0
  167. package/dist/utils/claims-helpers-device.d.ts +1 -0
  168. package/dist/utils/claims-helpers-device.js +1 -0
  169. package/dist/utils/claims-helpers-diagnostic-report.d.ts +1 -0
  170. package/dist/utils/claims-helpers-diagnostic-report.js +1 -0
  171. package/dist/utils/claims-helpers-document-reference.d.ts +1 -0
  172. package/dist/utils/claims-helpers-document-reference.js +1 -0
  173. package/dist/utils/claims-helpers-encounter.d.ts +1 -0
  174. package/dist/utils/claims-helpers-encounter.js +1 -0
  175. package/dist/utils/claims-helpers-flag.d.ts +1 -0
  176. package/dist/utils/claims-helpers-flag.js +1 -0
  177. package/dist/utils/claims-helpers-immunization.d.ts +1 -0
  178. package/dist/utils/claims-helpers-immunization.js +1 -0
  179. package/dist/utils/claims-helpers-location.d.ts +1 -0
  180. package/dist/utils/claims-helpers-location.js +1 -0
  181. package/dist/utils/claims-helpers-medication-statement.d.ts +1 -0
  182. package/dist/utils/claims-helpers-medication-statement.js +1 -0
  183. package/dist/utils/claims-helpers-observation.d.ts +1 -0
  184. package/dist/utils/claims-helpers-observation.js +1 -0
  185. package/dist/utils/claims-helpers-organization.d.ts +1 -0
  186. package/dist/utils/claims-helpers-organization.js +1 -0
  187. package/dist/utils/claims-helpers-procedure.d.ts +1 -0
  188. package/dist/utils/claims-helpers-procedure.js +1 -0
  189. package/dist/utils/claims-helpers-related-person.d.ts +1 -0
  190. package/dist/utils/claims-helpers-related-person.js +1 -0
  191. package/dist/utils/clinical-impression-claim-helpers.d.ts +10 -0
  192. package/dist/utils/clinical-impression-claim-helpers.js +26 -0
  193. package/dist/utils/clinical-resource-converters.d.ts +91 -62
  194. package/dist/utils/clinical-resource-converters.js +135 -273
  195. package/dist/utils/communication-bundle-document-request.d.ts +6 -4
  196. package/dist/utils/communication-bundle-document-request.js +7 -5
  197. package/dist/utils/communication-bundle-session.js +1 -1
  198. package/dist/utils/composition-claim-helpers.d.ts +12 -0
  199. package/dist/utils/composition-claim-helpers.js +32 -0
  200. package/dist/utils/consent-claim-helpers.d.ts +2 -2
  201. package/dist/utils/consent-claim-helpers.js +2 -2
  202. package/dist/utils/convert-allergy-intolerance.d.ts +3 -0
  203. package/dist/utils/convert-allergy-intolerance.js +34 -0
  204. package/dist/utils/convert-appointment-response.d.ts +3 -0
  205. package/dist/utils/convert-appointment-response.js +32 -0
  206. package/dist/utils/convert-appointment.d.ts +3 -0
  207. package/dist/utils/convert-appointment.js +61 -0
  208. package/dist/utils/convert-care-plan.d.ts +3 -0
  209. package/dist/utils/convert-care-plan.js +58 -0
  210. package/dist/utils/convert-clinical-impression.d.ts +3 -0
  211. package/dist/utils/convert-clinical-impression.js +42 -0
  212. package/dist/utils/convert-composition.d.ts +3 -0
  213. package/dist/utils/convert-composition.js +35 -0
  214. package/dist/utils/convert-condition.d.ts +3 -0
  215. package/dist/utils/convert-condition.js +24 -0
  216. package/dist/utils/convert-coverage.d.ts +3 -0
  217. package/dist/utils/convert-coverage.js +51 -0
  218. package/dist/utils/convert-device-use-statement.d.ts +3 -0
  219. package/dist/utils/convert-device-use-statement.js +28 -0
  220. package/dist/utils/convert-device.d.ts +3 -0
  221. package/dist/utils/convert-device.js +37 -0
  222. package/dist/utils/convert-diagnostic-report.d.ts +3 -0
  223. package/dist/utils/convert-diagnostic-report.js +55 -0
  224. package/dist/utils/convert-document-reference.d.ts +3 -0
  225. package/dist/utils/convert-document-reference.js +35 -0
  226. package/dist/utils/convert-encounter.d.ts +3 -0
  227. package/dist/utils/convert-encounter.js +68 -0
  228. package/dist/utils/convert-flag.d.ts +3 -0
  229. package/dist/utils/convert-flag.js +34 -0
  230. package/dist/utils/convert-immunization.d.ts +3 -0
  231. package/dist/utils/convert-immunization.js +56 -0
  232. package/dist/utils/convert-medication-statement.d.ts +3 -0
  233. package/dist/utils/convert-medication-statement.js +64 -0
  234. package/dist/utils/convert-observation.d.ts +3 -0
  235. package/dist/utils/convert-observation.js +57 -0
  236. package/dist/utils/convert-procedure.d.ts +3 -0
  237. package/dist/utils/convert-procedure.js +50 -0
  238. package/dist/utils/convert-related-person.d.ts +3 -0
  239. package/dist/utils/convert-related-person.js +31 -0
  240. package/dist/utils/convert-shared.d.ts +34 -0
  241. package/dist/utils/convert-shared.js +179 -0
  242. package/dist/utils/coverage-claim-helpers.d.ts +10 -0
  243. package/dist/utils/coverage-claim-helpers.js +26 -0
  244. package/dist/utils/diagnostic-report-claim-helpers.d.ts +12 -0
  245. package/dist/utils/diagnostic-report-claim-helpers.js +32 -0
  246. package/dist/utils/encounter-claim-helpers.d.ts +10 -0
  247. package/dist/utils/encounter-claim-helpers.js +26 -0
  248. package/dist/utils/fhir-cid.d.ts +49 -0
  249. package/dist/utils/fhir-cid.js +75 -0
  250. package/dist/utils/index.d.ts +4 -6
  251. package/dist/utils/index.js +4 -6
  252. package/dist/utils/ips-bundle-claims.d.ts +52 -0
  253. package/dist/utils/ips-bundle-claims.js +104 -0
  254. package/dist/utils/jwt.d.ts +16 -0
  255. package/dist/utils/jwt.js +21 -0
  256. package/dist/utils/related-person-claim-helpers.d.ts +8 -0
  257. package/dist/utils/related-person-claim-helpers.js +20 -0
  258. package/package.json +17 -1
@@ -0,0 +1,179 @@
1
+ // Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
+ // File: src/utils/convert-shared.ts
3
+ export function isPlainObject(value) {
4
+ return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
5
+ }
6
+ export function codingFromValue(value) {
7
+ if (!value)
8
+ return undefined;
9
+ const [system, code] = value.split('|');
10
+ if (!code)
11
+ return [{ code: system }];
12
+ return [{ system, code }];
13
+ }
14
+ export function codingToValue(coding) {
15
+ if (!coding?.code)
16
+ return undefined;
17
+ return coding.system ? `${coding.system}|${coding.code}` : coding.code;
18
+ }
19
+ export function referenceToValue(reference) {
20
+ return reference?.reference;
21
+ }
22
+ export function referenceListToCsv(references) {
23
+ const values = (references || [])
24
+ .map((item) => item?.reference)
25
+ .filter((item) => Boolean(item));
26
+ return values.length ? values.join(',') : undefined;
27
+ }
28
+ export function codingListToCsv(codings) {
29
+ const values = (codings || [])
30
+ .map((item) => codingToValue(item))
31
+ .filter((item) => Boolean(item));
32
+ return values.length ? values.join(',') : undefined;
33
+ }
34
+ export function requireClaim(claims, key) {
35
+ const value = claims[key];
36
+ if (!value)
37
+ throw new Error(`Missing required claim: ${key}`);
38
+ return value;
39
+ }
40
+ export function requireSubjectIdentifier(value, key) {
41
+ if (!value.startsWith('urn:') && !value.startsWith('did:web:')) {
42
+ throw new Error(`Invalid ${key}: expected urn:* or did:web:*`);
43
+ }
44
+ }
45
+ export function requireDidWeb(value, key) {
46
+ if (!value.startsWith('did:web:')) {
47
+ throw new Error(`Invalid ${key}: expected did:web:*`);
48
+ }
49
+ }
50
+ function stringifyClaimLeaf(value) {
51
+ if (value === undefined || value === null)
52
+ return undefined;
53
+ if (typeof value === 'string')
54
+ return value;
55
+ if (typeof value === 'number' || typeof value === 'boolean')
56
+ return String(value);
57
+ return undefined;
58
+ }
59
+ function flattenClaimPath(prefix, value, out) {
60
+ const primitive = stringifyClaimLeaf(value);
61
+ if (primitive !== undefined) {
62
+ out[prefix] = primitive;
63
+ if (typeof value === 'number' || typeof value === 'boolean') {
64
+ out[`${prefix}#type`] = typeof value;
65
+ }
66
+ return;
67
+ }
68
+ if (Array.isArray(value)) {
69
+ value.forEach((entry, index) => {
70
+ flattenClaimPath(`${prefix}[${index}]`, entry, out);
71
+ });
72
+ return;
73
+ }
74
+ if (isPlainObject(value)) {
75
+ for (const [key, nestedValue] of Object.entries(value)) {
76
+ if (key === 'meta' && isPlainObject(nestedValue) && 'claims' in nestedValue) {
77
+ const nestedMeta = { ...nestedValue };
78
+ delete nestedMeta.claims;
79
+ if (Object.keys(nestedMeta).length === 0)
80
+ continue;
81
+ flattenClaimPath(`${prefix}.${key}`, nestedMeta, out);
82
+ continue;
83
+ }
84
+ flattenClaimPath(`${prefix}.${key}`, nestedValue, out);
85
+ }
86
+ }
87
+ }
88
+ function parseClaimPath(path) {
89
+ const segments = [];
90
+ const re = /([^[.\]]+)|\[(\d+)\]/g;
91
+ let match;
92
+ while ((match = re.exec(path)) !== null) {
93
+ if (match[1])
94
+ segments.push(match[1]);
95
+ else if (match[2])
96
+ segments.push(Number(match[2]));
97
+ }
98
+ return segments;
99
+ }
100
+ function coerceClaimLeaf(value, typeHint) {
101
+ if (typeHint === 'boolean')
102
+ return value === 'true';
103
+ if (typeHint === 'number')
104
+ return Number(value);
105
+ return value;
106
+ }
107
+ function assignInflatedPath(target, path, value, typeHint) {
108
+ const segments = parseClaimPath(path);
109
+ if (segments.length === 0)
110
+ return;
111
+ let cursor = target;
112
+ for (let index = 0; index < segments.length; index += 1) {
113
+ const segment = segments[index];
114
+ const nextSegment = segments[index + 1];
115
+ const isLast = index === segments.length - 1;
116
+ if (typeof segment === 'number') {
117
+ if (!Array.isArray(cursor))
118
+ return;
119
+ if (isLast) {
120
+ cursor[segment] = coerceClaimLeaf(value, typeHint);
121
+ return;
122
+ }
123
+ if (cursor[segment] === undefined)
124
+ cursor[segment] = typeof nextSegment === 'number' ? [] : {};
125
+ cursor = cursor[segment];
126
+ continue;
127
+ }
128
+ if (!isPlainObject(cursor))
129
+ return;
130
+ if (isLast) {
131
+ cursor[segment] = coerceClaimLeaf(value, typeHint);
132
+ return;
133
+ }
134
+ if (cursor[segment] === undefined)
135
+ cursor[segment] = typeof nextSegment === 'number' ? [] : {};
136
+ cursor = cursor[segment];
137
+ }
138
+ }
139
+ /**
140
+ * Generic structural fallback for unsupported resources.
141
+ */
142
+ export function fhirResourceToFlatClaims(resource, context = 'org.hl7.fhir.r4') {
143
+ if (!resource?.resourceType) {
144
+ throw new Error('FHIR resource must define resourceType.');
145
+ }
146
+ const out = { '@context': context };
147
+ for (const [key, value] of Object.entries(resource)) {
148
+ if (key === 'resourceType')
149
+ continue;
150
+ flattenClaimPath(`${resource.resourceType}.${key}`, value, out);
151
+ }
152
+ return out;
153
+ }
154
+ /**
155
+ * Generic structural regeneration for unsupported resources.
156
+ */
157
+ export function flatClaimsToFhirResource(claims) {
158
+ const typeHints = new Map();
159
+ for (const [key, value] of Object.entries(claims || {})) {
160
+ if (key.endsWith('#type') && typeof value === 'string') {
161
+ typeHints.set(key.slice(0, -5), value);
162
+ }
163
+ }
164
+ const entries = Object.entries(claims || {}).filter(([key, value]) => key !== '@context' && !key.endsWith('#type') && value !== undefined);
165
+ const firstClaimKey = entries[0]?.[0];
166
+ if (!firstClaimKey || !firstClaimKey.includes('.')) {
167
+ throw new Error('Flat claims must contain at least one contextualized resource claim.');
168
+ }
169
+ const resourceType = firstClaimKey.split('.')[0];
170
+ const resource = { resourceType };
171
+ for (const [key, value] of entries) {
172
+ if (typeof value !== 'string')
173
+ continue;
174
+ if (!key.startsWith(`${resourceType}.`))
175
+ continue;
176
+ assignInflatedPath(resource, key.slice(resourceType.length + 1), value, typeHints.get(key));
177
+ }
178
+ return resource;
179
+ }
@@ -0,0 +1,22 @@
1
+ export * from './convert-shared';
2
+ export * from './convert-medication-statement';
3
+ export * from './convert-allergy-intolerance';
4
+ export * from './convert-condition';
5
+ export * from './convert-device-use-statement';
6
+ export * from './convert-document-reference';
7
+ export * from './convert-immunization';
8
+ export * from './convert-location';
9
+ export * from './convert-observation';
10
+ export * from './convert-organization';
11
+ export * from './convert-procedure';
12
+ export * from './convert-device';
13
+ export * from './convert-flag';
14
+ export * from './convert-care-plan';
15
+ export * from './convert-diagnostic-report';
16
+ export * from './convert-composition';
17
+ export * from './convert-appointment';
18
+ export * from './convert-appointment-response';
19
+ export * from './convert-encounter';
20
+ export * from './convert-related-person';
21
+ export * from './convert-coverage';
22
+ export * from './convert-clinical-impression';
@@ -0,0 +1,22 @@
1
+ export * from './convert-shared.js';
2
+ export * from './convert-medication-statement.js';
3
+ export * from './convert-allergy-intolerance.js';
4
+ export * from './convert-condition.js';
5
+ export * from './convert-device-use-statement.js';
6
+ export * from './convert-document-reference.js';
7
+ export * from './convert-immunization.js';
8
+ export * from './convert-location.js';
9
+ export * from './convert-observation.js';
10
+ export * from './convert-organization.js';
11
+ export * from './convert-procedure.js';
12
+ export * from './convert-device.js';
13
+ export * from './convert-flag.js';
14
+ export * from './convert-care-plan.js';
15
+ export * from './convert-diagnostic-report.js';
16
+ export * from './convert-composition.js';
17
+ export * from './convert-appointment.js';
18
+ export * from './convert-appointment-response.js';
19
+ export * from './convert-encounter.js';
20
+ export * from './convert-related-person.js';
21
+ export * from './convert-coverage.js';
22
+ export * from './convert-clinical-impression.js';
@@ -39,7 +39,7 @@ export function buildExampleIpsBundleDocumentRequestFromDoctor() {
39
39
  sender: EXAMPLE_EMAIL_PROFESSIONAL,
40
40
  requesterKind: BundleDocumentRequesterKinds.Employee,
41
41
  requesterIdentifier: EXAMPLE_EMAIL_PROFESSIONAL,
42
- requesterRole: HealthcareActorRoles.Physician,
42
+ requesterRole: HealthcareActorRoles.GeneralistMedicalPractitioner,
43
43
  documentType: DocumentTypeLoincOntology.IPS,
44
44
  sections,
45
45
  summaryOperationRequestReferencePath,
@@ -49,7 +49,7 @@ export function buildExampleIpsBundleDocumentRequestFromDoctor() {
49
49
  sender: EXAMPLE_EMAIL_PROFESSIONAL,
50
50
  requesterKind: BundleDocumentRequesterKinds.Employee,
51
51
  requesterIdentifier: EXAMPLE_EMAIL_PROFESSIONAL,
52
- requesterRole: HealthcareActorRoles.Physician,
52
+ requesterRole: HealthcareActorRoles.GeneralistMedicalPractitioner,
53
53
  documentType: DocumentTypeLoincOntology.IPS,
54
54
  sections,
55
55
  text: String(claims[CommunicationClaim.Text] || ''),
@@ -5,8 +5,8 @@ import { CommunicationCategoryCodes } from '../constants/communication.js';
5
5
  import { MedicationStatementClaim } from '../models/interoperable-claims/medication-statement-claims.js';
6
6
  import { EXAMPLE_COMMUNICATION_IDENTIFIER, EXAMPLE_CONSENT_DATE, EXAMPLE_CONSENT_IDENTIFIER, EXAMPLE_CONSENT_PERIOD_END, EXAMPLE_CONSENT_PERIOD_START, EXAMPLE_CONSENT_PURPOSE_TREATMENT, EXAMPLE_EMAIL_PROFESSIONAL, EXAMPLE_HEALTHCARE_ACTOR_ROLE_PHYSICIAN, EXAMPLE_IPS_BUNDLE_NOTE_TEXT, EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER, EXAMPLE_MEDICATION_STATEMENT_STATUS, EXAMPLE_MEDICATION_STATEMENT_TEXT, EXAMPLE_SUBJECT_DID, } from './shared.js';
7
7
  import { CommunicationBundleSession } from '../utils/communication-bundle-session.js';
8
- import { setCommunicationCategory, setCommunicationIdentifier, setCommunicationSubject, setCommunicationText, } from '../utils/communication-claim-helpers.js';
9
- import { setActorIdentifierList, setActorRoleList, setConsentDate, setConsentDecision, setConsentIdentifier, setConsentPeriodEnd, setConsentPeriodStart, setConsentSubject, setPurposeList, setSectionList, } from '../utils/consent-claim-helpers.js';
8
+ import { setCommunicationCategory, setCommunicationIdentifier, setCommunicationSubject, setCommunicationText, } from '../claims/claims-helpers-communication.js';
9
+ import { setActorIdentifierList, setActorRoleList, setConsentDate, setConsentDecision, setConsentIdentifier, setConsentPeriodEnd, setConsentPeriodStart, setConsentSubject, setPurposeList, setSectionList, } from '../claims/claims-helpers-consent.js';
10
10
  /**
11
11
  * First developer use case:
12
12
  * - edit a Consent entry inside a Communication-attached Bundle
@@ -110,8 +110,8 @@ export declare const EXAMPLE_MEDICATION_PARACETAMOL_TEXT: "Paracetamol 600 mg";
110
110
  export declare const EXAMPLE_MEDICATION_PARACETAMOL_IDENTIFIER_PREFIX: "urn:uuid:med-paracetamol";
111
111
  export declare const EXAMPLE_MEDICATION_PARACETAMOL_EFFECTIVE: "2026-06-01T12:00:00Z";
112
112
  export declare const EXAMPLE_MEDICATION_PARACETAMOL_NOTE: "Take every 8 hours as needed. Keep a 4 hour gap from ibuprofen.";
113
- export declare const EXAMPLE_IPS_BUNDLE_REFERENCE_URL: "individual/org.hl7.fhir.r4/Bundle?type=document&composition.subject=did:web:api.acme.org:individual:123&composition.type=http://loinc.org|60591-5";
114
- export declare const EXAMPLE_IPS_BUNDLE_REFERENCE_ABSOLUTE_URL: "https://provider.example.org/acme-id/cds-ES/v1/health-care/individual/org.hl7.fhir.r4/Bundle?type=document&composition.subject=did:web:api.acme.org:individual:123&composition.type=http://loinc.org|60591-5";
113
+ export declare const EXAMPLE_IPS_BUNDLE_REFERENCE_URL: "individual/org.hl7.fhir.r4/Bundle/_search?type=document&composition.subject=did:web:api.acme.org:individual:123&composition.type=http://loinc.org|60591-5";
114
+ export declare const EXAMPLE_IPS_BUNDLE_REFERENCE_ABSOLUTE_URL: "https://provider.example.org/acme-id/cds-ES/v1/health-care/individual/org.hl7.fhir.r4/Bundle/_search?type=document&composition.subject=did:web:api.acme.org:individual:123&composition.type=http://loinc.org|60591-5";
115
115
  export type ExampleDateRange = Readonly<{
116
116
  start: string;
117
117
  end: string;
@@ -141,6 +141,17 @@ export type ExampleLiveMedicationCase = Readonly<{
141
141
  dosageAsNeeded: boolean;
142
142
  section: string;
143
143
  }>;
144
+ export type ExampleMedicationIpsDocumentBundleInput = Readonly<{
145
+ subjectDid?: string;
146
+ medication: ExampleLiveMedicationCase;
147
+ }>;
148
+ export type ExampleMedicationIpsDocumentBundle = Readonly<{
149
+ resourceType: 'Bundle';
150
+ type: 'document';
151
+ entry: ReadonlyArray<{
152
+ resource: Record<string, unknown>;
153
+ }>;
154
+ }>;
144
155
  export declare const EXAMPLE_CONTROLLER_SIGN_KEY: {
145
156
  readonly kid: "controller-es384-001";
146
157
  readonly kty: "EC";
@@ -253,6 +264,14 @@ export declare function buildExampleDocumentReferenceSearchPayload(subjectDid?:
253
264
  };
254
265
  export declare function cloneExample<T>(value: T): T;
255
266
  export declare function buildExampleLiveMedicationCases(seed?: number): ExampleLiveMedicationCase[];
267
+ /**
268
+ * Builds a minimal IPS `Bundle.type=document` containing one
269
+ * `MedicationStatement` under the `History of medication use` section.
270
+ *
271
+ * This helper exists so live GW tests and demos do not handcraft one-off
272
+ * bundle structures inline.
273
+ */
274
+ export declare function buildExampleMedicationIpsDocumentBundle(input: ExampleMedicationIpsDocumentBundleInput): ExampleMedicationIpsDocumentBundle;
256
275
  export type ExampleHostedTenantRouteContext = Readonly<{
257
276
  alternateName: string;
258
277
  jurisdiction: string;
@@ -4,6 +4,8 @@ import { DataspaceSectors } from '../constants/sectors.js';
4
4
  import { HostNetworkTypes } from '../constants/network.js';
5
5
  import { HealthcareActorRoles, HealthcareBasicSections, HealthcareConsentPurposes, } from '../constants/healthcare.js';
6
6
  import { CommunicationClaim } from '../models/interoperable-claims/communication-claims.js';
7
+ import { MedicationStatementClaim, MedicationStatementClaimsFhirApiExtended, } from '../models/interoperable-claims/medication-statement-claims.js';
8
+ import { medicationStatementFlatToFhirR4 } from '../utils/clinical-resource-converters.js';
7
9
  /**
8
10
  * Shared low-level example fragments reused by multiple flow-specific example modules.
9
11
  *
@@ -116,7 +118,7 @@ export const EXAMPLE_MEDICATION_PARACETAMOL_TEXT = 'Paracetamol 600 mg';
116
118
  export const EXAMPLE_MEDICATION_PARACETAMOL_IDENTIFIER_PREFIX = 'urn:uuid:med-paracetamol';
117
119
  export const EXAMPLE_MEDICATION_PARACETAMOL_EFFECTIVE = '2026-06-01T12:00:00Z';
118
120
  export const EXAMPLE_MEDICATION_PARACETAMOL_NOTE = 'Take every 8 hours as needed. Keep a 4 hour gap from ibuprofen.';
119
- export const EXAMPLE_IPS_BUNDLE_REFERENCE_URL = `individual/org.hl7.fhir.r4/Bundle?type=document&composition.subject=${EXAMPLE_SUBJECT_DID}&composition.type=http://loinc.org|60591-5`;
121
+ export const EXAMPLE_IPS_BUNDLE_REFERENCE_URL = `individual/org.hl7.fhir.r4/Bundle/_search?type=document&composition.subject=${EXAMPLE_SUBJECT_DID}&composition.type=http://loinc.org|60591-5`;
120
122
  export const EXAMPLE_IPS_BUNDLE_REFERENCE_ABSOLUTE_URL = `https://provider.example.org/acme-id/cds-ES/v1/health-care/${EXAMPLE_IPS_BUNDLE_REFERENCE_URL}`;
121
123
  export const EXAMPLE_CLINICAL_DATE_RANGE = {
122
124
  start: '2026-01-01',
@@ -244,6 +246,77 @@ export function buildExampleLiveMedicationCases(seed = Date.now()) {
244
246
  },
245
247
  ];
246
248
  }
249
+ /**
250
+ * Builds a minimal IPS `Bundle.type=document` containing one
251
+ * `MedicationStatement` under the `History of medication use` section.
252
+ *
253
+ * This helper exists so live GW tests and demos do not handcraft one-off
254
+ * bundle structures inline.
255
+ */
256
+ export function buildExampleMedicationIpsDocumentBundle(input) {
257
+ const subjectDid = input.subjectDid || EXAMPLE_SUBJECT_DID;
258
+ const medicationClaims = {
259
+ '@context': 'org.hl7.fhir.api',
260
+ [MedicationStatementClaim.Identifier]: input.medication.identifier,
261
+ [MedicationStatementClaim.Subject]: subjectDid,
262
+ [MedicationStatementClaim.Status]: EXAMPLE_MEDICATION_STATEMENT_STATUS,
263
+ [MedicationStatementClaim.MedicationText]: input.medication.text,
264
+ [MedicationStatementClaim.Effective]: input.medication.effectiveDateTime,
265
+ [MedicationStatementClaim.Note]: input.medication.note,
266
+ [MedicationStatementClaim.Category]: input.medication.section || HealthcareBasicSections.HistoryOfMedicationUse.attributeValue,
267
+ [MedicationStatementClaimsFhirApiExtended.DoseQuantityValue]: input.medication.doseQuantityValue,
268
+ [MedicationStatementClaimsFhirApiExtended.DoseQuantityUnit]: input.medication.doseQuantityUnit,
269
+ [MedicationStatementClaimsFhirApiExtended.TimingFrequency]: input.medication.timingFrequency,
270
+ [MedicationStatementClaimsFhirApiExtended.TimingPeriod]: input.medication.timingPeriod,
271
+ [MedicationStatementClaimsFhirApiExtended.TimingPeriodUnit]: input.medication.timingPeriodUnit,
272
+ [MedicationStatementClaimsFhirApiExtended.DosageAsNeeded]: input.medication.dosageAsNeeded,
273
+ };
274
+ const medicationResource = medicationStatementFlatToFhirR4(medicationClaims);
275
+ medicationResource.id = input.medication.identifier;
276
+ medicationResource.meta = {
277
+ ...(typeof medicationResource.meta === 'object' && medicationResource.meta ? medicationResource.meta : {}),
278
+ claims: medicationClaims,
279
+ };
280
+ return {
281
+ resourceType: 'Bundle',
282
+ type: 'document',
283
+ entry: [
284
+ {
285
+ resource: {
286
+ resourceType: 'Composition',
287
+ id: `composition-${input.medication.identifier}`,
288
+ status: 'final',
289
+ subject: { reference: subjectDid },
290
+ type: { coding: [{ system: 'http://loinc.org', code: '60591-5' }] },
291
+ section: [
292
+ {
293
+ code: {
294
+ coding: [{
295
+ system: 'http://loinc.org',
296
+ code: '10160-0',
297
+ }],
298
+ },
299
+ entry: [
300
+ {
301
+ reference: `MedicationStatement/${input.medication.identifier}`,
302
+ },
303
+ ],
304
+ },
305
+ ],
306
+ },
307
+ },
308
+ {
309
+ resource: {
310
+ resourceType: 'Patient',
311
+ id: `patient-${input.medication.identifier}`,
312
+ },
313
+ },
314
+ {
315
+ resource: medicationResource,
316
+ },
317
+ ],
318
+ };
319
+ }
247
320
  export function buildExampleHostedTenantBaseUrl(input) {
248
321
  return `${EXAMPLE_GATEWAY_PUBLIC_ORIGIN}/${input.alternateName}/cds-${input.jurisdiction.toLowerCase()}/${input.version}/${input.sector}`;
249
322
  }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from './AesManager';
2
2
  export * from './CryptographyService';
3
+ export * from './claims';
3
4
  export * from './constants';
5
+ export * from './convert';
4
6
  export * from './examples';
5
7
  export * from './hmac';
6
8
  export * from './i18n/clinical-sections.i18n';
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from './AesManager.js';
2
2
  export * from './CryptographyService.js';
3
+ export * from './claims/index.js';
3
4
  export * from './constants/index.js';
5
+ export * from './convert/index.js';
4
6
  export * from './examples/index.js';
5
7
  export * from './hmac.js';
6
8
  export * from './i18n/clinical-sections.i18n.js';
@@ -34,6 +34,12 @@ export interface BundleRequest {
34
34
  /**
35
35
  * Defines the `response` property for an entry in a response Bundle.
36
36
  * This indicates the outcome of the action for the entry.
37
+ *
38
+ * Notes for consumers:
39
+ * - `status` is the primary per-entry result signal.
40
+ * - `response.outcome` may be present for diagnostics, warnings, or richer success details,
41
+ * but is not guaranteed to be present on every successful entry.
42
+ * - `BundleJsonApi.total` counts response entries in the bundle; it is not a success counter.
37
43
  */
38
44
  export interface BundleResponse {
39
45
  /** The HTTP status code as a string (e.g., "201", "404"). */
@@ -111,7 +117,13 @@ export interface ErrorEntry {
111
117
  response: {
112
118
  /** The HTTP status code reflecting the error (e.g., "400", "500"). */
113
119
  status: string;
114
- /** A FHIR OperationOutcome resource providing detailed error diagnostics. */
120
+ /**
121
+ * A FHIR OperationOutcome resource providing detailed diagnostics.
122
+ *
123
+ * `OperationOutcome.issue[*].severity` is not restricted to failure cases.
124
+ * Depending on the producer/profile it may contain:
125
+ * `fatal | error | warning | information | success`.
126
+ */
115
127
  outcome: OperationOutcome;
116
128
  };
117
129
  }
@@ -5,7 +5,7 @@
5
5
  * This model aligns with FHIR R5 conventions (using `note.text` instead of `comment`)
6
6
  * for forward compatibility and consistency with other resources like Communication.
7
7
  *
8
- * @basedon https://github.com/Universal-Health-Chain/uhc-fhir-utils-typescript/blob/main/src/models/templates/Appointment.template.model.ts
8
+ * @basedon https://github.com/Universal-Health-Chain/uhc-fhir-utils-ts/blob/main/src/models/templates/Appointment.template.model.ts
9
9
  */
10
10
  /**
11
11
  * Contains claims representing fields specific to the FHIR R4/R5 data model for an Appointment.
@@ -165,6 +165,28 @@ export declare const AppointmentClaimsFhirApiExtendedMap: {
165
165
  "org.hl7.fhir.api.Appointment.status": StringConstructor;
166
166
  "org.hl7.fhir.api.Appointment.supporting-info": StringConstructor;
167
167
  };
168
+ export declare const AppointmentClaim: {
169
+ readonly Identifier: "Appointment.identifier";
170
+ readonly Status: "Appointment.status";
171
+ readonly ServiceCategory: "Appointment.service-category";
172
+ readonly ServiceType: "Appointment.service-type";
173
+ readonly Specialty: "Appointment.specialty";
174
+ readonly AppointmentType: "Appointment.appointment-type";
175
+ readonly ReasonCode: "Appointment.reason-code";
176
+ readonly ReasonReference: "Appointment.reason-reference";
177
+ readonly Description: "Appointment.description";
178
+ readonly Start: "Appointment.start";
179
+ readonly End: "Appointment.end";
180
+ readonly MinutesDuration: "Appointment.minutes-duration";
181
+ readonly Created: "Appointment.created";
182
+ readonly NoteText: "Appointment.note-text";
183
+ readonly PatientInstruction: "Appointment.patient-instruction";
184
+ readonly BasedOn: "Appointment.based-on";
185
+ readonly ParticipantActor: "Appointment.participant.actor";
186
+ readonly ParticipantStatus: "Appointment.participant.status";
187
+ readonly ParticipantType: "Appointment.participant.type";
188
+ };
189
+ export type AppointmentClaimKey = typeof AppointmentClaim[keyof typeof AppointmentClaim];
168
190
  /**
169
191
  * Defines the possible values for the `status` field on a FHIR Appointment resource.
170
192
  * @basedon http://hl7.org/fhir/R4/appointment.html#status
@@ -6,7 +6,7 @@
6
6
  * This model aligns with FHIR R5 conventions (using `note.text` instead of `comment`)
7
7
  * for forward compatibility and consistency with other resources like Communication.
8
8
  *
9
- * @basedon https://github.com/Universal-Health-Chain/uhc-fhir-utils-typescript/blob/main/src/models/templates/Appointment.template.model.ts
9
+ * @basedon https://github.com/Universal-Health-Chain/uhc-fhir-utils-ts/blob/main/src/models/templates/Appointment.template.model.ts
10
10
  */
11
11
  /**
12
12
  * Contains claims representing fields specific to the FHIR R4/R5 data model for an Appointment.
@@ -155,6 +155,27 @@ export const AppointmentClaimsFhirApiExtendedMap = {
155
155
  [AppointmentClaimsFhirApiExtended.Description]: String,
156
156
  [AppointmentClaimsFhirApiExtended.NoteText]: String,
157
157
  };
158
+ export const AppointmentClaim = {
159
+ Identifier: 'Appointment.identifier',
160
+ Status: 'Appointment.status',
161
+ ServiceCategory: 'Appointment.service-category',
162
+ ServiceType: 'Appointment.service-type',
163
+ Specialty: 'Appointment.specialty',
164
+ AppointmentType: 'Appointment.appointment-type',
165
+ ReasonCode: 'Appointment.reason-code',
166
+ ReasonReference: 'Appointment.reason-reference',
167
+ Description: 'Appointment.description',
168
+ Start: 'Appointment.start',
169
+ End: 'Appointment.end',
170
+ MinutesDuration: 'Appointment.minutes-duration',
171
+ Created: 'Appointment.created',
172
+ NoteText: 'Appointment.note-text',
173
+ PatientInstruction: 'Appointment.patient-instruction',
174
+ BasedOn: 'Appointment.based-on',
175
+ ParticipantActor: 'Appointment.participant.actor',
176
+ ParticipantStatus: 'Appointment.participant.status',
177
+ ParticipantType: 'Appointment.participant.type',
178
+ };
158
179
  // src/models/fhir/Appointment.values.ts
159
180
  /**
160
181
  * Defines the possible values for the `status` field on a FHIR Appointment resource.
@@ -47,3 +47,17 @@ export declare const AppointmentResponseClaimsFhirApiExtended: {
47
47
  'org.hl7.fhir.api.AppointmentResponse.patient': StringConstructor;
48
48
  'org.hl7.fhir.api.AppointmentResponse.practitioner': StringConstructor;
49
49
  };
50
+ export declare const AppointmentResponseClaim: {
51
+ readonly Actor: "AppointmentResponse.actor";
52
+ readonly Appointment: "AppointmentResponse.appointment";
53
+ readonly Comment: "AppointmentResponse.comment";
54
+ readonly Identifier: "AppointmentResponse.identifier";
55
+ readonly Start: "AppointmentResponse.start";
56
+ readonly End: "AppointmentResponse.end";
57
+ readonly ParticipantType: "AppointmentResponse.participant-type";
58
+ readonly ParticipantStatus: "AppointmentResponse.participant-status";
59
+ readonly Patient: "AppointmentResponse.patient";
60
+ readonly Practitioner: "AppointmentResponse.practitioner";
61
+ readonly Location: "AppointmentResponse.location";
62
+ };
63
+ export type AppointmentResponseClaimKey = typeof AppointmentResponseClaim[keyof typeof AppointmentResponseClaim];
@@ -43,3 +43,16 @@ export const AppointmentResponseClaimsFhirApiExtended = {
43
43
  ...AppointmentResponseClaimsFhirApi,
44
44
  // No additional extended claims for AppointmentResponse at this time.
45
45
  };
46
+ export const AppointmentResponseClaim = {
47
+ Actor: 'AppointmentResponse.actor',
48
+ Appointment: 'AppointmentResponse.appointment',
49
+ Comment: 'AppointmentResponse.comment',
50
+ Identifier: 'AppointmentResponse.identifier',
51
+ Start: 'AppointmentResponse.start',
52
+ End: 'AppointmentResponse.end',
53
+ ParticipantType: 'AppointmentResponse.participant-type',
54
+ ParticipantStatus: 'AppointmentResponse.participant-status',
55
+ Patient: 'AppointmentResponse.patient',
56
+ Practitioner: 'AppointmentResponse.practitioner',
57
+ Location: 'AppointmentResponse.location',
58
+ };
@@ -0,0 +1,24 @@
1
+ import type { ClaimSpec } from './types';
2
+ export declare const CarePlanClaim: {
3
+ readonly ActivityCode: "CarePlan.activity-code";
4
+ readonly ActivityDate: "CarePlan.activity-date";
5
+ readonly ActivityReference: "CarePlan.activity-reference";
6
+ readonly BasedOn: "CarePlan.based-on";
7
+ readonly CareTeam: "CarePlan.care-team";
8
+ readonly Category: "CarePlan.category";
9
+ readonly Condition: "CarePlan.condition";
10
+ readonly Date: "CarePlan.date";
11
+ readonly Encounter: "CarePlan.encounter";
12
+ readonly Goal: "CarePlan.goal";
13
+ readonly Identifier: "CarePlan.identifier";
14
+ readonly Intent: "CarePlan.intent";
15
+ readonly PartOf: "CarePlan.part-of";
16
+ readonly Patient: "CarePlan.patient";
17
+ readonly Performer: "CarePlan.performer";
18
+ readonly Replaces: "CarePlan.replaces";
19
+ readonly Status: "CarePlan.status";
20
+ readonly Subject: "CarePlan.subject";
21
+ readonly Note: "CarePlan.note";
22
+ };
23
+ export type CarePlanClaimKey = typeof CarePlanClaim[keyof typeof CarePlanClaim];
24
+ export declare const CarePlanClaimSpecs: ClaimSpec[];
@@ -0,0 +1,44 @@
1
+ // Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
+ // File: src/models/interoperable-claims/care-plan-claims.ts
3
+ export const CarePlanClaim = {
4
+ ActivityCode: 'CarePlan.activity-code',
5
+ ActivityDate: 'CarePlan.activity-date',
6
+ ActivityReference: 'CarePlan.activity-reference',
7
+ BasedOn: 'CarePlan.based-on',
8
+ CareTeam: 'CarePlan.care-team',
9
+ Category: 'CarePlan.category',
10
+ Condition: 'CarePlan.condition',
11
+ Date: 'CarePlan.date',
12
+ Encounter: 'CarePlan.encounter',
13
+ Goal: 'CarePlan.goal',
14
+ Identifier: 'CarePlan.identifier',
15
+ Intent: 'CarePlan.intent',
16
+ PartOf: 'CarePlan.part-of',
17
+ Patient: 'CarePlan.patient',
18
+ Performer: 'CarePlan.performer',
19
+ Replaces: 'CarePlan.replaces',
20
+ Status: 'CarePlan.status',
21
+ Subject: 'CarePlan.subject',
22
+ Note: 'CarePlan.note',
23
+ };
24
+ export const CarePlanClaimSpecs = [
25
+ { key: CarePlanClaim.ActivityCode, meaning: 'Planned activity code token.', example: 'http://snomed.info/sct|229065009' },
26
+ { key: CarePlanClaim.ActivityDate, meaning: 'Planned activity date/time.', example: '2026-06-15T09:00:00Z' },
27
+ { key: CarePlanClaim.ActivityReference, meaning: 'Activity reference.', example: 'ServiceRequest/sr-1' },
28
+ { key: CarePlanClaim.BasedOn, meaning: 'Based-on reference.', example: 'CarePlan/plan-parent' },
29
+ { key: CarePlanClaim.CareTeam, meaning: 'Care team references (CSV).', example: 'CareTeam/team-1' },
30
+ { key: CarePlanClaim.Category, meaning: 'Care plan category token.', example: 'http://snomed.info/sct|736373009' },
31
+ { key: CarePlanClaim.Condition, meaning: 'Condition references (CSV).', example: 'Condition/cond-1' },
32
+ { key: CarePlanClaim.Date, meaning: 'Care plan creation or period date.', example: '2026-06-01T10:00:00Z' },
33
+ { key: CarePlanClaim.Encounter, meaning: 'Encounter reference.', example: 'Encounter/enc-1' },
34
+ { key: CarePlanClaim.Goal, meaning: 'Goal references (CSV).', example: 'Goal/goal-1' },
35
+ { key: CarePlanClaim.Identifier, meaning: 'Business identifier.', example: 'careplan-001' },
36
+ { key: CarePlanClaim.Intent, meaning: 'Care plan intent.', example: 'plan' },
37
+ { key: CarePlanClaim.PartOf, meaning: 'Parent care plan references (CSV).', example: 'CarePlan/plan-parent' },
38
+ { key: CarePlanClaim.Patient, meaning: 'Patient reference.', example: 'did:web:patient.example.org' },
39
+ { key: CarePlanClaim.Performer, meaning: 'Performer references (CSV).', example: 'Practitioner/prac-1' },
40
+ { key: CarePlanClaim.Replaces, meaning: 'Replaced care plan references (CSV).', example: 'CarePlan/old-plan' },
41
+ { key: CarePlanClaim.Status, meaning: 'Care plan status.', example: 'active' },
42
+ { key: CarePlanClaim.Subject, meaning: 'Canonical subject reference.', example: 'did:web:patient.example.org' },
43
+ { key: CarePlanClaim.Note, meaning: 'Clinical note text.', example: 'Daily home exercise plan.' },
44
+ ];
@@ -0,0 +1,17 @@
1
+ import type { ClaimSpec } from './types';
2
+ export declare const ClinicalImpressionClaim: {
3
+ readonly Identifier: "ClinicalImpression.identifier";
4
+ readonly Status: "ClinicalImpression.status";
5
+ readonly Description: "ClinicalImpression.description";
6
+ readonly Subject: "ClinicalImpression.subject";
7
+ readonly Encounter: "ClinicalImpression.encounter";
8
+ readonly EffectiveDateTime: "ClinicalImpression.effectiveDateTime";
9
+ readonly Date: "ClinicalImpression.date";
10
+ readonly Assessor: "ClinicalImpression.assessor";
11
+ readonly Problem: "ClinicalImpression.problem";
12
+ readonly Finding: "ClinicalImpression.finding";
13
+ readonly PrognosisCode: "ClinicalImpression.prognosis-code";
14
+ readonly Summary: "ClinicalImpression.summary";
15
+ };
16
+ export type ClinicalImpressionClaimKey = typeof ClinicalImpressionClaim[keyof typeof ClinicalImpressionClaim];
17
+ export declare const ClinicalImpressionClaimSpecs: ClaimSpec[];