@medplum/react 1.0.4 → 1.0.6

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 (379) hide show
  1. package/README.md +2 -1
  2. package/dist/cjs/AsyncAutocomplete/AsyncAutocomplete.d.ts +14 -0
  3. package/dist/cjs/DiagnosticReportDisplay/DiagnosticReportDisplay.stories.d.ts +1 -0
  4. package/dist/cjs/FhirPathTable/FhirPathTable.d.ts +2 -2
  5. package/dist/cjs/MoneyDisplay/MoneyDisplay.d.ts +6 -0
  6. package/dist/cjs/MoneyInput/MoneyInput.d.ts +10 -0
  7. package/dist/cjs/MoneyInput/MoneyInput.stories.d.ts +6 -0
  8. package/dist/cjs/ValueSetAutocomplete/ValueSetAutocomplete.d.ts +3 -6
  9. package/dist/cjs/auth/ChooseProfileForm.d.ts +2 -1
  10. package/dist/cjs/auth/ChooseScopeForm.d.ts +2 -1
  11. package/dist/cjs/auth/MfaForm.d.ts +7 -0
  12. package/dist/cjs/auth/SignInForm.d.ts +10 -0
  13. package/dist/cjs/{index.js → index.cjs} +860 -642
  14. package/dist/cjs/index.cjs.map +1 -0
  15. package/dist/cjs/index.d.ts +3 -0
  16. package/dist/cjs/index.min.cjs +1 -0
  17. package/dist/cjs/stories/referenceLab.d.ts +3 -1
  18. package/dist/esm/AddressDisplay/{AddressDisplay.js → AddressDisplay.mjs} +1 -1
  19. package/dist/esm/AddressDisplay/AddressDisplay.mjs.map +1 -0
  20. package/dist/esm/AddressInput/{AddressInput.js → AddressInput.mjs} +9 -9
  21. package/dist/esm/AddressInput/AddressInput.mjs.map +1 -0
  22. package/dist/esm/AnnotationInput/{AnnotationInput.js → AnnotationInput.mjs} +2 -2
  23. package/dist/esm/AnnotationInput/AnnotationInput.mjs.map +1 -0
  24. package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.d.ts +14 -0
  25. package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs +113 -0
  26. package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs.map +1 -0
  27. package/dist/esm/AttachmentArrayDisplay/{AttachmentArrayDisplay.js → AttachmentArrayDisplay.mjs} +2 -2
  28. package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs.map +1 -0
  29. package/dist/esm/AttachmentArrayInput/{AttachmentArrayInput.js → AttachmentArrayInput.mjs} +6 -7
  30. package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs.map +1 -0
  31. package/dist/esm/AttachmentButton/{AttachmentButton.js → AttachmentButton.mjs} +5 -7
  32. package/dist/esm/AttachmentButton/AttachmentButton.mjs.map +1 -0
  33. package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs +21 -0
  34. package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs.map +1 -0
  35. package/dist/esm/AttachmentInput/{AttachmentInput.js → AttachmentInput.mjs} +5 -5
  36. package/dist/esm/AttachmentInput/AttachmentInput.mjs.map +1 -0
  37. package/dist/esm/BackboneElementDisplay/{BackboneElementDisplay.js → BackboneElementDisplay.mjs} +4 -4
  38. package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs.map +1 -0
  39. package/dist/esm/BackboneElementInput/{BackboneElementInput.js → BackboneElementInput.mjs} +10 -11
  40. package/dist/esm/BackboneElementInput/BackboneElementInput.mjs.map +1 -0
  41. package/dist/esm/CalendarInput/{CalendarInput.js → CalendarInput.mjs} +1 -1
  42. package/dist/esm/CalendarInput/CalendarInput.mjs.map +1 -0
  43. package/dist/esm/CheckboxFormSection/{CheckboxFormSection.js → CheckboxFormSection.mjs} +1 -1
  44. package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs.map +1 -0
  45. package/dist/esm/CodeInput/{CodeInput.js → CodeInput.mjs} +6 -5
  46. package/dist/esm/CodeInput/CodeInput.mjs.map +1 -0
  47. package/dist/esm/CodeableConceptDisplay/{CodeableConceptDisplay.js → CodeableConceptDisplay.mjs} +1 -1
  48. package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs.map +1 -0
  49. package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs +36 -0
  50. package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs.map +1 -0
  51. package/dist/esm/CodingDisplay/{CodingDisplay.js → CodingDisplay.mjs} +1 -1
  52. package/dist/esm/CodingDisplay/CodingDisplay.mjs.map +1 -0
  53. package/dist/esm/CodingInput/{CodingInput.js → CodingInput.mjs} +5 -4
  54. package/dist/esm/CodingInput/CodingInput.mjs.map +1 -0
  55. package/dist/esm/ContactDetailDisplay/{ContactDetailDisplay.js → ContactDetailDisplay.mjs} +4 -5
  56. package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs.map +1 -0
  57. package/dist/esm/ContactDetailInput/{ContactDetailInput.js → ContactDetailInput.mjs} +6 -7
  58. package/dist/esm/ContactDetailInput/ContactDetailInput.mjs.map +1 -0
  59. package/dist/esm/ContactPointDisplay/{ContactPointDisplay.js → ContactPointDisplay.mjs} +1 -1
  60. package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs.map +1 -0
  61. package/dist/esm/ContactPointInput/{ContactPointInput.js → ContactPointInput.mjs} +7 -7
  62. package/dist/esm/ContactPointInput/ContactPointInput.mjs.map +1 -0
  63. package/dist/esm/Container/{Container.js → Container.mjs} +3 -4
  64. package/dist/esm/Container/Container.mjs.map +1 -0
  65. package/dist/esm/DateTimeInput/{DateTimeInput.js → DateTimeInput.mjs} +2 -2
  66. package/dist/esm/DateTimeInput/DateTimeInput.mjs.map +1 -0
  67. package/dist/esm/DefaultResourceTimeline/{DefaultResourceTimeline.js → DefaultResourceTimeline.mjs} +2 -2
  68. package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs.map +1 -0
  69. package/dist/esm/DescriptionList/{DescriptionList.js → DescriptionList.mjs} +1 -1
  70. package/dist/esm/DescriptionList/DescriptionList.mjs.map +1 -0
  71. package/dist/esm/DiagnosticReportDisplay/{DiagnosticReportDisplay.js → DiagnosticReportDisplay.mjs} +19 -16
  72. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs.map +1 -0
  73. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.stories.d.ts +1 -0
  74. package/dist/esm/Document/Document.mjs +12 -0
  75. package/dist/esm/Document/Document.mjs.map +1 -0
  76. package/dist/esm/EncounterTimeline/{EncounterTimeline.js → EncounterTimeline.mjs} +2 -2
  77. package/dist/esm/EncounterTimeline/EncounterTimeline.mjs.map +1 -0
  78. package/dist/esm/ErrorBoundary/{ErrorBoundary.js → ErrorBoundary.mjs} +1 -1
  79. package/dist/esm/ErrorBoundary/ErrorBoundary.mjs.map +1 -0
  80. package/dist/esm/ExtensionInput/{ExtensionInput.js → ExtensionInput.mjs} +1 -1
  81. package/dist/esm/ExtensionInput/ExtensionInput.mjs.map +1 -0
  82. package/dist/esm/FhirPathDisplay/{FhirPathDisplay.js → FhirPathDisplay.mjs} +2 -2
  83. package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs.map +1 -0
  84. package/dist/esm/FhirPathTable/FhirPathTable.d.ts +2 -2
  85. package/dist/esm/FhirPathTable/{FhirPathTable.js → FhirPathTable.mjs} +14 -17
  86. package/dist/esm/FhirPathTable/FhirPathTable.mjs.map +1 -0
  87. package/dist/esm/Form/{Form.js → Form.mjs} +2 -2
  88. package/dist/esm/Form/Form.mjs.map +1 -0
  89. package/dist/esm/Form/{FormUtils.js → FormUtils.mjs} +1 -1
  90. package/dist/esm/Form/FormUtils.mjs.map +1 -0
  91. package/dist/esm/FormSection/{FormSection.js → FormSection.mjs} +2 -2
  92. package/dist/esm/FormSection/FormSection.mjs.map +1 -0
  93. package/dist/esm/GoogleButton/{GoogleButton.js → GoogleButton.mjs} +4 -5
  94. package/dist/esm/GoogleButton/GoogleButton.mjs.map +1 -0
  95. package/dist/esm/HumanNameDisplay/{HumanNameDisplay.js → HumanNameDisplay.mjs} +1 -1
  96. package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs.map +1 -0
  97. package/dist/esm/HumanNameInput/HumanNameInput.mjs +50 -0
  98. package/dist/esm/HumanNameInput/HumanNameInput.mjs.map +1 -0
  99. package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs +11 -0
  100. package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs.map +1 -0
  101. package/dist/esm/IdentifierInput/{IdentifierInput.js → IdentifierInput.mjs} +3 -3
  102. package/dist/esm/IdentifierInput/IdentifierInput.mjs.map +1 -0
  103. package/dist/esm/Logo/{Logo.js → Logo.mjs} +1 -1
  104. package/dist/esm/Logo/Logo.mjs.map +1 -0
  105. package/dist/esm/MedplumLink/{MedplumLink.js → MedplumLink.mjs} +5 -6
  106. package/dist/esm/MedplumLink/MedplumLink.mjs.map +1 -0
  107. package/dist/esm/MedplumProvider/{MedplumProvider.js → MedplumProvider.mjs} +9 -3
  108. package/dist/esm/MedplumProvider/MedplumProvider.mjs.map +1 -0
  109. package/dist/esm/MoneyDisplay/MoneyDisplay.d.ts +6 -0
  110. package/dist/esm/MoneyDisplay/MoneyDisplay.mjs +9 -0
  111. package/dist/esm/MoneyDisplay/MoneyDisplay.mjs.map +1 -0
  112. package/dist/esm/MoneyInput/MoneyInput.d.ts +10 -0
  113. package/dist/esm/MoneyInput/MoneyInput.mjs +53 -0
  114. package/dist/esm/MoneyInput/MoneyInput.mjs.map +1 -0
  115. package/dist/esm/MoneyInput/MoneyInput.stories.d.ts +6 -0
  116. package/dist/esm/Panel/{Panel.js → Panel.mjs} +3 -4
  117. package/dist/esm/Panel/Panel.mjs.map +1 -0
  118. package/dist/esm/PatientTimeline/{PatientTimeline.js → PatientTimeline.mjs} +2 -2
  119. package/dist/esm/PatientTimeline/PatientTimeline.mjs.map +1 -0
  120. package/dist/esm/PeriodInput/{PeriodInput.js → PeriodInput.mjs} +4 -4
  121. package/dist/esm/PeriodInput/PeriodInput.mjs.map +1 -0
  122. package/dist/esm/PlanDefinitionBuilder/{PlanDefinitionBuilder.js → PlanDefinitionBuilder.mjs} +36 -24
  123. package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs.map +1 -0
  124. package/dist/esm/QuantityDisplay/{QuantityDisplay.js → QuantityDisplay.mjs} +1 -1
  125. package/dist/esm/QuantityDisplay/QuantityDisplay.mjs.map +1 -0
  126. package/dist/esm/QuantityInput/{QuantityInput.js → QuantityInput.mjs} +13 -5
  127. package/dist/esm/QuantityInput/QuantityInput.mjs.map +1 -0
  128. package/dist/esm/QuestionnaireBuilder/{QuestionnaireBuilder.js → QuestionnaireBuilder.mjs} +45 -27
  129. package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs.map +1 -0
  130. package/dist/esm/QuestionnaireForm/{QuestionnaireForm.js → QuestionnaireForm.mjs} +37 -36
  131. package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs.map +1 -0
  132. package/dist/esm/RangeDisplay/{RangeDisplay.js → RangeDisplay.mjs} +1 -1
  133. package/dist/esm/RangeDisplay/RangeDisplay.mjs.map +1 -0
  134. package/dist/esm/RangeInput/{RangeInput.js → RangeInput.mjs} +10 -4
  135. package/dist/esm/RangeInput/RangeInput.mjs.map +1 -0
  136. package/dist/esm/RatioDisplay/{RatioDisplay.js → RatioDisplay.mjs} +2 -2
  137. package/dist/esm/RatioDisplay/RatioDisplay.mjs.map +1 -0
  138. package/dist/esm/RatioInput/{RatioInput.js → RatioInput.mjs} +10 -4
  139. package/dist/esm/RatioInput/RatioInput.mjs.map +1 -0
  140. package/dist/esm/ReferenceDisplay/{ReferenceDisplay.js → ReferenceDisplay.mjs} +2 -2
  141. package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs.map +1 -0
  142. package/dist/esm/ReferenceInput/{ReferenceInput.js → ReferenceInput.mjs} +10 -5
  143. package/dist/esm/ReferenceInput/ReferenceInput.mjs.map +1 -0
  144. package/dist/esm/ReferenceRangeEditor/{ReferenceRangeEditor.js → ReferenceRangeEditor.mjs} +44 -38
  145. package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs.map +1 -0
  146. package/dist/esm/RequestGroupDisplay/{RequestGroupDisplay.js → RequestGroupDisplay.mjs} +14 -17
  147. package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs.map +1 -0
  148. package/dist/esm/ResourceArrayDisplay/{ResourceArrayDisplay.js → ResourceArrayDisplay.mjs} +4 -5
  149. package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs.map +1 -0
  150. package/dist/esm/ResourceArrayInput/{ResourceArrayInput.js → ResourceArrayInput.mjs} +3 -3
  151. package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs.map +1 -0
  152. package/dist/esm/ResourceAvatar/ResourceAvatar.mjs +23 -0
  153. package/dist/esm/ResourceAvatar/ResourceAvatar.mjs.map +1 -0
  154. package/dist/esm/ResourceBadge/{ResourceBadge.js → ResourceBadge.mjs} +3 -3
  155. package/dist/esm/ResourceBadge/ResourceBadge.mjs.map +1 -0
  156. package/dist/esm/ResourceBlame/{ResourceBlame.js → ResourceBlame.mjs} +6 -7
  157. package/dist/esm/ResourceBlame/ResourceBlame.mjs.map +1 -0
  158. package/dist/esm/ResourceDiff/{ResourceDiff.js → ResourceDiff.mjs} +4 -4
  159. package/dist/esm/ResourceDiff/ResourceDiff.mjs.map +1 -0
  160. package/dist/esm/ResourceDiffTable/{ResourceDiffTable.js → ResourceDiffTable.mjs} +3 -3
  161. package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs.map +1 -0
  162. package/dist/esm/ResourceForm/{ResourceForm.js → ResourceForm.mjs} +5 -5
  163. package/dist/esm/ResourceForm/ResourceForm.mjs.map +1 -0
  164. package/dist/esm/ResourceHistoryTable/{ResourceHistoryTable.js → ResourceHistoryTable.mjs} +10 -13
  165. package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs.map +1 -0
  166. package/dist/esm/ResourceInput/{ResourceInput.js → ResourceInput.mjs} +19 -25
  167. package/dist/esm/ResourceInput/ResourceInput.mjs.map +1 -0
  168. package/dist/esm/ResourceName/ResourceName.mjs +18 -0
  169. package/dist/esm/ResourceName/ResourceName.mjs.map +1 -0
  170. package/dist/esm/ResourcePropertyDisplay/{ResourcePropertyDisplay.js → ResourcePropertyDisplay.mjs} +23 -21
  171. package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs.map +1 -0
  172. package/dist/esm/ResourcePropertyInput/{ResourcePropertyInput.js → ResourcePropertyInput.mjs} +34 -34
  173. package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs.map +1 -0
  174. package/dist/esm/ResourceTable/{ResourceTable.js → ResourceTable.mjs} +4 -4
  175. package/dist/esm/ResourceTable/ResourceTable.mjs.map +1 -0
  176. package/dist/esm/ResourceTimeline/{ResourceTimeline.js → ResourceTimeline.mjs} +26 -30
  177. package/dist/esm/ResourceTimeline/ResourceTimeline.mjs.map +1 -0
  178. package/dist/esm/Scheduler/{Scheduler.js → Scheduler.mjs} +8 -9
  179. package/dist/esm/Scheduler/Scheduler.mjs.map +1 -0
  180. package/dist/esm/SearchControl/{SearchControl.js → SearchControl.mjs} +66 -50
  181. package/dist/esm/SearchControl/SearchControl.mjs.map +1 -0
  182. package/dist/esm/SearchControl/{SearchControlField.js → SearchControlField.mjs} +3 -4
  183. package/dist/esm/SearchControl/SearchControlField.mjs.map +1 -0
  184. package/dist/esm/SearchControl/{SearchUtils.js → SearchUtils.mjs} +34 -17
  185. package/dist/esm/SearchControl/SearchUtils.mjs.map +1 -0
  186. package/dist/esm/SearchFieldEditor/{SearchFieldEditor.js → SearchFieldEditor.mjs} +28 -21
  187. package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs.map +1 -0
  188. package/dist/esm/SearchFilterEditor/{SearchFilterEditor.js → SearchFilterEditor.mjs} +8 -9
  189. package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs.map +1 -0
  190. package/dist/esm/SearchFilterValueDialog/{SearchFilterValueDialog.js → SearchFilterValueDialog.mjs} +5 -6
  191. package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs.map +1 -0
  192. package/dist/esm/SearchFilterValueDisplay/{SearchFilterValueDisplay.js → SearchFilterValueDisplay.mjs} +3 -4
  193. package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs.map +1 -0
  194. package/dist/esm/SearchFilterValueInput/{SearchFilterValueInput.js → SearchFilterValueInput.mjs} +5 -6
  195. package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs.map +1 -0
  196. package/dist/esm/SearchPopupMenu/{SearchPopupMenu.js → SearchPopupMenu.mjs} +10 -10
  197. package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs.map +1 -0
  198. package/dist/esm/ServiceRequestTimeline/{ServiceRequestTimeline.js → ServiceRequestTimeline.mjs} +2 -2
  199. package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs.map +1 -0
  200. package/dist/esm/StatusBadge/{StatusBadge.js → StatusBadge.mjs} +3 -2
  201. package/dist/esm/StatusBadge/StatusBadge.mjs.map +1 -0
  202. package/dist/esm/Timeline/{Timeline.js → Timeline.mjs} +11 -13
  203. package/dist/esm/Timeline/Timeline.mjs.map +1 -0
  204. package/dist/esm/TimingInput/{TimingInput.js → TimingInput.mjs} +13 -18
  205. package/dist/esm/TimingInput/TimingInput.mjs.map +1 -0
  206. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.d.ts +3 -6
  207. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs +43 -0
  208. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs.map +1 -0
  209. package/dist/esm/auth/{AuthenticationForm.js → AuthenticationForm.mjs} +21 -19
  210. package/dist/esm/auth/AuthenticationForm.mjs.map +1 -0
  211. package/dist/esm/auth/ChooseProfileForm.d.ts +2 -1
  212. package/dist/esm/auth/ChooseProfileForm.mjs +29 -0
  213. package/dist/esm/auth/ChooseProfileForm.mjs.map +1 -0
  214. package/dist/esm/auth/ChooseScopeForm.d.ts +2 -1
  215. package/dist/esm/auth/{ChooseScopeForm.js → ChooseScopeForm.mjs} +4 -4
  216. package/dist/esm/auth/ChooseScopeForm.mjs.map +1 -0
  217. package/dist/esm/auth/MfaForm.d.ts +7 -0
  218. package/dist/esm/auth/MfaForm.mjs +34 -0
  219. package/dist/esm/auth/MfaForm.mjs.map +1 -0
  220. package/dist/esm/auth/{NewProjectForm.js → NewProjectForm.mjs} +8 -9
  221. package/dist/esm/auth/NewProjectForm.mjs.map +1 -0
  222. package/dist/esm/auth/{NewUserForm.js → NewUserForm.mjs} +15 -19
  223. package/dist/esm/auth/NewUserForm.mjs.map +1 -0
  224. package/dist/esm/auth/{RegisterForm.js → RegisterForm.mjs} +5 -5
  225. package/dist/esm/auth/RegisterForm.mjs.map +1 -0
  226. package/dist/esm/auth/SignInForm.d.ts +10 -0
  227. package/dist/esm/auth/{SignInForm.js → SignInForm.mjs} +25 -10
  228. package/dist/esm/auth/SignInForm.mjs.map +1 -0
  229. package/dist/esm/{constants.js → constants.mjs} +1 -1
  230. package/dist/esm/constants.mjs.map +1 -0
  231. package/dist/esm/index.d.ts +3 -0
  232. package/dist/esm/index.min.mjs +1 -0
  233. package/dist/esm/{index.js → index.mjs} +88 -85
  234. package/dist/esm/index.mjs.map +1 -0
  235. package/dist/esm/stories/referenceLab.d.ts +3 -1
  236. package/dist/esm/useResource/{useResource.js → useResource.mjs} +2 -2
  237. package/dist/esm/useResource/useResource.mjs.map +1 -0
  238. package/dist/esm/utils/{blame.js → blame.mjs} +6 -9
  239. package/dist/esm/utils/blame.mjs.map +1 -0
  240. package/dist/esm/utils/{date.js → date.mjs} +2 -3
  241. package/dist/esm/utils/date.mjs.map +1 -0
  242. package/dist/esm/utils/{diff.js → diff.mjs} +1 -1
  243. package/dist/esm/utils/diff.mjs.map +1 -0
  244. package/dist/esm/utils/{dom.js → dom.mjs} +1 -1
  245. package/dist/esm/utils/dom.mjs.map +1 -0
  246. package/dist/esm/utils/outcomes.mjs +30 -0
  247. package/dist/esm/utils/outcomes.mjs.map +1 -0
  248. package/dist/esm/utils/{questionnaire.js → questionnaire.mjs} +1 -1
  249. package/dist/esm/utils/questionnaire.mjs.map +1 -0
  250. package/dist/esm/utils/{recaptcha.js → recaptcha.mjs} +5 -6
  251. package/dist/esm/utils/recaptcha.mjs.map +1 -0
  252. package/dist/esm/utils/{script.js → script.mjs} +1 -1
  253. package/dist/esm/utils/script.mjs.map +1 -0
  254. package/package.json +22 -22
  255. package/rollup.config.mjs +6 -7
  256. package/dist/cjs/index.js.map +0 -1
  257. package/dist/cjs/index.min.js +0 -2
  258. package/dist/cjs/index.min.js.map +0 -1
  259. package/dist/esm/AddressDisplay/AddressDisplay.js.map +0 -1
  260. package/dist/esm/AddressInput/AddressInput.js.map +0 -1
  261. package/dist/esm/AnnotationInput/AnnotationInput.js.map +0 -1
  262. package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.js.map +0 -1
  263. package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.js.map +0 -1
  264. package/dist/esm/AttachmentButton/AttachmentButton.js.map +0 -1
  265. package/dist/esm/AttachmentDisplay/AttachmentDisplay.js +0 -21
  266. package/dist/esm/AttachmentDisplay/AttachmentDisplay.js.map +0 -1
  267. package/dist/esm/AttachmentInput/AttachmentInput.js.map +0 -1
  268. package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.js.map +0 -1
  269. package/dist/esm/BackboneElementInput/BackboneElementInput.js.map +0 -1
  270. package/dist/esm/CalendarInput/CalendarInput.js.map +0 -1
  271. package/dist/esm/CheckboxFormSection/CheckboxFormSection.js.map +0 -1
  272. package/dist/esm/CodeInput/CodeInput.js.map +0 -1
  273. package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.js.map +0 -1
  274. package/dist/esm/CodeableConceptInput/CodeableConceptInput.js +0 -37
  275. package/dist/esm/CodeableConceptInput/CodeableConceptInput.js.map +0 -1
  276. package/dist/esm/CodingDisplay/CodingDisplay.js.map +0 -1
  277. package/dist/esm/CodingInput/CodingInput.js.map +0 -1
  278. package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.js.map +0 -1
  279. package/dist/esm/ContactDetailInput/ContactDetailInput.js.map +0 -1
  280. package/dist/esm/ContactPointDisplay/ContactPointDisplay.js.map +0 -1
  281. package/dist/esm/ContactPointInput/ContactPointInput.js.map +0 -1
  282. package/dist/esm/Container/Container.js.map +0 -1
  283. package/dist/esm/DateTimeInput/DateTimeInput.js.map +0 -1
  284. package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.js.map +0 -1
  285. package/dist/esm/DescriptionList/DescriptionList.js.map +0 -1
  286. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.js.map +0 -1
  287. package/dist/esm/Document/Document.js +0 -13
  288. package/dist/esm/Document/Document.js.map +0 -1
  289. package/dist/esm/EncounterTimeline/EncounterTimeline.js.map +0 -1
  290. package/dist/esm/ErrorBoundary/ErrorBoundary.js.map +0 -1
  291. package/dist/esm/ExtensionInput/ExtensionInput.js.map +0 -1
  292. package/dist/esm/FhirPathDisplay/FhirPathDisplay.js.map +0 -1
  293. package/dist/esm/FhirPathTable/FhirPathTable.js.map +0 -1
  294. package/dist/esm/Form/Form.js.map +0 -1
  295. package/dist/esm/Form/FormUtils.js.map +0 -1
  296. package/dist/esm/FormSection/FormSection.js.map +0 -1
  297. package/dist/esm/GoogleButton/GoogleButton.js.map +0 -1
  298. package/dist/esm/HumanNameDisplay/HumanNameDisplay.js.map +0 -1
  299. package/dist/esm/HumanNameInput/HumanNameInput.js +0 -39
  300. package/dist/esm/HumanNameInput/HumanNameInput.js.map +0 -1
  301. package/dist/esm/IdentifierDisplay/IdentifierDisplay.js +0 -12
  302. package/dist/esm/IdentifierDisplay/IdentifierDisplay.js.map +0 -1
  303. package/dist/esm/IdentifierInput/IdentifierInput.js.map +0 -1
  304. package/dist/esm/Logo/Logo.js.map +0 -1
  305. package/dist/esm/MedplumLink/MedplumLink.js.map +0 -1
  306. package/dist/esm/MedplumProvider/MedplumProvider.js.map +0 -1
  307. package/dist/esm/Panel/Panel.js.map +0 -1
  308. package/dist/esm/PatientTimeline/PatientTimeline.js.map +0 -1
  309. package/dist/esm/PeriodInput/PeriodInput.js.map +0 -1
  310. package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.js.map +0 -1
  311. package/dist/esm/QuantityDisplay/QuantityDisplay.js.map +0 -1
  312. package/dist/esm/QuantityInput/QuantityInput.js.map +0 -1
  313. package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.js.map +0 -1
  314. package/dist/esm/QuestionnaireForm/QuestionnaireForm.js.map +0 -1
  315. package/dist/esm/RangeDisplay/RangeDisplay.js.map +0 -1
  316. package/dist/esm/RangeInput/RangeInput.js.map +0 -1
  317. package/dist/esm/RatioDisplay/RatioDisplay.js.map +0 -1
  318. package/dist/esm/RatioInput/RatioInput.js.map +0 -1
  319. package/dist/esm/ReferenceDisplay/ReferenceDisplay.js.map +0 -1
  320. package/dist/esm/ReferenceInput/ReferenceInput.js.map +0 -1
  321. package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.js.map +0 -1
  322. package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.js.map +0 -1
  323. package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.js.map +0 -1
  324. package/dist/esm/ResourceArrayInput/ResourceArrayInput.js.map +0 -1
  325. package/dist/esm/ResourceAvatar/ResourceAvatar.js +0 -24
  326. package/dist/esm/ResourceAvatar/ResourceAvatar.js.map +0 -1
  327. package/dist/esm/ResourceBadge/ResourceBadge.js.map +0 -1
  328. package/dist/esm/ResourceBlame/ResourceBlame.js.map +0 -1
  329. package/dist/esm/ResourceDiff/ResourceDiff.js.map +0 -1
  330. package/dist/esm/ResourceDiffTable/ResourceDiffTable.js.map +0 -1
  331. package/dist/esm/ResourceForm/ResourceForm.js.map +0 -1
  332. package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.js.map +0 -1
  333. package/dist/esm/ResourceInput/ResourceInput.js.map +0 -1
  334. package/dist/esm/ResourceName/ResourceName.js +0 -19
  335. package/dist/esm/ResourceName/ResourceName.js.map +0 -1
  336. package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.js.map +0 -1
  337. package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.js.map +0 -1
  338. package/dist/esm/ResourceTable/ResourceTable.js.map +0 -1
  339. package/dist/esm/ResourceTimeline/ResourceTimeline.js.map +0 -1
  340. package/dist/esm/Scheduler/Scheduler.js.map +0 -1
  341. package/dist/esm/SearchControl/SearchControl.js.map +0 -1
  342. package/dist/esm/SearchControl/SearchControlField.js.map +0 -1
  343. package/dist/esm/SearchControl/SearchUtils.js.map +0 -1
  344. package/dist/esm/SearchFieldEditor/SearchFieldEditor.js.map +0 -1
  345. package/dist/esm/SearchFilterEditor/SearchFilterEditor.js.map +0 -1
  346. package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.js.map +0 -1
  347. package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.js.map +0 -1
  348. package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.js.map +0 -1
  349. package/dist/esm/SearchPopupMenu/SearchPopupMenu.js.map +0 -1
  350. package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.js.map +0 -1
  351. package/dist/esm/StatusBadge/StatusBadge.js.map +0 -1
  352. package/dist/esm/Timeline/Timeline.js.map +0 -1
  353. package/dist/esm/TimingInput/TimingInput.js.map +0 -1
  354. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js +0 -65
  355. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js.map +0 -1
  356. package/dist/esm/auth/AuthenticationForm.js.map +0 -1
  357. package/dist/esm/auth/ChooseProfileForm.js +0 -32
  358. package/dist/esm/auth/ChooseProfileForm.js.map +0 -1
  359. package/dist/esm/auth/ChooseScopeForm.js.map +0 -1
  360. package/dist/esm/auth/NewProjectForm.js.map +0 -1
  361. package/dist/esm/auth/NewUserForm.js.map +0 -1
  362. package/dist/esm/auth/RegisterForm.js.map +0 -1
  363. package/dist/esm/auth/SignInForm.js.map +0 -1
  364. package/dist/esm/constants.js.map +0 -1
  365. package/dist/esm/index.js.map +0 -1
  366. package/dist/esm/index.min.js +0 -2
  367. package/dist/esm/index.min.js.map +0 -1
  368. package/dist/esm/node_modules/tslib/tslib.es6.js +0 -39
  369. package/dist/esm/node_modules/tslib/tslib.es6.js.map +0 -1
  370. package/dist/esm/useResource/useResource.js.map +0 -1
  371. package/dist/esm/utils/blame.js.map +0 -1
  372. package/dist/esm/utils/date.js.map +0 -1
  373. package/dist/esm/utils/diff.js.map +0 -1
  374. package/dist/esm/utils/dom.js.map +0 -1
  375. package/dist/esm/utils/outcomes.js +0 -29
  376. package/dist/esm/utils/outcomes.js.map +0 -1
  377. package/dist/esm/utils/questionnaire.js.map +0 -1
  378. package/dist/esm/utils/recaptcha.js.map +0 -1
  379. package/dist/esm/utils/script.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourcePropertyDisplay.mjs","sources":["../../../src/ResourcePropertyDisplay/ResourcePropertyDisplay.tsx"],"sourcesContent":["import {\n buildTypeName,\n formatDateTime,\n formatPeriod,\n formatTiming,\n getTypedPropertyValue,\n PropertyType,\n TypedValue,\n} from '@medplum/core';\nimport { ElementDefinition } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { AddressDisplay } from '../AddressDisplay/AddressDisplay';\nimport { AttachmentArrayDisplay } from '../AttachmentArrayDisplay/AttachmentArrayDisplay';\nimport { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay';\nimport { BackboneElementDisplay } from '../BackboneElementDisplay/BackboneElementDisplay';\nimport { CodeableConceptDisplay } from '../CodeableConceptDisplay/CodeableConceptDisplay';\nimport { CodingDisplay } from '../CodingDisplay/CodingDisplay';\nimport { ContactDetailDisplay } from '../ContactDetailDisplay/ContactDetailDisplay';\nimport { ContactPointDisplay } from '../ContactPointDisplay/ContactPointDisplay';\nimport { HumanNameDisplay } from '../HumanNameDisplay/HumanNameDisplay';\nimport { IdentifierDisplay } from '../IdentifierDisplay/IdentifierDisplay';\nimport { MoneyDisplay } from '../MoneyDisplay/MoneyDisplay';\nimport { QuantityDisplay } from '../QuantityDisplay/QuantityDisplay';\nimport { RangeDisplay } from '../RangeDisplay/RangeDisplay';\nimport { RatioDisplay } from '../RatioDisplay/RatioDisplay';\nimport { ReferenceDisplay } from '../ReferenceDisplay/ReferenceDisplay';\nimport { ResourceArrayDisplay } from '../ResourceArrayDisplay/ResourceArrayDisplay';\n\nexport interface ResourcePropertyDisplayProps {\n property?: ElementDefinition;\n propertyType: PropertyType;\n value: any;\n arrayElement?: boolean;\n maxWidth?: number;\n ignoreMissingValues?: boolean;\n link?: boolean;\n}\n\nexport function ResourcePropertyDisplay(props: ResourcePropertyDisplayProps): JSX.Element {\n const { property, propertyType, value } = props;\n\n if (property?.max === '*' && !props.arrayElement) {\n if (propertyType === 'Attachment') {\n return <AttachmentArrayDisplay values={value} maxWidth={props.maxWidth} />;\n }\n return (\n <ResourceArrayDisplay\n property={property}\n values={value}\n ignoreMissingValues={props.ignoreMissingValues}\n link={props.link}\n />\n );\n }\n\n switch (propertyType) {\n case PropertyType.boolean:\n return <>{value === undefined ? '' : Boolean(value).toString()}</>;\n case PropertyType.SystemString:\n case PropertyType.code:\n case PropertyType.date:\n case PropertyType.integer:\n case PropertyType.positiveInt:\n case PropertyType.string:\n case PropertyType.unsignedInt:\n case PropertyType.uri:\n case PropertyType.url:\n return <>{value}</>;\n case PropertyType.canonical:\n return <ReferenceDisplay value={{ reference: value }} link={props.link} />;\n case PropertyType.dateTime:\n case PropertyType.instant:\n return <>{formatDateTime(value)}</>;\n case PropertyType.markdown:\n return <pre>{value}</pre>;\n case PropertyType.Address:\n return <AddressDisplay value={value} />;\n case PropertyType.Annotation:\n return <>{value?.text}</>;\n case PropertyType.Attachment:\n return <AttachmentDisplay value={value} maxWidth={props.maxWidth} />;\n case PropertyType.CodeableConcept:\n return <CodeableConceptDisplay value={value} />;\n case PropertyType.Coding:\n return <CodingDisplay value={value} />;\n case PropertyType.ContactDetail:\n return <ContactDetailDisplay value={value} />;\n case PropertyType.ContactPoint:\n return <ContactPointDisplay value={value} />;\n case PropertyType.HumanName:\n return <HumanNameDisplay value={value} />;\n case PropertyType.Identifier:\n return <IdentifierDisplay value={value} />;\n case PropertyType.Money:\n return <MoneyDisplay value={value} />;\n case PropertyType.Period:\n return <>{formatPeriod(value)}</>;\n case PropertyType.Quantity:\n case PropertyType.Duration:\n return <QuantityDisplay value={value} />;\n case PropertyType.Range:\n return <RangeDisplay value={value} />;\n case PropertyType.Ratio:\n return <RatioDisplay value={value} />;\n case PropertyType.Reference:\n return <ReferenceDisplay value={value} link={props.link} />;\n case PropertyType.Timing:\n return <>{formatTiming(value)}</>;\n case PropertyType.Dosage:\n case PropertyType.UsageContext:\n return (\n <BackboneElementDisplay\n value={{ type: propertyType, value }}\n compact={true}\n ignoreMissingValues={props.ignoreMissingValues}\n />\n );\n default:\n if (!property?.path) {\n throw Error(`Displaying property of type ${props.propertyType} requires element definition path`);\n }\n return (\n <BackboneElementDisplay\n value={{ type: buildTypeName(property?.path?.split('.') as string[]), value }}\n compact={true}\n ignoreMissingValues={props.ignoreMissingValues}\n />\n );\n }\n}\n\n/**\n * Returns the value of the property and the property type.\n * Some property definitions support multiple types.\n * For example, \"Observation.value[x]\" can be \"valueString\", \"valueInteger\", \"valueQuantity\", etc.\n * According to the spec, there can only be one property for a given element definition.\n * This function returns the value and the type.\n * @param context The base context (usually a FHIR resource).\n * @param property The property definition.\n * @returns The value of the property and the property type.\n */\nexport function getValueAndType(context: TypedValue, path: string): [any, PropertyType] {\n const typedResult = getTypedPropertyValue(context, path);\n if (!typedResult) {\n return [undefined, 'undefined' as PropertyType];\n }\n\n if (Array.isArray(typedResult)) {\n return [typedResult.map((e) => e.value), typedResult[0].type as PropertyType];\n }\n\n return [typedResult.value, typedResult.type as PropertyType];\n}\n"],"names":[],"mappings":";;;;;;;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,QAAA;AACE,YAAA,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE;gBACnB,MAAM,KAAK,CAAC,CAA+B,4BAAA,EAAA,KAAK,CAAC,YAAY,CAAA,iCAAA,CAAmC,CAAC,CAAC;AACnG,aAAA;AACD,YAAA,QACE,KAAA,CAAA,aAAA,CAAC,sBAAsB,EAAA,EACrB,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAa,CAAC,EAAE,KAAK,EAAE,EAC7E,OAAO,EAAE,IAAI,EACb,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAAA,CAC9C,EACF;AACL,KAAA;AACH,CAAC;AAED;;;;;;;;;AASG;AACa,SAAA,eAAe,CAAC,OAAmB,EAAE,IAAY,EAAA;IAC/D,MAAM,WAAW,GAAG,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzD,IAAI,CAAC,WAAW,EAAE;AAChB,QAAA,OAAO,CAAC,SAAS,EAAE,WAA2B,CAAC,CAAC;AACjD,KAAA;AAED,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QAC9B,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAoB,CAAC,CAAC;AAC/E,KAAA;IAED,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,IAAoB,CAAC,CAAC;AAC/D;;;;"}
@@ -1,33 +1,33 @@
1
1
  import { Group, NativeSelect, Textarea, Checkbox, TextInput } from '@mantine/core';
2
2
  import { capitalize, buildTypeName, PropertyType } from '@medplum/core';
3
3
  import React, { useState } from 'react';
4
- import { AddressInput } from '../AddressInput/AddressInput.js';
5
- import { AnnotationInput } from '../AnnotationInput/AnnotationInput.js';
6
- import { AttachmentArrayInput } from '../AttachmentArrayInput/AttachmentArrayInput.js';
7
- import { AttachmentInput } from '../AttachmentInput/AttachmentInput.js';
8
- import { BackboneElementInput } from '../BackboneElementInput/BackboneElementInput.js';
9
- import { CodeableConceptInput } from '../CodeableConceptInput/CodeableConceptInput.js';
10
- import { CodeInput } from '../CodeInput/CodeInput.js';
11
- import { CodingInput } from '../CodingInput/CodingInput.js';
12
- import { ContactDetailInput } from '../ContactDetailInput/ContactDetailInput.js';
13
- import { ContactPointInput } from '../ContactPointInput/ContactPointInput.js';
14
- import { DateTimeInput } from '../DateTimeInput/DateTimeInput.js';
15
- import { ExtensionInput } from '../ExtensionInput/ExtensionInput.js';
16
- import { HumanNameInput } from '../HumanNameInput/HumanNameInput.js';
17
- import { IdentifierInput } from '../IdentifierInput/IdentifierInput.js';
18
- import { PeriodInput } from '../PeriodInput/PeriodInput.js';
19
- import { QuantityInput } from '../QuantityInput/QuantityInput.js';
20
- import { RangeInput } from '../RangeInput/RangeInput.js';
21
- import { RatioInput } from '../RatioInput/RatioInput.js';
22
- import { ReferenceInput } from '../ReferenceInput/ReferenceInput.js';
23
- import { ResourceArrayInput } from '../ResourceArrayInput/ResourceArrayInput.js';
24
- import { TimingInput } from '../TimingInput/TimingInput.js';
25
- import { getErrorsForInput } from '../utils/outcomes.js';
4
+ import { AddressInput } from '../AddressInput/AddressInput.mjs';
5
+ import { AnnotationInput } from '../AnnotationInput/AnnotationInput.mjs';
6
+ import { AttachmentArrayInput } from '../AttachmentArrayInput/AttachmentArrayInput.mjs';
7
+ import { AttachmentInput } from '../AttachmentInput/AttachmentInput.mjs';
8
+ import { BackboneElementInput } from '../BackboneElementInput/BackboneElementInput.mjs';
9
+ import { CodeableConceptInput } from '../CodeableConceptInput/CodeableConceptInput.mjs';
10
+ import { CodeInput } from '../CodeInput/CodeInput.mjs';
11
+ import { CodingInput } from '../CodingInput/CodingInput.mjs';
12
+ import { ContactDetailInput } from '../ContactDetailInput/ContactDetailInput.mjs';
13
+ import { ContactPointInput } from '../ContactPointInput/ContactPointInput.mjs';
14
+ import { DateTimeInput } from '../DateTimeInput/DateTimeInput.mjs';
15
+ import { ExtensionInput } from '../ExtensionInput/ExtensionInput.mjs';
16
+ import { HumanNameInput } from '../HumanNameInput/HumanNameInput.mjs';
17
+ import { IdentifierInput } from '../IdentifierInput/IdentifierInput.mjs';
18
+ import { MoneyInput } from '../MoneyInput/MoneyInput.mjs';
19
+ import { PeriodInput } from '../PeriodInput/PeriodInput.mjs';
20
+ import { QuantityInput } from '../QuantityInput/QuantityInput.mjs';
21
+ import { RangeInput } from '../RangeInput/RangeInput.mjs';
22
+ import { RatioInput } from '../RatioInput/RatioInput.mjs';
23
+ import { ReferenceInput } from '../ReferenceInput/ReferenceInput.mjs';
24
+ import { ResourceArrayInput } from '../ResourceArrayInput/ResourceArrayInput.mjs';
25
+ import { TimingInput } from '../TimingInput/TimingInput.mjs';
26
+ import { getErrorsForInput } from '../utils/outcomes.mjs';
26
27
 
27
28
  function ResourcePropertyInput(props) {
28
- var _a, _b, _c;
29
29
  const property = props.property;
30
- const propertyType = (_a = props.defaultPropertyType) !== null && _a !== void 0 ? _a : (_c = (_b = property.type) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.code;
30
+ const propertyType = props.defaultPropertyType ?? property.type?.[0]?.code;
31
31
  const name = props.name;
32
32
  const value = props.defaultValue;
33
33
  if (property.max === '*' && !props.arrayElement) {
@@ -38,10 +38,10 @@ function ResourcePropertyInput(props) {
38
38
  }
39
39
  const propertyTypes = property.type;
40
40
  if (propertyTypes.length > 1) {
41
- return React.createElement(ElementDefinitionInputSelector, Object.assign({ elementDefinitionTypes: propertyTypes }, props));
41
+ return React.createElement(ElementDefinitionInputSelector, { elementDefinitionTypes: propertyTypes, ...props });
42
42
  }
43
43
  else {
44
- return React.createElement(ElementDefinitionTypeInput, Object.assign({ elementDefinitionType: propertyTypes[0] }, props));
44
+ return React.createElement(ElementDefinitionTypeInput, { elementDefinitionType: propertyTypes[0], ...props });
45
45
  }
46
46
  }
47
47
  function ElementDefinitionInputSelector(props) {
@@ -55,20 +55,19 @@ function ElementDefinitionInputSelector(props) {
55
55
  }
56
56
  const [selectedType, setSelectedType] = useState(initialPropertyType);
57
57
  return (React.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
58
- React.createElement(NativeSelect, { style: { width: '200px' }, defaultValue: selectedType === null || selectedType === void 0 ? void 0 : selectedType.code, onChange: (e) => {
58
+ React.createElement(NativeSelect, { style: { width: '200px' }, defaultValue: selectedType?.code, onChange: (e) => {
59
59
  setSelectedType(propertyTypes.find((type) => type.code === e.currentTarget.value));
60
60
  }, data: propertyTypes.map((type) => ({
61
61
  value: type.code,
62
62
  label: type.code,
63
63
  })) }),
64
- React.createElement(ElementDefinitionTypeInput, Object.assign({}, props, { elementDefinitionType: selectedType, onChange: (newValue) => {
64
+ React.createElement(ElementDefinitionTypeInput, { ...props, elementDefinitionType: selectedType, onChange: (newValue) => {
65
65
  if (props.onChange) {
66
66
  props.onChange(newValue, props.name.replace('[x]', capitalize(selectedType.code)));
67
67
  }
68
- } }))));
68
+ } })));
69
69
  }
70
70
  function ElementDefinitionTypeInput(props) {
71
- var _a;
72
71
  const property = props.property;
73
72
  const propertyType = props.elementDefinitionType.code;
74
73
  const name = props.name;
@@ -141,6 +140,8 @@ function ElementDefinitionTypeInput(props) {
141
140
  return React.createElement(HumanNameInput, { name: name, defaultValue: value, onChange: props.onChange });
142
141
  case PropertyType.Identifier:
143
142
  return React.createElement(IdentifierInput, { name: name, defaultValue: value, onChange: props.onChange });
143
+ case PropertyType.Money:
144
+ return React.createElement(MoneyInput, { name: name, defaultValue: value, onChange: props.onChange });
144
145
  case PropertyType.Period:
145
146
  return React.createElement(PeriodInput, { name: name, defaultValue: value, onChange: props.onChange });
146
147
  case PropertyType.Duration:
@@ -158,13 +159,12 @@ function ElementDefinitionTypeInput(props) {
158
159
  case PropertyType.UsageContext:
159
160
  return (React.createElement(BackboneElementInput, { typeName: propertyType, defaultValue: value, onChange: props.onChange, outcome: props.outcome }));
160
161
  default:
161
- return (React.createElement(BackboneElementInput, { typeName: buildTypeName((_a = property.path) === null || _a === void 0 ? void 0 : _a.split('.')), defaultValue: value, onChange: props.onChange, outcome: props.outcome }));
162
+ return (React.createElement(BackboneElementInput, { typeName: buildTypeName(property.path?.split('.')), defaultValue: value, onChange: props.onChange, outcome: props.outcome }));
162
163
  }
163
164
  }
164
165
  function getTargetTypes(property) {
165
- var _a, _b, _c;
166
- return (_c = (_b = (_a = property === null || property === void 0 ? void 0 : property.type) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.targetProfile) === null || _c === void 0 ? void 0 : _c.map((p) => p.split('/').pop());
166
+ return property?.type?.[0]?.targetProfile?.map((p) => p.split('/').pop());
167
167
  }
168
168
 
169
169
  export { ElementDefinitionInputSelector, ElementDefinitionTypeInput, ResourcePropertyInput };
170
- //# sourceMappingURL=ResourcePropertyInput.js.map
170
+ //# sourceMappingURL=ResourcePropertyInput.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourcePropertyInput.mjs","sources":["../../../src/ResourcePropertyInput/ResourcePropertyInput.tsx"],"sourcesContent":["import { Checkbox, Group, NativeSelect, Textarea, TextInput } from '@mantine/core';\nimport { buildTypeName, capitalize, PropertyType } from '@medplum/core';\nimport { ElementDefinition, ElementDefinitionType, OperationOutcome } from '@medplum/fhirtypes';\nimport React, { useState } from 'react';\nimport { AddressInput } from '../AddressInput/AddressInput';\nimport { AnnotationInput } from '../AnnotationInput/AnnotationInput';\nimport { AttachmentArrayInput } from '../AttachmentArrayInput/AttachmentArrayInput';\nimport { AttachmentInput } from '../AttachmentInput/AttachmentInput';\nimport { BackboneElementInput } from '../BackboneElementInput/BackboneElementInput';\nimport { CodeableConceptInput } from '../CodeableConceptInput/CodeableConceptInput';\nimport { CodeInput } from '../CodeInput/CodeInput';\nimport { CodingInput } from '../CodingInput/CodingInput';\nimport { ContactDetailInput } from '../ContactDetailInput/ContactDetailInput';\nimport { ContactPointInput } from '../ContactPointInput/ContactPointInput';\nimport { DateTimeInput } from '../DateTimeInput/DateTimeInput';\nimport { ExtensionInput } from '../ExtensionInput/ExtensionInput';\nimport { HumanNameInput } from '../HumanNameInput/HumanNameInput';\nimport { IdentifierInput } from '../IdentifierInput/IdentifierInput';\nimport { MoneyInput } from '../MoneyInput/MoneyInput';\nimport { PeriodInput } from '../PeriodInput/PeriodInput';\nimport { QuantityInput } from '../QuantityInput/QuantityInput';\nimport { RangeInput } from '../RangeInput/RangeInput';\nimport { RatioInput } from '../RatioInput/RatioInput';\nimport { ReferenceInput } from '../ReferenceInput/ReferenceInput';\nimport { ResourceArrayInput } from '../ResourceArrayInput/ResourceArrayInput';\nimport { TimingInput } from '../TimingInput/TimingInput';\nimport { getErrorsForInput } from '../utils/outcomes';\n\nexport interface ResourcePropertyInputProps {\n property: ElementDefinition;\n name: string;\n defaultPropertyType?: PropertyType;\n defaultValue?: any;\n arrayElement?: boolean;\n onChange?: (value: any, propName?: string) => void;\n outcome?: OperationOutcome;\n}\n\nexport function ResourcePropertyInput(props: ResourcePropertyInputProps): JSX.Element {\n const property = props.property;\n const propertyType = props.defaultPropertyType ?? (property.type?.[0]?.code as PropertyType);\n const name = props.name;\n const value = props.defaultValue;\n\n if (property.max === '*' && !props.arrayElement) {\n if (propertyType === 'Attachment') {\n return <AttachmentArrayInput name={name} defaultValue={value} onChange={props.onChange} />;\n }\n return <ResourceArrayInput property={property} name={name} defaultValue={value} onChange={props.onChange} />;\n }\n\n const propertyTypes = property.type as ElementDefinitionType[];\n if (propertyTypes.length > 1) {\n return <ElementDefinitionInputSelector elementDefinitionTypes={propertyTypes} {...props} />;\n } else {\n return <ElementDefinitionTypeInput elementDefinitionType={propertyTypes[0]} {...props} />;\n }\n}\n\nexport interface ElementDefinitionSelectorProps extends ResourcePropertyInputProps {\n elementDefinitionTypes: ElementDefinitionType[];\n}\n\nexport function ElementDefinitionInputSelector(props: ElementDefinitionSelectorProps): JSX.Element {\n const propertyTypes = props.elementDefinitionTypes;\n let initialPropertyType: ElementDefinitionType | undefined = undefined;\n if (props.defaultPropertyType) {\n initialPropertyType = propertyTypes.find((t) => t.code === props.defaultPropertyType) as ElementDefinitionType;\n }\n if (!initialPropertyType) {\n initialPropertyType = propertyTypes[0];\n }\n const [selectedType, setSelectedType] = useState(initialPropertyType);\n return (\n <Group spacing=\"xs\" grow noWrap>\n <NativeSelect\n style={{ width: '200px' }}\n defaultValue={selectedType?.code}\n onChange={(e) => {\n setSelectedType(\n propertyTypes.find(\n (type: ElementDefinitionType) => type.code === e.currentTarget.value\n ) as ElementDefinitionType\n );\n }}\n data={propertyTypes.map((type: ElementDefinitionType) => ({\n value: type.code as string,\n label: type.code as string,\n }))}\n />\n <ElementDefinitionTypeInput\n {...props}\n elementDefinitionType={selectedType}\n onChange={(newValue: any) => {\n if (props.onChange) {\n props.onChange(newValue, props.name.replace('[x]', capitalize(selectedType.code as string)));\n }\n }}\n />\n </Group>\n );\n}\n\nexport interface ElementDefinitionTypeInputProps extends ResourcePropertyInputProps {\n elementDefinitionType: ElementDefinitionType;\n}\n\nexport function ElementDefinitionTypeInput(props: ElementDefinitionTypeInputProps): JSX.Element {\n const property = props.property;\n const propertyType = props.elementDefinitionType.code as PropertyType;\n const name = props.name;\n const value = props.defaultValue;\n\n switch (propertyType) {\n // 2.24.0.1 Primitive Types\n // https://www.hl7.org/fhir/datatypes.html#primitive\n\n case PropertyType.SystemString:\n case PropertyType.canonical:\n case PropertyType.string:\n case PropertyType.time:\n case PropertyType.uri:\n case PropertyType.url:\n return (\n <TextInput\n id={name}\n name={name}\n data-testid={name}\n defaultValue={value}\n onChange={(e) => {\n if (props.onChange) {\n props.onChange(e.currentTarget.value);\n }\n }}\n error={getErrorsForInput(props.outcome, name)}\n />\n );\n case PropertyType.date:\n return (\n <TextInput\n type=\"date\"\n id={name}\n name={name}\n data-testid={name}\n defaultValue={value}\n onChange={(e) => {\n if (props.onChange) {\n props.onChange(e.currentTarget.value);\n }\n }}\n error={getErrorsForInput(props.outcome, name)}\n />\n );\n case PropertyType.dateTime:\n case PropertyType.instant:\n return <DateTimeInput name={name} defaultValue={value} onChange={props.onChange} outcome={props.outcome} />;\n case PropertyType.decimal:\n case PropertyType.integer:\n case PropertyType.positiveInt:\n case PropertyType.unsignedInt:\n return (\n <TextInput\n type=\"number\"\n step={propertyType === PropertyType.decimal ? 'any' : '1'}\n id={name}\n name={name}\n data-testid={name}\n defaultValue={value}\n onChange={(e) => {\n if (props.onChange) {\n props.onChange(e.currentTarget.valueAsNumber);\n }\n }}\n />\n );\n case PropertyType.code:\n return <CodeInput property={property} name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.boolean:\n return (\n <Checkbox\n id={name}\n name={name}\n data-testid={name}\n defaultChecked={!!value}\n onChange={(e) => {\n if (props.onChange) {\n props.onChange(e.currentTarget.checked);\n }\n }}\n />\n );\n case PropertyType.markdown:\n return (\n <Textarea\n id={name}\n name={name}\n data-testid={name}\n defaultValue={value}\n onChange={(e) => {\n if (props.onChange) {\n props.onChange(e.currentTarget.value);\n }\n }}\n />\n );\n\n // 2.24.0.2 Complex Types\n // https://www.hl7.org/fhir/datatypes.html#complex\n\n case PropertyType.Address:\n return <AddressInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Annotation:\n return <AnnotationInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Attachment:\n return <AttachmentInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.CodeableConcept:\n return <CodeableConceptInput property={property} name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Coding:\n return <CodingInput property={property} name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.ContactDetail:\n return <ContactDetailInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.ContactPoint:\n return <ContactPointInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Extension:\n return <ExtensionInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.HumanName:\n return <HumanNameInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Identifier:\n return <IdentifierInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Money:\n return <MoneyInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Period:\n return <PeriodInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Duration:\n case PropertyType.Quantity:\n return <QuantityInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Range:\n return <RangeInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Ratio:\n return <RatioInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Reference:\n return (\n <ReferenceInput\n name={name}\n defaultValue={value}\n targetTypes={getTargetTypes(property)}\n onChange={props.onChange}\n />\n );\n case PropertyType.Timing:\n return <TimingInput name={name} defaultValue={value} onChange={props.onChange} />;\n case PropertyType.Dosage:\n case PropertyType.UsageContext:\n return (\n <BackboneElementInput\n typeName={propertyType}\n defaultValue={value}\n onChange={props.onChange}\n outcome={props.outcome}\n />\n );\n default:\n return (\n <BackboneElementInput\n typeName={buildTypeName(property.path?.split('.') as string[])}\n defaultValue={value}\n onChange={props.onChange}\n outcome={props.outcome}\n />\n );\n }\n}\n\nfunction getTargetTypes(property?: ElementDefinition): string[] | undefined {\n return property?.type?.[0]?.targetProfile?.map((p) => p.split('/').pop() as string);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCM,SAAU,qBAAqB,CAAC,KAAiC,EAAA;AACrE,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;AAChC,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,mBAAmB,IAAK,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,IAAqB,CAAC;AAC7F,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AACxB,IAAA,MAAM,KAAK,GAAG,KAAK,CAA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Q,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,CAAA,EACF;AACJ,QAAA;AACE,YAAA,QACE,KAAA,CAAA,aAAA,CAAC,oBAAoB,EAAA,EACnB,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAa,CAAC,EAC9D,YAAY,EAAE,KAAK,EACnB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,EAAA,CACtB,EACF;AACL,KAAA;AACH,CAAC;AAED,SAAS,cAAc,CAAC,QAA4B,EAAA;IAClD,OAAO,QAAQ,EAAE,IAAI,GAAG,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAY,CAAC,CAAC;AACtF;;;;"}
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { BackboneElementDisplay } from '../BackboneElementDisplay/BackboneElementDisplay.js';
3
- import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
4
- import { useResource } from '../useResource/useResource.js';
2
+ import { BackboneElementDisplay } from '../BackboneElementDisplay/BackboneElementDisplay.mjs';
3
+ import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
4
+ import { useResource } from '../useResource/useResource.mjs';
5
5
 
6
6
  function ResourceTable(props) {
7
7
  const medplum = useMedplum();
@@ -19,4 +19,4 @@ function ResourceTable(props) {
19
19
  }
20
20
 
21
21
  export { ResourceTable };
22
- //# sourceMappingURL=ResourceTable.js.map
22
+ //# sourceMappingURL=ResourceTable.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceTable.mjs","sources":["../../../src/ResourceTable/ResourceTable.tsx"],"sourcesContent":["import { IndexedStructureDefinition } from '@medplum/core';\nimport { Reference, Resource } from '@medplum/fhirtypes';\nimport React, { useEffect, useState } from 'react';\nimport { BackboneElementDisplay } from '../BackboneElementDisplay/BackboneElementDisplay';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { useResource } from '../useResource/useResource';\n\nexport interface ResourceTableProps {\n value: Resource | Reference;\n ignoreMissingValues?: boolean;\n}\n\nexport function ResourceTable(props: ResourceTableProps): JSX.Element | null {\n const medplum = useMedplum();\n const value = useResource(props.value);\n const [schema, setSchema] = useState<IndexedStructureDefinition | undefined>();\n\n useEffect(() => {\n if (value) {\n medplum.requestSchema(value.resourceType).then(setSchema).catch(console.log);\n }\n }, [medplum, value]);\n\n if (!schema || !value) {\n return null;\n }\n\n return (\n <BackboneElementDisplay\n value={{ type: value.resourceType, value }}\n ignoreMissingValues={props.ignoreMissingValues}\n />\n );\n}\n"],"names":[],"mappings":";;;;;AAYM,SAAU,aAAa,CAAC,KAAyB,EAAA;AACrD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAA0C,CAAC;IAE/E,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,KAAK,EAAE;AACT,YAAA,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC9E,SAAA;AACH,KAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAErB,IAAA,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE;AACrB,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;IAED,QACE,oBAAC,sBAAsB,EAAA,EACrB,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,EAAE,EAC1C,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,CAAA,EACF;AACJ;;;;"}
@@ -4,18 +4,18 @@ import { normalizeErrorString, getReferenceString } from '@medplum/core';
4
4
  import { IconMessage, IconCloudUpload, IconCheck, IconFileAlert, IconPin, IconPinnedOff, IconListDetails, IconEdit, IconTrash } from '@tabler/icons';
5
5
  import React, { useRef, useState, useCallback, useEffect } from 'react';
6
6
  import { useNavigate } from 'react-router-dom';
7
- import { AttachmentButton } from '../AttachmentButton/AttachmentButton.js';
8
- import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.js';
9
- import { DiagnosticReportDisplay } from '../DiagnosticReportDisplay/DiagnosticReportDisplay.js';
10
- import { Form } from '../Form/Form.js';
11
- import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
12
- import { Panel } from '../Panel/Panel.js';
13
- import { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar.js';
14
- import { ResourceDiffTable } from '../ResourceDiffTable/ResourceDiffTable.js';
15
- import { ResourceTable } from '../ResourceTable/ResourceTable.js';
16
- import { Timeline, TimelineItem } from '../Timeline/Timeline.js';
17
- import { useResource } from '../useResource/useResource.js';
18
- import { sortByDateAndPriority } from '../utils/date.js';
7
+ import { AttachmentButton } from '../AttachmentButton/AttachmentButton.mjs';
8
+ import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.mjs';
9
+ import { DiagnosticReportDisplay } from '../DiagnosticReportDisplay/DiagnosticReportDisplay.mjs';
10
+ import { Form } from '../Form/Form.mjs';
11
+ import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
12
+ import { Panel } from '../Panel/Panel.mjs';
13
+ import { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar.mjs';
14
+ import { ResourceDiffTable } from '../ResourceDiffTable/ResourceDiffTable.mjs';
15
+ import { ResourceTable } from '../ResourceTable/ResourceTable.mjs';
16
+ import { Timeline, TimelineItem } from '../Timeline/Timeline.mjs';
17
+ import { useResource } from '../useResource/useResource.mjs';
18
+ import { sortByDateAndPriority } from '../utils/date.mjs';
19
19
 
20
20
  const useStyles = createStyles((theme) => ({
21
21
  pinnedComment: {
@@ -129,7 +129,7 @@ function ResourceTimeline(props) {
129
129
  }));
130
130
  }
131
131
  function setPriority(communication, priority) {
132
- return medplum.updateResource(Object.assign(Object.assign({}, communication), { priority }));
132
+ return medplum.updateResource({ ...communication, priority });
133
133
  }
134
134
  function onPin(communication) {
135
135
  setPriority(communication, 'stat').then(loadTimeline).catch(console.log);
@@ -147,8 +147,7 @@ function ResourceTimeline(props) {
147
147
  navigate(`/${timelineItem.resourceType}/${timelineItem.id}/delete`);
148
148
  }
149
149
  function onVersionDetails(version) {
150
- var _a;
151
- navigate(`/${version.resourceType}/${version.id}/_history/${(_a = version.meta) === null || _a === void 0 ? void 0 : _a.versionId}`);
150
+ navigate(`/${version.resourceType}/${version.id}/_history/${version.meta?.versionId}`);
152
151
  }
153
152
  function onUploadStart() {
154
153
  showNotification({
@@ -189,12 +188,11 @@ function ResourceTimeline(props) {
189
188
  React.createElement(TextInput, { name: "text", ref: inputRef, placeholder: "Add comment", style: { width: '100%', maxWidth: 300 } }),
190
189
  React.createElement(ActionIcon, { type: "submit", radius: "xl", color: "blue", variant: "filled" },
191
190
  React.createElement(IconMessage, { size: 16 })),
192
- React.createElement(AttachmentButton, { onUpload: createMedia, onUploadStart: onUploadStart, onUploadProgress: onUploadProgress }, (props) => (React.createElement(ActionIcon, Object.assign({}, props, { radius: "xl", color: "blue", variant: "filled" }),
191
+ React.createElement(AttachmentButton, { onUpload: createMedia, onUploadStart: onUploadStart, onUploadProgress: onUploadProgress }, (props) => (React.createElement(ActionIcon, { ...props, radius: "xl", color: "blue", variant: "filled" },
193
192
  React.createElement(IconCloudUpload, { size: 16 })))))))),
194
193
  items.map((item) => {
195
- var _a;
196
194
  if (item.resourceType === resource.resourceType && item.id === resource.id) {
197
- return (React.createElement(HistoryTimelineItem, { key: (_a = item.meta) === null || _a === void 0 ? void 0 : _a.versionId, history: history, resource: item, onDetails: onVersionDetails }));
195
+ return (React.createElement(HistoryTimelineItem, { key: item.meta?.versionId, history: history, resource: item, onDetails: onVersionDetails }));
198
196
  }
199
197
  const key = `${item.resourceType}/${item.id}`;
200
198
  switch (item.resourceType) {
@@ -227,48 +225,46 @@ function TimelineItemPopupMenu(props) {
227
225
  function HistoryTimelineItem(props) {
228
226
  const previous = getPrevious(props.history, props.resource);
229
227
  if (previous) {
230
- return (React.createElement(TimelineItem, { resource: props.resource, padding: true, popupMenuItems: React.createElement(TimelineItemPopupMenu, Object.assign({}, props)) },
228
+ return (React.createElement(TimelineItem, { resource: props.resource, padding: true, popupMenuItems: React.createElement(TimelineItemPopupMenu, { ...props }) },
231
229
  React.createElement(ResourceDiffTable, { original: previous, revised: props.resource })));
232
230
  }
233
231
  else {
234
- return (React.createElement(TimelineItem, { resource: props.resource, padding: true, popupMenuItems: React.createElement(TimelineItemPopupMenu, Object.assign({}, props)) },
232
+ return (React.createElement(TimelineItem, { resource: props.resource, padding: true, popupMenuItems: React.createElement(TimelineItemPopupMenu, { ...props }) },
235
233
  React.createElement("h3", null, "Created"),
236
234
  React.createElement(ResourceTable, { value: props.resource, ignoreMissingValues: true })));
237
235
  }
238
236
  }
239
237
  function getPrevious(history, version) {
240
238
  const entries = history.entry;
241
- const index = entries.findIndex((entry) => { var _a, _b, _c; return ((_b = (_a = entry.resource) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.versionId) === ((_c = version.meta) === null || _c === void 0 ? void 0 : _c.versionId); });
239
+ const index = entries.findIndex((entry) => entry.resource?.meta?.versionId === version.meta?.versionId);
242
240
  if (index >= entries.length - 1) {
243
241
  return undefined;
244
242
  }
245
243
  return entries[index + 1].resource;
246
244
  }
247
245
  function CommunicationTimelineItem(props) {
248
- var _a, _b;
249
246
  const { classes } = useStyles();
250
247
  const routine = !props.resource.priority || props.resource.priority === 'routine';
251
248
  const className = routine ? undefined : classes.pinnedComment;
252
- return (React.createElement(TimelineItem, { resource: props.resource, profile: props.resource.sender, padding: true, className: className, popupMenuItems: React.createElement(TimelineItemPopupMenu, Object.assign({}, props)) },
253
- React.createElement("p", null, (_b = (_a = props.resource.payload) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.contentString)));
249
+ return (React.createElement(TimelineItem, { resource: props.resource, profile: props.resource.sender, padding: true, className: className, popupMenuItems: React.createElement(TimelineItemPopupMenu, { ...props }) },
250
+ React.createElement("p", null, props.resource.payload?.[0]?.contentString)));
254
251
  }
255
252
  function MediaTimelineItem(props) {
256
- var _a;
257
- const contentType = (_a = props.resource.content) === null || _a === void 0 ? void 0 : _a.contentType;
253
+ const contentType = props.resource.content?.contentType;
258
254
  const padding = contentType &&
259
255
  !contentType.startsWith('image/') &&
260
256
  !contentType.startsWith('video/') &&
261
257
  contentType !== 'application/pdf';
262
- return (React.createElement(TimelineItem, { resource: props.resource, padding: !!padding, popupMenuItems: React.createElement(TimelineItemPopupMenu, Object.assign({}, props)) },
258
+ return (React.createElement(TimelineItem, { resource: props.resource, padding: !!padding, popupMenuItems: React.createElement(TimelineItemPopupMenu, { ...props }) },
263
259
  React.createElement(AttachmentDisplay, { value: props.resource.content })));
264
260
  }
265
261
  function AuditEventTimelineItem(props) {
266
- return (React.createElement(TimelineItem, { resource: props.resource, padding: true, popupMenuItems: React.createElement(TimelineItemPopupMenu, Object.assign({}, props)) },
262
+ return (React.createElement(TimelineItem, { resource: props.resource, padding: true, popupMenuItems: React.createElement(TimelineItemPopupMenu, { ...props }) },
267
263
  React.createElement(ScrollArea, null,
268
264
  React.createElement("pre", null, props.resource.outcomeDesc))));
269
265
  }
270
266
  function DiagnosticReportTimelineItem(props) {
271
- return (React.createElement(TimelineItem, { resource: props.resource, padding: true, popupMenuItems: React.createElement(TimelineItemPopupMenu, Object.assign({}, props)) },
267
+ return (React.createElement(TimelineItem, { resource: props.resource, padding: true, popupMenuItems: React.createElement(TimelineItemPopupMenu, { ...props }) },
272
268
  React.createElement(DiagnosticReportDisplay, { value: props.resource })));
273
269
  }
274
270
  function getProgressMessage(e) {
@@ -287,4 +283,4 @@ function formatFileSize(bytes) {
287
283
  }
288
284
 
289
285
  export { ResourceTimeline };
290
- //# sourceMappingURL=ResourceTimeline.js.map
286
+ //# sourceMappingURL=ResourceTimeline.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceTimeline.mjs","sources":["../../../src/ResourceTimeline/ResourceTimeline.tsx"],"sourcesContent":["import { ActionIcon, Center, createStyles, Group, Loader, Menu, ScrollArea, TextInput } from '@mantine/core';\nimport { showNotification, updateNotification } from '@mantine/notifications';\nimport { getReferenceString, normalizeErrorString, ProfileResource } from '@medplum/core';\nimport {\n Attachment,\n AuditEvent,\n Bundle,\n BundleEntry,\n Communication,\n DiagnosticReport,\n Media,\n Reference,\n Resource,\n} from '@medplum/fhirtypes';\nimport {\n IconCheck,\n IconCloudUpload,\n IconEdit,\n IconFileAlert,\n IconListDetails,\n IconMessage,\n IconPin,\n IconPinnedOff,\n IconTrash,\n} from '@tabler/icons';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { AttachmentButton } from '../AttachmentButton/AttachmentButton';\nimport { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay';\nimport { DiagnosticReportDisplay } from '../DiagnosticReportDisplay/DiagnosticReportDisplay';\nimport { Form } from '../Form/Form';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { Panel } from '../Panel/Panel';\nimport { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar';\nimport { ResourceDiffTable } from '../ResourceDiffTable/ResourceDiffTable';\nimport { ResourceTable } from '../ResourceTable/ResourceTable';\nimport { Timeline, TimelineItem } from '../Timeline/Timeline';\nimport { useResource } from '../useResource/useResource';\nimport { sortByDateAndPriority } from '../utils/date';\n\nconst useStyles = createStyles((theme) => ({\n pinnedComment: {\n backgroundColor: theme.colors.blue[0],\n },\n}));\n\nexport interface ResourceTimelineProps<T extends Resource> {\n value: T | Reference<T>;\n buildSearchRequests: (resource: T) => Bundle;\n createCommunication?: (resource: T, sender: ProfileResource, text: string) => Communication;\n createMedia?: (resource: T, operator: ProfileResource, attachment: Attachment) => Media;\n}\n\nexport function ResourceTimeline<T extends Resource>(props: ResourceTimelineProps<T>): JSX.Element {\n const navigate = useNavigate();\n const medplum = useMedplum();\n const sender = medplum.getProfile() as ProfileResource;\n const inputRef = useRef<HTMLInputElement>(null);\n const resource = useResource(props.value);\n const [history, setHistory] = useState<Bundle>();\n const [items, setItems] = useState<Resource[]>([]);\n const buildSearchRequests = props.buildSearchRequests;\n\n const itemsRef = useRef<Resource[]>(items);\n itemsRef.current = items;\n\n const loadTimeline = useCallback(() => {\n if (!resource) {\n setItems([]);\n setHistory({} as Bundle);\n return;\n }\n medplum.executeBatch(buildSearchRequests(resource)).then(handleBatchResponse).catch(console.log);\n }, [medplum, resource, buildSearchRequests]);\n\n useEffect(() => {\n loadTimeline();\n }, [loadTimeline]);\n\n /**\n * Handles a batch request response.\n * @param batchResponse The batch response.\n */\n function handleBatchResponse(batchResponse: Bundle): void {\n const newItems = [];\n\n if (batchResponse.entry) {\n for (const batchEntry of batchResponse.entry) {\n const bundle = batchEntry.resource as Bundle;\n if (!bundle) {\n // User may not have access to all resource types\n continue;\n }\n\n if (bundle.type === 'history') {\n setHistory(bundle);\n }\n\n if (bundle.entry) {\n for (const entry of bundle.entry) {\n if (entry.resource) {\n newItems.push(entry.resource);\n }\n }\n }\n }\n\n sortByDateAndPriority(newItems);\n newItems.reverse();\n }\n\n setItems(newItems);\n }\n\n /**\n * Adds an array of resources to the timeline.\n * @param resources Array of resources.\n */\n function addResources(resources: Resource[]): void {\n const newItems = [...itemsRef.current, ...resources];\n sortByDateAndPriority(newItems);\n newItems.reverse();\n setItems(newItems);\n }\n\n /**\n * Adds a Communication resource to the timeline.\n * @param contentString The comment content.\n */\n function createComment(contentString: string): void {\n if (!resource || !props.createCommunication) {\n // Encounter not loaded yet\n return;\n }\n medplum\n .createResource(props.createCommunication(resource, sender, contentString))\n .then((result) => {\n addResources([result]);\n })\n .catch(console.log);\n }\n\n /**\n * Adds a Media resource to the timeline.\n * @param attachment The media attachment.\n */\n function createMedia(attachment: Attachment): void {\n if (!resource || !props.createMedia) {\n // Encounter not loaded yet\n return;\n }\n medplum\n .createResource(props.createMedia(resource, sender, attachment))\n .then((result) => addResources([result]))\n .then(() =>\n updateNotification({\n id: 'upload-notification',\n color: 'teal',\n title: 'Upload complete',\n message: '',\n icon: <IconCheck size={16} />,\n autoClose: 2000,\n })\n )\n .catch((reason) =>\n updateNotification({\n id: 'upload-notification',\n color: 'red',\n title: 'Upload error',\n message: normalizeErrorString(reason),\n icon: <IconFileAlert size={16} />,\n autoClose: 2000,\n })\n );\n }\n\n function setPriority(\n communication: Communication,\n priority: 'routine' | 'urgent' | 'asap' | 'stat'\n ): Promise<Communication> {\n return medplum.updateResource({ ...communication, priority });\n }\n\n function onPin(communication: Communication): void {\n setPriority(communication, 'stat').then(loadTimeline).catch(console.log);\n }\n\n function onUnpin(communication: Communication): void {\n setPriority(communication, 'routine').then(loadTimeline).catch(console.log);\n }\n\n function onDetails(timelineItem: Resource): void {\n navigate(`/${timelineItem.resourceType}/${timelineItem.id}`);\n }\n\n function onEdit(timelineItem: Resource): void {\n navigate(`/${timelineItem.resourceType}/${timelineItem.id}/edit`);\n }\n\n function onDelete(timelineItem: Resource): void {\n navigate(`/${timelineItem.resourceType}/${timelineItem.id}/delete`);\n }\n\n function onVersionDetails(version: Resource): void {\n navigate(`/${version.resourceType}/${version.id}/_history/${version.meta?.versionId}`);\n }\n\n function onUploadStart(): void {\n showNotification({\n id: 'upload-notification',\n loading: true,\n title: 'Initializing upload...',\n message: 'Please wait...',\n autoClose: false,\n disallowClose: true,\n });\n }\n\n function onUploadProgress(e: ProgressEvent): void {\n updateNotification({\n id: 'upload-notification',\n loading: true,\n title: 'Uploading...',\n message: getProgressMessage(e),\n autoClose: false,\n disallowClose: true,\n });\n }\n\n if (!resource) {\n return (\n <Center style={{ width: '100%', height: '100%' }}>\n <Loader />\n </Center>\n );\n }\n\n return (\n <Timeline>\n {props.createCommunication && (\n <Panel>\n <Form\n testid=\"timeline-form\"\n onSubmit={(formData: Record<string, string>) => {\n createComment(formData.text);\n\n const input = inputRef.current;\n if (input) {\n input.value = '';\n input.focus();\n }\n }}\n >\n <Group spacing=\"xs\" noWrap style={{ width: '100%' }}>\n <ResourceAvatar value={sender} />\n <TextInput\n name=\"text\"\n ref={inputRef}\n placeholder=\"Add comment\"\n style={{ width: '100%', maxWidth: 300 }}\n />\n <ActionIcon type=\"submit\" radius=\"xl\" color=\"blue\" variant=\"filled\">\n <IconMessage size={16} />\n </ActionIcon>\n <AttachmentButton\n onUpload={createMedia}\n onUploadStart={onUploadStart}\n onUploadProgress={onUploadProgress}\n >\n {(props) => (\n <ActionIcon {...props} radius=\"xl\" color=\"blue\" variant=\"filled\">\n <IconCloudUpload size={16} />\n </ActionIcon>\n )}\n </AttachmentButton>\n </Group>\n </Form>\n </Panel>\n )}\n {items.map((item) => {\n if (item.resourceType === resource.resourceType && item.id === resource.id) {\n return (\n <HistoryTimelineItem\n key={item.meta?.versionId}\n history={history as Bundle<Resource>}\n resource={item}\n onDetails={onVersionDetails}\n />\n );\n }\n const key = `${item.resourceType}/${item.id}`;\n switch (item.resourceType) {\n case 'AuditEvent':\n return <AuditEventTimelineItem key={key} resource={item} onDetails={onDetails} />;\n case 'Communication':\n return (\n <CommunicationTimelineItem\n key={key}\n resource={item}\n onPin={item.priority !== 'stat' ? onPin : undefined}\n onUnpin={item.priority === 'stat' ? onUnpin : undefined}\n onDetails={onDetails}\n onEdit={onEdit}\n onDelete={onDelete}\n />\n );\n case 'DiagnosticReport':\n return (\n <DiagnosticReportTimelineItem\n key={key}\n resource={item}\n onDetails={onDetails}\n onEdit={onEdit}\n onDelete={onDelete}\n />\n );\n case 'Media':\n return (\n <MediaTimelineItem key={key} resource={item} onDetails={onDetails} onEdit={onEdit} onDelete={onDelete} />\n );\n default:\n return (\n <TimelineItem key={key} resource={item} padding={true}>\n <ResourceTable value={item} ignoreMissingValues={true} />\n </TimelineItem>\n );\n }\n })}\n </Timeline>\n );\n}\n\ninterface BaseTimelineItemProps<T extends Resource> {\n resource: T;\n onPin?: (resource: T) => void;\n onUnpin?: (resource: T) => void;\n onDetails?: (resource: T) => void;\n onEdit?: (resource: T) => void;\n onDelete?: (resource: T) => void;\n}\n\nfunction TimelineItemPopupMenu<T extends Resource>(props: BaseTimelineItemProps<T>): JSX.Element {\n return (\n <Menu.Dropdown>\n <Menu.Label>Resource</Menu.Label>\n {props.onPin && (\n <Menu.Item\n icon={<IconPin size={14} />}\n onClick={() => (props.onPin as (resource: T) => void)(props.resource)}\n aria-label={`Pin ${getReferenceString(props.resource)}`}\n >\n Pin\n </Menu.Item>\n )}\n {props.onUnpin && (\n <Menu.Item\n icon={<IconPinnedOff size={14} />}\n onClick={() => (props.onUnpin as (resource: T) => void)(props.resource)}\n aria-label={`Unpin ${getReferenceString(props.resource)}`}\n >\n Unpin\n </Menu.Item>\n )}\n {props.onDetails && (\n <Menu.Item\n icon={<IconListDetails size={14} />}\n onClick={() => (props.onDetails as (resource: T) => void)(props.resource)}\n aria-label={`Details ${getReferenceString(props.resource)}`}\n >\n Details\n </Menu.Item>\n )}\n {props.onEdit && (\n <Menu.Item\n icon={<IconEdit size={14} />}\n onClick={() => (props.onEdit as (resource: T) => void)(props.resource)}\n aria-label={`Edit ${getReferenceString(props.resource)}`}\n >\n Edit\n </Menu.Item>\n )}\n {props.onDelete && (\n <>\n <Menu.Divider />\n <Menu.Label>Danger zone</Menu.Label>\n <Menu.Item\n color=\"red\"\n icon={<IconTrash size={14} />}\n onClick={() => (props.onDelete as (resource: T) => void)(props.resource)}\n aria-label={`Delete ${getReferenceString(props.resource)}`}\n >\n Delete\n </Menu.Item>\n </>\n )}\n </Menu.Dropdown>\n );\n}\n\ninterface HistoryTimelineItemProps extends BaseTimelineItemProps<Resource> {\n history: Bundle;\n}\n\nfunction HistoryTimelineItem(props: HistoryTimelineItemProps): JSX.Element {\n const previous = getPrevious(props.history, props.resource);\n if (previous) {\n return (\n <TimelineItem resource={props.resource} padding={true} popupMenuItems={<TimelineItemPopupMenu {...props} />}>\n <ResourceDiffTable original={previous} revised={props.resource} />\n </TimelineItem>\n );\n } else {\n return (\n <TimelineItem resource={props.resource} padding={true} popupMenuItems={<TimelineItemPopupMenu {...props} />}>\n <h3>Created</h3>\n <ResourceTable value={props.resource} ignoreMissingValues={true} />\n </TimelineItem>\n );\n }\n}\n\nfunction getPrevious(history: Bundle, version: Resource): Resource | undefined {\n const entries = history.entry as BundleEntry[];\n const index = entries.findIndex((entry) => entry.resource?.meta?.versionId === version.meta?.versionId);\n if (index >= entries.length - 1) {\n return undefined;\n }\n return entries[index + 1].resource;\n}\n\nfunction CommunicationTimelineItem(props: BaseTimelineItemProps<Communication>): JSX.Element {\n const { classes } = useStyles();\n const routine = !props.resource.priority || props.resource.priority === 'routine';\n const className = routine ? undefined : classes.pinnedComment;\n return (\n <TimelineItem\n resource={props.resource}\n profile={props.resource.sender}\n padding={true}\n className={className}\n popupMenuItems={<TimelineItemPopupMenu {...props} />}\n >\n <p>{props.resource.payload?.[0]?.contentString}</p>\n </TimelineItem>\n );\n}\n\nfunction MediaTimelineItem(props: BaseTimelineItemProps<Media>): JSX.Element {\n const contentType = props.resource.content?.contentType;\n const padding =\n contentType &&\n !contentType.startsWith('image/') &&\n !contentType.startsWith('video/') &&\n contentType !== 'application/pdf';\n return (\n <TimelineItem resource={props.resource} padding={!!padding} popupMenuItems={<TimelineItemPopupMenu {...props} />}>\n <AttachmentDisplay value={props.resource.content} />\n </TimelineItem>\n );\n}\n\nfunction AuditEventTimelineItem(props: BaseTimelineItemProps<AuditEvent>): JSX.Element {\n return (\n <TimelineItem resource={props.resource} padding={true} popupMenuItems={<TimelineItemPopupMenu {...props} />}>\n <ScrollArea>\n <pre>{props.resource.outcomeDesc}</pre>\n </ScrollArea>\n </TimelineItem>\n );\n}\n\nfunction DiagnosticReportTimelineItem(props: BaseTimelineItemProps<DiagnosticReport>): JSX.Element {\n return (\n <TimelineItem resource={props.resource} padding={true} popupMenuItems={<TimelineItemPopupMenu {...props} />}>\n <DiagnosticReportDisplay value={props.resource} />\n </TimelineItem>\n );\n}\n\nfunction getProgressMessage(e: ProgressEvent): string {\n if (e.lengthComputable) {\n const percent = (100 * e.loaded) / e.total;\n return `Uploaded: ${formatFileSize(e.loaded)} / ${formatFileSize(e.total)} ${percent.toFixed(2)}%`;\n }\n return `Uploaded: ${formatFileSize(e.loaded)}`;\n}\n\nfunction formatFileSize(bytes: number): string {\n if (bytes == 0) {\n return '0.00 B';\n }\n const e = Math.floor(Math.log(bytes) / Math.log(1024));\n return (bytes / Math.pow(1024, e)).toFixed(2) + ' ' + ' KMGTP'.charAt(e) + 'B';\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,MAAM;AACzC,IAAA,aAAa,EAAE;QACb,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,KAAA;AACF,CAAA,CAAC,CAAC,CAAC;AASE,SAAU,gBAAgB,CAAqB,KAA+B,EAAA;AAClF,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;AAC/B,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAC7B,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,EAAqB,CAAC;AACvD,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAU,CAAC;IACjD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAa,EAAE,CA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CAAC,GAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AACjF;;;;"}
@@ -1,12 +1,12 @@
1
1
  import { createStyles, Text, Stack, Button } from '@mantine/core';
2
2
  import { getReferenceString } from '@medplum/core';
3
3
  import React, { useState, useRef, useEffect } from 'react';
4
- import { getStartMonth, CalendarInput } from '../CalendarInput/CalendarInput.js';
5
- import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
6
- import { QuestionnaireForm } from '../QuestionnaireForm/QuestionnaireForm.js';
7
- import { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar.js';
8
- import { ResourceName } from '../ResourceName/ResourceName.js';
9
- import { useResource } from '../useResource/useResource.js';
4
+ import { getStartMonth, CalendarInput } from '../CalendarInput/CalendarInput.mjs';
5
+ import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
6
+ import { QuestionnaireForm } from '../QuestionnaireForm/QuestionnaireForm.mjs';
7
+ import { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar.mjs';
8
+ import { ResourceName } from '../ResourceName/ResourceName.mjs';
9
+ import { useResource } from '../useResource/useResource.mjs';
10
10
 
11
11
  const useStyles = createStyles((theme) => ({
12
12
  container: {
@@ -24,7 +24,6 @@ const useStyles = createStyles((theme) => ({
24
24
  },
25
25
  }));
26
26
  function Scheduler(props) {
27
- var _a;
28
27
  const { classes } = useStyles();
29
28
  const medplum = useMedplum();
30
29
  const schedule = useResource(props.schedule);
@@ -56,7 +55,7 @@ function Scheduler(props) {
56
55
  if (!schedule || !slots || !questionnaire) {
57
56
  return null;
58
57
  }
59
- const actor = (_a = schedule.actor) === null || _a === void 0 ? void 0 : _a[0];
58
+ const actor = schedule.actor?.[0];
60
59
  return (React.createElement("div", { className: classes.container, "data-testid": "scheduler" },
61
60
  React.createElement("div", { className: classes.info },
62
61
  actor && React.createElement(ResourceAvatar, { value: actor, size: "xl" }),
@@ -96,4 +95,4 @@ function formatTime(date) {
96
95
  }
97
96
 
98
97
  export { Scheduler };
99
- //# sourceMappingURL=Scheduler.js.map
98
+ //# sourceMappingURL=Scheduler.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scheduler.mjs","sources":["../../../src/Scheduler/Scheduler.tsx"],"sourcesContent":["import { Button, createStyles, Stack, Text } from '@mantine/core';\nimport { getReferenceString } from '@medplum/core';\nimport { Questionnaire, QuestionnaireResponse, Reference, Schedule, Slot } from '@medplum/fhirtypes';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { CalendarInput, getStartMonth } from '../CalendarInput/CalendarInput';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { QuestionnaireForm } from '../QuestionnaireForm/QuestionnaireForm';\nimport { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar';\nimport { ResourceName } from '../ResourceName/ResourceName';\nimport { useResource } from '../useResource/useResource';\n\nconst useStyles = createStyles((theme) => ({\n container: {\n display: 'flex',\n minHeight: 400,\n },\n\n info: {\n minWidth: 300,\n padding: 20,\n borderRight: `1px solid ${theme.colors.gray[3]}`,\n },\n\n selection: {\n minWidth: 300,\n padding: 20,\n },\n}));\n\nexport interface SchedulerProps {\n schedule: Schedule | Reference<Schedule>;\n questionnaire: Questionnaire | Reference<Questionnaire>;\n}\n\nexport function Scheduler(props: SchedulerProps): JSX.Element | null {\n const { classes } = useStyles();\n const medplum = useMedplum();\n const schedule = useResource(props.schedule);\n const questionnaire = useResource(props.questionnaire);\n\n const [slots, setSlots] = useState<Slot[]>();\n const slotsRef = useRef<Slot[]>();\n slotsRef.current = slots;\n\n const [month, setMonth] = useState<Date>(getStartMonth());\n const [date, setDate] = useState<Date>();\n const [slot, setSlot] = useState<Slot>();\n const [response, setResponse] = useState<QuestionnaireResponse>();\n\n useEffect(() => {\n if (schedule) {\n setSlots([]);\n medplum\n .searchResources(\n 'Slot',\n new URLSearchParams([\n ['_count', (30 * 24).toString()],\n ['schedule', getReferenceString(schedule)],\n ['start', 'gt' + getStart(month)],\n ['start', 'lt' + getEnd(month)],\n ])\n )\n .then(setSlots)\n .catch(console.log);\n } else {\n setSlots(undefined);\n }\n }, [medplum, schedule, month]);\n\n if (!schedule || !slots || !questionnaire) {\n return null;\n }\n\n const actor = schedule.actor?.[0];\n\n return (\n <div className={classes.container} data-testid=\"scheduler\">\n <div className={classes.info}>\n {actor && <ResourceAvatar value={actor} size=\"xl\" />}\n {actor && (\n <Text size=\"xl\" weight={500}>\n <ResourceName value={actor} />\n </Text>\n )}\n <p>1 hour</p>\n {date && <p>{date.toLocaleDateString()}</p>}\n {slot && <p>{formatTime(new Date(slot.start as string))}</p>}\n </div>\n <div className={classes.selection}>\n {!date && (\n <div>\n <h3>Select date</h3>\n <CalendarInput slots={slots} onChangeMonth={setMonth} onClick={setDate} />\n </div>\n )}\n {date && !slot && (\n <div>\n <h3>Select time</h3>\n <Stack>\n {slots.map((s) => {\n const slotStart = new Date(s.start as string);\n return (\n slotStart.getTime() > date.getTime() &&\n slotStart.getTime() < date.getTime() + 24 * 3600 * 1000 && (\n <div key={s.id}>\n <Button variant=\"outline\" style={{ width: 150 }} onClick={() => setSlot(s)}>\n {formatTime(slotStart)}\n </Button>\n </div>\n )\n );\n })}\n </Stack>\n </div>\n )}\n {date && slot && !response && (\n <QuestionnaireForm questionnaire={questionnaire} submitButtonText={'Next'} onSubmit={setResponse} />\n )}\n {date && slot && response && (\n <div>\n <h3>You're all set!</h3>\n <p>Check your email for a calendar invite.</p>\n </div>\n )}\n </div>\n </div>\n );\n}\n\nfunction getStart(month: Date): string {\n return formatSlotInstant(month.getTime());\n}\n\nfunction getEnd(month: Date): string {\n return formatSlotInstant(month.getTime() + 31 * 24 * 60 * 60 * 1000);\n}\n\nfunction formatSlotInstant(time: number): string {\n return new Date(Math.max(Date.now(), time)).toISOString();\n}\n\nfunction formatTime(date: Date): string {\n return date.toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });\n}\n"],"names":[],"mappings":";;;;;;;;;;AAWA,MAAM,SAAS,G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