@medplum/react 2.0.1 → 2.0.3

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 (165) hide show
  1. package/dist/cjs/DiagnosticReportDisplay/DiagnosticReportDisplay.d.ts +2 -0
  2. package/dist/cjs/DiagnosticReportDisplay/DiagnosticReportDisplay.stories.d.ts +1 -0
  3. package/dist/cjs/MedplumProvider/MedplumProvider.d.ts +8 -0
  4. package/dist/cjs/NoteDisplay/NoteDisplay.d.ts +6 -0
  5. package/dist/cjs/NoteDisplay/NoteDisplay.stories.d.ts +7 -0
  6. package/dist/cjs/OperationOutcomeAlert/OperationOutcomeAlert.d.ts +2 -1
  7. package/dist/cjs/QuantityInput/QuantityInput.d.ts +1 -0
  8. package/dist/cjs/QuantityInput/QuantityInput.stories.d.ts +7 -0
  9. package/dist/cjs/ResourceTable/ResourceTable.d.ts +13 -0
  10. package/dist/cjs/ResourceTimeline/ResourceTimeline.d.ts +2 -2
  11. package/dist/cjs/index.cjs +917 -230
  12. package/dist/cjs/index.cjs.map +1 -1
  13. package/dist/cjs/index.d.ts +1 -0
  14. package/dist/cjs/index.min.cjs +1 -1
  15. package/dist/cjs/useResource/useResource.d.ts +2 -2
  16. package/dist/cjs/utils/date.d.ts +2 -1
  17. package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs +2 -1
  18. package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs.map +1 -1
  19. package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs +2 -6
  20. package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs.map +1 -1
  21. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.d.ts +2 -0
  22. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs +26 -22
  23. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs.map +1 -1
  24. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.stories.d.ts +1 -0
  25. package/dist/esm/EncounterTimeline/EncounterTimeline.mjs +6 -6
  26. package/dist/esm/EncounterTimeline/EncounterTimeline.mjs.map +1 -1
  27. package/dist/esm/ErrorBoundary/ErrorBoundary.mjs +1 -1
  28. package/dist/esm/ErrorBoundary/ErrorBoundary.mjs.map +1 -1
  29. package/dist/esm/GoogleButton/GoogleButton.mjs +6 -4
  30. package/dist/esm/GoogleButton/GoogleButton.mjs.map +1 -1
  31. package/dist/esm/MedplumLink/MedplumLink.mjs +2 -2
  32. package/dist/esm/MedplumLink/MedplumLink.mjs.map +1 -1
  33. package/dist/esm/MedplumProvider/MedplumProvider.d.ts +8 -0
  34. package/dist/esm/MedplumProvider/MedplumProvider.mjs +17 -1
  35. package/dist/esm/MedplumProvider/MedplumProvider.mjs.map +1 -1
  36. package/dist/esm/MoneyInput/MoneyInput.mjs +1 -1
  37. package/dist/esm/MoneyInput/MoneyInput.mjs.map +1 -1
  38. package/dist/esm/NoteDisplay/NoteDisplay.d.ts +6 -0
  39. package/dist/esm/NoteDisplay/NoteDisplay.mjs +18 -0
  40. package/dist/esm/NoteDisplay/NoteDisplay.mjs.map +1 -0
  41. package/dist/esm/NoteDisplay/NoteDisplay.stories.d.ts +7 -0
  42. package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.d.ts +2 -1
  43. package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs +4 -3
  44. package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs.map +1 -1
  45. package/dist/esm/PatientTimeline/PatientTimeline.mjs +10 -10
  46. package/dist/esm/PatientTimeline/PatientTimeline.mjs.map +1 -1
  47. package/dist/esm/QuantityInput/QuantityInput.d.ts +1 -0
  48. package/dist/esm/QuantityInput/QuantityInput.mjs +10 -4
  49. package/dist/esm/QuantityInput/QuantityInput.mjs.map +1 -1
  50. package/dist/esm/QuantityInput/QuantityInput.stories.d.ts +7 -0
  51. package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs +2 -2
  52. package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs.map +1 -1
  53. package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs +2 -1
  54. package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs.map +1 -1
  55. package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs +2 -1
  56. package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs.map +1 -1
  57. package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs +2 -1
  58. package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs.map +1 -1
  59. package/dist/esm/ResourceTable/ResourceTable.d.ts +13 -0
  60. package/dist/esm/ResourceTable/ResourceTable.mjs +4 -1
  61. package/dist/esm/ResourceTable/ResourceTable.mjs.map +1 -1
  62. package/dist/esm/ResourceTimeline/ResourceTimeline.d.ts +2 -2
  63. package/dist/esm/ResourceTimeline/ResourceTimeline.mjs +62 -34
  64. package/dist/esm/ResourceTimeline/ResourceTimeline.mjs.map +1 -1
  65. package/dist/esm/SearchControl/SearchControl.mjs +7 -1
  66. package/dist/esm/SearchControl/SearchControl.mjs.map +1 -1
  67. package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs +14 -1
  68. package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs.map +1 -1
  69. package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs +7 -7
  70. package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs.map +1 -1
  71. package/dist/esm/Timeline/Timeline.mjs +1 -1
  72. package/dist/esm/Timeline/Timeline.mjs.map +1 -1
  73. package/dist/esm/auth/AuthenticationForm.mjs +1 -1
  74. package/dist/esm/auth/AuthenticationForm.mjs.map +1 -1
  75. package/dist/esm/auth/MfaForm.mjs +1 -1
  76. package/dist/esm/auth/MfaForm.mjs.map +1 -1
  77. package/dist/esm/index.d.ts +1 -0
  78. package/dist/esm/index.min.mjs +1 -1
  79. package/dist/esm/index.mjs +2 -1
  80. package/dist/esm/index.mjs.map +1 -1
  81. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs +69 -0
  82. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs.map +1 -0
  83. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs +18 -0
  84. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs.map +1 -0
  85. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs +24 -0
  86. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs.map +1 -0
  87. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs +14 -0
  88. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs.map +1 -0
  89. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs +18 -0
  90. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs.map +1 -0
  91. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs +19 -0
  92. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs.map +1 -0
  93. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs +25 -0
  94. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs.map +1 -0
  95. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs +16 -0
  96. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs.map +1 -0
  97. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs +19 -0
  98. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs.map +1 -0
  99. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs +26 -0
  100. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs.map +1 -0
  101. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs +23 -0
  102. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs.map +1 -0
  103. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs +12 -0
  104. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs.map +1 -0
  105. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs +19 -0
  106. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs.map +1 -0
  107. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs +13 -0
  108. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs.map +1 -0
  109. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs +14 -0
  110. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs.map +1 -0
  111. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs +20 -0
  112. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs.map +1 -0
  113. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs +19 -0
  114. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs.map +1 -0
  115. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs +19 -0
  116. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs.map +1 -0
  117. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs +14 -0
  118. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs.map +1 -0
  119. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs +26 -0
  120. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs.map +1 -0
  121. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs +13 -0
  122. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs.map +1 -0
  123. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs +14 -0
  124. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs.map +1 -0
  125. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs +21 -0
  126. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs.map +1 -0
  127. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs +21 -0
  128. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs.map +1 -0
  129. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs +18 -0
  130. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs.map +1 -0
  131. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs +29 -0
  132. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs.map +1 -0
  133. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs +12 -0
  134. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs.map +1 -0
  135. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs +12 -0
  136. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs.map +1 -0
  137. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs +20 -0
  138. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs.map +1 -0
  139. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs +20 -0
  140. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs.map +1 -0
  141. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs +21 -0
  142. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs.map +1 -0
  143. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs +19 -0
  144. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs.map +1 -0
  145. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs +16 -0
  146. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs.map +1 -0
  147. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs +16 -0
  148. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs.map +1 -0
  149. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs +18 -0
  150. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs.map +1 -0
  151. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs +18 -0
  152. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs.map +1 -0
  153. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs +19 -0
  154. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs.map +1 -0
  155. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs +13 -0
  156. package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs.map +1 -0
  157. package/dist/esm/useResource/useResource.d.ts +2 -2
  158. package/dist/esm/useResource/useResource.mjs +62 -39
  159. package/dist/esm/useResource/useResource.mjs.map +1 -1
  160. package/dist/esm/utils/date.d.ts +2 -1
  161. package/dist/esm/utils/date.mjs +31 -25
  162. package/dist/esm/utils/date.mjs.map +1 -1
  163. package/icons-unique.txt +36 -0
  164. package/icons.txt +44 -0
  165. package/package.json +12 -17
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@medplum/core'), require('react'), require('@mantine/core'), require('@tabler/icons'), require('react-router-dom'), require('@mantine/notifications')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@medplum/core', 'react', '@mantine/core', '@tabler/icons', 'react-router-dom', '@mantine/notifications'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.medplum = global.medplum || {}, global.medplum.react = {}), global.medplum.core, global.React, global.mantine.core, global.tabler.icons, global.ReactRouterDOM, global.mantine.notifications));
5
- })(this, (function (exports, core, React, core$1, icons, reactRouterDom, notifications) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@medplum/core'), require('react'), require('@mantine/core'), require('prop-types'), require('@mantine/notifications')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@medplum/core', 'react', '@mantine/core', 'prop-types', '@mantine/notifications'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.medplum = global.medplum || {}, global.medplum.react = {}), global.medplum.core, global.React, global.mantine.core, global.PropTypes, global.mantine.notifications));
5
+ })(this, (function (exports, core, React, core$1, PropTypes, notifications) { 'use strict';
6
6
 
7
7
  function AddressDisplay(props) {
8
8
  const address = props.value;
@@ -74,6 +74,7 @@
74
74
  */
75
75
  function MedplumProvider(props) {
76
76
  const medplum = props.medplum;
77
+ const navigate = props.navigate || defaultNavigate;
77
78
  const [state, setState] = React.useState({
78
79
  profile: medplum.getProfile(),
79
80
  loading: false,
@@ -91,6 +92,7 @@
91
92
  const medplumContext = {
92
93
  ...state,
93
94
  medplum,
95
+ navigate,
94
96
  };
95
97
  return React.createElement(reactContext.Provider, { value: medplumContext }, props.children);
96
98
  }
@@ -107,6 +109,13 @@
107
109
  function useMedplum() {
108
110
  return useMedplumContext().medplum;
109
111
  }
112
+ /**
113
+ * Returns the Medplum navigate function.
114
+ * @returns The Medplum navigate function.
115
+ */
116
+ function useMedplumNavigate() {
117
+ return useMedplumContext().navigate;
118
+ }
110
119
  /**
111
120
  * Returns the current Medplum user profile (if signed in).
112
121
  * This is a shortcut for useMedplumContext().profile.
@@ -115,6 +124,13 @@
115
124
  function useMedplumProfile() {
116
125
  return useMedplumContext().profile;
117
126
  }
127
+ /**
128
+ * The default "navigate" function which simply uses window.location.href.
129
+ * @param path The path to navigate to.
130
+ */
131
+ function defaultNavigate(path) {
132
+ window.location.assign(path);
133
+ }
118
134
 
119
135
  function AnnotationInput(props) {
120
136
  const author = useMedplumProfile();
@@ -298,6 +314,601 @@
298
314
  React.createElement(AttachmentDisplay, { value: v, maxWidth: props.maxWidth }))))));
299
315
  }
300
316
 
317
+ /**
318
+ * @tabler/icons-react v2.3.0 - MIT
319
+ */
320
+
321
+ var defaultAttributes = {
322
+ xmlns: "http://www.w3.org/2000/svg",
323
+ width: 24,
324
+ height: 24,
325
+ viewBox: "0 0 24 24",
326
+ fill: "none",
327
+ stroke: "currentColor",
328
+ strokeWidth: 2,
329
+ strokeLinecap: "round",
330
+ strokeLinejoin: "round"
331
+ };
332
+
333
+ /**
334
+ * @tabler/icons-react v2.3.0 - MIT
335
+ */
336
+
337
+ var __defProp = Object.defineProperty;
338
+ var __defProps = Object.defineProperties;
339
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
340
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
341
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
342
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
343
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
344
+ var __spreadValues = (a, b) => {
345
+ for (var prop in b || (b = {}))
346
+ if (__hasOwnProp.call(b, prop))
347
+ __defNormalProp(a, prop, b[prop]);
348
+ if (__getOwnPropSymbols)
349
+ for (var prop of __getOwnPropSymbols(b)) {
350
+ if (__propIsEnum.call(b, prop))
351
+ __defNormalProp(a, prop, b[prop]);
352
+ }
353
+ return a;
354
+ };
355
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
356
+ var __objRest = (source, exclude) => {
357
+ var target = {};
358
+ for (var prop in source)
359
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
360
+ target[prop] = source[prop];
361
+ if (source != null && __getOwnPropSymbols)
362
+ for (var prop of __getOwnPropSymbols(source)) {
363
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
364
+ target[prop] = source[prop];
365
+ }
366
+ return target;
367
+ };
368
+ var createReactComponent = (iconName, iconNamePascal, iconNode) => {
369
+ const Component = React.forwardRef(
370
+ (_a, ref) => {
371
+ var _b = _a, { color = "currentColor", size = 24, stroke = 2, children } = _b, rest = __objRest(_b, ["color", "size", "stroke", "children"]);
372
+ return React.createElement(
373
+ "svg",
374
+ __spreadValues(__spreadProps(__spreadValues({
375
+ ref
376
+ }, defaultAttributes), {
377
+ width: size,
378
+ height: size,
379
+ stroke: color,
380
+ strokeWidth: stroke,
381
+ className: `tabler-icon tabler-icon-${iconName}`
382
+ }), rest),
383
+ [...iconNode.map(([tag, attrs]) => React.createElement(tag, attrs)), ...children || []]
384
+ );
385
+ }
386
+ );
387
+ Component.propTypes = {
388
+ color: PropTypes.string,
389
+ size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
390
+ stroke: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
391
+ };
392
+ Component.displayName = `${iconNamePascal}`;
393
+ return Component;
394
+ };
395
+
396
+ /**
397
+ * @tabler/icons-react v2.3.0 - MIT
398
+ */
399
+
400
+ var IconAdjustmentsHorizontal = createReactComponent(
401
+ "adjustments-horizontal",
402
+ "IconAdjustmentsHorizontal",
403
+ [
404
+ ["path", { d: "M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-0" }],
405
+ ["path", { d: "M4 6l8 0", key: "svg-1" }],
406
+ ["path", { d: "M16 6l4 0", key: "svg-2" }],
407
+ ["path", { d: "M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-3" }],
408
+ ["path", { d: "M4 12l2 0", key: "svg-4" }],
409
+ ["path", { d: "M10 12l10 0", key: "svg-5" }],
410
+ ["path", { d: "M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-6" }],
411
+ ["path", { d: "M4 18l11 0", key: "svg-7" }],
412
+ ["path", { d: "M19 18l1 0", key: "svg-8" }]
413
+ ]
414
+ );
415
+
416
+ /**
417
+ * @tabler/icons-react v2.3.0 - MIT
418
+ */
419
+
420
+ var IconAlertCircle = createReactComponent("alert-circle", "IconAlertCircle", [
421
+ ["path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", key: "svg-0" }],
422
+ ["path", { d: "M12 8l0 4", key: "svg-1" }],
423
+ ["path", { d: "M12 16l.01 0", key: "svg-2" }]
424
+ ]);
425
+
426
+ /**
427
+ * @tabler/icons-react v2.3.0 - MIT
428
+ */
429
+
430
+ var IconBleachOff = createReactComponent("bleach-off", "IconBleachOff", [
431
+ [
432
+ "path",
433
+ {
434
+ d: "M5 19h14m1.986 -1.977a2 2 0 0 0 -.146 -.773l-7.1 -12.25a2 2 0 0 0 -3.5 0l-.815 1.405m-1.488 2.568l-4.797 8.277a2 2 0 0 0 1.75 2.75",
435
+ key: "svg-0"
436
+ }
437
+ ],
438
+ ["path", { d: "M3 3l18 18", key: "svg-1" }]
439
+ ]);
440
+
441
+ /**
442
+ * @tabler/icons-react v2.3.0 - MIT
443
+ */
444
+
445
+ var IconBleach = createReactComponent("bleach", "IconBleach", [
446
+ [
447
+ "path",
448
+ {
449
+ d: "M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75",
450
+ key: "svg-0"
451
+ }
452
+ ]
453
+ ]);
454
+
455
+ /**
456
+ * @tabler/icons-react v2.3.0 - MIT
457
+ */
458
+
459
+ var IconBoxMultiple = createReactComponent("box-multiple", "IconBoxMultiple", [
460
+ [
461
+ "path",
462
+ {
463
+ d: "M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",
464
+ key: "svg-0"
465
+ }
466
+ ],
467
+ [
468
+ "path",
469
+ {
470
+ d: "M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",
471
+ key: "svg-1"
472
+ }
473
+ ]
474
+ ]);
475
+
476
+ /**
477
+ * @tabler/icons-react v2.3.0 - MIT
478
+ */
479
+
480
+ var IconBracketsContain = createReactComponent("brackets-contain", "IconBracketsContain", [
481
+ ["path", { d: "M7 4h-4v16h4", key: "svg-0" }],
482
+ ["path", { d: "M17 4h4v16h-4", key: "svg-1" }],
483
+ ["path", { d: "M8 16h.01", key: "svg-2" }],
484
+ ["path", { d: "M12 16h.01", key: "svg-3" }],
485
+ ["path", { d: "M16 16h.01", key: "svg-4" }]
486
+ ]);
487
+
488
+ /**
489
+ * @tabler/icons-react v2.3.0 - MIT
490
+ */
491
+
492
+ var IconBucketOff = createReactComponent("bucket-off", "IconBucketOff", [
493
+ [
494
+ "path",
495
+ {
496
+ d: "M5.029 5.036c-.655 .58 -1.029 1.25 -1.029 1.964c0 2.033 3.033 3.712 6.96 3.967m3.788 -.21c3.064 -.559 5.252 -2.029 5.252 -3.757c0 -2.21 -3.582 -4 -8 -4c-1.605 0 -3.1 .236 -4.352 .643",
497
+ key: "svg-0"
498
+ }
499
+ ],
500
+ [
501
+ "path",
502
+ {
503
+ d: "M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.1 -.3 .252 -.812 .457 -1.535m.862 -3.146c.262 -.975 .735 -2.76 1.418 -5.354a7.45 7.45 0 0 0 .263 -1.965",
504
+ key: "svg-1"
505
+ }
506
+ ],
507
+ ["path", { d: "M3 3l18 18", key: "svg-2" }]
508
+ ]);
509
+
510
+ /**
511
+ * @tabler/icons-react v2.3.0 - MIT
512
+ */
513
+
514
+ var IconBucket = createReactComponent("bucket", "IconBucket", [
515
+ ["path", { d: "M12 7m-8 0a8 4 0 1 0 16 0a8 4 0 1 0 -16 0", key: "svg-0" }],
516
+ [
517
+ "path",
518
+ {
519
+ d: "M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.333 -1 1.246 -4.345 2.737 -10.035a7.45 7.45 0 0 0 .263 -1.965",
520
+ key: "svg-1"
521
+ }
522
+ ]
523
+ ]);
524
+
525
+ /**
526
+ * @tabler/icons-react v2.3.0 - MIT
527
+ */
528
+
529
+ var IconCalendar = createReactComponent("calendar", "IconCalendar", [
530
+ [
531
+ "path",
532
+ {
533
+ d: "M4 5m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z",
534
+ key: "svg-0"
535
+ }
536
+ ],
537
+ ["path", { d: "M16 3l0 4", key: "svg-1" }],
538
+ ["path", { d: "M8 3l0 4", key: "svg-2" }],
539
+ ["path", { d: "M4 11l16 0", key: "svg-3" }],
540
+ ["path", { d: "M11 15l1 0", key: "svg-4" }],
541
+ ["path", { d: "M12 15l0 3", key: "svg-5" }]
542
+ ]);
543
+
544
+ /**
545
+ * @tabler/icons-react v2.3.0 - MIT
546
+ */
547
+
548
+ var IconCheck = createReactComponent("check", "IconCheck", [
549
+ ["path", { d: "M5 12l5 5l10 -10", key: "svg-0" }]
550
+ ]);
551
+
552
+ /**
553
+ * @tabler/icons-react v2.3.0 - MIT
554
+ */
555
+
556
+ var IconCheckbox = createReactComponent("checkbox", "IconCheckbox", [
557
+ ["path", { d: "M9 11l3 3l8 -8", key: "svg-0" }],
558
+ [
559
+ "path",
560
+ {
561
+ d: "M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9",
562
+ key: "svg-1"
563
+ }
564
+ ]
565
+ ]);
566
+
567
+ /**
568
+ * @tabler/icons-react v2.3.0 - MIT
569
+ */
570
+
571
+ var IconCircleMinus = createReactComponent("circle-minus", "IconCircleMinus", [
572
+ ["path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", key: "svg-0" }],
573
+ ["path", { d: "M9 12l6 0", key: "svg-1" }]
574
+ ]);
575
+
576
+ /**
577
+ * @tabler/icons-react v2.3.0 - MIT
578
+ */
579
+
580
+ var IconCirclePlus = createReactComponent("circle-plus", "IconCirclePlus", [
581
+ ["path", { d: "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", key: "svg-0" }],
582
+ ["path", { d: "M9 12l6 0", key: "svg-1" }],
583
+ ["path", { d: "M12 9l0 6", key: "svg-2" }]
584
+ ]);
585
+
586
+ /**
587
+ * @tabler/icons-react v2.3.0 - MIT
588
+ */
589
+
590
+ var IconCloudUpload = createReactComponent("cloud-upload", "IconCloudUpload", [
591
+ [
592
+ "path",
593
+ {
594
+ d: "M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1",
595
+ key: "svg-0"
596
+ }
597
+ ],
598
+ ["path", { d: "M9 15l3 -3l3 3", key: "svg-1" }],
599
+ ["path", { d: "M12 12l0 9", key: "svg-2" }]
600
+ ]);
601
+
602
+ /**
603
+ * @tabler/icons-react v2.3.0 - MIT
604
+ */
605
+
606
+ var IconColumns = createReactComponent("columns", "IconColumns", [
607
+ ["path", { d: "M4 6l5.5 0", key: "svg-0" }],
608
+ ["path", { d: "M4 10l5.5 0", key: "svg-1" }],
609
+ ["path", { d: "M4 14l5.5 0", key: "svg-2" }],
610
+ ["path", { d: "M4 18l5.5 0", key: "svg-3" }],
611
+ ["path", { d: "M14.5 6l5.5 0", key: "svg-4" }],
612
+ ["path", { d: "M14.5 10l5.5 0", key: "svg-5" }],
613
+ ["path", { d: "M14.5 14l5.5 0", key: "svg-6" }],
614
+ ["path", { d: "M14.5 18l5.5 0", key: "svg-7" }]
615
+ ]);
616
+
617
+ /**
618
+ * @tabler/icons-react v2.3.0 - MIT
619
+ */
620
+
621
+ var IconCurrencyDollar = createReactComponent("currency-dollar", "IconCurrencyDollar", [
622
+ [
623
+ "path",
624
+ {
625
+ d: "M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2",
626
+ key: "svg-0"
627
+ }
628
+ ],
629
+ ["path", { d: "M12 3v3m0 12v3", key: "svg-1" }]
630
+ ]);
631
+
632
+ /**
633
+ * @tabler/icons-react v2.3.0 - MIT
634
+ */
635
+
636
+ var IconDots = createReactComponent("dots", "IconDots", [
637
+ ["path", { d: "M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", key: "svg-0" }],
638
+ ["path", { d: "M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", key: "svg-1" }],
639
+ ["path", { d: "M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", key: "svg-2" }]
640
+ ]);
641
+
642
+ /**
643
+ * @tabler/icons-react v2.3.0 - MIT
644
+ */
645
+
646
+ var IconEdit = createReactComponent("edit", "IconEdit", [
647
+ [
648
+ "path",
649
+ {
650
+ d: "M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",
651
+ key: "svg-0"
652
+ }
653
+ ],
654
+ [
655
+ "path",
656
+ {
657
+ d: "M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",
658
+ key: "svg-1"
659
+ }
660
+ ],
661
+ ["path", { d: "M16 5l3 3", key: "svg-2" }]
662
+ ]);
663
+
664
+ /**
665
+ * @tabler/icons-react v2.3.0 - MIT
666
+ */
667
+
668
+ var IconEqualNot = createReactComponent("equal-not", "IconEqualNot", [
669
+ ["path", { d: "M5 10h14", key: "svg-0" }],
670
+ ["path", { d: "M5 14h14", key: "svg-1" }],
671
+ ["path", { d: "M5 19l14 -14", key: "svg-2" }]
672
+ ]);
673
+
674
+ /**
675
+ * @tabler/icons-react v2.3.0 - MIT
676
+ */
677
+
678
+ var IconEqual = createReactComponent("equal", "IconEqual", [
679
+ ["path", { d: "M5 10h14", key: "svg-0" }],
680
+ ["path", { d: "M5 14h14", key: "svg-1" }]
681
+ ]);
682
+
683
+ /**
684
+ * @tabler/icons-react v2.3.0 - MIT
685
+ */
686
+
687
+ var IconFileAlert = createReactComponent("file-alert", "IconFileAlert", [
688
+ ["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-0" }],
689
+ [
690
+ "path",
691
+ {
692
+ d: "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",
693
+ key: "svg-1"
694
+ }
695
+ ],
696
+ ["path", { d: "M12 17l.01 0", key: "svg-2" }],
697
+ ["path", { d: "M12 11l0 3", key: "svg-3" }]
698
+ ]);
699
+
700
+ /**
701
+ * @tabler/icons-react v2.3.0 - MIT
702
+ */
703
+
704
+ var IconFilePlus = createReactComponent("file-plus", "IconFilePlus", [
705
+ ["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-0" }],
706
+ [
707
+ "path",
708
+ {
709
+ d: "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",
710
+ key: "svg-1"
711
+ }
712
+ ],
713
+ ["path", { d: "M12 11l0 6", key: "svg-2" }],
714
+ ["path", { d: "M9 14l6 0", key: "svg-3" }]
715
+ ]);
716
+
717
+ /**
718
+ * @tabler/icons-react v2.3.0 - MIT
719
+ */
720
+
721
+ var IconFilter = createReactComponent("filter", "IconFilter", [
722
+ [
723
+ "path",
724
+ {
725
+ d: "M5.5 5h13a1 1 0 0 1 .5 1.5l-5 5.5l0 7l-4 -3l0 -4l-5 -5.5a1 1 0 0 1 .5 -1.5",
726
+ key: "svg-0"
727
+ }
728
+ ]
729
+ ]);
730
+
731
+ /**
732
+ * @tabler/icons-react v2.3.0 - MIT
733
+ */
734
+
735
+ var IconListDetails = createReactComponent("list-details", "IconListDetails", [
736
+ ["path", { d: "M13 5h8", key: "svg-0" }],
737
+ ["path", { d: "M13 9h5", key: "svg-1" }],
738
+ ["path", { d: "M13 15h8", key: "svg-2" }],
739
+ ["path", { d: "M13 19h5", key: "svg-3" }],
740
+ [
741
+ "path",
742
+ {
743
+ d: "M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",
744
+ key: "svg-4"
745
+ }
746
+ ],
747
+ [
748
+ "path",
749
+ {
750
+ d: "M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",
751
+ key: "svg-5"
752
+ }
753
+ ]
754
+ ]);
755
+
756
+ /**
757
+ * @tabler/icons-react v2.3.0 - MIT
758
+ */
759
+
760
+ var IconMathGreater = createReactComponent("math-greater", "IconMathGreater", [
761
+ ["path", { d: "M5 18l14 -6l-14 -6", key: "svg-0" }]
762
+ ]);
763
+
764
+ /**
765
+ * @tabler/icons-react v2.3.0 - MIT
766
+ */
767
+
768
+ var IconMathLower = createReactComponent("math-lower", "IconMathLower", [
769
+ ["path", { d: "M19 18l-14 -6l14 -6", key: "svg-0" }]
770
+ ]);
771
+
772
+ /**
773
+ * @tabler/icons-react v2.3.0 - MIT
774
+ */
775
+
776
+ var IconMessage = createReactComponent("message", "IconMessage", [
777
+ [
778
+ "path",
779
+ {
780
+ d: "M4 21v-13a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v6a3 3 0 0 1 -3 3h-9l-4 4",
781
+ key: "svg-0"
782
+ }
783
+ ],
784
+ ["path", { d: "M8 9l8 0", key: "svg-1" }],
785
+ ["path", { d: "M8 13l6 0", key: "svg-2" }]
786
+ ]);
787
+
788
+ /**
789
+ * @tabler/icons-react v2.3.0 - MIT
790
+ */
791
+
792
+ var IconPin = createReactComponent("pin", "IconPin", [
793
+ [
794
+ "path",
795
+ {
796
+ d: "M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4",
797
+ key: "svg-0"
798
+ }
799
+ ],
800
+ ["path", { d: "M9 15l-4.5 4.5", key: "svg-1" }],
801
+ ["path", { d: "M14.5 4l5.5 5.5", key: "svg-2" }]
802
+ ]);
803
+
804
+ /**
805
+ * @tabler/icons-react v2.3.0 - MIT
806
+ */
807
+
808
+ var IconPinnedOff = createReactComponent("pinned-off", "IconPinnedOff", [
809
+ ["path", { d: "M3 3l18 18", key: "svg-0" }],
810
+ [
811
+ "path",
812
+ {
813
+ d: "M15 4.5l-3.249 3.249m-2.57 1.433l-2.181 .818l-1.5 1.5l7 7l1.5 -1.5l.82 -2.186m1.43 -2.563l3.25 -3.251",
814
+ key: "svg-1"
815
+ }
816
+ ],
817
+ ["path", { d: "M9 15l-4.5 4.5", key: "svg-2" }],
818
+ ["path", { d: "M14.5 4l5.5 5.5", key: "svg-3" }]
819
+ ]);
820
+
821
+ /**
822
+ * @tabler/icons-react v2.3.0 - MIT
823
+ */
824
+
825
+ var IconSettings = createReactComponent("settings", "IconSettings", [
826
+ [
827
+ "path",
828
+ {
829
+ d: "M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",
830
+ key: "svg-0"
831
+ }
832
+ ],
833
+ ["path", { d: "M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", key: "svg-1" }]
834
+ ]);
835
+
836
+ /**
837
+ * @tabler/icons-react v2.3.0 - MIT
838
+ */
839
+
840
+ var IconSortAscending = createReactComponent("sort-ascending", "IconSortAscending", [
841
+ ["path", { d: "M4 6l7 0", key: "svg-0" }],
842
+ ["path", { d: "M4 12l7 0", key: "svg-1" }],
843
+ ["path", { d: "M4 18l9 0", key: "svg-2" }],
844
+ ["path", { d: "M15 9l3 -3l3 3", key: "svg-3" }],
845
+ ["path", { d: "M18 6l0 12", key: "svg-4" }]
846
+ ]);
847
+
848
+ /**
849
+ * @tabler/icons-react v2.3.0 - MIT
850
+ */
851
+
852
+ var IconSortDescending = createReactComponent("sort-descending", "IconSortDescending", [
853
+ ["path", { d: "M4 6l9 0", key: "svg-0" }],
854
+ ["path", { d: "M4 12l7 0", key: "svg-1" }],
855
+ ["path", { d: "M4 18l7 0", key: "svg-2" }],
856
+ ["path", { d: "M15 15l3 3l3 -3", key: "svg-3" }],
857
+ ["path", { d: "M18 6l0 12", key: "svg-4" }]
858
+ ]);
859
+
860
+ /**
861
+ * @tabler/icons-react v2.3.0 - MIT
862
+ */
863
+
864
+ var IconSquare = createReactComponent("square", "IconSquare", [
865
+ [
866
+ "path",
867
+ {
868
+ d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z",
869
+ key: "svg-0"
870
+ }
871
+ ]
872
+ ]);
873
+
874
+ /**
875
+ * @tabler/icons-react v2.3.0 - MIT
876
+ */
877
+
878
+ var IconTableExport = createReactComponent("table-export", "IconTableExport", [
879
+ [
880
+ "path",
881
+ {
882
+ d: "M11.5 20h-5.5a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v7.5m-16 -3.5h16m-10 -6v16m4 -1h7m-3 -3l3 3l-3 3",
883
+ key: "svg-0"
884
+ }
885
+ ]
886
+ ]);
887
+
888
+ /**
889
+ * @tabler/icons-react v2.3.0 - MIT
890
+ */
891
+
892
+ var IconTrash = createReactComponent("trash", "IconTrash", [
893
+ ["path", { d: "M4 7l16 0", key: "svg-0" }],
894
+ ["path", { d: "M10 11l0 6", key: "svg-1" }],
895
+ ["path", { d: "M14 11l0 6", key: "svg-2" }],
896
+ [
897
+ "path",
898
+ { d: "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12", key: "svg-3" }
899
+ ],
900
+ ["path", { d: "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3", key: "svg-4" }]
901
+ ]);
902
+
903
+ /**
904
+ * @tabler/icons-react v2.3.0 - MIT
905
+ */
906
+
907
+ var IconX = createReactComponent("x", "IconX", [
908
+ ["path", { d: "M18 6l-12 12", key: "svg-0" }],
909
+ ["path", { d: "M6 6l12 12", key: "svg-1" }]
910
+ ]);
911
+
301
912
  function AttachmentButton(props) {
302
913
  const medplum = useMedplum();
303
914
  const fileInputRef = React.useRef(null);
@@ -373,14 +984,14 @@
373
984
  copy.splice(index, 1);
374
985
  setValuesWrapper(copy);
375
986
  } },
376
- React.createElement(icons.IconCircleMinus, null)))))),
987
+ React.createElement(IconCircleMinus, null)))))),
377
988
  React.createElement("tr", null,
378
989
  React.createElement("td", null),
379
990
  React.createElement("td", null,
380
991
  React.createElement(AttachmentButton, { onUpload: (attachment) => {
381
992
  setValuesWrapper([...valuesRef.current, attachment]);
382
993
  } }, (props) => (React.createElement(core$1.ActionIcon, { ...props, title: "Add", size: "sm", color: "green" },
383
- React.createElement(icons.IconCloudUpload, { size: 16 })))))))));
994
+ React.createElement(IconCloudUpload, { size: 16 })))))))));
384
995
  }
385
996
 
386
997
  function AttachmentInput(props) {
@@ -402,7 +1013,7 @@
402
1013
  return (React.createElement(AttachmentButton, { onUpload: setValueWrapper }, (props) => React.createElement(core$1.Button, { ...props }, "Upload...")));
403
1014
  }
404
1015
 
405
- const useStyles$d = core$1.createStyles(() => ({
1016
+ const useStyles$e = core$1.createStyles(() => ({
406
1017
  root: {
407
1018
  '@media (max-width: 800px)': {
408
1019
  paddingLeft: 4,
@@ -412,11 +1023,11 @@
412
1023
  }));
413
1024
  function Container(props) {
414
1025
  const { children, ...others } = props;
415
- const { classes } = useStyles$d();
1026
+ const { classes } = useStyles$e();
416
1027
  return (React.createElement(core$1.Container, { className: classes.root, ...others }, children));
417
1028
  }
418
1029
 
419
- const useStyles$c = core$1.createStyles((theme, { width, fill }) => ({
1030
+ const useStyles$d = core$1.createStyles((theme, { width, fill }) => ({
420
1031
  paper: {
421
1032
  maxWidth: width,
422
1033
  margin: `${theme.spacing.xl}px auto`,
@@ -441,7 +1052,7 @@
441
1052
  };
442
1053
  function Panel(props) {
443
1054
  const { className, children, width, fill, unstyled, ...others } = core$1.useComponentDefaultProps('Panel', defaultProps$1, props);
444
- const { classes, cx } = useStyles$c({ width, fill }, { name: 'Panel', unstyled });
1055
+ const { classes, cx } = useStyles$d({ width, fill }, { name: 'Panel', unstyled });
445
1056
  return (React.createElement(core$1.Paper, { className: cx(classes.paper, className), ...others }, children));
446
1057
  }
447
1058
 
@@ -622,19 +1233,22 @@
622
1233
  if (clientId) {
623
1234
  return clientId;
624
1235
  }
625
- const origin = window.location.protocol + '//' + window.location.host;
626
- const authorizedOrigins = "http://localhost:3000,http://127.0.0.1:3000,http://localhost:6006,http://127.0.0.1:6006,https://app.medplum.com,https://docs.medplum.com,https://storybook.medplum.com,https://graphiql.medplum.com,https://www.medplum.com"?.split(',') ?? [];
627
- if (authorizedOrigins.includes(origin)) {
628
- return "921088377005-3j1sa10vr6hj86jgmdfh2l53v3mp7lfi.apps.googleusercontent.com";
1236
+ if (typeof window !== 'undefined') {
1237
+ const origin = window.location.protocol + '//' + window.location.host;
1238
+ const authorizedOrigins = "http://localhost:3000,http://127.0.0.1:3000,http://localhost:6006,http://127.0.0.1:6006,https://app.medplum.com,https://docs.medplum.com,https://storybook.medplum.com,https://graphiql.medplum.com,https://www.medplum.com"?.split(',') ?? [];
1239
+ if (authorizedOrigins.includes(origin)) {
1240
+ return "921088377005-3j1sa10vr6hj86jgmdfh2l53v3mp7lfi.apps.googleusercontent.com";
1241
+ }
629
1242
  }
630
1243
  return undefined;
631
1244
  }
632
1245
 
633
1246
  function OperationOutcomeAlert(props) {
634
- if (!props.issues) {
1247
+ const issues = props.outcome?.issue || props.issues;
1248
+ if (!issues) {
635
1249
  return null;
636
1250
  }
637
- return (React.createElement(core$1.Alert, { icon: React.createElement(icons.IconAlertCircle, { size: 16 }), color: "red" }, props.issues.map((issue) => (React.createElement("div", { "data-testid": "text-field-error", key: issue.details?.text }, issue.details?.text)))));
1251
+ return (React.createElement(core$1.Alert, { icon: React.createElement(IconAlertCircle, { size: 16 }), color: "red" }, issues.map((issue) => (React.createElement("div", { "data-testid": "text-field-error", key: issue.details?.text }, issue.details?.text)))));
638
1252
  }
639
1253
 
640
1254
  /**
@@ -833,7 +1447,7 @@
833
1447
  React.createElement(core$1.Center, { sx: { flexDirection: 'column' } }, children),
834
1448
  React.createElement(OperationOutcomeAlert, { issues: issues }),
835
1449
  React.createElement(core$1.Stack, { spacing: "xl" },
836
- React.createElement(core$1.PasswordInput, { name: "password", type: "password", label: "Password", autoComplete: "off", required: true, error: getErrorsForInput(outcome, 'password') })),
1450
+ React.createElement(core$1.PasswordInput, { name: "password", label: "Password", autoComplete: "off", required: true, error: getErrorsForInput(outcome, 'password') })),
837
1451
  React.createElement(core$1.Group, { position: "apart", mt: "xl", spacing: 0, noWrap: true },
838
1452
  onForgotPassword && (React.createElement(core$1.Anchor, { component: "button", type: "button", color: "dimmed", onClick: onForgotPassword, size: "xs" }, "Forgot password")),
839
1453
  React.createElement(core$1.Checkbox, { id: "remember", name: "remember", label: "Remember me", size: "xs", sx: { lineHeight: 1 } }),
@@ -899,7 +1513,7 @@
899
1513
  React.createElement(core$1.Center, { sx: { flexDirection: 'column' } },
900
1514
  React.createElement(Logo, { size: 32 }),
901
1515
  React.createElement(core$1.Title, null, "Enter MFA code")),
902
- errorMessage && (React.createElement(core$1.Alert, { icon: React.createElement(icons.IconAlertCircle, { size: 16 }), title: "Error", color: "red" }, errorMessage)),
1516
+ errorMessage && (React.createElement(core$1.Alert, { icon: React.createElement(IconAlertCircle, { size: 16 }), title: "Error", color: "red" }, errorMessage)),
903
1517
  React.createElement(core$1.Stack, null,
904
1518
  React.createElement(core$1.TextInput, { name: "token", label: "MFA code", required: true })),
905
1519
  React.createElement(core$1.Group, { position: "right", mt: "xl" },
@@ -997,7 +1611,7 @@
997
1611
  'modifierExtension',
998
1612
  ];
999
1613
 
1000
- const useStyles$b = core$1.createStyles((theme) => ({
1614
+ const useStyles$c = core$1.createStyles((theme) => ({
1001
1615
  root: {
1002
1616
  display: 'grid',
1003
1617
  gridTemplateColumns: '30% 70%',
@@ -1018,7 +1632,7 @@
1018
1632
  }));
1019
1633
  function DescriptionList(props) {
1020
1634
  const { children, compact } = props;
1021
- const { classes, cx } = useStyles$b();
1635
+ const { classes, cx } = useStyles$c();
1022
1636
  return React.createElement("dl", { className: cx(classes.root, { [classes.compact]: compact }) }, children);
1023
1637
  }
1024
1638
  function DescriptionListEntry(props) {
@@ -1110,7 +1724,7 @@
1110
1724
  }
1111
1725
 
1112
1726
  function MedplumLink(props) {
1113
- const navigate = reactRouterDom.useNavigate();
1727
+ const navigate = useMedplumNavigate();
1114
1728
  const { to, suffix, label, onClick, children, ...rest } = props;
1115
1729
  let href = getHref(to);
1116
1730
  if (suffix) {
@@ -1320,64 +1934,86 @@
1320
1934
  return (React.createElement(core$1.Input.Wrapper, { id: props.htmlFor, label: props.title, description: props.description, error: getErrorsForInput(props.outcome, props.htmlFor) }, props.children));
1321
1935
  }
1322
1936
 
1323
- const system = {
1324
- resourceType: 'Device',
1325
- id: 'system',
1326
- deviceName: [
1327
- {
1328
- name: 'System',
1329
- },
1330
- ],
1331
- };
1332
1937
  /**
1333
1938
  * React Hook to use a FHIR reference.
1334
1939
  * Handles the complexity of resolving references and caching resources.
1335
1940
  * @param value The resource or reference to resource.
1336
1941
  * @returns The resolved resource.
1337
1942
  */
1338
- function useResource(value) {
1943
+ function useResource(value, setOutcome) {
1339
1944
  const medplum = useMedplum();
1340
- const [resource, setResource] = React.useState(getInitialResource(medplum, value));
1945
+ const referenceRef = React.useRef(undefined);
1946
+ const resourceRef = React.useRef(undefined);
1947
+ // Parse the input value into a reference and resource
1948
+ parseValue(value, referenceRef, resourceRef);
1949
+ // Priority order:
1950
+ // 1. Cached reference
1951
+ // 2. Resource passed in as-is
1952
+ // 3. Undefined
1953
+ const currentResource = getCurrentValue(medplum, referenceRef, resourceRef);
1954
+ // Keep track of the previous resource
1955
+ // This is used to detect when the resource has changed
1956
+ // We need a React "state" variable to trigger a re-render
1957
+ const [prevResource, forceRerender] = React.useState(currentResource);
1958
+ // Subscribe to changes to the passed-in value
1341
1959
  React.useEffect(() => {
1342
- let subscribed = true;
1343
- if (!resource && value && 'reference' in value && value.reference) {
1960
+ if (referenceRef.current) {
1344
1961
  medplum
1345
- .readReference(value)
1346
- .then((r) => {
1347
- if (subscribed) {
1348
- setResource(r);
1962
+ .readReference(referenceRef.current)
1963
+ .then((newValue) => {
1964
+ if (!core.deepEquals(newValue, prevResource)) {
1965
+ forceRerender(newValue);
1349
1966
  }
1350
1967
  })
1351
- .catch(() => setResource(undefined));
1968
+ .catch((err) => {
1969
+ if (setOutcome) {
1970
+ setOutcome(err);
1971
+ }
1972
+ });
1352
1973
  }
1353
- return (() => (subscribed = false));
1354
- }, [medplum, resource, value]);
1355
- return resource;
1974
+ }, [medplum, prevResource, value, setOutcome]);
1975
+ return currentResource;
1356
1976
  }
1357
1977
  /**
1358
- * Returns the initial resource value based on the input value.
1359
- * If the input value is a resource, returns the resource.
1360
- * If the input value is a reference to system, returns the system resource.
1361
- * If the input value is a reference to a resource available in the cache, returns the resource.
1362
- * Otherwise, returns undefined.
1363
- * @param medplum The medplum client.
1364
- * @param value The resource or reference to resource.
1365
- * @returns An initial resource if available; undefined otherwise.
1978
+ * Parses the input into a reference and resource.
1979
+ * @param value The input value to parse. Can be either a reference or a resource.
1980
+ * @param referenceRef The output reference.
1981
+ * @param resourceRef The output resource.
1366
1982
  */
1367
- function getInitialResource(medplum, value) {
1983
+ function parseValue(value, referenceRef, resourceRef) {
1984
+ // Reset the reference and resource
1985
+ referenceRef.current = undefined;
1986
+ resourceRef.current = undefined;
1368
1987
  if (!value) {
1369
- return undefined;
1370
- }
1371
- if ('resourceType' in value) {
1372
- return value;
1988
+ return;
1373
1989
  }
1374
1990
  if ('reference' in value) {
1375
- if (value.reference === 'system') {
1376
- return system;
1991
+ // If the input is a reference then we can use it as-is
1992
+ referenceRef.current = value;
1993
+ }
1994
+ else if ('resourceType' in value) {
1995
+ resourceRef.current = value;
1996
+ if ('id' in value) {
1997
+ // If the input is a resource with an ID, then we can still create a reference
1998
+ referenceRef.current = { reference: value.resourceType + '/' + value.id };
1377
1999
  }
1378
- return medplum.getCachedReference(value);
1379
2000
  }
1380
- return undefined;
2001
+ }
2002
+ /**
2003
+ * Returns the best currently available value.
2004
+ * This is ***not*** asynchronous and returns immediately.
2005
+ * It attempts to return the value from the cache, or the resource passed in as-is.
2006
+ * @param medplum The Medplum client.
2007
+ * @param referenceRef The reference.
2008
+ * @param resourceRef The resource.
2009
+ * @returns The currently available value.
2010
+ */
2011
+ function getCurrentValue(medplum, referenceRef, resourceRef) {
2012
+ // Priority order:
2013
+ // 1. Cached reference
2014
+ // 2. Resource passed in as-is
2015
+ // 3. Undefined
2016
+ return (referenceRef.current && medplum.getCachedReference(referenceRef.current)) || resourceRef.current;
1381
2017
  }
1382
2018
 
1383
2019
  function ResourceForm(props) {
@@ -1782,7 +2418,7 @@
1782
2418
  width: 92,
1783
2419
  },
1784
2420
  }, onChange: handleCurrencyChange }));
1785
- return (React.createElement(core$1.TextInput, { type: "number", label: props.label, placeholder: props.placeholder || 'Value', defaultValue: value?.value?.toString() || 'USD', icon: React.createElement(icons.IconCurrencyDollar, { size: 14 }), rightSection: select, rightSectionWidth: 92, onChange: handleValueChange }));
2421
+ return (React.createElement(core$1.TextInput, { type: "number", label: props.label, placeholder: props.placeholder || 'Value', defaultValue: value?.value?.toString() || 'USD', icon: React.createElement(IconCurrencyDollar, { size: 14 }), rightSection: select, rightSectionWidth: 92, onChange: handleValueChange }));
1786
2422
  }
1787
2423
 
1788
2424
  function PeriodInput(props) {
@@ -1811,10 +2447,16 @@
1811
2447
  ...value,
1812
2448
  comparator: e.currentTarget.value,
1813
2449
  }) }),
1814
- React.createElement(core$1.TextInput, { id: props.name, name: props.name, "data-testid": props.name + '-value', type: "number", step: "any", placeholder: "Value", defaultValue: value?.value?.toString(), onChange: (e) => setValueWrapper({
1815
- ...value,
1816
- value: tryParseNumber(e.currentTarget.value),
1817
- }) }),
2450
+ React.createElement(core$1.TextInput, { id: props.name, name: props.name, "data-testid": props.name + '-value', type: "number", placeholder: "Value", defaultValue: value?.value, step: "any", onWheel: (e) => {
2451
+ if (props.disableWheel) {
2452
+ e.currentTarget.blur();
2453
+ }
2454
+ }, onChange: (e) => {
2455
+ setValueWrapper({
2456
+ ...value,
2457
+ value: tryParseNumber(e.currentTarget.value),
2458
+ });
2459
+ } }),
1818
2460
  React.createElement(core$1.TextInput, { placeholder: "Unit", "data-testid": props.name + '-unit', defaultValue: value?.unit, onChange: (e) => setValueWrapper({
1819
2461
  ...value,
1820
2462
  unit: e.currentTarget.value,
@@ -2020,7 +2662,7 @@
2020
2662
  copy.splice(index, 1);
2021
2663
  setValuesWrapper(copy);
2022
2664
  } },
2023
- React.createElement(icons.IconCircleMinus, null)))))),
2665
+ React.createElement(IconCircleMinus, null)))))),
2024
2666
  React.createElement("tr", null,
2025
2667
  React.createElement("td", null),
2026
2668
  React.createElement("td", { style: { textAlign: 'right' } },
@@ -2030,7 +2672,7 @@
2030
2672
  copy.push(undefined);
2031
2673
  setValuesWrapper(copy);
2032
2674
  } },
2033
- React.createElement(icons.IconCirclePlus, null)))))));
2675
+ React.createElement(IconCirclePlus, null)))))));
2034
2676
  }
2035
2677
 
2036
2678
  const daysOfWeek = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
@@ -2287,7 +2929,7 @@
2287
2929
  })));
2288
2930
  }
2289
2931
 
2290
- const useStyles$a = core$1.createStyles((theme) => ({
2932
+ const useStyles$b = core$1.createStyles((theme) => ({
2291
2933
  table: {
2292
2934
  width: 350,
2293
2935
  '& th': {
@@ -2332,7 +2974,7 @@
2332
2974
  return date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();
2333
2975
  }
2334
2976
  function CalendarInput(props) {
2335
- const { classes } = useStyles$a();
2977
+ const { classes } = useStyles$b();
2336
2978
  const { onChangeMonth, onClick } = props;
2337
2979
  const [month, setMonth] = React.useState(getStartMonth);
2338
2980
  function moveMonth(delta) {
@@ -2415,6 +3057,19 @@
2415
3057
  return false;
2416
3058
  }
2417
3059
 
3060
+ const useStyles$a = core$1.createStyles((theme) => ({
3061
+ noteBody: { fontSize: theme.fontSizes.sm },
3062
+ noteCite: { fontSize: theme.fontSizes.xs, marginBlockStart: 3 },
3063
+ noteRoot: { padding: 5 },
3064
+ }));
3065
+ function NoteDisplay({ value }) {
3066
+ const { classes } = useStyles$a();
3067
+ if (!value) {
3068
+ return null;
3069
+ }
3070
+ return (React.createElement(core$1.Stack, { justify: "flex-start", spacing: "xs" }, value.map((note, index) => note.text && (React.createElement(core$1.Blockquote, { key: `note-${index}`, classNames: { cite: classes.noteCite, body: classes.noteBody, root: classes.noteRoot }, cite: note.authorReference?.display || note.authorString, icon: null }, note.text)))));
3071
+ }
3072
+
2418
3073
  function ResourceName(props) {
2419
3074
  const { value, link, ...rest } = props;
2420
3075
  const resource = useResource(value);
@@ -2507,6 +3162,9 @@
2507
3162
  border: `0.1px solid ${theme.colors.red[5]}`,
2508
3163
  },
2509
3164
  },
3165
+ noteBody: { fontSize: theme.fontSizes.sm },
3166
+ noteCite: { fontSize: theme.fontSizes.xs, marginBlockStart: 3 },
3167
+ noteRoot: { padding: 5 },
2510
3168
  }));
2511
3169
  function DiagnosticReportDisplay(props) {
2512
3170
  const diagnosticReport = useResource(props.value);
@@ -2514,16 +3172,11 @@
2514
3172
  if (!diagnosticReport) {
2515
3173
  return null;
2516
3174
  }
2517
- let textContent = '';
3175
+ const specimenNotes = specimen?.note || [];
2518
3176
  if (diagnosticReport.presentedForm && diagnosticReport.presentedForm.length > 0) {
2519
3177
  const pf = diagnosticReport.presentedForm[0];
2520
3178
  if (pf.contentType?.startsWith('text/plain') && pf.data) {
2521
- textContent = window.atob(pf.data);
2522
- }
2523
- }
2524
- if (specimen?.note) {
2525
- for (const note of specimen.note) {
2526
- textContent += note.text + '\n\n';
3179
+ specimenNotes.push({ text: window.atob(pf.data) });
2527
3180
  }
2528
3181
  }
2529
3182
  return (React.createElement(core$1.Stack, null,
@@ -2544,8 +3197,8 @@
2544
3197
  diagnosticReport.status && (React.createElement("div", null,
2545
3198
  React.createElement(core$1.Text, { size: "xs", transform: "uppercase", color: "dimmed" }, "Status"),
2546
3199
  React.createElement(core$1.Text, null, core.capitalize(diagnosticReport.status))))),
2547
- diagnosticReport.result && React.createElement(ObservationTable, { value: diagnosticReport.result }),
2548
- textContent && React.createElement("pre", null, textContent.trim())));
3200
+ diagnosticReport.result && (React.createElement(ObservationTable, { hideObservationNotes: props.hideObservationNotes, value: diagnosticReport.result })),
3201
+ specimenNotes.length > 0 && React.createElement(NoteDisplay, { value: specimenNotes })));
2549
3202
  }
2550
3203
  function ObservationTable(props) {
2551
3204
  const { classes } = useStyles$9();
@@ -2558,7 +3211,7 @@
2558
3211
  React.createElement("th", null, "Interpretation"),
2559
3212
  React.createElement("th", null, "Category"),
2560
3213
  React.createElement("th", null, "Status"))),
2561
- React.createElement("tbody", null, props.value?.map((observation, index) => (React.createElement(ObservationRow, { key: 'obs-' + index, value: observation }))))));
3214
+ React.createElement("tbody", null, props.value?.map((observation, index) => (React.createElement(ObservationRow, { key: `obs-${index}-${observation.id}`, hideObservationNotes: props.hideObservationNotes, value: observation }))))));
2562
3215
  }
2563
3216
  function ObservationRow(props) {
2564
3217
  const { classes, cx } = useStyles$9();
@@ -2566,19 +3219,24 @@
2566
3219
  if (!observation) {
2567
3220
  return null;
2568
3221
  }
3222
+ const displayNotes = !props.hideObservationNotes && observation?.note;
2569
3223
  const critical = isCritical(observation);
2570
- return (React.createElement("tr", { className: cx({ [classes.criticalRow]: critical }) },
2571
- React.createElement("td", null,
2572
- React.createElement(MedplumLink, { to: observation },
2573
- React.createElement(CodeableConceptDisplay, { value: observation.code }))),
2574
- React.createElement("td", null,
2575
- React.createElement(ObservationValueDisplay, { value: observation })),
2576
- React.createElement("td", null,
2577
- React.createElement(ReferenceRangeDisplay, { value: observation.referenceRange })),
2578
- React.createElement("td", null, observation.interpretation && observation.interpretation.length > 0 && (React.createElement(CodeableConceptDisplay, { value: observation.interpretation[0] }))),
2579
- React.createElement("td", null, observation.category && observation.category.length > 0 && (React.createElement("ul", null, observation.category.map((concept, index) => (React.createElement("li", { key: `category-${index}` },
2580
- React.createElement(CodeableConceptDisplay, { value: concept }))))))),
2581
- React.createElement("td", null, observation.status && React.createElement(StatusBadge, { status: observation.status }))));
3224
+ return (React.createElement(React.Fragment, null,
3225
+ React.createElement("tr", { className: cx({ [classes.criticalRow]: critical }) },
3226
+ React.createElement("td", { rowSpan: displayNotes ? 2 : 1 },
3227
+ React.createElement(MedplumLink, { to: observation },
3228
+ React.createElement(CodeableConceptDisplay, { value: observation.code }))),
3229
+ React.createElement("td", null,
3230
+ React.createElement(ObservationValueDisplay, { value: observation })),
3231
+ React.createElement("td", null,
3232
+ React.createElement(ReferenceRangeDisplay, { value: observation.referenceRange })),
3233
+ React.createElement("td", null, observation.interpretation && observation.interpretation.length > 0 && (React.createElement(CodeableConceptDisplay, { value: observation.interpretation[0] }))),
3234
+ React.createElement("td", null, observation.category && observation.category.length > 0 && (React.createElement("ul", null, observation.category.map((concept, index) => (React.createElement("li", { key: `category-${index}` },
3235
+ React.createElement(CodeableConceptDisplay, { value: concept }))))))),
3236
+ React.createElement("td", null, observation.status && React.createElement(StatusBadge, { status: observation.status }))),
3237
+ displayNotes && (React.createElement("tr", null,
3238
+ React.createElement("td", { colSpan: 5 },
3239
+ React.createElement(NoteDisplay, { value: observation.note }))))));
2582
3240
  }
2583
3241
  function ObservationValueDisplay(props) {
2584
3242
  const obs = props.value;
@@ -2689,7 +3347,10 @@
2689
3347
  if (!schema || !value) {
2690
3348
  return null;
2691
3349
  }
2692
- return (React.createElement(BackboneElementDisplay, { value: { type: value.resourceType, value }, ignoreMissingValues: props.ignoreMissingValues }));
3350
+ return (React.createElement(BackboneElementDisplay, { value: {
3351
+ type: value.resourceType,
3352
+ value: props.forceUseInput ? props.value : value,
3353
+ }, ignoreMissingValues: props.ignoreMissingValues }));
2693
3354
  }
2694
3355
 
2695
3356
  /**
@@ -2709,7 +3370,7 @@
2709
3370
  }
2710
3371
  render() {
2711
3372
  if (this.state.error) {
2712
- return (React.createElement(core$1.Alert, { icon: React.createElement(icons.IconAlertCircle, { size: 16 }), title: "Something went wrong", color: "red" }, core.normalizeErrorString(this.state.error)));
3373
+ return (React.createElement(core$1.Alert, { icon: React.createElement(IconAlertCircle, { size: 16 }), title: "Something went wrong", color: "red" }, core.normalizeErrorString(this.state.error)));
2713
3374
  }
2714
3375
  return this.props.children;
2715
3376
  }
@@ -2734,7 +3395,7 @@
2734
3395
  popupMenuItems && (React.createElement(core$1.Menu, { position: "bottom-end", shadow: "md", width: 200 },
2735
3396
  React.createElement(core$1.Menu.Target, null,
2736
3397
  React.createElement(core$1.ActionIcon, { radius: "xl", "aria-label": `Actions for ${core.getReferenceString(props.resource)}` },
2737
- React.createElement(icons.IconDots, null))),
3398
+ React.createElement(IconDots, null))),
2738
3399
  popupMenuItems))),
2739
3400
  React.createElement(ErrorBoundary, null,
2740
3401
  padding && React.createElement("div", { style: { padding: '0 16px 16px 16px' } }, props.children),
@@ -2744,20 +3405,20 @@
2744
3405
  /**
2745
3406
  * Sorts an array of resources in place by meta.lastUpdated ascending.
2746
3407
  * @param resources Array of resources.
3408
+ * @param timelineResource Optional primary resource of a timeline view. If specified, the primary resource will be sorted by meta.lastUpdated descending.
2747
3409
  */
2748
- function sortByDateAndPriority(resources) {
2749
- resources.sort(resourceDateComparator);
2750
- }
2751
- function resourceDateComparator(a, b) {
2752
- const priority1 = getPriorityScore(a);
2753
- const priority2 = getPriorityScore(b);
2754
- if (priority1 > priority2) {
2755
- return 1;
2756
- }
2757
- if (priority1 < priority2) {
2758
- return -1;
2759
- }
2760
- return getTime(a) - getTime(b);
3410
+ function sortByDateAndPriority(resources, timelineResource) {
3411
+ resources.sort((a, b) => {
3412
+ const priority1 = getPriorityScore(a);
3413
+ const priority2 = getPriorityScore(b);
3414
+ if (priority1 > priority2) {
3415
+ return 1;
3416
+ }
3417
+ if (priority1 < priority2) {
3418
+ return -1;
3419
+ }
3420
+ return getTime(a, timelineResource) - getTime(b, timelineResource);
3421
+ });
2761
3422
  }
2762
3423
  function getPriorityScore(resource) {
2763
3424
  const priority = resource.priority;
@@ -2766,18 +3427,21 @@
2766
3427
  }
2767
3428
  return 0;
2768
3429
  }
2769
- function getTime(resource) {
2770
- if (resource.resourceType === 'Communication' && resource.sent) {
2771
- return new Date(resource.sent).getTime();
2772
- }
2773
- if ((resource.resourceType === 'DiagnosticReport' ||
2774
- resource.resourceType === 'Media' ||
2775
- resource.resourceType === 'Observation') &&
2776
- resource.issued) {
2777
- return new Date(resource.issued).getTime();
2778
- }
2779
- if (resource.resourceType === 'DocumentReference' && resource.date) {
2780
- return new Date(resource.date).getTime();
3430
+ function getTime(resource, timelineResource) {
3431
+ if (!isSameResourceType(resource, timelineResource)) {
3432
+ // Only use special case timestamps if not the primary resource of a timeline view.
3433
+ if (resource.resourceType === 'Communication' && resource.sent) {
3434
+ return new Date(resource.sent).getTime();
3435
+ }
3436
+ if ((resource.resourceType === 'DiagnosticReport' ||
3437
+ resource.resourceType === 'Media' ||
3438
+ resource.resourceType === 'Observation') &&
3439
+ resource.issued) {
3440
+ return new Date(resource.issued).getTime();
3441
+ }
3442
+ if (resource.resourceType === 'DocumentReference' && resource.date) {
3443
+ return new Date(resource.date).getTime();
3444
+ }
2781
3445
  }
2782
3446
  const dateTime = resource.meta?.lastUpdated;
2783
3447
  if (!dateTime) {
@@ -2785,6 +3449,9 @@
2785
3449
  }
2786
3450
  return new Date(dateTime).getTime();
2787
3451
  }
3452
+ function isSameResourceType(a, b) {
3453
+ return !!b && a.resourceType === b.resourceType && a.id === b.id;
3454
+ }
2788
3455
 
2789
3456
  const useStyles$7 = core$1.createStyles((theme) => ({
2790
3457
  pinnedComment: {
@@ -2792,8 +3459,8 @@
2792
3459
  },
2793
3460
  }));
2794
3461
  function ResourceTimeline(props) {
2795
- const navigate = reactRouterDom.useNavigate();
2796
3462
  const medplum = useMedplum();
3463
+ const navigate = useMedplumNavigate();
2797
3464
  const sender = medplum.getProfile();
2798
3465
  const inputRef = React.useRef(null);
2799
3466
  const resource = useResource(props.value);
@@ -2802,28 +3469,38 @@
2802
3469
  const loadTimelineResources = props.loadTimelineResources;
2803
3470
  const itemsRef = React.useRef(items);
2804
3471
  itemsRef.current = items;
2805
- const loadTimeline = React.useCallback(() => {
2806
- if (!resource) {
2807
- setItems([]);
2808
- setHistory({});
2809
- return;
2810
- }
2811
- loadTimelineResources(medplum, resource).then(handleBatchResponse).catch(console.log);
2812
- }, [medplum, resource, loadTimelineResources]);
2813
- React.useEffect(() => {
2814
- loadTimeline();
2815
- }, [loadTimeline]);
3472
+ /**
3473
+ * Sorts and sets the items.
3474
+ *
3475
+ * Sorting is primarily a function of meta.lastUpdated, but there are special cases.
3476
+ * When displaying connected resources, for example a Communication in the context of an Encounter,
3477
+ * the Communication.sent time is used rather than Communication.meta.lastUpdated.
3478
+ *
3479
+ * Other examples of special cases:
3480
+ * - DiagnosticReport.issued
3481
+ * - Media.issued
3482
+ * - Observation.issued
3483
+ * - DocumentReference.date
3484
+ *
3485
+ * See "sortByDateAndPriority()" for more details.
3486
+ */
3487
+ const sortAndSetItems = React.useCallback((newItmes) => {
3488
+ sortByDateAndPriority(newItmes, resource);
3489
+ newItmes.reverse();
3490
+ setItems(newItmes);
3491
+ }, [resource]);
2816
3492
  /**
2817
3493
  * Handles a batch request response.
2818
3494
  * @param batchResponse The batch response.
2819
3495
  */
2820
- function handleBatchResponse(bundles) {
3496
+ const handleBatchResponse = React.useCallback((batchResponse) => {
2821
3497
  const newItems = [];
2822
- for (const bundle of bundles) {
2823
- if (!bundle) {
3498
+ for (const settledResult of batchResponse) {
3499
+ if (settledResult.status !== 'fulfilled') {
2824
3500
  // User may not have access to all resource types
2825
3501
  continue;
2826
3502
  }
3503
+ const bundle = settledResult.value;
2827
3504
  if (bundle.type === 'history') {
2828
3505
  setHistory(bundle);
2829
3506
  }
@@ -2833,20 +3510,29 @@
2833
3510
  }
2834
3511
  }
2835
3512
  }
2836
- sortByDateAndPriority(newItems);
2837
- newItems.reverse();
2838
- setItems(newItems);
2839
- }
3513
+ sortAndSetItems(newItems);
3514
+ }, [sortAndSetItems]);
2840
3515
  /**
2841
3516
  * Adds an array of resources to the timeline.
2842
- * @param resources Array of resources.
3517
+ * @param resource Resource to add.
2843
3518
  */
2844
- function addResources(resources) {
2845
- const newItems = [...itemsRef.current, ...resources];
2846
- sortByDateAndPriority(newItems);
2847
- newItems.reverse();
2848
- setItems(newItems);
2849
- }
3519
+ const addResource = React.useCallback((resource) => sortAndSetItems([...itemsRef.current, resource]), [sortAndSetItems]);
3520
+ /**
3521
+ * Loads the timeline.
3522
+ */
3523
+ const loadTimeline = React.useCallback(() => {
3524
+ let resourceType;
3525
+ let id;
3526
+ if ('resourceType' in props.value) {
3527
+ resourceType = props.value.resourceType;
3528
+ id = props.value.id;
3529
+ }
3530
+ else {
3531
+ [resourceType, id] = props.value.reference?.split('/');
3532
+ }
3533
+ loadTimelineResources(medplum, resourceType, id).then(handleBatchResponse).catch(console.log);
3534
+ }, [medplum, props.value, loadTimelineResources, handleBatchResponse]);
3535
+ React.useEffect(() => loadTimeline(), [loadTimeline]);
2850
3536
  /**
2851
3537
  * Adds a Communication resource to the timeline.
2852
3538
  * @param contentString The comment content.
@@ -2858,9 +3544,7 @@
2858
3544
  }
2859
3545
  medplum
2860
3546
  .createResource(props.createCommunication(resource, sender, contentString))
2861
- .then((result) => {
2862
- addResources([result]);
2863
- })
3547
+ .then((result) => addResource(result))
2864
3548
  .catch(console.log);
2865
3549
  }
2866
3550
  /**
@@ -2874,13 +3558,13 @@
2874
3558
  }
2875
3559
  medplum
2876
3560
  .createResource(props.createMedia(resource, sender, attachment))
2877
- .then((result) => addResources([result]))
3561
+ .then((result) => addResource(result))
2878
3562
  .then(() => notifications.updateNotification({
2879
3563
  id: 'upload-notification',
2880
3564
  color: 'teal',
2881
3565
  title: 'Upload complete',
2882
3566
  message: '',
2883
- icon: React.createElement(icons.IconCheck, { size: 16 }),
3567
+ icon: React.createElement(IconCheck, { size: 16 }),
2884
3568
  autoClose: 2000,
2885
3569
  }))
2886
3570
  .catch((reason) => notifications.updateNotification({
@@ -2888,7 +3572,7 @@
2888
3572
  color: 'red',
2889
3573
  title: 'Upload error',
2890
3574
  message: core.normalizeErrorString(reason),
2891
- icon: React.createElement(icons.IconFileAlert, { size: 16 }),
3575
+ icon: React.createElement(IconFileAlert, { size: 16 }),
2892
3576
  autoClose: 2000,
2893
3577
  }));
2894
3578
  }
@@ -2951,10 +3635,14 @@
2951
3635
  React.createElement(ResourceAvatar, { value: sender }),
2952
3636
  React.createElement(core$1.TextInput, { name: "text", ref: inputRef, placeholder: "Add comment", style: { width: '100%', maxWidth: 300 } }),
2953
3637
  React.createElement(core$1.ActionIcon, { type: "submit", radius: "xl", color: "blue", variant: "filled" },
2954
- React.createElement(icons.IconMessage, { size: 16 })),
3638
+ React.createElement(IconMessage, { size: 16 })),
2955
3639
  React.createElement(AttachmentButton, { onUpload: createMedia, onUploadStart: onUploadStart, onUploadProgress: onUploadProgress }, (props) => (React.createElement(core$1.ActionIcon, { ...props, radius: "xl", color: "blue", variant: "filled" },
2956
- React.createElement(icons.IconCloudUpload, { size: 16 })))))))),
3640
+ React.createElement(IconCloudUpload, { size: 16 })))))))),
2957
3641
  items.map((item) => {
3642
+ if (!item) {
3643
+ // TODO: Handle null history items for deleted versions.
3644
+ return null;
3645
+ }
2958
3646
  const key = `${item.resourceType}/${item.id}/${item.meta?.versionId}`;
2959
3647
  if (item.resourceType === resource.resourceType && item.id === resource.id) {
2960
3648
  return (React.createElement(HistoryTimelineItem, { key: key, history: history, resource: item, onDetails: onVersionDetails }));
@@ -2977,14 +3665,14 @@
2977
3665
  function TimelineItemPopupMenu(props) {
2978
3666
  return (React.createElement(core$1.Menu.Dropdown, null,
2979
3667
  React.createElement(core$1.Menu.Label, null, "Resource"),
2980
- props.onPin && (React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconPin, { size: 14 }), onClick: () => props.onPin(props.resource), "aria-label": `Pin ${core.getReferenceString(props.resource)}` }, "Pin")),
2981
- props.onUnpin && (React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconPinnedOff, { size: 14 }), onClick: () => props.onUnpin(props.resource), "aria-label": `Unpin ${core.getReferenceString(props.resource)}` }, "Unpin")),
2982
- props.onDetails && (React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconListDetails, { size: 14 }), onClick: () => props.onDetails(props.resource), "aria-label": `Details ${core.getReferenceString(props.resource)}` }, "Details")),
2983
- props.onEdit && (React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconEdit, { size: 14 }), onClick: () => props.onEdit(props.resource), "aria-label": `Edit ${core.getReferenceString(props.resource)}` }, "Edit")),
3668
+ props.onPin && (React.createElement(core$1.Menu.Item, { icon: React.createElement(IconPin, { size: 14 }), onClick: () => props.onPin(props.resource), "aria-label": `Pin ${core.getReferenceString(props.resource)}` }, "Pin")),
3669
+ props.onUnpin && (React.createElement(core$1.Menu.Item, { icon: React.createElement(IconPinnedOff, { size: 14 }), onClick: () => props.onUnpin(props.resource), "aria-label": `Unpin ${core.getReferenceString(props.resource)}` }, "Unpin")),
3670
+ props.onDetails && (React.createElement(core$1.Menu.Item, { icon: React.createElement(IconListDetails, { size: 14 }), onClick: () => props.onDetails(props.resource), "aria-label": `Details ${core.getReferenceString(props.resource)}` }, "Details")),
3671
+ props.onEdit && (React.createElement(core$1.Menu.Item, { icon: React.createElement(IconEdit, { size: 14 }), onClick: () => props.onEdit(props.resource), "aria-label": `Edit ${core.getReferenceString(props.resource)}` }, "Edit")),
2984
3672
  props.onDelete && (React.createElement(React.Fragment, null,
2985
3673
  React.createElement(core$1.Menu.Divider, null),
2986
3674
  React.createElement(core$1.Menu.Label, null, "Danger zone"),
2987
- React.createElement(core$1.Menu.Item, { color: "red", icon: React.createElement(icons.IconTrash, { size: 14 }), onClick: () => props.onDelete(props.resource), "aria-label": `Delete ${core.getReferenceString(props.resource)}` }, "Delete")))));
3675
+ React.createElement(core$1.Menu.Item, { color: "red", icon: React.createElement(IconTrash, { size: 14 }), onClick: () => props.onDelete(props.resource), "aria-label": `Delete ${core.getReferenceString(props.resource)}` }, "Delete")))));
2988
3676
  }
2989
3677
  function HistoryTimelineItem(props) {
2990
3678
  const previous = getPrevious(props.history, props.resource);
@@ -2995,7 +3683,7 @@
2995
3683
  else {
2996
3684
  return (React.createElement(TimelineItem, { resource: props.resource, padding: true, popupMenuItems: React.createElement(TimelineItemPopupMenu, { ...props }) },
2997
3685
  React.createElement("h3", null, "Created"),
2998
- React.createElement(ResourceTable, { value: props.resource, ignoreMissingValues: true })));
3686
+ React.createElement(ResourceTable, { value: props.resource, ignoreMissingValues: true, forceUseInput: true })));
2999
3687
  }
3000
3688
  }
3001
3689
  function getPrevious(history, version) {
@@ -3047,20 +3735,17 @@
3047
3735
  }
3048
3736
 
3049
3737
  function DefaultResourceTimeline(props) {
3050
- return (React.createElement(ResourceTimeline, { value: props.resource, loadTimelineResources: async (medplum, resource) => {
3051
- return Promise.all([
3052
- medplum.readHistory(resource.resourceType, resource.id),
3053
- medplum.search('AuditEvent', '_sort=-_lastUpdated&entity=' + core.getReferenceString(resource)),
3054
- ]);
3738
+ return (React.createElement(ResourceTimeline, { value: props.resource, loadTimelineResources: async (medplum, resourceType, id) => {
3739
+ return Promise.allSettled([medplum.readHistory(resourceType, id)]);
3055
3740
  } }));
3056
3741
  }
3057
3742
 
3058
3743
  function EncounterTimeline(props) {
3059
- return (React.createElement(ResourceTimeline, { value: props.encounter, loadTimelineResources: async (medplum, resource) => {
3060
- return Promise.all([
3061
- medplum.readHistory('Encounter', resource.id),
3062
- medplum.search('Communication', 'encounter=' + core.getReferenceString(resource)),
3063
- medplum.search('Media', 'encounter=' + core.getReferenceString(resource)),
3744
+ return (React.createElement(ResourceTimeline, { value: props.encounter, loadTimelineResources: async (medplum, _resourceType, id) => {
3745
+ return Promise.allSettled([
3746
+ medplum.readHistory('Encounter', id),
3747
+ medplum.search('Communication', 'encounter=Encounter/' + id),
3748
+ medplum.search('Media', 'encounter=Encounter/' + id),
3064
3749
  ]);
3065
3750
  }, createCommunication: (resource, sender, text) => ({
3066
3751
  resourceType: 'Communication',
@@ -3968,60 +4653,60 @@
3968
4653
  const { searchParam } = props;
3969
4654
  const code = searchParam.code;
3970
4655
  return (React.createElement(core$1.Menu.Dropdown, null,
3971
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconSortAscending, { size: 14 }), onClick: () => props.onSort(searchParam, false) }, "Sort Oldest to Newest"),
3972
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconSortDescending, { size: 14 }), onClick: () => props.onSort(searchParam, true) }, "Sort Newest to Oldest"),
4656
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconSortAscending, { size: 14 }), onClick: () => props.onSort(searchParam, false) }, "Sort Oldest to Newest"),
4657
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconSortDescending, { size: 14 }), onClick: () => props.onSort(searchParam, true) }, "Sort Newest to Oldest"),
3973
4658
  React.createElement(core$1.Menu.Divider, null),
3974
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconEqual, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Equals..."),
3975
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconEqualNot, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.NOT_EQUALS) }, "Does not equal..."),
4659
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconEqual, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Equals..."),
4660
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconEqualNot, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.NOT_EQUALS) }, "Does not equal..."),
3976
4661
  React.createElement(core$1.Menu.Divider, null),
3977
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconMathLower, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.ENDS_BEFORE) }, "Before..."),
3978
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconMathGreater, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.STARTS_AFTER) }, "After..."),
3979
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconBracketsContain, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Between..."),
4662
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconMathLower, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.ENDS_BEFORE) }, "Before..."),
4663
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconMathGreater, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.STARTS_AFTER) }, "After..."),
4664
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconBracketsContain, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Between..."),
3980
4665
  React.createElement(core$1.Menu.Divider, null),
3981
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconCalendar, { size: 14 }), onClick: () => props.onChange(addTomorrowFilter(props.search, code)) }, "Tomorrow"),
3982
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconCalendar, { size: 14 }), onClick: () => props.onChange(addTodayFilter(props.search, code)) }, "Today"),
3983
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconCalendar, { size: 14 }), onClick: () => props.onChange(addYesterdayFilter(props.search, code)) }, "Yesterday"),
4666
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconCalendar, { size: 14 }), onClick: () => props.onChange(addTomorrowFilter(props.search, code)) }, "Tomorrow"),
4667
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconCalendar, { size: 14 }), onClick: () => props.onChange(addTodayFilter(props.search, code)) }, "Today"),
4668
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconCalendar, { size: 14 }), onClick: () => props.onChange(addYesterdayFilter(props.search, code)) }, "Yesterday"),
3984
4669
  React.createElement(core$1.Menu.Divider, null),
3985
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconCalendar, { size: 14 }), onClick: () => props.onChange(addNextMonthFilter(props.search, code)) }, "Next Month"),
3986
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconCalendar, { size: 14 }), onClick: () => props.onChange(addThisMonthFilter(props.search, code)) }, "This Month"),
3987
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconCalendar, { size: 14 }), onClick: () => props.onChange(addLastMonthFilter(props.search, code)) }, "Last Month"),
4670
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconCalendar, { size: 14 }), onClick: () => props.onChange(addNextMonthFilter(props.search, code)) }, "Next Month"),
4671
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconCalendar, { size: 14 }), onClick: () => props.onChange(addThisMonthFilter(props.search, code)) }, "This Month"),
4672
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconCalendar, { size: 14 }), onClick: () => props.onChange(addLastMonthFilter(props.search, code)) }, "Last Month"),
3988
4673
  React.createElement(core$1.Menu.Divider, null),
3989
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconCalendar, { size: 14 }), onClick: () => props.onChange(addYearToDateFilter(props.search, code)) }, "Year to date"),
4674
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconCalendar, { size: 14 }), onClick: () => props.onChange(addYearToDateFilter(props.search, code)) }, "Year to date"),
3990
4675
  React.createElement(CommonMenuItems, { ...props })));
3991
4676
  }
3992
4677
  function NumericFilterSubMenu(props) {
3993
4678
  const { searchParam } = props;
3994
4679
  return (React.createElement(core$1.Menu.Dropdown, null,
3995
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconSortAscending, { size: 14 }), onClick: () => props.onSort(searchParam, false) }, "Sort Smallest to Largest"),
3996
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconSortDescending, { size: 14 }), onClick: () => props.onSort(searchParam, true) }, "Sort Largest to Smallest"),
4680
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconSortAscending, { size: 14 }), onClick: () => props.onSort(searchParam, false) }, "Sort Smallest to Largest"),
4681
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconSortDescending, { size: 14 }), onClick: () => props.onSort(searchParam, true) }, "Sort Largest to Smallest"),
3997
4682
  React.createElement(core$1.Menu.Divider, null),
3998
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconEqual, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Equals..."),
3999
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconEqualNot, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.NOT_EQUALS) }, "Does not equal..."),
4683
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconEqual, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Equals..."),
4684
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconEqualNot, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.NOT_EQUALS) }, "Does not equal..."),
4000
4685
  React.createElement(core$1.Menu.Divider, null),
4001
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconMathGreater, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.GREATER_THAN) }, "Greater than..."),
4002
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconSettings, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.GREATER_THAN_OR_EQUALS) }, "Greater than or equal to..."),
4003
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconMathLower, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.LESS_THAN) }, "Less than..."),
4004
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconSettings, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.LESS_THAN_OR_EQUALS) }, "Less than or equal to..."),
4686
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconMathGreater, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.GREATER_THAN) }, "Greater than..."),
4687
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconSettings, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.GREATER_THAN_OR_EQUALS) }, "Greater than or equal to..."),
4688
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconMathLower, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.LESS_THAN) }, "Less than..."),
4689
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconSettings, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.LESS_THAN_OR_EQUALS) }, "Less than or equal to..."),
4005
4690
  React.createElement(CommonMenuItems, { ...props })));
4006
4691
  }
4007
4692
  function ReferenceFilterSubMenu(props) {
4008
4693
  const { searchParam } = props;
4009
4694
  return (React.createElement(core$1.Menu.Dropdown, null,
4010
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconEqual, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Equals..."),
4011
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconEqualNot, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.NOT) }, "Does not equal..."),
4695
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconEqual, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Equals..."),
4696
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconEqualNot, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.NOT) }, "Does not equal..."),
4012
4697
  React.createElement(CommonMenuItems, { ...props })));
4013
4698
  }
4014
4699
  function TextFilterSubMenu(props) {
4015
4700
  const { searchParam } = props;
4016
4701
  return (React.createElement(core$1.Menu.Dropdown, null,
4017
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconSortAscending, { size: 14 }), onClick: () => props.onSort(searchParam, false) }, "Sort A to Z"),
4018
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconSortDescending, { size: 14 }), onClick: () => props.onSort(searchParam, true) }, "Sort Z to A"),
4702
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconSortAscending, { size: 14 }), onClick: () => props.onSort(searchParam, false) }, "Sort A to Z"),
4703
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconSortDescending, { size: 14 }), onClick: () => props.onSort(searchParam, true) }, "Sort Z to A"),
4019
4704
  React.createElement(core$1.Menu.Divider, null),
4020
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconEqual, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Equals..."),
4021
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconEqualNot, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.NOT) }, "Does not equal..."),
4705
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconEqual, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Equals..."),
4706
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconEqualNot, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.NOT) }, "Does not equal..."),
4022
4707
  React.createElement(core$1.Menu.Divider, null),
4023
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconBucket, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.CONTAINS) }, "Contains..."),
4024
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconBucketOff, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Does not contain..."),
4708
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconBucket, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.CONTAINS) }, "Contains..."),
4709
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconBucketOff, { size: 14 }), onClick: () => props.onPrompt(searchParam, core.Operator.EQUALS) }, "Does not contain..."),
4025
4710
  React.createElement(CommonMenuItems, { ...props })));
4026
4711
  }
4027
4712
  function CommonMenuItems(props) {
@@ -4029,10 +4714,10 @@
4029
4714
  const code = searchParam.code;
4030
4715
  return (React.createElement(React.Fragment, null,
4031
4716
  React.createElement(core$1.Menu.Divider, null),
4032
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconBleach, { size: 14 }), onClick: () => props.onChange(addMissingFilter(props.search, code)) }, "Missing"),
4033
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconBleachOff, { size: 14 }), onClick: () => props.onChange(addMissingFilter(props.search, code, false)) }, "Not missing"),
4717
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconBleach, { size: 14 }), onClick: () => props.onChange(addMissingFilter(props.search, code)) }, "Missing"),
4718
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconBleachOff, { size: 14 }), onClick: () => props.onChange(addMissingFilter(props.search, code, false)) }, "Not missing"),
4034
4719
  React.createElement(core$1.Menu.Divider, null),
4035
- React.createElement(core$1.Menu.Item, { icon: React.createElement(icons.IconX, { size: 14 }), onClick: () => props.onClear(searchParam) }, "Clear filters")));
4720
+ React.createElement(core$1.Menu.Item, { icon: React.createElement(IconX, { size: 14 }), onClick: () => props.onClear(searchParam) }, "Clear filters")));
4036
4721
  }
4037
4722
 
4038
4723
  /**
@@ -4307,12 +4992,12 @@
4307
4992
  return (React.createElement("div", { className: classes.root, "data-testid": "search-control" },
4308
4993
  !props.hideToolbar && (React.createElement(core$1.Group, { position: "apart", mb: "xl" },
4309
4994
  React.createElement(core$1.Group, { spacing: 2 },
4310
- React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(icons.IconFilter, { size: iconSize }), onClick: () => setState({ ...stateRef.current, fieldEditorVisible: true }) }, "Fields"),
4311
- React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(icons.IconColumns, { size: iconSize }), onClick: () => setState({ ...stateRef.current, filterEditorVisible: true }) }, "Filters"),
4312
- props.onNew && (React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(icons.IconFilePlus, { size: iconSize }), onClick: props.onNew }, "New...")),
4313
- !isMobile && props.onExport && (React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(icons.IconTableExport, { size: iconSize }), onClick: props.onExport }, "Export...")),
4314
- !isMobile && props.onDelete && (React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(icons.IconTrash, { size: iconSize }), onClick: () => props.onDelete(Object.keys(state.selected)) }, "Delete...")),
4315
- !isMobile && props.onBulk && (React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(icons.IconBoxMultiple, { size: iconSize }), onClick: () => props.onBulk(Object.keys(state.selected)) }, "Bulk..."))),
4995
+ React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(IconFilter, { size: iconSize }), onClick: () => setState({ ...stateRef.current, fieldEditorVisible: true }) }, "Fields"),
4996
+ React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(IconColumns, { size: iconSize }), onClick: () => setState({ ...stateRef.current, filterEditorVisible: true }) }, "Filters"),
4997
+ props.onNew && (React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(IconFilePlus, { size: iconSize }), onClick: props.onNew }, "New...")),
4998
+ !isMobile && props.onExport && (React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(IconTableExport, { size: iconSize }), onClick: props.onExport }, "Export...")),
4999
+ !isMobile && props.onDelete && (React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(IconTrash, { size: iconSize }), onClick: () => props.onDelete(Object.keys(state.selected)) }, "Delete...")),
5000
+ !isMobile && props.onBulk && (React.createElement(core$1.Button, { compact: true, variant: buttonVariant, color: buttonColor, leftIcon: React.createElement(IconBoxMultiple, { size: iconSize }), onClick: () => props.onBulk(Object.keys(state.selected)) }, "Bulk..."))),
4316
5001
  lastResult && (React.createElement(core$1.Text, { size: "xs", color: "dimmed" },
4317
5002
  getStart$1(search, lastResult.total),
4318
5003
  "-",
@@ -4332,7 +5017,7 @@
4332
5017
  React.createElement(core$1.Group, { position: "apart", noWrap: true },
4333
5018
  React.createElement(core$1.Text, { weight: 500, size: "sm" }, buildFieldNameString(field.name)),
4334
5019
  React.createElement(core$1.Center, { className: classes.icon },
4335
- React.createElement(icons.IconAdjustmentsHorizontal, { size: 14, stroke: 1.5 }))))),
5020
+ React.createElement(IconAdjustmentsHorizontal, { size: 14, stroke: 1.5 }))))),
4336
5021
  React.createElement(SearchPopupMenu, { search: props.search, searchParams: field.searchParams, onPrompt: (searchParam, filter) => {
4337
5022
  setState({
4338
5023
  ...stateRef.current,
@@ -4536,15 +5221,15 @@
4536
5221
  const MemoizedFhirPathTable = React.memo(FhirPathTable);
4537
5222
 
4538
5223
  function PatientTimeline(props) {
4539
- const loadTimelineResources = React.useCallback((medplum, resource) => {
4540
- return Promise.all([
4541
- medplum.readHistory('Patient', resource.id),
4542
- medplum.search('Communication', 'subject=' + core.getReferenceString(resource)),
4543
- medplum.search('Device', 'patient=' + core.getReferenceString(resource)),
4544
- medplum.search('DeviceRequest', 'patient=' + core.getReferenceString(resource)),
4545
- medplum.search('DiagnosticReport', 'subject=' + core.getReferenceString(resource)),
4546
- medplum.search('Media', 'subject=' + core.getReferenceString(resource)),
4547
- medplum.search('ServiceRequest', 'subject=' + core.getReferenceString(resource)),
5224
+ const loadTimelineResources = React.useCallback((medplum, _resourceType, id) => {
5225
+ return Promise.allSettled([
5226
+ medplum.readHistory('Patient', id),
5227
+ medplum.search('Communication', 'subject=Patient/' + id),
5228
+ medplum.search('Device', 'patient=Patient/' + id),
5229
+ medplum.search('DeviceRequest', 'patient=Patient/' + id),
5230
+ medplum.search('DiagnosticReport', 'subject=Patient/' + id),
5231
+ medplum.search('Media', 'subject=Patient/' + id),
5232
+ medplum.search('ServiceRequest', 'subject=Patient/' + id),
4548
5233
  ]);
4549
5234
  }, []);
4550
5235
  return (React.createElement(ResourceTimeline, { value: props.patient, loadTimelineResources: loadTimelineResources, createCommunication: (resource, sender, text) => ({
@@ -4849,7 +5534,6 @@
4849
5534
  function setItems(newResponseItems) {
4850
5535
  const newResponse = {
4851
5536
  resourceType: 'QuestionnaireResponse',
4852
- status: 'completed',
4853
5537
  item: newResponseItems,
4854
5538
  };
4855
5539
  setResponse(newResponse);
@@ -4866,6 +5550,7 @@
4866
5550
  subject: props.subject,
4867
5551
  source: core.createReference(source),
4868
5552
  authored: new Date().toISOString(),
5553
+ status: 'completed',
4869
5554
  });
4870
5555
  }
4871
5556
  } },
@@ -4957,7 +5642,7 @@
4957
5642
  case exports.QuestionnaireItemType.reference:
4958
5643
  return (React.createElement(ReferenceInput, { name: name, defaultValue: initial?.valueReference, onChange: (newValue) => onChangeAnswer({ valueReference: newValue }) }));
4959
5644
  case exports.QuestionnaireItemType.quantity:
4960
- return (React.createElement(QuantityInput, { name: name, defaultValue: initial?.valueQuantity, onChange: (newValue) => onChangeAnswer({ valueQuantity: newValue }) }));
5645
+ return (React.createElement(QuantityInput, { name: name, defaultValue: initial?.valueQuantity, onChange: (newValue) => onChangeAnswer({ valueQuantity: newValue }), disableWheel: true }));
4961
5646
  case exports.QuestionnaireItemType.choice:
4962
5647
  case exports.QuestionnaireItemType.openChoice:
4963
5648
  if (isDropDownChoice(item)) {
@@ -5396,7 +6081,7 @@
5396
6081
  addGroup({ id: `group-id-${groupId}`, filters: {}, intervals: [] });
5397
6082
  setGroupId((id) => id + 1);
5398
6083
  } },
5399
- React.createElement(icons.IconCirclePlus, null)),
6084
+ React.createElement(IconCirclePlus, null)),
5400
6085
  React.createElement(core$1.Group, { position: "right" },
5401
6086
  React.createElement(core$1.Button, { type: "submit" }, "Save"))));
5402
6087
  /**
@@ -5469,7 +6154,7 @@
5469
6154
  killEvent(e);
5470
6155
  props.onRemoveGroup(intervalGroup);
5471
6156
  } },
5472
- React.createElement(icons.IconCircleMinus, null))),
6157
+ React.createElement(IconCircleMinus, null))),
5473
6158
  React.createElement(ReferenceRangeGroupFilters, { intervalGroup: intervalGroup, onChange: props.onChange }),
5474
6159
  React.createElement(core$1.Divider, null),
5475
6160
  intervalGroup.intervals.map((interval) => (React.createElement(core$1.Stack, { key: `interval-${interval.id}`, spacing: 'xs' },
@@ -5482,7 +6167,7 @@
5482
6167
  killEvent(e);
5483
6168
  props.onRemove(intervalGroup.id, interval);
5484
6169
  } },
5485
- React.createElement(icons.IconCircleMinus, null))),
6170
+ React.createElement(IconCircleMinus, null))),
5486
6171
  React.createElement(RangeInput, { onChange: (range) => {
5487
6172
  props.onChange(intervalGroup.id, { ...interval, range });
5488
6173
  }, key: `range-${interval.id}`, name: `range-${interval.id}`, defaultValue: interval.range })))),
@@ -5495,7 +6180,7 @@
5495
6180
  },
5496
6181
  });
5497
6182
  } },
5498
- React.createElement(icons.IconCirclePlus, null)))));
6183
+ React.createElement(IconCirclePlus, null)))));
5499
6184
  }
5500
6185
  /**
5501
6186
  * Render the "filters" section of the IntervalGroup. Also populates some initial
@@ -5646,7 +6331,7 @@
5646
6331
  const taskInput = task?.input?.[0]?.valueReference;
5647
6332
  const taskOutput = task?.output?.[0]?.valueReference;
5648
6333
  return (React.createElement(React.Fragment, { key: `action-${index}` },
5649
- React.createElement(core$1.Grid.Col, { span: 1, p: "md" }, task?.status === 'completed' ? React.createElement(icons.IconCheckbox, null) : React.createElement(icons.IconSquare, { color: "gray" })),
6334
+ React.createElement(core$1.Grid.Col, { span: 1, p: "md" }, task?.status === 'completed' ? React.createElement(IconCheckbox, null) : React.createElement(IconSquare, { color: "gray" })),
5650
6335
  React.createElement(core$1.Grid.Col, { span: 9, p: "xs" },
5651
6336
  React.createElement(core$1.Text, { weight: 500 }, action.title),
5652
6337
  action.description && React.createElement("div", null, action.description),
@@ -6134,12 +6819,12 @@
6134
6819
  }
6135
6820
 
6136
6821
  function ServiceRequestTimeline(props) {
6137
- return (React.createElement(ResourceTimeline, { value: props.serviceRequest, loadTimelineResources: async (medplum, resource) => {
6138
- return Promise.all([
6139
- medplum.readHistory('ServiceRequest', resource.id),
6140
- medplum.search('Communication', 'based-on=' + core.getReferenceString(resource)),
6141
- medplum.search('Media', '_count=100&based-on=' + core.getReferenceString(resource)),
6142
- medplum.search('DiagnosticReport', 'based-on=' + core.getReferenceString(resource)),
6822
+ return (React.createElement(ResourceTimeline, { value: props.serviceRequest, loadTimelineResources: async (medplum, _resourceType, id) => {
6823
+ return Promise.allSettled([
6824
+ medplum.readHistory('ServiceRequest', id),
6825
+ medplum.search('Communication', 'based-on=ServiceRequest/' + id),
6826
+ medplum.search('Media', '_count=100&based-on=ServiceRequest/' + id),
6827
+ medplum.search('DiagnosticReport', 'based-on=ServiceRequest/' + id),
6143
6828
  ]);
6144
6829
  }, createCommunication: (resource, sender, text) => ({
6145
6830
  resourceType: 'Communication',
@@ -6208,6 +6893,7 @@
6208
6893
  exports.MoneyDisplay = MoneyDisplay;
6209
6894
  exports.MoneyInput = MoneyInput;
6210
6895
  exports.ObservationTable = ObservationTable;
6896
+ exports.OperationOutcomeAlert = OperationOutcomeAlert;
6211
6897
  exports.Panel = Panel;
6212
6898
  exports.PatientTimeline = PatientTimeline;
6213
6899
  exports.PlanDefinitionBuilder = PlanDefinitionBuilder;
@@ -6294,6 +6980,7 @@
6294
6980
  exports.toggleSort = toggleSort;
6295
6981
  exports.useMedplum = useMedplum;
6296
6982
  exports.useMedplumContext = useMedplumContext;
6983
+ exports.useMedplumNavigate = useMedplumNavigate;
6297
6984
  exports.useMedplumProfile = useMedplumProfile;
6298
6985
  exports.useResource = useResource;
6299
6986