@metriport/fhir-sdk 1.3.7 → 1.4.1

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 (58) hide show
  1. package/README.md +173 -8
  2. package/dist/__tests__/careplan.test.d.ts +2 -0
  3. package/dist/__tests__/careplan.test.d.ts.map +1 -0
  4. package/dist/__tests__/careplan.test.js +544 -0
  5. package/dist/__tests__/careplan.test.js.map +1 -0
  6. package/dist/__tests__/coding-utilities.test.d.ts +2 -0
  7. package/dist/__tests__/coding-utilities.test.d.ts.map +1 -0
  8. package/dist/__tests__/coding-utilities.test.js +482 -0
  9. package/dist/__tests__/coding-utilities.test.js.map +1 -0
  10. package/dist/__tests__/type-guards.test.d.ts +2 -0
  11. package/dist/__tests__/type-guards.test.d.ts.map +1 -0
  12. package/dist/__tests__/type-guards.test.js +163 -0
  13. package/dist/__tests__/type-guards.test.js.map +1 -0
  14. package/dist/demo-reverse-references.d.ts +7 -0
  15. package/dist/demo-reverse-references.d.ts.map +1 -0
  16. package/dist/demo-reverse-references.js +207 -0
  17. package/dist/demo-reverse-references.js.map +1 -0
  18. package/dist/fhir-bundle-sdk.d.ts +50 -47
  19. package/dist/fhir-bundle-sdk.d.ts.map +1 -1
  20. package/dist/fhir-bundle-sdk.js +10 -2
  21. package/dist/fhir-bundle-sdk.js.map +1 -1
  22. package/dist/index.d.ts +4 -2
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +15 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/internal/coding-systems.d.ts +42 -0
  27. package/dist/internal/coding-systems.d.ts.map +1 -0
  28. package/dist/internal/coding-systems.js +47 -0
  29. package/dist/internal/coding-systems.js.map +1 -0
  30. package/dist/internal/coding-utilities.d.ts +27 -0
  31. package/dist/internal/coding-utilities.d.ts.map +1 -0
  32. package/dist/internal/coding-utilities.js +297 -0
  33. package/dist/internal/coding-utilities.js.map +1 -0
  34. package/dist/internal/graph-traversal.js +1 -1
  35. package/dist/internal/graph-traversal.js.map +1 -1
  36. package/dist/internal/llm-context.d.ts.map +1 -1
  37. package/dist/internal/llm-context.js +3 -1
  38. package/dist/internal/llm-context.js.map +1 -1
  39. package/dist/internal/reference-resolution.d.ts.map +1 -1
  40. package/dist/internal/reference-resolution.js +99 -11
  41. package/dist/internal/reference-resolution.js.map +1 -1
  42. package/dist/internal/transparent-proxy.d.ts +12 -0
  43. package/dist/internal/transparent-proxy.d.ts.map +1 -0
  44. package/dist/internal/transparent-proxy.js +81 -0
  45. package/dist/internal/transparent-proxy.js.map +1 -0
  46. package/dist/type-guards.d.ts +183 -0
  47. package/dist/type-guards.d.ts.map +1 -0
  48. package/dist/type-guards.js +108 -0
  49. package/dist/type-guards.js.map +1 -0
  50. package/dist/types/coding-fields.d.ts +292 -0
  51. package/dist/types/coding-fields.d.ts.map +1 -0
  52. package/dist/types/coding-fields.js +3 -0
  53. package/dist/types/coding-fields.js.map +1 -0
  54. package/dist/types/smart-resources.d.ts +152 -6
  55. package/dist/types/smart-resources.d.ts.map +1 -1
  56. package/dist/types/smart-resources.js +35 -3
  57. package/dist/types/smart-resources.js.map +1 -1
  58. package/package.json +2 -3
@@ -1 +1 @@
1
- {"version":3,"file":"reference-resolution.d.ts","sourceRoot":"","sources":["../../src/internal/reference-resolution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EACL,KAAK,EAIN,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAyC7D;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAwChE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,OAAO,EACrB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EACpC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAA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kNV"}
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createSmartResource = exports.resolveReference = exports.resolveReferenceObject = exports.isArrayReferenceField = void 0;
4
4
  const util_1 = require("util");
5
5
  const smart_resources_1 = require("../types/smart-resources");
6
+ const coding_utilities_1 = require("./coding-utilities");
7
+ const transparent_proxy_1 = require("./transparent-proxy");
6
8
  /**
7
9
  * Navigate through a nested path in a resource to get the value at that path.
8
10
  * Handles both simple paths ("subject") and nested paths ("diagnosis.condition").
@@ -15,6 +17,10 @@ const smart_resources_1 = require("../types/smart-resources");
15
17
  * - "hospitalization.origin" navigates to resource.hospitalization.origin
16
18
  * - Returns the single reference value
17
19
  *
20
+ * For deeply nested paths like "activity.detail.goal":
21
+ * - Flattens nested arrays that may result from navigating through multiple array levels
22
+ * - Returns a flat array of all references found
23
+ *
18
24
  * @param resource - The FHIR resource to navigate
19
25
  * @param path - Dot-separated path to the reference field
20
26
  * @returns The value at the path, which could be a reference, array of references, or undefined
@@ -36,6 +42,12 @@ function getNestedValue(resource, path) {
36
42
  current = current[part];
37
43
  }
38
44
  }
45
+ // Flatten nested arrays that may result from navigating through multiple array levels
46
+ // For example, activity.detail.goal where activity is an array and goal is also an array
47
+ // This prevents [[reference]] and instead returns [reference]
48
+ if (Array.isArray(current) && current.some(item => Array.isArray(item))) {
49
+ current = current.flat();
50
+ }
39
51
  return current;
40
52
  }
41
53
  /**
@@ -76,6 +88,7 @@ function isArrayReferenceField(fieldName) {
76
88
  "protocolApplied",
77
89
  "reaction",
78
90
  "ingredient",
91
+ "activity",
79
92
  ]);
80
93
  return arrayBaseFields.has(baseField ?? "");
81
94
  }
@@ -216,33 +229,108 @@ function createSmartResource(resource, smartResourceCache, resourcesById, resour
216
229
  return JSON.stringify(target, null, 2);
217
230
  };
218
231
  }
232
+ // Handle Symbol.toStringTag for better console display
233
+ if (prop === Symbol.toStringTag) {
234
+ return `Smart<${target.resourceType}>`;
235
+ }
236
+ // Handle toJSON for serialization
237
+ if (prop === "toJSON") {
238
+ return () => target;
239
+ }
219
240
  // Check if this is a reference method call
220
241
  if (typeof prop === "string" && (0, smart_resources_1.isReferenceMethod)(prop, target.resourceType)) {
221
242
  return () => resolveReference(prop, target, resourcesById, resourcesByFullUrl, resolutionStack, res => createSmartResource(res, smartResourceCache, resourcesById, resourcesByFullUrl, resolutionStack, getResourcesReferencingIdFn));
222
243
  }
223
- // Return original property
224
- return Reflect.get(target, prop, receiver);
244
+ // Get the property value
245
+ const value = Reflect.get(target, prop, receiver);
246
+ // Don't wrap null or undefined
247
+ if (value === null || value === undefined) {
248
+ return value;
249
+ }
250
+ // Wrap CodeableConcept objects (check before Coding to avoid misidentification)
251
+ if ((0, coding_utilities_1.isCodeableConcept)(value)) {
252
+ return (0, coding_utilities_1.createSmartCodeableConcept)(value);
253
+ }
254
+ // Wrap Coding objects
255
+ if ((0, coding_utilities_1.isCoding)(value)) {
256
+ return (0, coding_utilities_1.createSmartCoding)(value);
257
+ }
258
+ // Handle arrays - wrap each element if needed
259
+ if (Array.isArray(value)) {
260
+ return value.map(item => {
261
+ if (item === null || item === undefined) {
262
+ return item;
263
+ }
264
+ // Check CodeableConcept before Coding
265
+ if ((0, coding_utilities_1.isCodeableConcept)(item)) {
266
+ return (0, coding_utilities_1.createSmartCodeableConcept)(item);
267
+ }
268
+ if ((0, coding_utilities_1.isCoding)(item)) {
269
+ return (0, coding_utilities_1.createSmartCoding)(item);
270
+ }
271
+ // Recursively wrap plain objects with transparent proxy
272
+ // Only wrap plain objects, not built-in types
273
+ if (typeof item === "object" && !Array.isArray(item) && item.constructor === Object) {
274
+ return (0, transparent_proxy_1.createTransparentProxy)(item);
275
+ }
276
+ return item;
277
+ });
278
+ }
279
+ // Recursively wrap plain objects with transparent proxy (but not primitives, dates, etc.)
280
+ // Only wrap plain objects, not built-in types like Date, RegExp, etc.
281
+ if (typeof value === "object" && !Array.isArray(value) && value.constructor === Object) {
282
+ return (0, transparent_proxy_1.createTransparentProxy)(value);
283
+ }
284
+ // Return original property for primitives and other types
285
+ return value;
225
286
  },
226
287
  // Ensure JSON serialization works correctly (FR-5.8)
227
288
  ownKeys: target => {
228
- return Reflect.ownKeys(target).filter(key => key !== "__isSmartResource" &&
229
- key !== "getReferencingResources" &&
230
- key !== "getReferencedResources" &&
231
- key !== "toString" &&
232
- key !== util_1.inspect.custom);
289
+ const keys = Reflect.ownKeys(target);
290
+ const virtualMethods = [
291
+ "getReferencingResources",
292
+ "getReferencedResources",
293
+ "toString",
294
+ ];
295
+ // Add reference methods for this resource type
296
+ const referenceMethods = smart_resources_1.REFERENCE_METHOD_MAPPING[target.resourceType];
297
+ if (referenceMethods) {
298
+ virtualMethods.push(...Object.keys(referenceMethods));
299
+ }
300
+ // Filter out internal markers and add virtual methods for DevTools
301
+ return [...keys.filter(key => key !== "__isSmartResource"), ...virtualMethods];
233
302
  },
234
303
  getOwnPropertyDescriptor: (target, prop) => {
304
+ // Hide internal markers from enumeration
235
305
  if (prop === "__isSmartResource" ||
236
- prop === "getReferencingResources" ||
237
- prop === "getReferencedResources" ||
238
- prop === "toString" ||
306
+ prop === Symbol.toStringTag ||
307
+ prop === "toJSON" ||
239
308
  prop === util_1.inspect.custom) {
240
309
  return undefined;
241
310
  }
311
+ // Make virtual methods enumerable for DevTools
312
+ if (prop === "getReferencingResources" ||
313
+ prop === "getReferencedResources" ||
314
+ prop === "toString") {
315
+ return {
316
+ enumerable: true,
317
+ configurable: true,
318
+ writable: false,
319
+ };
320
+ }
321
+ // Make reference methods enumerable for DevTools
322
+ const referenceMethods = smart_resources_1.REFERENCE_METHOD_MAPPING[target.resourceType];
323
+ if (referenceMethods && typeof prop === "string" && prop in referenceMethods) {
324
+ return {
325
+ enumerable: true,
326
+ configurable: true,
327
+ writable: false,
328
+ };
329
+ }
242
330
  return Reflect.getOwnPropertyDescriptor(target, prop);
243
331
  },
244
332
  });
245
- // Cache the smart resource
333
+ // Cache the smart resource - cast to avoid type complexity issues
246
334
  smartResourceCache.set(resource, smartResource);
247
335
  return smartResource;
248
336
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reference-resolution.js","sourceRoot":"","sources":["../../src/internal/reference-resolution.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,8DAKkC;AAGlC;;;;;;;;;;;;;;;GAeG;AACH,SAAS,cAAc,CAAC,QAAkB,EAAE,IAAY;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE9B,8DAA8D;IAC9D,IAAI,OAAO,GAAQ,QAAQ,CAAC;IAE5B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,SAAS,CAAC;SAClB;QAED,yDAAyD;QACzD,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;YAC9E,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;SAClD;aAAM;YACL,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;SACzB;KACF;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,qBAAqB,CAAC,SAAiB;IACrD,sCAAsC;IACtC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAE3F,wCAAwC;IACxC,IAAI,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IAED,qEAAqE;IACrE,0EAA0E;IAC1E,IAA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e,EACf,2BAA2B,CAC5B,CACF,CAAC;aACL;YAED,2BAA2B;YAC3B,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC;QAED,qDAAqD;QACrD,OAAO,EAAE,MAAM,CAAC,EAAE;YAChB,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CACnC,GAAG,CAAC,EAAE,CACJ,GAAG,KAAK,mBAAmB;gBAC3B,GAAG,KAAK,yBAAyB;gBACjC,GAAG,KAAK,wBAAwB;gBAChC,GAAG,KAAK,UAAU;gBAClB,GAAG,KAAK,cAAO,CAAC,MAAM,CACzB,CAAC;QACJ,CAAC;QAED,wBAAwB,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;YACzC,IACE,IAAI,KAAK,mBAAmB;gBAC5B,IAAI,KAAK,yBAAyB;gBAClC,IAAI,KAAK,wBAAwB;gBACjC,IAAI,KAAK,UAAU;gBACnB,IAAI,KAAK,cAAO,CAAC,MAAM,EACvB;gBACA,OAAO,SAAS,CAAC;aAClB;YACD,OAAO,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;KACF,CAAa,CAAC;IAEf,2BAA2B;IAC3B,kBAAkB,CAAC,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAEhD,OAAO,aAAa,CAAC;AACvB,CAAC;AAnID,kDAmIC"}
1
+ {"version":3,"file":"reference-resolution.js","sourceRoot":"","sources":["../../src/internal/reference-resolution.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,8DAKkC;AAElC,yDAK4B;AAC5B,2DAA6D;AAE7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,cAAc,CAAC,QAAkB,EAAE,IAAY;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE9B,8DAA8D;IAC9D,IAA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I,KAAK,yBAAyB;gBAClC,IAAI,KAAK,wBAAwB;gBACjC,IAAI,KAAK,UAAU,EACnB;gBACA,OAAO;oBACL,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,IAAI;oBAClB,QAAQ,EAAE,KAAK;iBAChB,CAAC;aACH;YAED,iDAAiD;YACjD,MAAM,gBAAgB,GAAG,0CAAwB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YACvE,IAAI,gBAAgB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,IAAI,gBAAgB,EAAE;gBAC5E,OAAO;oBACL,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,IAAI;oBAClB,QAAQ,EAAE,KAAK;iBAChB,CAAC;aACH;YAED,OAAO,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;KACF,CAAa,CAAC;IAEf,kEAAkE;IAClE,kBAAkB,CAAC,GAAG,CAAC,QAAQ,EAAE,aAAgC,CAAC,CAAC;IAEnE,OAAO,aAAa,CAAC;AACvB,CAAC;AA5ND,kDA4NC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Create a transparent proxy that wraps plain objects to intercept property access.
3
+ * This enables deep access to Coding and CodeableConcept objects at any nesting level.
4
+ *
5
+ * Unlike SmartResource proxies, transparent proxies don't add methods - they just
6
+ * intercept property access to wrap Coding/CodeableConcept objects when accessed.
7
+ *
8
+ * @param obj - The plain object to wrap
9
+ * @returns A proxied object that wraps Coding/CodeableConcept on access
10
+ */
11
+ export declare function createTransparentProxy<T extends object>(obj: T): T;
12
+ //# sourceMappingURL=transparent-proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transparent-proxy.d.ts","sourceRoot":"","sources":["../../src/internal/transparent-proxy.ts"],"names":[],"mappings":"AAYA;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAuElE"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTransparentProxy = void 0;
4
+ const coding_utilities_1 = require("./coding-utilities");
5
+ /**
6
+ * Cache for transparent proxy objects to maintain object identity
7
+ */
8
+ const transparentProxyCache = new WeakMap();
9
+ /**
10
+ * Create a transparent proxy that wraps plain objects to intercept property access.
11
+ * This enables deep access to Coding and CodeableConcept objects at any nesting level.
12
+ *
13
+ * Unlike SmartResource proxies, transparent proxies don't add methods - they just
14
+ * intercept property access to wrap Coding/CodeableConcept objects when accessed.
15
+ *
16
+ * @param obj - The plain object to wrap
17
+ * @returns A proxied object that wraps Coding/CodeableConcept on access
18
+ */
19
+ function createTransparentProxy(obj) {
20
+ // Check cache first to maintain object identity
21
+ const cached = transparentProxyCache.get(obj);
22
+ if (cached) {
23
+ return cached;
24
+ }
25
+ const proxy = new Proxy(obj, {
26
+ get: (target, prop, receiver) => {
27
+ const value = Reflect.get(target, prop, receiver);
28
+ // Don't wrap null or undefined
29
+ if (value === null || value === undefined) {
30
+ return value;
31
+ }
32
+ // Wrap CodeableConcept objects (check before Coding to avoid misidentification)
33
+ if ((0, coding_utilities_1.isCodeableConcept)(value)) {
34
+ return (0, coding_utilities_1.createSmartCodeableConcept)(value);
35
+ }
36
+ // Wrap Coding objects
37
+ if ((0, coding_utilities_1.isCoding)(value)) {
38
+ return (0, coding_utilities_1.createSmartCoding)(value);
39
+ }
40
+ // Handle arrays - wrap each element if needed
41
+ if (Array.isArray(value)) {
42
+ return value.map(item => {
43
+ if (item === null || item === undefined) {
44
+ return item;
45
+ }
46
+ // Check CodeableConcept before Coding
47
+ if ((0, coding_utilities_1.isCodeableConcept)(item)) {
48
+ return (0, coding_utilities_1.createSmartCodeableConcept)(item);
49
+ }
50
+ if ((0, coding_utilities_1.isCoding)(item)) {
51
+ return (0, coding_utilities_1.createSmartCoding)(item);
52
+ }
53
+ // Recursively wrap plain objects, not built-in types
54
+ if (typeof item === "object" && !Array.isArray(item) && item.constructor === Object) {
55
+ return createTransparentProxy(item);
56
+ }
57
+ return item;
58
+ });
59
+ }
60
+ // Recursively wrap plain objects (but not primitives, dates, etc.)
61
+ // Only wrap plain objects, not built-in types like Date, RegExp, etc.
62
+ if (typeof value === "object" && !Array.isArray(value) && value.constructor === Object) {
63
+ return createTransparentProxy(value);
64
+ }
65
+ // Return primitives, dates, and other built-in types as-is
66
+ return value;
67
+ },
68
+ // Handle Symbol.toStringTag for better console display
69
+ ownKeys: target => {
70
+ return Reflect.ownKeys(target);
71
+ },
72
+ getOwnPropertyDescriptor: (target, prop) => {
73
+ return Reflect.getOwnPropertyDescriptor(target, prop);
74
+ },
75
+ });
76
+ // Cache the proxy
77
+ transparentProxyCache.set(obj, proxy);
78
+ return proxy;
79
+ }
80
+ exports.createTransparentProxy = createTransparentProxy;
81
+ //# sourceMappingURL=transparent-proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transparent-proxy.js","sourceRoot":"","sources":["../../src/internal/transparent-proxy.ts"],"names":[],"mappings":";;;AAAA,yDAK4B;AAE5B;;GAEG;AACH,MAAM,qBAAqB,GAAG,IAAI,OAAO,EAAkB,CAAC;AAE5D;;;;;;;;;GASG;AACH,SAAgB,sBAAsB,CAAmB,GAAM;IAC7D,gDAAgD;IAChD,MAAM,MAAM,GAAG,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI,MAAM,EAAE;QACV,OAAO,MAAW,CAAC;KACpB;IAED,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,EAAE;QAC3B,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;YAElD,+BAA+B;YAC/B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;gB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QAED,uDAAuD;QACvD,OAAO,EAAE,MAAM,CAAC,EAAE;YAChB,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QAED,wBAAwB,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;YACzC,OAAO,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;KACF,CAAM,CAAC;IAER,kBAAkB;IAClB,qBAAqB,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAEtC,OAAO,KAAK,CAAC;AACf,CAAC;AAvED,wDAuEC"}
@@ -0,0 +1,183 @@
1
+ import { Resource, Patient, Observation, DiagnosticReport, Encounter, Practitioner, PractitionerRole, Organization, Location, AllergyIntolerance, Condition, Composition, Coverage, DocumentReference, FamilyMemberHistory, Immunization, Medication, MedicationAdministration, MedicationDispense, MedicationRequest, MedicationStatement, Procedure, RelatedPerson, RiskAssessment, ServiceRequest, CarePlan, Bundle } from "@medplum/fhirtypes";
2
+ import { Smart } from "./types/smart-resources";
3
+ import { SmartPatient, SmartObservation, SmartDiagnosticReport, SmartEncounter, SmartPractitioner, SmartOrganization, SmartLocation, SmartAllergyIntolerance, SmartCondition, SmartComposition, SmartCoverage, SmartDocumentReference, SmartFamilyMemberHistory, SmartImmunization, SmartMedication, SmartMedicationAdministration, SmartMedicationDispense, SmartMedicationRequest, SmartMedicationStatement, SmartProcedure, SmartRelatedPerson, SmartRiskAssessment, SmartServiceRequest, SmartCarePlan } from "./types/coding-fields";
4
+ /**
5
+ * Patient type guard
6
+ * Returns SmartPatient when used with Smart resources to provide full TypeScript support
7
+ * for coding utilities
8
+ */
9
+ export declare function isPatient(resource: Smart<Resource> | undefined): resource is SmartPatient;
10
+ export declare function isPatient(resource: Resource | undefined): resource is Patient;
11
+ /**
12
+ * Observation type guard
13
+ * Returns SmartObservation when used with Smart resources to provide full TypeScript support
14
+ * for coding utilities
15
+ */
16
+ export declare function isObservation(resource: Smart<Resource> | undefined): resource is SmartObservation;
17
+ export declare function isObservation(resource: Resource | undefined): resource is Observation;
18
+ /**
19
+ * DiagnosticReport type guard
20
+ * Returns SmartDiagnosticReport when used with Smart resources to provide full TypeScript support
21
+ * for coding utilities
22
+ */
23
+ export declare function isDiagnosticReport(resource: Smart<Resource> | undefined): resource is SmartDiagnosticReport;
24
+ export declare function isDiagnosticReport(resource: Resource | undefined): resource is DiagnosticReport;
25
+ /**
26
+ * Encounter type guard
27
+ * Returns SmartEncounter when used with Smart resources to provide full TypeScript support
28
+ * for coding utilities
29
+ */
30
+ export declare function isEncounter(resource: Smart<Resource> | undefined): resource is SmartEncounter;
31
+ export declare function isEncounter(resource: Resource | undefined): resource is Encounter;
32
+ /**
33
+ * Practitioner type guard
34
+ * Returns SmartPractitioner when used with Smart resources to provide full TypeScript support
35
+ * for coding utilities
36
+ */
37
+ export declare function isPractitioner(resource: Smart<Resource> | undefined): resource is SmartPractitioner;
38
+ export declare function isPractitioner(resource: Resource | undefined): resource is Practitioner;
39
+ /**
40
+ * PractitionerRole type guard
41
+ * Note: PractitionerRole doesn't have specific coding fields, so it uses the generic Smart type
42
+ */
43
+ export declare function isPractitionerRole(resource: Smart<Resource> | undefined): resource is Smart<PractitionerRole>;
44
+ export declare function isPractitionerRole(resource: Resource | undefined): resource is PractitionerRole;
45
+ /**
46
+ * Organization type guard
47
+ * Returns SmartOrganization when used with Smart resources to provide full TypeScript support
48
+ * for coding utilities
49
+ */
50
+ export declare function isOrganization(resource: Smart<Resource> | undefined): resource is SmartOrganization;
51
+ export declare function isOrganization(resource: Resource | undefined): resource is Organization;
52
+ /**
53
+ * Location type guard
54
+ * Returns SmartLocation when used with Smart resources to provide full TypeScript support
55
+ * for coding utilities
56
+ */
57
+ export declare function isLocation(resource: Smart<Resource> | undefined): resource is SmartLocation;
58
+ export declare function isLocation(resource: Resource | undefined): resource is Location;
59
+ /**
60
+ * AllergyIntolerance type guard
61
+ * Returns SmartAllergyIntolerance when used with Smart resources to provide full TypeScript support
62
+ * for coding utilities
63
+ */
64
+ export declare function isAllergyIntolerance(resource: Smart<Resource> | undefined): resource is SmartAllergyIntolerance;
65
+ export declare function isAllergyIntolerance(resource: Resource | undefined): resource is AllergyIntolerance;
66
+ /**
67
+ * Condition type guard
68
+ * Returns SmartCondition when used with Smart resources to provide full TypeScript support
69
+ * for coding utilities
70
+ */
71
+ export declare function isCondition(resource: Smart<Resource> | undefined): resource is SmartCondition;
72
+ export declare function isCondition(resource: Resource | undefined): resource is Condition;
73
+ /**
74
+ * Composition type guard
75
+ * Returns SmartComposition when used with Smart resources to provide full TypeScript support
76
+ * for coding utilities
77
+ */
78
+ export declare function isComposition(resource: Smart<Resource> | undefined): resource is SmartComposition;
79
+ export declare function isComposition(resource: Resource | undefined): resource is Composition;
80
+ /**
81
+ * Coverage type guard
82
+ * Returns SmartCoverage when used with Smart resources to provide full TypeScript support
83
+ * for coding utilities
84
+ */
85
+ export declare function isCoverage(resource: Smart<Resource> | undefined): resource is SmartCoverage;
86
+ export declare function isCoverage(resource: Resource | undefined): resource is Coverage;
87
+ /**
88
+ * DocumentReference type guard
89
+ * Returns SmartDocumentReference when used with Smart resources to provide full TypeScript support
90
+ * for coding utilities
91
+ */
92
+ export declare function isDocumentReference(resource: Smart<Resource> | undefined): resource is SmartDocumentReference;
93
+ export declare function isDocumentReference(resource: Resource | undefined): resource is DocumentReference;
94
+ /**
95
+ * FamilyMemberHistory type guard
96
+ * Returns SmartFamilyMemberHistory when used with Smart resources to provide full TypeScript support
97
+ * for coding utilities
98
+ */
99
+ export declare function isFamilyMemberHistory(resource: Smart<Resource> | undefined): resource is SmartFamilyMemberHistory;
100
+ export declare function isFamilyMemberHistory(resource: Resource | undefined): resource is FamilyMemberHistory;
101
+ /**
102
+ * Immunization type guard
103
+ * Returns SmartImmunization when used with Smart resources to provide full TypeScript support
104
+ * for coding utilities
105
+ */
106
+ export declare function isImmunization(resource: Smart<Resource> | undefined): resource is SmartImmunization;
107
+ export declare function isImmunization(resource: Resource | undefined): resource is Immunization;
108
+ /**
109
+ * Medication type guard
110
+ * Returns SmartMedication when used with Smart resources to provide full TypeScript support
111
+ * for coding utilities
112
+ */
113
+ export declare function isMedication(resource: Smart<Resource> | undefined): resource is SmartMedication;
114
+ export declare function isMedication(resource: Resource | undefined): resource is Medication;
115
+ /**
116
+ * MedicationAdministration type guard
117
+ * Returns SmartMedicationAdministration when used with Smart resources to provide full TypeScript support
118
+ * for coding utilities
119
+ */
120
+ export declare function isMedicationAdministration(resource: Smart<Resource> | undefined): resource is SmartMedicationAdministration;
121
+ export declare function isMedicationAdministration(resource: Resource | undefined): resource is MedicationAdministration;
122
+ /**
123
+ * MedicationDispense type guard
124
+ * Returns SmartMedicationDispense when used with Smart resources to provide full TypeScript support
125
+ * for coding utilities
126
+ */
127
+ export declare function isMedicationDispense(resource: Smart<Resource> | undefined): resource is SmartMedicationDispense;
128
+ export declare function isMedicationDispense(resource: Resource | undefined): resource is MedicationDispense;
129
+ /**
130
+ * MedicationRequest type guard
131
+ * Returns SmartMedicationRequest when used with Smart resources to provide full TypeScript support
132
+ * for coding utilities
133
+ */
134
+ export declare function isMedicationRequest(resource: Smart<Resource> | undefined): resource is SmartMedicationRequest;
135
+ export declare function isMedicationRequest(resource: Resource | undefined): resource is MedicationRequest;
136
+ /**
137
+ * MedicationStatement type guard
138
+ * Returns SmartMedicationStatement when used with Smart resources to provide full TypeScript support
139
+ * for coding utilities
140
+ */
141
+ export declare function isMedicationStatement(resource: Smart<Resource> | undefined): resource is SmartMedicationStatement;
142
+ export declare function isMedicationStatement(resource: Resource | undefined): resource is MedicationStatement;
143
+ /**
144
+ * Procedure type guard
145
+ * Returns SmartProcedure when used with Smart resources to provide full TypeScript support
146
+ * for coding utilities
147
+ */
148
+ export declare function isProcedure(resource: Smart<Resource> | undefined): resource is SmartProcedure;
149
+ export declare function isProcedure(resource: Resource | undefined): resource is Procedure;
150
+ /**
151
+ * RelatedPerson type guard
152
+ * Returns SmartRelatedPerson when used with Smart resources to provide full TypeScript support
153
+ * for coding utilities
154
+ */
155
+ export declare function isRelatedPerson(resource: Smart<Resource> | undefined): resource is SmartRelatedPerson;
156
+ export declare function isRelatedPerson(resource: Resource | undefined): resource is RelatedPerson;
157
+ /**
158
+ * RiskAssessment type guard
159
+ * Returns SmartRiskAssessment when used with Smart resources to provide full TypeScript support
160
+ * for coding utilities
161
+ */
162
+ export declare function isRiskAssessment(resource: Smart<Resource> | undefined): resource is SmartRiskAssessment;
163
+ export declare function isRiskAssessment(resource: Resource | undefined): resource is RiskAssessment;
164
+ /**
165
+ * ServiceRequest type guard
166
+ * Returns SmartServiceRequest when used with Smart resources to provide full TypeScript support
167
+ * for coding utilities
168
+ */
169
+ export declare function isServiceRequest(resource: Smart<Resource> | undefined): resource is SmartServiceRequest;
170
+ export declare function isServiceRequest(resource: Resource | undefined): resource is ServiceRequest;
171
+ /**
172
+ * CarePlan type guard
173
+ * Returns SmartCarePlan when used with Smart resources to provide full TypeScript support
174
+ * for coding utilities
175
+ */
176
+ export declare function isCarePlan(resource: Smart<Resource> | undefined): resource is SmartCarePlan;
177
+ export declare function isCarePlan(resource: Resource | undefined): resource is CarePlan;
178
+ /**
179
+ * Bundle type guard
180
+ */
181
+ export declare function isBundle(resource: Smart<Resource> | undefined): resource is Smart<Bundle>;
182
+ export declare function isBundle(resource: Resource | undefined): resource is Bundle;
183
+ //# sourceMappingURL=type-guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["../src/type-guards.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,wBAAwB,EACxB,kB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KAAK,CAAC,MAAM,CAAC,CAAC;AAC3F,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,IAAI,MAAM,CAAC"}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isBundle = exports.isCarePlan = exports.isServiceRequest = exports.isRiskAssessment = exports.isRelatedPerson = exports.isProcedure = exports.isMedicationStatement = exports.isMedicationRequest = exports.isMedicationDispense = exports.isMedicationAdministration = exports.isMedication = exports.isImmunization = exports.isFamilyMemberHistory = exports.isDocumentReference = exports.isCoverage = exports.isComposition = exports.isCondition = exports.isAllergyIntolerance = exports.isLocation = exports.isOrganization = exports.isPractitionerRole = exports.isPractitioner = exports.isEncounter = exports.isDiagnosticReport = exports.isObservation = exports.isPatient = void 0;
4
+ function isPatient(resource) {
5
+ return resource?.resourceType === "Patient";
6
+ }
7
+ exports.isPatient = isPatient;
8
+ function isObservation(resource) {
9
+ return resource?.resourceType === "Observation";
10
+ }
11
+ exports.isObservation = isObservation;
12
+ function isDiagnosticReport(resource) {
13
+ return resource?.resourceType === "DiagnosticReport";
14
+ }
15
+ exports.isDiagnosticReport = isDiagnosticReport;
16
+ function isEncounter(resource) {
17
+ return resource?.resourceType === "Encounter";
18
+ }
19
+ exports.isEncounter = isEncounter;
20
+ function isPractitioner(resource) {
21
+ return resource?.resourceType === "Practitioner";
22
+ }
23
+ exports.isPractitioner = isPractitioner;
24
+ function isPractitionerRole(resource) {
25
+ return resource?.resourceType === "PractitionerRole";
26
+ }
27
+ exports.isPractitionerRole = isPractitionerRole;
28
+ function isOrganization(resource) {
29
+ return resource?.resourceType === "Organization";
30
+ }
31
+ exports.isOrganization = isOrganization;
32
+ function isLocation(resource) {
33
+ return resource?.resourceType === "Location";
34
+ }
35
+ exports.isLocation = isLocation;
36
+ function isAllergyIntolerance(resource) {
37
+ return resource?.resourceType === "AllergyIntolerance";
38
+ }
39
+ exports.isAllergyIntolerance = isAllergyIntolerance;
40
+ function isCondition(resource) {
41
+ return resource?.resourceType === "Condition";
42
+ }
43
+ exports.isCondition = isCondition;
44
+ function isComposition(resource) {
45
+ return resource?.resourceType === "Composition";
46
+ }
47
+ exports.isComposition = isComposition;
48
+ function isCoverage(resource) {
49
+ return resource?.resourceType === "Coverage";
50
+ }
51
+ exports.isCoverage = isCoverage;
52
+ function isDocumentReference(resource) {
53
+ return resource?.resourceType === "DocumentReference";
54
+ }
55
+ exports.isDocumentReference = isDocumentReference;
56
+ function isFamilyMemberHistory(resource) {
57
+ return resource?.resourceType === "FamilyMemberHistory";
58
+ }
59
+ exports.isFamilyMemberHistory = isFamilyMemberHistory;
60
+ function isImmunization(resource) {
61
+ return resource?.resourceType === "Immunization";
62
+ }
63
+ exports.isImmunization = isImmunization;
64
+ function isMedication(resource) {
65
+ return resource?.resourceType === "Medication";
66
+ }
67
+ exports.isMedication = isMedication;
68
+ function isMedicationAdministration(resource) {
69
+ return resource?.resourceType === "MedicationAdministration";
70
+ }
71
+ exports.isMedicationAdministration = isMedicationAdministration;
72
+ function isMedicationDispense(resource) {
73
+ return resource?.resourceType === "MedicationDispense";
74
+ }
75
+ exports.isMedicationDispense = isMedicationDispense;
76
+ function isMedicationRequest(resource) {
77
+ return resource?.resourceType === "MedicationRequest";
78
+ }
79
+ exports.isMedicationRequest = isMedicationRequest;
80
+ function isMedicationStatement(resource) {
81
+ return resource?.resourceType === "MedicationStatement";
82
+ }
83
+ exports.isMedicationStatement = isMedicationStatement;
84
+ function isProcedure(resource) {
85
+ return resource?.resourceType === "Procedure";
86
+ }
87
+ exports.isProcedure = isProcedure;
88
+ function isRelatedPerson(resource) {
89
+ return resource?.resourceType === "RelatedPerson";
90
+ }
91
+ exports.isRelatedPerson = isRelatedPerson;
92
+ function isRiskAssessment(resource) {
93
+ return resource?.resourceType === "RiskAssessment";
94
+ }
95
+ exports.isRiskAssessment = isRiskAssessment;
96
+ function isServiceRequest(resource) {
97
+ return resource?.resourceType === "ServiceRequest";
98
+ }
99
+ exports.isServiceRequest = isServiceRequest;
100
+ function isCarePlan(resource) {
101
+ return resource?.resourceType === "CarePlan";
102
+ }
103
+ exports.isCarePlan = isCarePlan;
104
+ function isBundle(resource) {
105
+ return resource?.resourceType === "Bundle";
106
+ }
107
+ exports.isBundle = isBundle;
108
+ //# sourceMappingURL=type-guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-guards.js","sourceRoot":"","sources":["../src/type-guards.ts"],"names":[],"mappings":";;;AAgEA,SAAgB,SAAS,CACvB,QAAgD;IAEhD,OAAO,QAAQ,EAAE,YAAY,KAAK,SAAS,CAAC;AAC9C,CAAC;AAJD,8BAIC;AASD,SAAgB,aAAa,CAC3B,QAAgD;IAEhD,OAAO,QAAQ,EAAE,YAAY,KAAK,aAAa,CAAC;AAClD,CAAC;AAJD,sCAIC;AAWD,SAAgB,kBAAkB,CAChC,QAAgD;IAEhD,OAAO,QAAQ,EAAE,YAAY,KAAK,kBAAkB,CAAC;AACvD,CAAC;AAJD,gDAIC;AASD,SAAgB,WAAW,CACzB,QAAgD;IAEhD,OAAO,QAAQ,EAAE,YAAY,KAAK,WAAW,CAAC;AAChD,CAAC;AAJD,kCAIC;AAWD,SAAgB,cAAc,CAC5B,QAAgD;IAEhD,OAAO,QAAQ,EAAE,YAAY,KAAK,cAAc,CAAC;AACnD,CAAC;AAJD,wCAIC;AAUD,SAAgB,kBAAkB,CAChC,QAAgD;IAEhD,OAAO,QAAQ,EAAE,YAAY,KAAK,kBAAkB,CAAC;AACvD,CAAC;AAJD,gDAIC;AAWD,SAAgB,cAAc,CAC5B,QAAgD;IAEhD,OAAO,QAAQ,EAAE,YAAY,KAAK,cAAc,CAAC;AACnD,CAAC;AAJD,wCAIC;AASD,SAAgB,UAAU,CACxB,QAAgD;IAEhD,OAAO,QAAQ,EAAE,YAAY,KAAK,UAAU,CAAC;AAC/C,CAAC;AAJD,gCAIC;AAaD,SAAgB,oBAAoB,CAClC,QA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