@medplum/react 0.9.25 → 0.9.26

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 (407) hide show
  1. package/dist/cjs/index.js.map +1 -1
  2. package/dist/cjs/index.min.js.map +1 -1
  3. package/dist/{types → esm}/AddressDisplay.d.ts +0 -0
  4. package/dist/esm/AddressDisplay.js +13 -0
  5. package/dist/esm/AddressDisplay.js.map +1 -0
  6. package/dist/{types → esm}/AddressInput.d.ts +0 -0
  7. package/dist/esm/AddressInput.js +69 -0
  8. package/dist/esm/AddressInput.js.map +1 -0
  9. package/dist/{types → esm}/AnnotationInput.d.ts +0 -0
  10. package/dist/esm/AnnotationInput.js +28 -0
  11. package/dist/esm/AnnotationInput.js.map +1 -0
  12. package/dist/{types → esm}/AttachmentArrayDisplay.d.ts +0 -0
  13. package/dist/esm/AttachmentArrayDisplay.js +11 -0
  14. package/dist/esm/AttachmentArrayDisplay.js.map +1 -0
  15. package/dist/{types → esm}/AttachmentArrayInput.d.ts +0 -0
  16. package/dist/esm/AttachmentArrayInput.js +42 -0
  17. package/dist/esm/AttachmentArrayInput.js.map +1 -0
  18. package/dist/{types → esm}/AttachmentDisplay.d.ts +0 -0
  19. package/dist/esm/AttachmentDisplay.js +20 -0
  20. package/dist/esm/AttachmentDisplay.js.map +1 -0
  21. package/dist/{types → esm}/AttachmentInput.d.ts +0 -0
  22. package/dist/esm/AttachmentInput.js +27 -0
  23. package/dist/esm/AttachmentInput.js.map +1 -0
  24. package/dist/{types → esm}/Autocomplete.d.ts +0 -0
  25. package/dist/esm/Autocomplete.js +284 -0
  26. package/dist/esm/Autocomplete.js.map +1 -0
  27. package/dist/{types → esm}/Avatar.d.ts +0 -0
  28. package/dist/esm/Avatar.js +24 -0
  29. package/dist/esm/Avatar.js.map +1 -0
  30. package/dist/{types → esm}/BackboneElementDisplay.d.ts +0 -0
  31. package/dist/esm/BackboneElementDisplay.js +43 -0
  32. package/dist/esm/BackboneElementDisplay.js.map +1 -0
  33. package/dist/{types → esm}/BackboneElementInput.d.ts +0 -0
  34. package/dist/esm/BackboneElementInput.js +51 -0
  35. package/dist/esm/BackboneElementInput.js.map +1 -0
  36. package/dist/{types → esm}/Button.d.ts +0 -0
  37. package/dist/esm/Button.js +13 -0
  38. package/dist/esm/Button.js.map +1 -0
  39. package/dist/{types → esm}/CalendarInput.d.ts +0 -0
  40. package/dist/esm/CalendarInput.js +96 -0
  41. package/dist/esm/CalendarInput.js.map +1 -0
  42. package/dist/{types → esm}/Checkbox.d.ts +0 -0
  43. package/dist/esm/Checkbox.js +13 -0
  44. package/dist/esm/Checkbox.js.map +1 -0
  45. package/dist/{types → esm}/CheckboxFormSection.d.ts +0 -0
  46. package/dist/esm/CheckboxFormSection.js +12 -0
  47. package/dist/esm/CheckboxFormSection.js.map +1 -0
  48. package/dist/{types → esm}/CodeInput.d.ts +0 -0
  49. package/dist/esm/CodeInput.js +28 -0
  50. package/dist/esm/CodeInput.js.map +1 -0
  51. package/dist/{types → esm}/CodeableConceptDisplay.d.ts +0 -0
  52. package/dist/esm/CodeableConceptDisplay.js +19 -0
  53. package/dist/esm/CodeableConceptDisplay.js.map +1 -0
  54. package/dist/{types → esm}/CodeableConceptInput.d.ts +0 -0
  55. package/dist/esm/CodeableConceptInput.js +52 -0
  56. package/dist/esm/CodeableConceptInput.js.map +1 -0
  57. package/dist/{types → esm}/CodingDisplay.d.ts +0 -0
  58. package/dist/esm/CodingDisplay.js +9 -0
  59. package/dist/esm/CodingDisplay.js.map +1 -0
  60. package/dist/{types → esm}/CodingInput.d.ts +0 -0
  61. package/dist/esm/CodingInput.js +30 -0
  62. package/dist/esm/CodingInput.js.map +1 -0
  63. package/dist/{types → esm}/ContactDetailDisplay.d.ts +0 -0
  64. package/dist/esm/ContactDetailDisplay.js +17 -0
  65. package/dist/esm/ContactDetailDisplay.js.map +1 -0
  66. package/dist/{types → esm}/ContactDetailInput.d.ts +0 -0
  67. package/dist/esm/ContactDetailInput.js +37 -0
  68. package/dist/esm/ContactDetailInput.js.map +1 -0
  69. package/dist/{types → esm}/ContactPointDisplay.d.ts +0 -0
  70. package/dist/esm/ContactPointDisplay.js +29 -0
  71. package/dist/esm/ContactPointDisplay.js.map +1 -0
  72. package/dist/{types → esm}/ContactPointInput.d.ts +0 -0
  73. package/dist/esm/ContactPointInput.js +60 -0
  74. package/dist/esm/ContactPointInput.js.map +1 -0
  75. package/dist/{types → esm}/DateTimeDisplay.d.ts +0 -0
  76. package/dist/esm/DateTimeDisplay.js +11 -0
  77. package/dist/esm/DateTimeDisplay.js.map +1 -0
  78. package/dist/{types → esm}/DateTimeInput.d.ts +0 -0
  79. package/dist/esm/DateTimeInput.js +62 -0
  80. package/dist/esm/DateTimeInput.js.map +1 -0
  81. package/dist/{types → esm}/DefaultResourceTimeline.d.ts +0 -0
  82. package/dist/esm/DefaultResourceTimeline.js +27 -0
  83. package/dist/esm/DefaultResourceTimeline.js.map +1 -0
  84. package/dist/{types → esm}/DescriptionList.d.ts +0 -0
  85. package/dist/esm/DescriptionList.js +13 -0
  86. package/dist/esm/DescriptionList.js.map +1 -0
  87. package/dist/{types → esm}/DiagnosticReportDisplay.d.ts +0 -0
  88. package/dist/esm/DiagnosticReportDisplay.js +103 -0
  89. package/dist/esm/DiagnosticReportDisplay.js.map +1 -0
  90. package/dist/{types → esm}/Dialog.d.ts +0 -0
  91. package/dist/esm/Dialog.js +43 -0
  92. package/dist/esm/Dialog.js.map +1 -0
  93. package/dist/{types → esm}/Document.d.ts +0 -0
  94. package/dist/esm/Document.js +9 -0
  95. package/dist/esm/Document.js.map +1 -0
  96. package/dist/{types → esm}/EncounterTimeline.d.ts +0 -0
  97. package/dist/esm/EncounterTimeline.js +47 -0
  98. package/dist/esm/EncounterTimeline.js.map +1 -0
  99. package/dist/{types → esm}/ErrorBoundary.d.ts +0 -0
  100. package/dist/esm/ErrorBoundary.js +27 -0
  101. package/dist/esm/ErrorBoundary.js.map +1 -0
  102. package/dist/{types → esm}/ExtensionInput.d.ts +0 -0
  103. package/dist/esm/ExtensionInput.js +14 -0
  104. package/dist/esm/ExtensionInput.js.map +1 -0
  105. package/dist/{types → esm}/FhirPathDisplay.d.ts +0 -0
  106. package/dist/esm/FhirPathDisplay.js +23 -0
  107. package/dist/esm/FhirPathDisplay.js.map +1 -0
  108. package/dist/{types → esm}/FhirPathTable.d.ts +0 -0
  109. package/dist/esm/FhirPathTable.js +117 -0
  110. package/dist/esm/FhirPathTable.js.map +1 -0
  111. package/dist/{types → esm}/FooterLinks.d.ts +0 -0
  112. package/dist/esm/FooterLinks.js +8 -0
  113. package/dist/esm/FooterLinks.js.map +1 -0
  114. package/dist/{types → esm}/Form.d.ts +0 -0
  115. package/dist/esm/Form.js +15 -0
  116. package/dist/esm/Form.js.map +1 -0
  117. package/dist/{types → esm}/FormSection.d.ts +0 -0
  118. package/dist/esm/FormSection.js +18 -0
  119. package/dist/esm/FormSection.js.map +1 -0
  120. package/dist/{types → esm}/FormUtils.d.ts +0 -0
  121. package/dist/esm/FormUtils.js +49 -0
  122. package/dist/esm/FormUtils.js.map +1 -0
  123. package/dist/{types → esm}/GoogleButton.d.ts +0 -0
  124. package/dist/esm/GoogleButton.js +48 -0
  125. package/dist/esm/GoogleButton.js.map +1 -0
  126. package/dist/{types → esm}/Header.d.ts +0 -0
  127. package/dist/esm/Header.js +95 -0
  128. package/dist/esm/Header.js.map +1 -0
  129. package/dist/{types → esm}/HeaderSearchInput.d.ts +0 -0
  130. package/dist/esm/HeaderSearchInput.js +181 -0
  131. package/dist/esm/HeaderSearchInput.js.map +1 -0
  132. package/dist/{types → esm}/HumanNameDisplay.d.ts +0 -0
  133. package/dist/esm/HumanNameDisplay.js +13 -0
  134. package/dist/esm/HumanNameDisplay.js.map +1 -0
  135. package/dist/{types → esm}/HumanNameInput.d.ts +0 -0
  136. package/dist/esm/HumanNameInput.js +49 -0
  137. package/dist/esm/HumanNameInput.js.map +1 -0
  138. package/dist/{types → esm}/IdentifierDisplay.d.ts +0 -0
  139. package/dist/esm/IdentifierDisplay.js +12 -0
  140. package/dist/esm/IdentifierDisplay.js.map +1 -0
  141. package/dist/{types → esm}/IdentifierInput.d.ts +0 -0
  142. package/dist/esm/IdentifierInput.js +19 -0
  143. package/dist/esm/IdentifierInput.js.map +1 -0
  144. package/dist/{types → esm}/Input.d.ts +0 -0
  145. package/dist/esm/Input.js +26 -0
  146. package/dist/esm/Input.js.map +1 -0
  147. package/dist/{types → esm}/InputRow.d.ts +0 -0
  148. package/dist/esm/InputRow.js +8 -0
  149. package/dist/esm/InputRow.js.map +1 -0
  150. package/dist/{types → esm}/Loading.d.ts +0 -0
  151. package/dist/esm/Loading.js +11 -0
  152. package/dist/esm/Loading.js.map +1 -0
  153. package/dist/{types → esm}/Logo.d.ts +0 -0
  154. package/dist/esm/Logo.js +14 -0
  155. package/dist/esm/Logo.js.map +1 -0
  156. package/dist/{types → esm}/MedplumLink.d.ts +0 -0
  157. package/dist/esm/MedplumLink.js +34 -0
  158. package/dist/esm/MedplumLink.js.map +1 -0
  159. package/dist/{types → esm}/MedplumProvider.d.ts +0 -0
  160. package/dist/esm/MedplumProvider.js +50 -0
  161. package/dist/esm/MedplumProvider.js.map +1 -0
  162. package/dist/{types → esm}/MenuItem.d.ts +0 -0
  163. package/dist/esm/MenuItem.js +8 -0
  164. package/dist/esm/MenuItem.js.map +1 -0
  165. package/dist/{types → esm}/MenuSeparator.d.ts +0 -0
  166. package/dist/esm/MenuSeparator.js +8 -0
  167. package/dist/esm/MenuSeparator.js.map +1 -0
  168. package/dist/{types → esm}/PatientTimeline.d.ts +0 -0
  169. package/dist/esm/PatientTimeline.js +40 -0
  170. package/dist/esm/PatientTimeline.js.map +1 -0
  171. package/dist/{types → esm}/PeriodDisplay.d.ts +0 -0
  172. package/dist/esm/PeriodDisplay.js +16 -0
  173. package/dist/esm/PeriodDisplay.js.map +1 -0
  174. package/dist/{types → esm}/PeriodInput.d.ts +0 -0
  175. package/dist/esm/PeriodInput.js +19 -0
  176. package/dist/esm/PeriodInput.js.map +1 -0
  177. package/dist/{types → esm}/PlanDefinitionBuilder.d.ts +0 -0
  178. package/dist/esm/PlanDefinitionBuilder.js +155 -0
  179. package/dist/esm/PlanDefinitionBuilder.js.map +1 -0
  180. package/dist/{types → esm}/Popup.d.ts +0 -0
  181. package/dist/esm/Popup.js +64 -0
  182. package/dist/esm/Popup.js.map +1 -0
  183. package/dist/{types → esm}/QuantityDisplay.d.ts +0 -0
  184. package/dist/esm/QuantityDisplay.js +28 -0
  185. package/dist/esm/QuantityDisplay.js.map +1 -0
  186. package/dist/{types → esm}/QuantityInput.d.ts +0 -0
  187. package/dist/esm/QuantityInput.js +33 -0
  188. package/dist/esm/QuantityInput.js.map +1 -0
  189. package/dist/{types → esm}/QuestionnaireBuilder.d.ts +0 -0
  190. package/dist/esm/QuestionnaireBuilder.js +217 -0
  191. package/dist/esm/QuestionnaireBuilder.js.map +1 -0
  192. package/dist/{types → esm}/QuestionnaireForm.d.ts +0 -0
  193. package/dist/esm/QuestionnaireForm.js +215 -0
  194. package/dist/esm/QuestionnaireForm.js.map +1 -0
  195. package/dist/{types → esm}/QuestionnaireUtils.d.ts +0 -0
  196. package/dist/esm/QuestionnaireUtils.js +103 -0
  197. package/dist/esm/QuestionnaireUtils.js.map +1 -0
  198. package/dist/{types → esm}/RangeDisplay.d.ts +0 -0
  199. package/dist/esm/RangeDisplay.js +21 -0
  200. package/dist/esm/RangeDisplay.js.map +1 -0
  201. package/dist/{types → esm}/RangeInput.d.ts +0 -0
  202. package/dist/esm/RangeInput.js +25 -0
  203. package/dist/esm/RangeInput.js.map +1 -0
  204. package/dist/{types → esm}/RatioDisplay.d.ts +0 -0
  205. package/dist/esm/RatioDisplay.js +16 -0
  206. package/dist/esm/RatioDisplay.js.map +1 -0
  207. package/dist/{types → esm}/RatioInput.d.ts +0 -0
  208. package/dist/esm/RatioInput.js +25 -0
  209. package/dist/esm/RatioInput.js.map +1 -0
  210. package/dist/{types → esm}/ReferenceDisplay.d.ts +0 -0
  211. package/dist/esm/ReferenceDisplay.js +21 -0
  212. package/dist/esm/ReferenceDisplay.js.map +1 -0
  213. package/dist/{types → esm}/ReferenceInput.d.ts +0 -0
  214. package/dist/esm/ReferenceInput.js +42 -0
  215. package/dist/esm/ReferenceInput.js.map +1 -0
  216. package/dist/{types → esm}/RegisterForm.d.ts +0 -0
  217. package/dist/esm/RegisterForm.js +110 -0
  218. package/dist/esm/RegisterForm.js.map +1 -0
  219. package/dist/{types → esm}/RequestGroupDisplay.d.ts +0 -0
  220. package/dist/esm/RequestGroupDisplay.js +73 -0
  221. package/dist/esm/RequestGroupDisplay.js.map +1 -0
  222. package/dist/{types → esm}/ResourceArrayDisplay.d.ts +0 -0
  223. package/dist/esm/ResourceArrayDisplay.js +14 -0
  224. package/dist/esm/ResourceArrayDisplay.js.map +1 -0
  225. package/dist/{types → esm}/ResourceArrayInput.d.ts +0 -0
  226. package/dist/esm/ResourceArrayInput.js +48 -0
  227. package/dist/esm/ResourceArrayInput.js.map +1 -0
  228. package/dist/{types → esm}/ResourceBadge.d.ts +0 -0
  229. package/dist/esm/ResourceBadge.js +13 -0
  230. package/dist/esm/ResourceBadge.js.map +1 -0
  231. package/dist/{types → esm}/ResourceBlame.d.ts +0 -0
  232. package/dist/esm/ResourceBlame.js +65 -0
  233. package/dist/esm/ResourceBlame.js.map +1 -0
  234. package/dist/{types → esm}/ResourceDiff.d.ts +0 -0
  235. package/dist/esm/ResourceDiff.js +28 -0
  236. package/dist/esm/ResourceDiff.js.map +1 -0
  237. package/dist/{types → esm}/ResourceDiffTable.d.ts +0 -0
  238. package/dist/esm/ResourceDiffTable.js +58 -0
  239. package/dist/esm/ResourceDiffTable.js.map +1 -0
  240. package/dist/{types → esm}/ResourceForm.d.ts +0 -0
  241. package/dist/esm/ResourceForm.js +55 -0
  242. package/dist/esm/ResourceForm.js.map +1 -0
  243. package/dist/{types → esm}/ResourceHistoryTable.d.ts +0 -0
  244. package/dist/esm/ResourceHistoryTable.js +46 -0
  245. package/dist/esm/ResourceHistoryTable.js.map +1 -0
  246. package/dist/{types → esm}/ResourceInput.d.ts +0 -0
  247. package/dist/esm/ResourceInput.js +40 -0
  248. package/dist/esm/ResourceInput.js.map +1 -0
  249. package/dist/{types → esm}/ResourceName.d.ts +0 -0
  250. package/dist/esm/ResourceName.js +16 -0
  251. package/dist/esm/ResourceName.js.map +1 -0
  252. package/dist/{types → esm}/ResourcePropertyDisplay.d.ts +0 -0
  253. package/dist/esm/ResourcePropertyDisplay.js +107 -0
  254. package/dist/esm/ResourcePropertyDisplay.js.map +1 -0
  255. package/dist/{types → esm}/ResourcePropertyInput.d.ts +0 -0
  256. package/dist/esm/ResourcePropertyInput.js +151 -0
  257. package/dist/esm/ResourcePropertyInput.js.map +1 -0
  258. package/dist/{types → esm}/ResourceTable.d.ts +0 -0
  259. package/dist/esm/ResourceTable.js +22 -0
  260. package/dist/esm/ResourceTable.js.map +1 -0
  261. package/dist/{types → esm}/ResourceTimeline.d.ts +0 -0
  262. package/dist/esm/ResourceTimeline.js +221 -0
  263. package/dist/esm/ResourceTimeline.js.map +1 -0
  264. package/dist/{types → esm}/Scheduler.d.ts +0 -0
  265. package/dist/esm/Scheduler.js +82 -0
  266. package/dist/esm/Scheduler.js.map +1 -0
  267. package/dist/{types → esm}/Scrollable.d.ts +0 -0
  268. package/dist/esm/Scrollable.js +12 -0
  269. package/dist/esm/Scrollable.js.map +1 -0
  270. package/dist/{types → esm}/SearchControl.d.ts +0 -0
  271. package/dist/esm/SearchControl.js +268 -0
  272. package/dist/esm/SearchControl.js.map +1 -0
  273. package/dist/{types → esm}/SearchControlField.d.ts +0 -0
  274. package/dist/esm/SearchControlField.js +98 -0
  275. package/dist/esm/SearchControlField.js.map +1 -0
  276. package/dist/{types → esm}/SearchFieldEditor.d.ts +0 -0
  277. package/dist/esm/SearchFieldEditor.js +192 -0
  278. package/dist/esm/SearchFieldEditor.js.map +1 -0
  279. package/dist/{types → esm}/SearchFilterEditor.d.ts +0 -0
  280. package/dist/esm/SearchFilterEditor.js +103 -0
  281. package/dist/esm/SearchFilterEditor.js.map +1 -0
  282. package/dist/{types → esm}/SearchFilterValueDialog.d.ts +0 -0
  283. package/dist/esm/SearchFilterValueDialog.js +22 -0
  284. package/dist/esm/SearchFilterValueDialog.js.map +1 -0
  285. package/dist/{types → esm}/SearchFilterValueDisplay.d.ts +0 -0
  286. package/dist/esm/SearchFilterValueDisplay.js +22 -0
  287. package/dist/esm/SearchFilterValueDisplay.js.map +1 -0
  288. package/dist/{types → esm}/SearchFilterValueInput.d.ts +0 -0
  289. package/dist/esm/SearchFilterValueInput.js +59 -0
  290. package/dist/esm/SearchFilterValueInput.js.map +1 -0
  291. package/dist/{types → esm}/SearchPopupMenu.d.ts +0 -0
  292. package/dist/esm/SearchPopupMenu.js +135 -0
  293. package/dist/esm/SearchPopupMenu.js.map +1 -0
  294. package/dist/{types → esm}/SearchUtils.d.ts +0 -0
  295. package/dist/esm/SearchUtils.js +488 -0
  296. package/dist/esm/SearchUtils.js.map +1 -0
  297. package/dist/{types → esm}/Select.d.ts +0 -0
  298. package/dist/esm/Select.js +16 -0
  299. package/dist/esm/Select.js.map +1 -0
  300. package/dist/{types → esm}/ServiceRequestTimeline.d.ts +0 -0
  301. package/dist/esm/ServiceRequestTimeline.js +53 -0
  302. package/dist/esm/ServiceRequestTimeline.js.map +1 -0
  303. package/dist/{types → esm}/SignInForm.d.ts +0 -0
  304. package/dist/esm/SignInForm.js +130 -0
  305. package/dist/esm/SignInForm.js.map +1 -0
  306. package/dist/{types → esm}/StatusBadge.d.ts +0 -0
  307. package/dist/esm/StatusBadge.js +8 -0
  308. package/dist/esm/StatusBadge.js.map +1 -0
  309. package/dist/{types → esm}/SubMenu.d.ts +0 -0
  310. package/dist/esm/SubMenu.js +38 -0
  311. package/dist/esm/SubMenu.js.map +1 -0
  312. package/dist/{types → esm}/Tab.d.ts +0 -0
  313. package/dist/esm/Tab.js +19 -0
  314. package/dist/esm/Tab.js.map +1 -0
  315. package/dist/{types → esm}/TabList.d.ts +0 -0
  316. package/dist/esm/TabList.js +23 -0
  317. package/dist/esm/TabList.js.map +1 -0
  318. package/dist/{types → esm}/TabPanel.d.ts +0 -0
  319. package/dist/esm/TabPanel.js +8 -0
  320. package/dist/esm/TabPanel.js.map +1 -0
  321. package/dist/{types → esm}/TabSwitch.d.ts +0 -0
  322. package/dist/esm/TabSwitch.js +16 -0
  323. package/dist/esm/TabSwitch.js.map +1 -0
  324. package/dist/{types → esm}/TextArea.d.ts +0 -0
  325. package/dist/esm/TextArea.js +16 -0
  326. package/dist/esm/TextArea.js.map +1 -0
  327. package/dist/{types → esm}/Timeline.d.ts +0 -0
  328. package/dist/esm/Timeline.js +50 -0
  329. package/dist/esm/Timeline.js.map +1 -0
  330. package/dist/{types → esm}/TitleBar.d.ts +0 -0
  331. package/dist/esm/TitleBar.js +8 -0
  332. package/dist/esm/TitleBar.js.map +1 -0
  333. package/dist/{types → esm}/UploadButton.d.ts +0 -0
  334. package/dist/esm/UploadButton.js +55 -0
  335. package/dist/esm/UploadButton.js.map +1 -0
  336. package/dist/{types → esm}/constants.d.ts +0 -0
  337. package/dist/esm/constants.js +12 -0
  338. package/dist/esm/constants.js.map +1 -0
  339. package/dist/{types → esm}/index.d.ts +0 -0
  340. package/dist/esm/index.js +87 -5814
  341. package/dist/esm/index.js.map +1 -1
  342. package/dist/esm/index.min.js.map +1 -1
  343. package/dist/esm/node_modules/tslib/tslib.es6.js +27 -0
  344. package/dist/esm/node_modules/tslib/tslib.es6.js.map +1 -0
  345. package/dist/{types → esm}/stories/AddressInput.stories.d.ts +0 -0
  346. package/dist/{types → esm}/stories/AttachmentArrayInput.stories.d.ts +0 -0
  347. package/dist/{types → esm}/stories/AttachmentInput.stories.d.ts +0 -0
  348. package/dist/{types → esm}/stories/Autocomplete.stories.d.ts +0 -0
  349. package/dist/{types → esm}/stories/Avatar.stories.d.ts +0 -0
  350. package/dist/{types → esm}/stories/Button.stories.d.ts +0 -0
  351. package/dist/{types → esm}/stories/DiagnosticReportDisplay.stories.d.ts +0 -0
  352. package/dist/{types → esm}/stories/Dialog.stories.d.ts +0 -0
  353. package/dist/{types → esm}/stories/EncounterTimeline.stories.d.ts +0 -0
  354. package/dist/{types → esm}/stories/FhirPathDisplay.stories.d.ts +0 -0
  355. package/dist/{types → esm}/stories/FormSection.stories.d.ts +0 -0
  356. package/dist/{types → esm}/stories/Header.stories.d.ts +0 -0
  357. package/dist/{types → esm}/stories/Input.stories.d.ts +0 -0
  358. package/dist/{types → esm}/stories/Loading.stories.d.ts +0 -0
  359. package/dist/{types → esm}/stories/Logo.stories.d.ts +0 -0
  360. package/dist/{types → esm}/stories/PatientTimeline.stories.d.ts +0 -0
  361. package/dist/{types → esm}/stories/PlanDefinitionBuilder.stories.d.ts +0 -0
  362. package/dist/{types → esm}/stories/QuestionnaireBuilder.stories.d.ts +0 -0
  363. package/dist/{types → esm}/stories/QuestionnaireForm.stories.d.ts +0 -0
  364. package/dist/{types → esm}/stories/ReferenceInput.stories.d.ts +0 -0
  365. package/dist/{types → esm}/stories/RegisterForm.stories.d.ts +0 -0
  366. package/dist/{types → esm}/stories/RequestGroupDisplay.stories.d.ts +0 -0
  367. package/dist/{types → esm}/stories/ResourceBlame.stories.d.ts +0 -0
  368. package/dist/{types → esm}/stories/ResourceForm.stories.d.ts +0 -0
  369. package/dist/{types → esm}/stories/ResourceHistoryTable.stories.d.ts +0 -0
  370. package/dist/{types → esm}/stories/ResourceTable.stories.d.ts +0 -0
  371. package/dist/{types → esm}/stories/Scheduler.stories.d.ts +0 -0
  372. package/dist/{types → esm}/stories/SearchControl.stories.d.ts +0 -0
  373. package/dist/{types → esm}/stories/Select.stories.d.ts +0 -0
  374. package/dist/{types → esm}/stories/SignInForm.stories.d.ts +0 -0
  375. package/dist/{types → esm}/stories/StatusBadge.stories.d.ts +0 -0
  376. package/dist/{types → esm}/stories/Tabs.stories.d.ts +0 -0
  377. package/dist/{types → esm}/stories/Timeline.stories.d.ts +0 -0
  378. package/dist/{types → esm}/stories/UploadButton.stories.d.ts +0 -0
  379. package/dist/{types → esm}/test.setup.d.ts +0 -0
  380. package/dist/{types → esm}/useResource.d.ts +0 -0
  381. package/dist/esm/useResource.js +65 -0
  382. package/dist/esm/useResource.js.map +1 -0
  383. package/dist/{types → esm}/utils/blame.d.ts +0 -0
  384. package/dist/esm/utils/blame.js +74 -0
  385. package/dist/esm/utils/blame.js.map +1 -0
  386. package/dist/{types → esm}/utils/date.d.ts +0 -0
  387. package/dist/esm/utils/date.js +48 -0
  388. package/dist/esm/utils/date.js.map +1 -0
  389. package/dist/{types → esm}/utils/diff.d.ts +0 -0
  390. package/dist/esm/utils/diff.js +118 -0
  391. package/dist/esm/utils/diff.js.map +1 -0
  392. package/dist/{types → esm}/utils/dom.d.ts +0 -0
  393. package/dist/esm/utils/dom.js +34 -0
  394. package/dist/esm/utils/dom.js.map +1 -0
  395. package/dist/{types → esm}/utils/outcomes.d.ts +0 -0
  396. package/dist/esm/utils/outcomes.js +7 -0
  397. package/dist/esm/utils/outcomes.js.map +1 -0
  398. package/dist/{types → esm}/utils/recaptcha.d.ts +0 -0
  399. package/dist/esm/utils/recaptcha.js +27 -0
  400. package/dist/esm/utils/recaptcha.js.map +1 -0
  401. package/dist/{types → esm}/utils.d.ts +0 -0
  402. package/dist/esm/utils.js +15 -0
  403. package/dist/esm/utils.js.map +1 -0
  404. package/package.json +7 -7
  405. package/stats.html +4034 -0
  406. package/tsconfig.cjs.json +7 -0
  407. package/tsconfig.esm.json +7 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContactDetailInput.js","sources":["../../src/ContactDetailInput.tsx"],"sourcesContent":["import { ContactDetail, ContactPoint } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\nimport { ContactPointInput } from './ContactPointInput';\nimport { Input } from './Input';\nimport { InputRow } from './InputRow';\n\nexport interface ContactDetailInputProps {\n name: string;\n defaultValue?: ContactDetail;\n onChange?: (value: ContactDetail) => void;\n}\n\nexport function ContactDetailInput(props: ContactDetailInputProps): JSX.Element {\n const [contactPoint, setContactDetail] = useState(props.defaultValue);\n\n const ref = useRef<ContactDetail>();\n ref.current = contactPoint;\n\n function setContactDetailWrapper(newValue: ContactDetail): void {\n setContactDetail(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n function setName(name: string): void {\n const newValue: ContactDetail = { ...ref.current, name };\n if (!name) {\n delete newValue.name;\n }\n setContactDetailWrapper(newValue);\n }\n\n function setTelecom(telecom: ContactPoint | undefined): void {\n const newValue: ContactDetail = { ...ref.current, telecom: telecom && [telecom] };\n if (!telecom) {\n delete newValue.telecom;\n }\n setContactDetailWrapper(newValue);\n }\n\n return (\n <InputRow>\n <Input\n name={props.name + '-name'}\n placeholder=\"Name\"\n style={{ width: 180 }}\n defaultValue={contactPoint?.name}\n onChange={setName}\n />\n <ContactPointInput\n name={props.name + '-telecom'}\n defaultValue={contactPoint?.telecom?.[0]}\n onChange={setTelecom}\n />\n </InputRow>\n );\n}\n"],"names":[],"mappings":";;;;;AAYM,SAAU,kBAAkB,CAAC,KAA8B,EAAA;;AAC/D,IAAA,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAEtE,IAAA,MAAM,GAAG,GAAG,MAAM,EAAiB,CAAC;AACpC,IAAA,GAAG,CAAC,OAAO,GAAG,YAAY,CAAC;IAE3B,SAAS,uBAAuB,CAAC,QAAuB,EAAA;QACtD,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAC3B,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,SAAA;KACF;IAED,SAAS,OAAO,CAAC,IAAY,EAAA;QAC3B,MAAM,QAAQ,mCAAuB,GAAG,CAAC,OAAO,CAAE,EAAA,EAAA,IAAI,GAAE,CAAC;QACzD,IAA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isplay(props) {
4
+ const contactPoint = props.value;
5
+ if (!contactPoint) {
6
+ return null;
7
+ }
8
+ const builder = [];
9
+ if (contactPoint.value) {
10
+ builder.push(contactPoint.value);
11
+ }
12
+ if (contactPoint.use || contactPoint.system) {
13
+ builder.push(' [');
14
+ if (contactPoint.use) {
15
+ builder.push(contactPoint.use);
16
+ }
17
+ if (contactPoint.use && contactPoint.system) {
18
+ builder.push(' ');
19
+ }
20
+ if (contactPoint.system) {
21
+ builder.push(contactPoint.system);
22
+ }
23
+ builder.push(']');
24
+ }
25
+ return React.createElement(React.Fragment, null, builder.join('').trim());
26
+ }
27
+
28
+ export { ContactPointDisplay };
29
+ //# sourceMappingURL=ContactPointDisplay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContactPointDisplay.js","sources":["../../src/ContactPointDisplay.tsx"],"sourcesContent":["import { ContactPoint } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface ContactPointDisplayProps {\n value?: ContactPoint;\n}\n\nexport function ContactPointDisplay(props: ContactPointDisplayProps): JSX.Element | null {\n const contactPoint = props.value;\n if (!contactPoint) {\n return null;\n }\n\n const builder = [];\n\n if (contactPoint.value) {\n builder.push(contactPoint.value);\n }\n\n if (contactPoint.use || contactPoint.system) {\n builder.push(' [');\n\n if (contactPoint.use) {\n builder.push(contactPoint.use);\n }\n\n if (contactPoint.use && contactPoint.system) {\n builder.push(' ');\n }\n\n if (contactPoint.system) {\n builder.push(contactPoint.system);\n }\n\n builder.push(']');\n }\n\n return <>{builder.join('').trim()}</>;\n}\n"],"names":[],"mappings":";;AAOM,SAAU,mBAAmB,CAAC,KAA+B,EAAA;AACjE,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;IACjC,IAAI,CAAC,YAAY,EAAE;AACjB,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;IAED,MAAM,OAAO,GAAG,EAAE,CAAC;IAEnB,IAAI,YAAY,CAAC,KAAK,EAAE;AACtB,QAAA,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAClC,KAAA;AAED,IAAA,IAAI,YAAY,CAAC,GAAG,IAAI,YAAY,CAAC,MAAM,EAAE;AAC3C,QAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnB,IAAI,YAAY,CAAC,GAAG,EAAE;AACpB,YAAA,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AAChC,SAAA;AAED,QAAA,IAAI,YAAY,CAAC,GAAG,IAAI,YAAY,CAAC,MAAM,EAAE;AAC3C,YAAA,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,SAAA;QAED,IAAI,YAAY,CAAC,MAAM,EAAE;AACvB,YAAA,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,KAAA;IAED,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAI,CAAC;AACxC;;;;"}
File without changes
@@ -0,0 +1,60 @@
1
+ import React, { useState, useRef } from 'react';
2
+ import { Input } from './Input.js';
3
+ import { InputRow } from './InputRow.js';
4
+ import { Select } from './Select.js';
5
+
6
+ function ContactPointInput(props) {
7
+ const [contactPoint, setContactPoint] = useState(props.defaultValue);
8
+ const ref = useRef();
9
+ ref.current = contactPoint;
10
+ function setContactPointWrapper(newValue) {
11
+ if (newValue && Object.keys(newValue).length === 0) {
12
+ newValue = undefined;
13
+ }
14
+ setContactPoint(newValue);
15
+ if (props.onChange) {
16
+ props.onChange(newValue);
17
+ }
18
+ }
19
+ function setSystem(system) {
20
+ const newValue = Object.assign(Object.assign({}, ref.current), { system });
21
+ if (!system) {
22
+ delete newValue.system;
23
+ }
24
+ setContactPointWrapper(newValue);
25
+ }
26
+ function setUse(use) {
27
+ const newValue = Object.assign(Object.assign({}, ref.current), { use });
28
+ if (!use) {
29
+ delete newValue.use;
30
+ }
31
+ setContactPointWrapper(newValue);
32
+ }
33
+ function setValue(value) {
34
+ const newValue = Object.assign(Object.assign({}, ref.current), { value });
35
+ if (!value) {
36
+ delete newValue.value;
37
+ }
38
+ setContactPointWrapper(newValue);
39
+ }
40
+ return (React.createElement(InputRow, null,
41
+ React.createElement(Select, { defaultValue: contactPoint === null || contactPoint === void 0 ? void 0 : contactPoint.system, onChange: setSystem, testid: "system" },
42
+ React.createElement("option", null),
43
+ React.createElement("option", null, "email"),
44
+ React.createElement("option", null, "fax"),
45
+ React.createElement("option", null, "pager"),
46
+ React.createElement("option", null, "phone"),
47
+ React.createElement("option", null, "other"),
48
+ React.createElement("option", null, "sms")),
49
+ React.createElement(Select, { defaultValue: contactPoint === null || contactPoint === void 0 ? void 0 : contactPoint.use, onChange: setUse, testid: "use" },
50
+ React.createElement("option", null),
51
+ React.createElement("option", null, "home"),
52
+ React.createElement("option", null, "mobile"),
53
+ React.createElement("option", null, "old"),
54
+ React.createElement("option", null, "temp"),
55
+ React.createElement("option", null, "work")),
56
+ React.createElement(Input, { placeholder: "Value", defaultValue: contactPoint === null || contactPoint === void 0 ? void 0 : contactPoint.value, onChange: setValue })));
57
+ }
58
+
59
+ export { ContactPointInput };
60
+ //# sourceMappingURL=ContactPointInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContactPointInput.js","sources":["../../src/ContactPointInput.tsx"],"sourcesContent":["import { ContactPoint } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\nimport { Input } from './Input';\nimport { InputRow } from './InputRow';\nimport { Select } from './Select';\n\nexport interface ContactPointInputProps {\n name: string;\n defaultValue?: ContactPoint;\n onChange?: (value: ContactPoint | undefined) => void;\n}\n\nexport function ContactPointInput(props: ContactPointInputProps): JSX.Element {\n const [contactPoint, setContactPoint] = useState(props.defaultValue);\n\n const ref = useRef<ContactPoint>();\n ref.current = contactPoint;\n\n function setContactPointWrapper(newValue: ContactPoint | undefined): void {\n if (newValue && Object.keys(newValue).length === 0) {\n newValue = undefined;\n }\n setContactPoint(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n function setSystem(system: string): void {\n const newValue: ContactPoint = { ...ref.current, system };\n if (!system) {\n delete newValue.system;\n }\n setContactPointWrapper(newValue);\n }\n\n function setUse(use: string): void {\n const newValue: ContactPoint = { ...ref.current, use };\n if (!use) {\n delete newValue.use;\n }\n setContactPointWrapper(newValue);\n }\n\n function setValue(value: string): void {\n const newValue: ContactPoint = { ...ref.current, value };\n if (!value) {\n delete newValue.value;\n }\n setContactPointWrapper(newValue);\n }\n\n return (\n <InputRow>\n <Select defaultValue={contactPoint?.system} onChange={setSystem} testid=\"system\">\n <option></option>\n <option>email</option>\n <option>fax</option>\n <option>pager</option>\n <option>phone</option>\n <option>other</option>\n <option>sms</option>\n </Select>\n <Select defaultValue={contactPoint?.use} onChange={setUse} testid=\"use\">\n <option></option>\n <option>home</option>\n <option>mobile</option>\n <option>old</option>\n <option>temp</option>\n <option>work</option>\n </Select>\n <Input placeholder=\"Value\" defaultValue={contactPoint?.value} onChange={setValue} />\n </InputRow>\n );\n}\n"],"names":[],"mappings":";;;;;AAYM,SAAU,iBAAiB,CAAC,KAA6B,EAAA;AAC7D,IAAA,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAErE,IAAA,MAAM,GAAG,GAAG,MAAM,EAAgB,CAAC;AACnC,IAAA,GAAG,CAAC,OAAO,GAAG,YAAY,CAAC;IAE3B,SAAS,sBAAsB,CAAC,QAAkC,EAAA;AAChE,QAAA,IAAI,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YAClD,QAAQ,GAAG,SAAS,CAAC;AACtB,SAAA;QACD,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ay(props) {
4
+ if (!props.value) {
5
+ return null;
6
+ }
7
+ return React.createElement(React.Fragment, null, new Date(props.value).toLocaleString());
8
+ }
9
+
10
+ export { DateTimeDisplay };
11
+ //# sourceMappingURL=DateTimeDisplay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimeDisplay.js","sources":["../../src/DateTimeDisplay.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface DateTimeDisplayProps {\n value?: string;\n}\n\nexport function DateTimeDisplay(props: DateTimeDisplayProps): JSX.Element | null {\n if (!props.value) {\n return null;\n }\n return <>{new Date(props.value).toLocaleString()}</>;\n}\n"],"names":[],"mappings":";;AAMM,SAAU,eAAe,CAAC,KAA2B,EAAA;AACzD,IAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;AAChB,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AACD,IAAA,OAAO,KAAG,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAI,CAAC;AACvD;;;;"}
File without changes
@@ -0,0 +1,62 @@
1
+ import React from 'react';
2
+ import { Input } from './Input.js';
3
+
4
+ /**
5
+ * The DateTimeInput component is a wrapper around the HTML5 input type="datetime-local".
6
+ * The main purpose is to reconcile time zones.
7
+ * Most of our date/time values are in ISO-8601, which includes a time zone offset.
8
+ * The datetime-local input does not support the time zone offset.
9
+ * @param props The Input props.
10
+ * @returns The JSX element to render.
11
+ */
12
+ function DateTimeInput(props) {
13
+ return (React.createElement(Input, Object.assign({}, props, { type: "datetime-local", defaultValue: convertIsoToLocal(props.defaultValue), onChange: (newValue) => {
14
+ if (props.onChange) {
15
+ props.onChange(convertLocalToIso(newValue));
16
+ }
17
+ } })));
18
+ }
19
+ /**
20
+ * Converts an ISO-8601 date/time string to a local date/time string.
21
+ * @param isoString The ISO-8601 date/time string to convert.
22
+ * @returns The local date/time string.
23
+ */
24
+ function convertIsoToLocal(isoString) {
25
+ if (!isoString) {
26
+ return '';
27
+ }
28
+ // Convert the ISO-8601 date to a local datetime-local value.
29
+ // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Date_and_time_formats#local_date_and_time_strings
30
+ // See: https://stackoverflow.com/a/60368477
31
+ const date = new Date(isoString);
32
+ if (!isValidDate(date)) {
33
+ // If the input string was malformed, return an empty string.
34
+ return '';
35
+ }
36
+ return date.toLocaleDateString('sv') + 'T' + date.toLocaleTimeString('sv');
37
+ }
38
+ /**
39
+ * Converts a local date/time string to an ISO-8601 date/time string.
40
+ * @param localString The local date/time string to convert.
41
+ * @returns The ISO-8601 date/time string.
42
+ */
43
+ function convertLocalToIso(localString) {
44
+ if (!localString) {
45
+ return '';
46
+ }
47
+ // Try to parse the local string as a Date
48
+ // JavaScript's Date() constructor defaults to the local time zone.
49
+ // The Date() constructor will throw if the value is malformed.
50
+ const date = new Date(localString);
51
+ if (!isValidDate(date)) {
52
+ // If the input string was malformed, return an empty string.
53
+ return '';
54
+ }
55
+ return date.toISOString();
56
+ }
57
+ function isValidDate(date) {
58
+ return date instanceof Date && !isNaN(date.getTime());
59
+ }
60
+
61
+ export { DateTimeInput, convertIsoToLocal, convertLocalToIso };
62
+ //# sourceMappingURL=DateTimeInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimeInput.js","sources":["../../src/DateTimeInput.tsx"],"sourcesContent":["import React from 'react';\nimport { Input, InputProps } from './Input';\n\n/**\n * The DateTimeInput component is a wrapper around the HTML5 input type=\"datetime-local\".\n * The main purpose is to reconcile time zones.\n * Most of our date/time values are in ISO-8601, which includes a time zone offset.\n * The datetime-local input does not support the time zone offset.\n * @param props The Input props.\n * @returns The JSX element to render.\n */\nexport function DateTimeInput(props: InputProps): JSX.Element {\n return (\n <Input\n {...props}\n type=\"datetime-local\"\n defaultValue={convertIsoToLocal(props.defaultValue as string | undefined)}\n onChange={(newValue: string) => {\n if (props.onChange) {\n props.onChange(convertLocalToIso(newValue));\n }\n }}\n />\n );\n}\n\n/**\n * Converts an ISO-8601 date/time string to a local date/time string.\n * @param isoString The ISO-8601 date/time string to convert.\n * @returns The local date/time string.\n */\nexport function convertIsoToLocal(isoString: string | undefined): string {\n if (!isoString) {\n return '';\n }\n\n // Convert the ISO-8601 date to a local datetime-local value.\n // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Date_and_time_formats#local_date_and_time_strings\n // See: https://stackoverflow.com/a/60368477\n const date = new Date(isoString);\n if (!isValidDate(date)) {\n // If the input string was malformed, return an empty string.\n return '';\n }\n\n return date.toLocaleDateString('sv') + 'T' + date.toLocaleTimeString('sv');\n}\n\n/**\n * Converts a local date/time string to an ISO-8601 date/time string.\n * @param localString The local date/time string to convert.\n * @returns The ISO-8601 date/time string.\n */\nexport function convertLocalToIso(localString: string | undefined): string {\n if (!localString) {\n return '';\n }\n\n // Try to parse the local string as a Date\n // JavaScript's Date() constructor defaults to the local time zone.\n // The Date() constructor will throw if the value is malformed.\n const date = new Date(localString);\n if (!isValidDate(date)) {\n // If the input string was malformed, return an empty string.\n return '';\n }\n\n return date.toISOString();\n}\n\nfunction isValidDate(date: Date): boolean {\n return date instanceof Date && !isNaN(date.getTime());\n}\n"],"names":[],"mappings":";;;AAGA;;;;;;;AAOG;AACG,SAAU,aAAa,CAAC,KAAiB,EAAA;IAC7C,QACE,KAAC,CAAA,aAAA,CAAA,KAAK,EACA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,KAAK,IACT,IAAI,EAAC,gBAAgB,EACrB,YAAY,EAAE,iBAAiB,CAAC,KAAK,CAAC,YAAkC,CAAC,EACzE,QAAQ,EAAE,CAAC,QAAgB,KAAI;YAC7B,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAK,CAAC,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC7C,aAAA;SACF,EAAA,CAAA,CACD,EACF;AACJ,CAAC;AAED;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,SAA6B,EAAA;IAC7D,IAAI,CAAC,SAAS,EAAE;AACd,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;;;;AAKD,IAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;AACjC,IAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;;AAEtB,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;AAED,IAAA,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC7E,CAAC;AAED;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,WAA+B,EAAA;IAC/D,IAAI,CAAC,WAAW,EAAE;AAChB,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;;;;AAKD,IAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;AACnC,IAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;;AAEtB,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;AAED,IAAA,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5B,CAAC;AAED,SAAS,WAAW,CAAC,IAAU,EAAA;AAC7B,IAAA,OAAO,IAAI,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AACxD;;;;"}
File without changes
@@ -0,0 +1,27 @@
1
+ import { getReferenceString } from '@medplum/core';
2
+ import React from 'react';
3
+ import { ResourceTimeline } from './ResourceTimeline.js';
4
+
5
+ function DefaultResourceTimeline(props) {
6
+ return (React.createElement(ResourceTimeline, { value: props.resource, buildSearchRequests: (resource) => ({
7
+ resourceType: 'Bundle',
8
+ type: 'batch',
9
+ entry: [
10
+ {
11
+ request: {
12
+ method: 'GET',
13
+ url: `${getReferenceString(resource)}/_history`,
14
+ },
15
+ },
16
+ {
17
+ request: {
18
+ method: 'GET',
19
+ url: `AuditEvent?entity=${getReferenceString(resource)}&_sort=-_lastUpdated`,
20
+ },
21
+ },
22
+ ],
23
+ }) }));
24
+ }
25
+
26
+ export { DefaultResourceTimeline };
27
+ //# sourceMappingURL=DefaultResourceTimeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultResourceTimeline.js","sources":["../../src/DefaultResourceTimeline.tsx"],"sourcesContent":["import { getReferenceString } from '@medplum/core';\nimport { Reference, Resource } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { ResourceTimeline } from './ResourceTimeline';\n\nexport interface DefaultResourceTimelineProps {\n resource: Resource | Reference;\n}\n\nexport function DefaultResourceTimeline(props: DefaultResourceTimelineProps): JSX.Element {\n return (\n <ResourceTimeline\n value={props.resource}\n buildSearchRequests={(resource: Resource) => ({\n resourceType: 'Bundle',\n type: 'batch',\n entry: [\n {\n request: {\n method: 'GET',\n url: `${getReferenceString(resource)}/_history`,\n },\n },\n {\n request: {\n method: 'GET',\n url: `AuditEvent?entity=${getReferenceString(resource)}&_sort=-_lastUpdated`,\n },\n },\n ],\n })}\n />\n );\n}\n"],"names":[],"mappings":";;;;AASM,SAAU,uBAAuB,CAAC,KAAmC,EAAA;AACzE,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,gBAAgB,EACf,EAAA,KAAK,EAAE,KAAK,CAAC,QAAQ,EACrB,mBAAmB,EAAE,CAAC,QAAkB,MAAM;AAC5C,YAAA,YAAY,EAAE,QAAQ;AACtB,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,KAAK,EAAE;AACL,gBAAA;AACE,oBAAA,OAAO,EAAE;AACP,wBAAA,MAAM,EAAE,KAAK;AACb,wBAAA,GAAG,EAAE,CAAG,EAAA,kBAAkB,CAAC,QAAQ,CAAC,CAAW,SAAA,CAAA;AAChD,qBAAA;AACF,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE;AACP,wBAAA,MAAM,EAAE,KAAK;AACb,wBAAA,GAAG,EAAE,CAAqB,kBAAA,EAAA,kBAAkB,CAAC,QAAQ,CAAC,CAAsB,oBAAA,CAAA;AAC7E,qBAAA;AACF,iBAAA;AACF,aAAA;SACF,CAAC,EAAA,CACF,EACF;AACJ;;;;"}
File without changes
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+
3
+ function DescriptionList(props) {
4
+ return React.createElement("dl", { className: 'medplum-description-list' + (props.compact ? ' compact' : '') }, props.children);
5
+ }
6
+ function DescriptionListEntry(props) {
7
+ return (React.createElement(React.Fragment, null,
8
+ React.createElement("dt", null, props.term),
9
+ React.createElement("dd", null, props.children)));
10
+ }
11
+
12
+ export { DescriptionList, DescriptionListEntry };
13
+ //# sourceMappingURL=DescriptionList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DescriptionList.js","sources":["../../src/DescriptionList.tsx"],"sourcesContent":["import React from 'react';\nimport './DescriptionList.css';\n\nexport interface DescriptionListProps {\n children: React.ReactNode;\n compact?: boolean;\n}\n\nexport function DescriptionList(props: DescriptionListProps): JSX.Element {\n return <dl className={'medplum-description-list' + (props.compact ? ' compact' : '')}>{props.children}</dl>;\n}\n\nexport interface DescriptionListEntryProps {\n term: string;\n children: React.ReactNode;\n}\n\nexport function DescriptionListEntry(props: DescriptionListEntryProps): JSX.Element {\n return (\n <>\n <dt>{props.term}</dt>\n <dd>{props.children}</dd>\n </>\n );\n}\n"],"names":[],"mappings":";;AAQM,SAAU,eAAe,CAAC,KAA2B,EAAA;IACzD,OAAO,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,0BAA0B,IAAI,KAAK,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,CAAC,IAAG,KAAK,CAAC,QAAQ,CAAM,CAAC;AAC9G,CAAC;AAOK,SAAU,oBAAoB,CAAC,KAAgC,EAAA;AACnE,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;QACE,KAAK,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,EAAA,KAAK,CAAC,IAAI,CAAM;AACrB,QAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,EAAK,KAAK,CAAC,QAAQ,CAAM,CACxB,EACH;AACJ;;;;"}
File without changes
@@ -0,0 +1,103 @@
1
+ import { capitalize } from '@medplum/core';
2
+ import React from 'react';
3
+ import { CodeableConceptDisplay } from './CodeableConceptDisplay.js';
4
+ import { DateTimeDisplay } from './DateTimeDisplay.js';
5
+ import { MedplumLink } from './MedplumLink.js';
6
+ import { QuantityDisplay } from './QuantityDisplay.js';
7
+ import { RangeDisplay } from './RangeDisplay.js';
8
+ import { ResourceBadge } from './ResourceBadge.js';
9
+ import { useResource } from './useResource.js';
10
+
11
+ function DiagnosticReportDisplay(props) {
12
+ var _a, _b;
13
+ const diagnosticReport = useResource(props.value);
14
+ const specimen = useResource((_a = diagnosticReport === null || diagnosticReport === void 0 ? void 0 : diagnosticReport.specimen) === null || _a === void 0 ? void 0 : _a[0]);
15
+ if (!diagnosticReport) {
16
+ return null;
17
+ }
18
+ let textContent = '';
19
+ if (diagnosticReport.presentedForm && diagnosticReport.presentedForm.length > 0) {
20
+ const pf = diagnosticReport.presentedForm[0];
21
+ if (((_b = pf.contentType) === null || _b === void 0 ? void 0 : _b.startsWith('text/plain')) && pf.data) {
22
+ textContent = window.atob(pf.data);
23
+ }
24
+ }
25
+ if (specimen === null || specimen === void 0 ? void 0 : specimen.note) {
26
+ for (const note of specimen.note) {
27
+ textContent += note.text + '\n\n';
28
+ }
29
+ }
30
+ return (React.createElement("div", { className: "medplum-diagnostic-report" },
31
+ React.createElement("h1", null, "Diagnostic Report"),
32
+ React.createElement("div", { className: "medplum-diagnostic-report-header" },
33
+ diagnosticReport.subject && (React.createElement("dl", null,
34
+ React.createElement("dt", null, "Subject"),
35
+ React.createElement("dd", null,
36
+ React.createElement(ResourceBadge, { value: diagnosticReport.subject, link: true })))),
37
+ diagnosticReport.resultsInterpreter &&
38
+ diagnosticReport.resultsInterpreter.map((interpreter) => (React.createElement("dl", { key: interpreter.reference },
39
+ React.createElement("dt", null, "Interpreter"),
40
+ React.createElement("dd", null,
41
+ React.createElement(ResourceBadge, { value: interpreter, link: true }))))),
42
+ diagnosticReport.issued && (React.createElement("dl", null,
43
+ React.createElement("dt", null, "Issued"),
44
+ React.createElement("dd", null,
45
+ React.createElement(DateTimeDisplay, { value: diagnosticReport.issued })))),
46
+ diagnosticReport.status && (React.createElement("dl", null,
47
+ React.createElement("dt", null, "Status"),
48
+ React.createElement("dd", null, capitalize(diagnosticReport.status))))),
49
+ diagnosticReport.result && React.createElement(ObservationTable, { value: diagnosticReport.result }),
50
+ textContent && React.createElement("pre", null, textContent.trim())));
51
+ }
52
+ function ObservationTable(props) {
53
+ var _a;
54
+ return (React.createElement("table", { className: "medplum-table" },
55
+ React.createElement("thead", null,
56
+ React.createElement("tr", null,
57
+ React.createElement("th", null, "Test"),
58
+ React.createElement("th", null, "Value"),
59
+ React.createElement("th", null, "Reference Range"),
60
+ React.createElement("th", null, "Interpretation"))),
61
+ React.createElement("tbody", null, (_a = props.value) === null || _a === void 0 ? void 0 : _a.map((observation, index) => (React.createElement(ObservationRow, { key: 'obs-' + index, value: observation }))))));
62
+ }
63
+ function ObservationRow(props) {
64
+ const observation = useResource(props.value);
65
+ if (!observation) {
66
+ return null;
67
+ }
68
+ return (React.createElement("tr", null,
69
+ React.createElement("td", null,
70
+ React.createElement(MedplumLink, { to: observation },
71
+ React.createElement(CodeableConceptDisplay, { value: observation.code }))),
72
+ React.createElement("td", null,
73
+ React.createElement(ObservationValueDisplay, { value: observation })),
74
+ React.createElement("td", null,
75
+ React.createElement(ReferenceRangeDisplay, { value: observation.referenceRange })),
76
+ React.createElement("td", null, observation.interpretation && observation.interpretation.length > 0 && (React.createElement(CodeableConceptDisplay, { value: observation.interpretation[0] })))));
77
+ }
78
+ function ObservationValueDisplay(props) {
79
+ var _a;
80
+ const obs = props.value;
81
+ if (obs === null || obs === void 0 ? void 0 : obs.valueQuantity) {
82
+ return React.createElement(QuantityDisplay, { value: (_a = props.value) === null || _a === void 0 ? void 0 : _a.valueQuantity });
83
+ }
84
+ if (obs === null || obs === void 0 ? void 0 : obs.valueString) {
85
+ return React.createElement(React.Fragment, null, obs.valueString);
86
+ }
87
+ if (obs && 'component' in obs && (obs === null || obs === void 0 ? void 0 : obs.component)) {
88
+ return (React.createElement(React.Fragment, null, obs.component
89
+ .map((component, index) => (React.createElement(ObservationValueDisplay, { key: `obs-${index}`, value: component })))
90
+ .reduce((prev, curr) => [prev, ' / ', curr])));
91
+ }
92
+ return null;
93
+ }
94
+ function ReferenceRangeDisplay(props) {
95
+ const range = props.value && props.value.length > 0 && props.value[0];
96
+ if (!range) {
97
+ return null;
98
+ }
99
+ return React.createElement(RangeDisplay, { value: range });
100
+ }
101
+
102
+ export { DiagnosticReportDisplay, ObservationTable };
103
+ //# sourceMappingURL=DiagnosticReportDisplay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiagnosticReportDisplay.js","sources":["../../src/DiagnosticReportDisplay.tsx"],"sourcesContent":["import { capitalize } from '@medplum/core';\nimport {\n DiagnosticReport,\n Observation,\n ObservationComponent,\n ObservationReferenceRange,\n Reference,\n} from '@medplum/fhirtypes';\nimport React from 'react';\nimport { CodeableConceptDisplay } from './CodeableConceptDisplay';\nimport { DateTimeDisplay } from './DateTimeDisplay';\nimport { MedplumLink } from './MedplumLink';\nimport { QuantityDisplay } from './QuantityDisplay';\nimport { RangeDisplay } from './RangeDisplay';\nimport { ResourceBadge } from './ResourceBadge';\nimport { useResource } from './useResource';\nimport './DiagnosticReportDisplay.css';\nimport './Table.css';\n\nexport interface DiagnosticReportDisplayProps {\n value?: DiagnosticReport | Reference<DiagnosticReport>;\n}\n\nexport function DiagnosticReportDisplay(props: DiagnosticReportDisplayProps): JSX.Element | null {\n const diagnosticReport = useResource(props.value);\n const specimen = useResource(diagnosticReport?.specimen?.[0]);\n if (!diagnosticReport) {\n return null;\n }\n\n let textContent = '';\n\n if (diagnosticReport.presentedForm && diagnosticReport.presentedForm.length > 0) {\n const pf = diagnosticReport.presentedForm[0];\n if (pf.contentType?.startsWith('text/plain') && pf.data) {\n textContent = window.atob(pf.data);\n }\n }\n\n if (specimen?.note) {\n for (const note of specimen.note) {\n textContent += note.text + '\\n\\n';\n }\n }\n\n return (\n <div className=\"medplum-diagnostic-report\">\n <h1>Diagnostic Report</h1>\n <div className=\"medplum-diagnostic-report-header\">\n {diagnosticReport.subject && (\n <dl>\n <dt>Subject</dt>\n <dd>\n <ResourceBadge value={diagnosticReport.subject} link={true} />\n </dd>\n </dl>\n )}\n {diagnosticReport.resultsInterpreter &&\n diagnosticReport.resultsInterpreter.map((interpreter) => (\n <dl key={interpreter.reference}>\n <dt>Interpreter</dt>\n <dd>\n <ResourceBadge value={interpreter} link={true} />\n </dd>\n </dl>\n ))}\n {diagnosticReport.issued && (\n <dl>\n <dt>Issued</dt>\n <dd>\n <DateTimeDisplay value={diagnosticReport.issued} />\n </dd>\n </dl>\n )}\n {diagnosticReport.status && (\n <dl>\n <dt>Status</dt>\n <dd>{capitalize(diagnosticReport.status)}</dd>\n </dl>\n )}\n </div>\n {diagnosticReport.result && <ObservationTable value={diagnosticReport.result} />}\n {textContent && <pre>{textContent.trim()}</pre>}\n </div>\n );\n}\n\nexport interface ObservationTableProps {\n value?: Observation[] | Reference<Observation>[];\n}\n\nexport function ObservationTable(props: ObservationTableProps): JSX.Element {\n return (\n <table className=\"medplum-table\">\n <thead>\n <tr>\n <th>Test</th>\n <th>Value</th>\n <th>Reference Range</th>\n <th>Interpretation</th>\n </tr>\n </thead>\n <tbody>\n {props.value?.map((observation, index) => (\n <ObservationRow key={'obs-' + index} value={observation} />\n ))}\n </tbody>\n </table>\n );\n}\n\ninterface ObservationRowProps {\n value: Observation | Reference<Observation>;\n}\n\nfunction ObservationRow(props: ObservationRowProps): JSX.Element | null {\n const observation = useResource(props.value);\n if (!observation) {\n return null;\n }\n\n return (\n <tr>\n <td>\n <MedplumLink to={observation}>\n <CodeableConceptDisplay value={observation.code} />\n </MedplumLink>\n </td>\n <td>\n <ObservationValueDisplay value={observation} />\n </td>\n <td>\n <ReferenceRangeDisplay value={observation.referenceRange} />\n </td>\n <td>\n {observation.interpretation && observation.interpretation.length > 0 && (\n <CodeableConceptDisplay value={observation.interpretation[0]} />\n )}\n </td>\n </tr>\n );\n}\n\ninterface ObservationValueDisplayProps {\n value?: Observation | ObservationComponent;\n}\n\nfunction ObservationValueDisplay(props: ObservationValueDisplayProps): JSX.Element | null {\n const obs = props.value;\n\n if (obs?.valueQuantity) {\n return <QuantityDisplay value={props.value?.valueQuantity} />;\n }\n\n if (obs?.valueString) {\n return <>{obs.valueString}</>;\n }\n\n if (obs && 'component' in obs && obs?.component) {\n return (\n <>\n {obs.component\n .map<React.ReactNode>((component: ObservationComponent, index: number) => (\n <ObservationValueDisplay key={`obs-${index}`} value={component} />\n ))\n .reduce((prev, curr) => [prev, ' / ', curr])}\n </>\n );\n }\n\n return null;\n}\n\ninterface ReferenceRangeProps {\n value?: ObservationReferenceRange[];\n}\n\nfunction ReferenceRangeDisplay(props: ReferenceRangeProps): JSX.Element | null {\n const range = props.value && props.value.length > 0 && props.value[0];\n if (!range) {\n return null;\n }\n return <RangeDisplay value={range} />;\n}\n"],"names":[],"mappings":";;;;;;;;;;AAuBM,SAAU,uBAAuB,CAAC,KAAmC,EAAA;;IACzE,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAClD,IAAA,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAA,EAAA,GAAA,gBAAgB,KAAhB,IAAA,IAAA,gBAAgB,KAAhB,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,gBAAgB,CAAE,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,CAAC,CAAC,CAAC,CAAC;IAC9D,IAAI,CAAC,gBAAgB,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AAA;AAED,IAAA,IAAI,GAAG,IAAI,WAAW,IAAI,GAAG,KAAI,GAAG,KAAH,IAAA,IAAA,GAAG,KAAH,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,GAAG,CAAE,SAAS,CAAA,EAAE;AAC/C,QAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACG,GAAG,CAAC,SAAS;aACX,GAAG,CAAkB,CAAC,SAA+B,EAAE,KAAa,MACnE,KAAC,CAAA,aAAA,CAAA,uBAAuB,IAAC,GAAG,EAAE,CAAO,IAAA,EAAA,KAAK,CAAE,CAAA,EAAE,KAAK,EAAE,SAAS,EAAI,CAAA,CACnE,CAAC;AACD,aAAA,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAC7C,EACH;AACH,KAAA;AAED,IAAA,OAAO,IAAI,CAAC;AACd,CAAC;AAMD,SAAS,qBAAqB,CAAC,KAA0B,EAAA;IACvD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtE,IAAI,CAAC,KAAK,EAAE;AACV,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AACD,IAAA,OAAO,oBAAC,YAAY,EAAA,EAAC,KAAK,EAAE,KAAK,GAAI,CAAC;AACxC;;;;"}
File without changes
@@ -0,0 +1,43 @@
1
+ import React, { useState } from 'react';
2
+ import { Button } from './Button.js';
3
+ import { killEvent } from './utils/dom.js';
4
+
5
+ function Dialog(props) {
6
+ const [x, setX] = useState(100);
7
+ const [y, setY] = useState(100);
8
+ if (!props.visible) {
9
+ return null;
10
+ }
11
+ function handleMouseDown(downEvent) {
12
+ killEvent(downEvent);
13
+ const dragX = downEvent.clientX - x;
14
+ const dragY = downEvent.clientY - y;
15
+ function handleMouseMove(moveEvent) {
16
+ killEvent(moveEvent);
17
+ setX(moveEvent.clientX - dragX);
18
+ setY(moveEvent.clientY - dragY);
19
+ }
20
+ function handleMouseUp(upEvent) {
21
+ killEvent(upEvent);
22
+ document.removeEventListener('mouseup', handleMouseUp, true);
23
+ document.removeEventListener('mousemove', handleMouseMove, true);
24
+ }
25
+ document.addEventListener('mouseup', handleMouseUp, true);
26
+ document.addEventListener('mousemove', handleMouseMove, true);
27
+ }
28
+ return (React.createElement(React.Fragment, null,
29
+ React.createElement("div", { className: "modal-dialog-bg" }),
30
+ React.createElement("div", { className: "modal-dialog", "data-testid": "dialog", tabIndex: 0, style: { left: x + 'px', top: y + 'px' } },
31
+ React.createElement("div", { className: "modal-dialog-title", onMouseDown: (e) => handleMouseDown(e) },
32
+ React.createElement("span", { className: "modal-dialog-title-text" }, props.title),
33
+ React.createElement("span", { className: "modal-dialog-title-close", tabIndex: 0, onClick: props.onCancel },
34
+ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" },
35
+ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" })))),
36
+ React.createElement("div", { className: "modal-dialog-content" }, props.children),
37
+ React.createElement("div", { className: "modal-dialog-buttons" },
38
+ React.createElement(Button, { testid: "dialog-ok", onClick: props.onOk }, "OK"),
39
+ React.createElement(Button, { testid: "dialog-cancel", onClick: props.onCancel }, "Cancel")))));
40
+ }
41
+
42
+ export { Dialog };
43
+ //# sourceMappingURL=Dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.js","sources":["../../src/Dialog.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Button } from './Button';\nimport { killEvent } from './utils/dom';\nimport './Dialog.css';\n\nexport interface DialogProps {\n visible: boolean;\n title: string;\n children?: React.ReactNode;\n onOk: () => void;\n onCancel: () => void;\n}\n\nexport function Dialog(props: DialogProps): JSX.Element | null {\n const [x, setX] = useState(100);\n const [y, setY] = useState(100);\n\n if (!props.visible) {\n return null;\n }\n\n function handleMouseDown(downEvent: React.MouseEvent): void {\n killEvent(downEvent);\n\n const dragX = downEvent.clientX - x;\n const dragY = downEvent.clientY - y;\n\n function handleMouseMove(moveEvent: MouseEvent): void {\n killEvent(moveEvent);\n setX(moveEvent.clientX - dragX);\n setY(moveEvent.clientY - dragY);\n }\n\n function handleMouseUp(upEvent: MouseEvent): void {\n killEvent(upEvent);\n document.removeEventListener('mouseup', handleMouseUp, true);\n document.removeEventListener('mousemove', handleMouseMove, true);\n }\n\n document.addEventListener('mouseup', handleMouseUp, true);\n document.addEventListener('mousemove', handleMouseMove, true);\n }\n\n return (\n <>\n <div className=\"modal-dialog-bg\"></div>\n <div className=\"modal-dialog\" data-testid=\"dialog\" tabIndex={0} style={{ left: x + 'px', top: y + 'px' }}>\n <div className=\"modal-dialog-title\" onMouseDown={(e) => handleMouseDown(e)}>\n <span className=\"modal-dialog-title-text\">{props.title}</span>\n <span className=\"modal-dialog-title-close\" tabIndex={0} onClick={props.onCancel}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </span>\n </div>\n <div className=\"modal-dialog-content\">{props.children}</div>\n <div className=\"modal-dialog-buttons\">\n <Button testid=\"dialog-ok\" onClick={props.onOk}>\n OK\n </Button>\n <Button testid=\"dialog-cancel\" onClick={props.onCancel}>\n Cancel\n </Button>\n </div>\n </div>\n </>\n );\n}\n"],"names":[],"mappings":";;;;AAaM,SAAU,MAAM,CAAC,KAAkB,EAAA;IACvC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,QAAQ,CAAC,G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ACL,EACH;AACJ;;;;"}
File without changes
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+
3
+ function Document(props) {
4
+ return (React.createElement("main", { className: "medplum-document" },
5
+ React.createElement("article", { style: { maxWidth: props.width } }, props.children)));
6
+ }
7
+
8
+ export { Document };
9
+ //# sourceMappingURL=Document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Document.js","sources":["../../src/Document.tsx"],"sourcesContent":["import React from 'react';\nimport './Document.css';\n\nexport interface DocumentProps {\n width?: number;\n children?: React.ReactNode;\n}\n\nexport function Document(props: DocumentProps): JSX.Element {\n return (\n <main className=\"medplum-document\">\n <article style={{ maxWidth: props.width }}>{props.children}</article>\n </main>\n );\n}\n"],"names":[],"mappings":";;AAQM,SAAU,QAAQ,CAAC,KAAoB,EAAA;AAC3C,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,kBAAkB,EAAA;AAChC,QAAA,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAS,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,EAAE,EAAA,EAAG,KAAK,CAAC,QAAQ,CAAW,CAChE,EACP;AACJ;;;;"}
File without changes
@@ -0,0 +1,47 @@
1
+ import { getReferenceString, createReference } from '@medplum/core';
2
+ import React from 'react';
3
+ import { ResourceTimeline } from './ResourceTimeline.js';
4
+
5
+ function EncounterTimeline(props) {
6
+ return (React.createElement(ResourceTimeline, { value: props.encounter, buildSearchRequests: (resource) => ({
7
+ resourceType: 'Bundle',
8
+ type: 'batch',
9
+ entry: [
10
+ {
11
+ request: {
12
+ method: 'GET',
13
+ url: `${getReferenceString(resource)}/_history`,
14
+ },
15
+ },
16
+ {
17
+ request: {
18
+ method: 'GET',
19
+ url: `Communication?encounter=${getReferenceString(resource)}`,
20
+ },
21
+ },
22
+ {
23
+ request: {
24
+ method: 'GET',
25
+ url: `Media?encounter=${getReferenceString(resource)}`,
26
+ },
27
+ },
28
+ ],
29
+ }), createCommunication: (resource, sender, text) => ({
30
+ resourceType: 'Communication',
31
+ encounter: createReference(resource),
32
+ subject: resource.subject,
33
+ sender: createReference(sender),
34
+ sent: new Date().toISOString(),
35
+ payload: [{ contentString: text }],
36
+ }), createMedia: (resource, operator, content) => ({
37
+ resourceType: 'Media',
38
+ encounter: createReference(resource),
39
+ subject: resource.subject,
40
+ operator: createReference(operator),
41
+ issued: new Date().toISOString(),
42
+ content,
43
+ }) }));
44
+ }
45
+
46
+ export { EncounterTimeline };
47
+ //# sourceMappingURL=EncounterTimeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EncounterTimeline.js","sources":["../../src/EncounterTimeline.tsx"],"sourcesContent":["import { createReference, getReferenceString, ProfileResource } from '@medplum/core';\nimport { Attachment, Encounter, Reference, Resource } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { ResourceTimeline } from './ResourceTimeline';\n\nexport interface EncounterTimelineProps {\n encounter: Encounter | Reference<Encounter>;\n}\n\nexport function EncounterTimeline(props: EncounterTimelineProps): JSX.Element {\n return (\n <ResourceTimeline\n value={props.encounter}\n buildSearchRequests={(resource: Resource) => ({\n resourceType: 'Bundle',\n type: 'batch',\n entry: [\n {\n request: {\n method: 'GET',\n url: `${getReferenceString(resource)}/_history`,\n },\n },\n {\n request: {\n method: 'GET',\n url: `Communication?encounter=${getReferenceString(resource)}`,\n },\n },\n {\n request: {\n method: 'GET',\n url: `Media?encounter=${getReferenceString(resource)}`,\n },\n },\n ],\n })}\n createCommunication={(resource: Encounter, sender: ProfileResource, text: string) => ({\n resourceType: 'Communication',\n encounter: createReference(resource),\n subject: resource.subject,\n sender: createReference(sender),\n sent: new Date().toISOString(),\n payload: [{ contentString: text }],\n })}\n createMedia={(resource: Encounter, operator: ProfileResource, content: Attachment) => ({\n resourceType: 'Media',\n encounter: createReference(resource),\n subject: resource.subject,\n operator: createReference(operator),\n issued: new Date().toISOString(),\n content,\n })}\n />\n );\n}\n"],"names":[],"mappings":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,EAAE,OAAmB,MAAM;AACrF,YAAA,YAAY,EAAE,OAAO;AACrB,YAAA,SAAS,EAAE,eAAe,CAAC,QAAQ,CAAC;YACpC,OAAO,EAAE,QAAQ,CAAC,OAAO;AACzB,YAAA,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAAC;AACnC,YAAA,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YAChC,OAAO;SACR,CAAC,EAAA,CACF,EACF;AACJ;;;;"}
File without changes
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ * ErrorBoundary is a React component that handles errors in its child components.
5
+ * See: https://reactjs.org/docs/error-boundaries.html
6
+ */
7
+ class ErrorBoundary extends React.Component {
8
+ constructor(props) {
9
+ super(props);
10
+ this.state = {};
11
+ }
12
+ static getDerivedStateFromError(error) {
13
+ return { error };
14
+ }
15
+ componentDidCatch(error, errorInfo) {
16
+ console.error('Uncaught error:', error, errorInfo);
17
+ }
18
+ render() {
19
+ if (this.state.error) {
20
+ return React.createElement("h1", null, "Something went wrong.");
21
+ }
22
+ return this.props.children;
23
+ }
24
+ }
25
+
26
+ export { ErrorBoundary };
27
+ //# sourceMappingURL=ErrorBoundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorBoundary.js","sources":["../../src/ErrorBoundary.tsx"],"sourcesContent":["import React, { ErrorInfo, ReactNode } from 'react';\n\nexport interface ErrorBoundaryProps {\n children: ReactNode;\n}\n\nexport interface ErrorBoundaryState {\n error?: any;\n}\n\n/**\n * ErrorBoundary is a React component that handles errors in its child components.\n * See: https://reactjs.org/docs/error-boundaries.html\n */\nexport class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {\n state: ErrorBoundaryState;\n\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = {};\n }\n\n static getDerivedStateFromError(error: any): ErrorBoundaryState {\n return { error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n console.error('Uncaught error:', error, errorInfo);\n }\n\n render(): ReactNode {\n if (this.state.error) {\n return <h1>Something went wrong.</h1>;\n }\n\n return this.props.children;\n }\n}\n"],"names":[],"mappings":";;AAUA;;;AAGG;AACU,MAAA,aAAc,SAAQ,KAAK,CAAC,SAAiD,CAAA;AAGxF,IAAA,WAAA,CAAY,KAAyB,EAAA;QACnC,KAAK,CAAC,KAAK,CAAC,CAAC;AACb,QAAA,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;KACjB;IAED,OAAO,wBAAwB,CAAC,KAAU,EAAA;QACxC,OAAO,EAAE,KAAK,EAAE,CAAC;KAClB;IAED,iBAAiB,CAAC,KAAY,EAAE,SAAoB,EAAA;QAClD,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;KACpD;IAED,MAAM,GAAA;AACJ,QAAA,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;AACpB,YAAA,OAAO,wDAA8B,CAAC;AACvC,SAAA;AAED,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;KAC5B;AACF;;;;"}
File without changes
@@ -0,0 +1,14 @@
1
+ import { stringify } from '@medplum/core';
2
+ import React from 'react';
3
+ import { TextArea } from './TextArea.js';
4
+
5
+ function ExtensionInput(props) {
6
+ return (React.createElement(TextArea, { testid: "extension-input", name: props.name, defaultValue: stringify(props.defaultValue), monospace: true, onChange: (newValue) => {
7
+ if (props.onChange) {
8
+ props.onChange(JSON.parse(newValue));
9
+ }
10
+ } }));
11
+ }
12
+
13
+ export { ExtensionInput };
14
+ //# sourceMappingURL=ExtensionInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtensionInput.js","sources":["../../src/ExtensionInput.tsx"],"sourcesContent":["import { stringify } from '@medplum/core';\nimport { Extension } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { TextArea } from './TextArea';\n\nexport interface ExtensionInputProps {\n name: string;\n defaultValue?: Extension;\n onChange?: (value: Extension) => void;\n}\n\nexport function ExtensionInput(props: ExtensionInputProps): JSX.Element {\n return (\n <TextArea\n testid=\"extension-input\"\n name={props.name}\n defaultValue={stringify(props.defaultValue)}\n monospace={true}\n onChange={(newValue: string) => {\n if (props.onChange) {\n props.onChange(JSON.parse(newValue));\n }\n }}\n />\n );\n}\n"],"names":[],"mappings":";;;;AAWM,SAAU,cAAc,CAAC,KAA0B,EAAA;AACvD,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,QAAQ,EAAA,EACP,MAAM,EAAC,iBAAiB,EACxB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,YAAY,EAAE,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,EAC3C,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,CAAC,QAAgB,KAAI;YAC7B,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtC,aAAA;SACF,EAAA,CACD,EACF;AACJ;;;;"}
File without changes