@medplum/react 1.0.5 → 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 (364) hide show
  1. package/README.md +2 -1
  2. package/dist/cjs/MoneyDisplay/MoneyDisplay.d.ts +6 -0
  3. package/dist/cjs/MoneyInput/MoneyInput.d.ts +10 -0
  4. package/dist/cjs/MoneyInput/MoneyInput.stories.d.ts +6 -0
  5. package/dist/cjs/{index.js → index.cjs} +598 -518
  6. package/dist/cjs/index.cjs.map +1 -0
  7. package/dist/cjs/index.d.ts +2 -0
  8. package/dist/cjs/index.min.cjs +1 -0
  9. package/dist/esm/AddressDisplay/{AddressDisplay.js → AddressDisplay.mjs} +1 -1
  10. package/dist/esm/AddressDisplay/AddressDisplay.mjs.map +1 -0
  11. package/dist/esm/AddressInput/{AddressInput.js → AddressInput.mjs} +9 -9
  12. package/dist/esm/AddressInput/AddressInput.mjs.map +1 -0
  13. package/dist/esm/AnnotationInput/{AnnotationInput.js → AnnotationInput.mjs} +2 -2
  14. package/dist/esm/AnnotationInput/AnnotationInput.mjs.map +1 -0
  15. package/dist/esm/AsyncAutocomplete/{AsyncAutocomplete.js → AsyncAutocomplete.mjs} +7 -10
  16. package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs.map +1 -0
  17. package/dist/esm/AttachmentArrayDisplay/{AttachmentArrayDisplay.js → AttachmentArrayDisplay.mjs} +2 -2
  18. package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs.map +1 -0
  19. package/dist/esm/AttachmentArrayInput/{AttachmentArrayInput.js → AttachmentArrayInput.mjs} +6 -7
  20. package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs.map +1 -0
  21. package/dist/esm/AttachmentButton/{AttachmentButton.js → AttachmentButton.mjs} +5 -7
  22. package/dist/esm/AttachmentButton/AttachmentButton.mjs.map +1 -0
  23. package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs +21 -0
  24. package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs.map +1 -0
  25. package/dist/esm/AttachmentInput/{AttachmentInput.js → AttachmentInput.mjs} +5 -5
  26. package/dist/esm/AttachmentInput/AttachmentInput.mjs.map +1 -0
  27. package/dist/esm/BackboneElementDisplay/{BackboneElementDisplay.js → BackboneElementDisplay.mjs} +4 -4
  28. package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs.map +1 -0
  29. package/dist/esm/BackboneElementInput/{BackboneElementInput.js → BackboneElementInput.mjs} +10 -11
  30. package/dist/esm/BackboneElementInput/BackboneElementInput.mjs.map +1 -0
  31. package/dist/esm/CalendarInput/{CalendarInput.js → CalendarInput.mjs} +1 -1
  32. package/dist/esm/CalendarInput/CalendarInput.mjs.map +1 -0
  33. package/dist/esm/CheckboxFormSection/{CheckboxFormSection.js → CheckboxFormSection.mjs} +1 -1
  34. package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs.map +1 -0
  35. package/dist/esm/CodeInput/{CodeInput.js → CodeInput.mjs} +3 -3
  36. package/dist/esm/CodeInput/CodeInput.mjs.map +1 -0
  37. package/dist/esm/CodeableConceptDisplay/{CodeableConceptDisplay.js → CodeableConceptDisplay.mjs} +1 -1
  38. package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs.map +1 -0
  39. package/dist/esm/CodeableConceptInput/{CodeableConceptInput.js → CodeableConceptInput.mjs} +3 -4
  40. package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs.map +1 -0
  41. package/dist/esm/CodingDisplay/{CodingDisplay.js → CodingDisplay.mjs} +1 -1
  42. package/dist/esm/CodingDisplay/CodingDisplay.mjs.map +1 -0
  43. package/dist/esm/CodingInput/{CodingInput.js → CodingInput.mjs} +2 -2
  44. package/dist/esm/CodingInput/CodingInput.mjs.map +1 -0
  45. package/dist/esm/ContactDetailDisplay/{ContactDetailDisplay.js → ContactDetailDisplay.mjs} +4 -5
  46. package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs.map +1 -0
  47. package/dist/esm/ContactDetailInput/{ContactDetailInput.js → ContactDetailInput.mjs} +6 -7
  48. package/dist/esm/ContactDetailInput/ContactDetailInput.mjs.map +1 -0
  49. package/dist/esm/ContactPointDisplay/{ContactPointDisplay.js → ContactPointDisplay.mjs} +1 -1
  50. package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs.map +1 -0
  51. package/dist/esm/ContactPointInput/{ContactPointInput.js → ContactPointInput.mjs} +7 -7
  52. package/dist/esm/ContactPointInput/ContactPointInput.mjs.map +1 -0
  53. package/dist/esm/Container/{Container.js → Container.mjs} +3 -4
  54. package/dist/esm/Container/Container.mjs.map +1 -0
  55. package/dist/esm/DateTimeInput/{DateTimeInput.js → DateTimeInput.mjs} +2 -2
  56. package/dist/esm/DateTimeInput/DateTimeInput.mjs.map +1 -0
  57. package/dist/esm/DefaultResourceTimeline/{DefaultResourceTimeline.js → DefaultResourceTimeline.mjs} +2 -2
  58. package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs.map +1 -0
  59. package/dist/esm/DescriptionList/{DescriptionList.js → DescriptionList.mjs} +1 -1
  60. package/dist/esm/DescriptionList/DescriptionList.mjs.map +1 -0
  61. package/dist/esm/DiagnosticReportDisplay/{DiagnosticReportDisplay.js → DiagnosticReportDisplay.mjs} +13 -16
  62. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs.map +1 -0
  63. package/dist/esm/Document/Document.mjs +12 -0
  64. package/dist/esm/Document/Document.mjs.map +1 -0
  65. package/dist/esm/EncounterTimeline/{EncounterTimeline.js → EncounterTimeline.mjs} +2 -2
  66. package/dist/esm/EncounterTimeline/EncounterTimeline.mjs.map +1 -0
  67. package/dist/esm/ErrorBoundary/{ErrorBoundary.js → ErrorBoundary.mjs} +1 -1
  68. package/dist/esm/ErrorBoundary/ErrorBoundary.mjs.map +1 -0
  69. package/dist/esm/ExtensionInput/{ExtensionInput.js → ExtensionInput.mjs} +1 -1
  70. package/dist/esm/ExtensionInput/ExtensionInput.mjs.map +1 -0
  71. package/dist/esm/FhirPathDisplay/{FhirPathDisplay.js → FhirPathDisplay.mjs} +2 -2
  72. package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs.map +1 -0
  73. package/dist/esm/FhirPathTable/{FhirPathTable.js → FhirPathTable.mjs} +14 -17
  74. package/dist/esm/FhirPathTable/FhirPathTable.mjs.map +1 -0
  75. package/dist/esm/Form/{Form.js → Form.mjs} +2 -2
  76. package/dist/esm/Form/Form.mjs.map +1 -0
  77. package/dist/esm/Form/{FormUtils.js → FormUtils.mjs} +1 -1
  78. package/dist/esm/Form/FormUtils.mjs.map +1 -0
  79. package/dist/esm/FormSection/{FormSection.js → FormSection.mjs} +2 -2
  80. package/dist/esm/FormSection/FormSection.mjs.map +1 -0
  81. package/dist/esm/GoogleButton/{GoogleButton.js → GoogleButton.mjs} +4 -5
  82. package/dist/esm/GoogleButton/GoogleButton.mjs.map +1 -0
  83. package/dist/esm/HumanNameDisplay/{HumanNameDisplay.js → HumanNameDisplay.mjs} +1 -1
  84. package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs.map +1 -0
  85. package/dist/esm/HumanNameInput/HumanNameInput.mjs +50 -0
  86. package/dist/esm/HumanNameInput/HumanNameInput.mjs.map +1 -0
  87. package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs +11 -0
  88. package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs.map +1 -0
  89. package/dist/esm/IdentifierInput/{IdentifierInput.js → IdentifierInput.mjs} +3 -3
  90. package/dist/esm/IdentifierInput/IdentifierInput.mjs.map +1 -0
  91. package/dist/esm/Logo/{Logo.js → Logo.mjs} +1 -1
  92. package/dist/esm/Logo/Logo.mjs.map +1 -0
  93. package/dist/esm/MedplumLink/{MedplumLink.js → MedplumLink.mjs} +5 -6
  94. package/dist/esm/MedplumLink/MedplumLink.mjs.map +1 -0
  95. package/dist/esm/MedplumProvider/{MedplumProvider.js → MedplumProvider.mjs} +9 -3
  96. package/dist/esm/MedplumProvider/MedplumProvider.mjs.map +1 -0
  97. package/dist/esm/MoneyDisplay/MoneyDisplay.d.ts +6 -0
  98. package/dist/esm/MoneyDisplay/MoneyDisplay.mjs +9 -0
  99. package/dist/esm/MoneyDisplay/MoneyDisplay.mjs.map +1 -0
  100. package/dist/esm/MoneyInput/MoneyInput.d.ts +10 -0
  101. package/dist/esm/MoneyInput/MoneyInput.mjs +53 -0
  102. package/dist/esm/MoneyInput/MoneyInput.mjs.map +1 -0
  103. package/dist/esm/MoneyInput/MoneyInput.stories.d.ts +6 -0
  104. package/dist/esm/Panel/{Panel.js → Panel.mjs} +3 -4
  105. package/dist/esm/Panel/Panel.mjs.map +1 -0
  106. package/dist/esm/PatientTimeline/{PatientTimeline.js → PatientTimeline.mjs} +2 -2
  107. package/dist/esm/PatientTimeline/PatientTimeline.mjs.map +1 -0
  108. package/dist/esm/PeriodInput/{PeriodInput.js → PeriodInput.mjs} +4 -4
  109. package/dist/esm/PeriodInput/PeriodInput.mjs.map +1 -0
  110. package/dist/esm/PlanDefinitionBuilder/{PlanDefinitionBuilder.js → PlanDefinitionBuilder.mjs} +36 -24
  111. package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs.map +1 -0
  112. package/dist/esm/QuantityDisplay/{QuantityDisplay.js → QuantityDisplay.mjs} +1 -1
  113. package/dist/esm/QuantityDisplay/QuantityDisplay.mjs.map +1 -0
  114. package/dist/esm/QuantityInput/{QuantityInput.js → QuantityInput.mjs} +13 -5
  115. package/dist/esm/QuantityInput/QuantityInput.mjs.map +1 -0
  116. package/dist/esm/QuestionnaireBuilder/{QuestionnaireBuilder.js → QuestionnaireBuilder.mjs} +45 -27
  117. package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs.map +1 -0
  118. package/dist/esm/QuestionnaireForm/{QuestionnaireForm.js → QuestionnaireForm.mjs} +36 -36
  119. package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs.map +1 -0
  120. package/dist/esm/RangeDisplay/{RangeDisplay.js → RangeDisplay.mjs} +1 -1
  121. package/dist/esm/RangeDisplay/RangeDisplay.mjs.map +1 -0
  122. package/dist/esm/RangeInput/{RangeInput.js → RangeInput.mjs} +10 -4
  123. package/dist/esm/RangeInput/RangeInput.mjs.map +1 -0
  124. package/dist/esm/RatioDisplay/{RatioDisplay.js → RatioDisplay.mjs} +2 -2
  125. package/dist/esm/RatioDisplay/RatioDisplay.mjs.map +1 -0
  126. package/dist/esm/RatioInput/{RatioInput.js → RatioInput.mjs} +10 -4
  127. package/dist/esm/RatioInput/RatioInput.mjs.map +1 -0
  128. package/dist/esm/ReferenceDisplay/{ReferenceDisplay.js → ReferenceDisplay.mjs} +2 -2
  129. package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs.map +1 -0
  130. package/dist/esm/ReferenceInput/{ReferenceInput.js → ReferenceInput.mjs} +10 -5
  131. package/dist/esm/ReferenceInput/ReferenceInput.mjs.map +1 -0
  132. package/dist/esm/ReferenceRangeEditor/{ReferenceRangeEditor.js → ReferenceRangeEditor.mjs} +44 -38
  133. package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs.map +1 -0
  134. package/dist/esm/RequestGroupDisplay/{RequestGroupDisplay.js → RequestGroupDisplay.mjs} +14 -17
  135. package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs.map +1 -0
  136. package/dist/esm/ResourceArrayDisplay/{ResourceArrayDisplay.js → ResourceArrayDisplay.mjs} +4 -5
  137. package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs.map +1 -0
  138. package/dist/esm/ResourceArrayInput/{ResourceArrayInput.js → ResourceArrayInput.mjs} +3 -3
  139. package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs.map +1 -0
  140. package/dist/esm/ResourceAvatar/ResourceAvatar.mjs +23 -0
  141. package/dist/esm/ResourceAvatar/ResourceAvatar.mjs.map +1 -0
  142. package/dist/esm/ResourceBadge/{ResourceBadge.js → ResourceBadge.mjs} +3 -3
  143. package/dist/esm/ResourceBadge/ResourceBadge.mjs.map +1 -0
  144. package/dist/esm/ResourceBlame/{ResourceBlame.js → ResourceBlame.mjs} +6 -7
  145. package/dist/esm/ResourceBlame/ResourceBlame.mjs.map +1 -0
  146. package/dist/esm/ResourceDiff/{ResourceDiff.js → ResourceDiff.mjs} +4 -4
  147. package/dist/esm/ResourceDiff/ResourceDiff.mjs.map +1 -0
  148. package/dist/esm/ResourceDiffTable/{ResourceDiffTable.js → ResourceDiffTable.mjs} +3 -3
  149. package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs.map +1 -0
  150. package/dist/esm/ResourceForm/{ResourceForm.js → ResourceForm.mjs} +5 -5
  151. package/dist/esm/ResourceForm/ResourceForm.mjs.map +1 -0
  152. package/dist/esm/ResourceHistoryTable/{ResourceHistoryTable.js → ResourceHistoryTable.mjs} +10 -13
  153. package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs.map +1 -0
  154. package/dist/esm/ResourceInput/{ResourceInput.js → ResourceInput.mjs} +18 -24
  155. package/dist/esm/ResourceInput/ResourceInput.mjs.map +1 -0
  156. package/dist/esm/ResourceName/ResourceName.mjs +18 -0
  157. package/dist/esm/ResourceName/ResourceName.mjs.map +1 -0
  158. package/dist/esm/ResourcePropertyDisplay/{ResourcePropertyDisplay.js → ResourcePropertyDisplay.mjs} +23 -21
  159. package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs.map +1 -0
  160. package/dist/esm/ResourcePropertyInput/{ResourcePropertyInput.js → ResourcePropertyInput.mjs} +34 -34
  161. package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs.map +1 -0
  162. package/dist/esm/ResourceTable/{ResourceTable.js → ResourceTable.mjs} +4 -4
  163. package/dist/esm/ResourceTable/ResourceTable.mjs.map +1 -0
  164. package/dist/esm/ResourceTimeline/{ResourceTimeline.js → ResourceTimeline.mjs} +26 -30
  165. package/dist/esm/ResourceTimeline/ResourceTimeline.mjs.map +1 -0
  166. package/dist/esm/Scheduler/{Scheduler.js → Scheduler.mjs} +8 -9
  167. package/dist/esm/Scheduler/Scheduler.mjs.map +1 -0
  168. package/dist/esm/SearchControl/{SearchControl.js → SearchControl.mjs} +66 -50
  169. package/dist/esm/SearchControl/SearchControl.mjs.map +1 -0
  170. package/dist/esm/SearchControl/{SearchControlField.js → SearchControlField.mjs} +3 -4
  171. package/dist/esm/SearchControl/SearchControlField.mjs.map +1 -0
  172. package/dist/esm/SearchControl/{SearchUtils.js → SearchUtils.mjs} +34 -17
  173. package/dist/esm/SearchControl/SearchUtils.mjs.map +1 -0
  174. package/dist/esm/SearchFieldEditor/{SearchFieldEditor.js → SearchFieldEditor.mjs} +28 -21
  175. package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs.map +1 -0
  176. package/dist/esm/SearchFilterEditor/{SearchFilterEditor.js → SearchFilterEditor.mjs} +8 -9
  177. package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs.map +1 -0
  178. package/dist/esm/SearchFilterValueDialog/{SearchFilterValueDialog.js → SearchFilterValueDialog.mjs} +5 -6
  179. package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs.map +1 -0
  180. package/dist/esm/SearchFilterValueDisplay/{SearchFilterValueDisplay.js → SearchFilterValueDisplay.mjs} +3 -4
  181. package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs.map +1 -0
  182. package/dist/esm/SearchFilterValueInput/{SearchFilterValueInput.js → SearchFilterValueInput.mjs} +5 -6
  183. package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs.map +1 -0
  184. package/dist/esm/SearchPopupMenu/{SearchPopupMenu.js → SearchPopupMenu.mjs} +10 -10
  185. package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs.map +1 -0
  186. package/dist/esm/ServiceRequestTimeline/{ServiceRequestTimeline.js → ServiceRequestTimeline.mjs} +2 -2
  187. package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs.map +1 -0
  188. package/dist/esm/StatusBadge/{StatusBadge.js → StatusBadge.mjs} +1 -1
  189. package/dist/esm/StatusBadge/StatusBadge.mjs.map +1 -0
  190. package/dist/esm/Timeline/{Timeline.js → Timeline.mjs} +11 -13
  191. package/dist/esm/Timeline/Timeline.mjs.map +1 -0
  192. package/dist/esm/TimingInput/{TimingInput.js → TimingInput.mjs} +13 -18
  193. package/dist/esm/TimingInput/TimingInput.mjs.map +1 -0
  194. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs +43 -0
  195. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs.map +1 -0
  196. package/dist/esm/auth/{AuthenticationForm.js → AuthenticationForm.mjs} +21 -19
  197. package/dist/esm/auth/AuthenticationForm.mjs.map +1 -0
  198. package/dist/esm/auth/ChooseProfileForm.mjs +29 -0
  199. package/dist/esm/auth/ChooseProfileForm.mjs.map +1 -0
  200. package/dist/esm/auth/{ChooseScopeForm.js → ChooseScopeForm.mjs} +4 -4
  201. package/dist/esm/auth/ChooseScopeForm.mjs.map +1 -0
  202. package/dist/esm/auth/{MfaForm.js → MfaForm.mjs} +4 -4
  203. package/dist/esm/auth/MfaForm.mjs.map +1 -0
  204. package/dist/esm/auth/{NewProjectForm.js → NewProjectForm.mjs} +8 -9
  205. package/dist/esm/auth/NewProjectForm.mjs.map +1 -0
  206. package/dist/esm/auth/{NewUserForm.js → NewUserForm.mjs} +15 -19
  207. package/dist/esm/auth/NewUserForm.mjs.map +1 -0
  208. package/dist/esm/auth/{RegisterForm.js → RegisterForm.mjs} +5 -5
  209. package/dist/esm/auth/RegisterForm.mjs.map +1 -0
  210. package/dist/esm/auth/{SignInForm.js → SignInForm.mjs} +10 -11
  211. package/dist/esm/auth/SignInForm.mjs.map +1 -0
  212. package/dist/esm/{constants.js → constants.mjs} +1 -1
  213. package/dist/esm/constants.mjs.map +1 -0
  214. package/dist/esm/index.d.ts +2 -0
  215. package/dist/esm/index.min.mjs +1 -0
  216. package/dist/esm/{index.js → index.mjs} +88 -86
  217. package/dist/esm/index.mjs.map +1 -0
  218. package/dist/esm/useResource/{useResource.js → useResource.mjs} +2 -2
  219. package/dist/esm/useResource/useResource.mjs.map +1 -0
  220. package/dist/esm/utils/{blame.js → blame.mjs} +6 -9
  221. package/dist/esm/utils/blame.mjs.map +1 -0
  222. package/dist/esm/utils/{date.js → date.mjs} +2 -3
  223. package/dist/esm/utils/date.mjs.map +1 -0
  224. package/dist/esm/utils/{diff.js → diff.mjs} +1 -1
  225. package/dist/esm/utils/diff.mjs.map +1 -0
  226. package/dist/esm/utils/{dom.js → dom.mjs} +1 -1
  227. package/dist/esm/utils/dom.mjs.map +1 -0
  228. package/dist/esm/utils/outcomes.mjs +30 -0
  229. package/dist/esm/utils/outcomes.mjs.map +1 -0
  230. package/dist/esm/utils/{questionnaire.js → questionnaire.mjs} +1 -1
  231. package/dist/esm/utils/questionnaire.mjs.map +1 -0
  232. package/dist/esm/utils/{recaptcha.js → recaptcha.mjs} +5 -6
  233. package/dist/esm/utils/recaptcha.mjs.map +1 -0
  234. package/dist/esm/utils/{script.js → script.mjs} +1 -1
  235. package/dist/esm/utils/script.mjs.map +1 -0
  236. package/package.json +22 -22
  237. package/rollup.config.mjs +6 -7
  238. package/dist/cjs/auth/OktaButton.d.ts +0 -5
  239. package/dist/cjs/index.js.map +0 -1
  240. package/dist/cjs/index.min.js +0 -2
  241. package/dist/cjs/index.min.js.map +0 -1
  242. package/dist/esm/AddressDisplay/AddressDisplay.js.map +0 -1
  243. package/dist/esm/AddressInput/AddressInput.js.map +0 -1
  244. package/dist/esm/AnnotationInput/AnnotationInput.js.map +0 -1
  245. package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.js.map +0 -1
  246. package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.js.map +0 -1
  247. package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.js.map +0 -1
  248. package/dist/esm/AttachmentButton/AttachmentButton.js.map +0 -1
  249. package/dist/esm/AttachmentDisplay/AttachmentDisplay.js +0 -21
  250. package/dist/esm/AttachmentDisplay/AttachmentDisplay.js.map +0 -1
  251. package/dist/esm/AttachmentInput/AttachmentInput.js.map +0 -1
  252. package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.js.map +0 -1
  253. package/dist/esm/BackboneElementInput/BackboneElementInput.js.map +0 -1
  254. package/dist/esm/CalendarInput/CalendarInput.js.map +0 -1
  255. package/dist/esm/CheckboxFormSection/CheckboxFormSection.js.map +0 -1
  256. package/dist/esm/CodeInput/CodeInput.js.map +0 -1
  257. package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.js.map +0 -1
  258. package/dist/esm/CodeableConceptInput/CodeableConceptInput.js.map +0 -1
  259. package/dist/esm/CodingDisplay/CodingDisplay.js.map +0 -1
  260. package/dist/esm/CodingInput/CodingInput.js.map +0 -1
  261. package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.js.map +0 -1
  262. package/dist/esm/ContactDetailInput/ContactDetailInput.js.map +0 -1
  263. package/dist/esm/ContactPointDisplay/ContactPointDisplay.js.map +0 -1
  264. package/dist/esm/ContactPointInput/ContactPointInput.js.map +0 -1
  265. package/dist/esm/Container/Container.js.map +0 -1
  266. package/dist/esm/DateTimeInput/DateTimeInput.js.map +0 -1
  267. package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.js.map +0 -1
  268. package/dist/esm/DescriptionList/DescriptionList.js.map +0 -1
  269. package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.js.map +0 -1
  270. package/dist/esm/Document/Document.js +0 -13
  271. package/dist/esm/Document/Document.js.map +0 -1
  272. package/dist/esm/EncounterTimeline/EncounterTimeline.js.map +0 -1
  273. package/dist/esm/ErrorBoundary/ErrorBoundary.js.map +0 -1
  274. package/dist/esm/ExtensionInput/ExtensionInput.js.map +0 -1
  275. package/dist/esm/FhirPathDisplay/FhirPathDisplay.js.map +0 -1
  276. package/dist/esm/FhirPathTable/FhirPathTable.js.map +0 -1
  277. package/dist/esm/Form/Form.js.map +0 -1
  278. package/dist/esm/Form/FormUtils.js.map +0 -1
  279. package/dist/esm/FormSection/FormSection.js.map +0 -1
  280. package/dist/esm/GoogleButton/GoogleButton.js.map +0 -1
  281. package/dist/esm/HumanNameDisplay/HumanNameDisplay.js.map +0 -1
  282. package/dist/esm/HumanNameInput/HumanNameInput.js +0 -39
  283. package/dist/esm/HumanNameInput/HumanNameInput.js.map +0 -1
  284. package/dist/esm/IdentifierDisplay/IdentifierDisplay.js +0 -12
  285. package/dist/esm/IdentifierDisplay/IdentifierDisplay.js.map +0 -1
  286. package/dist/esm/IdentifierInput/IdentifierInput.js.map +0 -1
  287. package/dist/esm/Logo/Logo.js.map +0 -1
  288. package/dist/esm/MedplumLink/MedplumLink.js.map +0 -1
  289. package/dist/esm/MedplumProvider/MedplumProvider.js.map +0 -1
  290. package/dist/esm/Panel/Panel.js.map +0 -1
  291. package/dist/esm/PatientTimeline/PatientTimeline.js.map +0 -1
  292. package/dist/esm/PeriodInput/PeriodInput.js.map +0 -1
  293. package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.js.map +0 -1
  294. package/dist/esm/QuantityDisplay/QuantityDisplay.js.map +0 -1
  295. package/dist/esm/QuantityInput/QuantityInput.js.map +0 -1
  296. package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.js.map +0 -1
  297. package/dist/esm/QuestionnaireForm/QuestionnaireForm.js.map +0 -1
  298. package/dist/esm/RangeDisplay/RangeDisplay.js.map +0 -1
  299. package/dist/esm/RangeInput/RangeInput.js.map +0 -1
  300. package/dist/esm/RatioDisplay/RatioDisplay.js.map +0 -1
  301. package/dist/esm/RatioInput/RatioInput.js.map +0 -1
  302. package/dist/esm/ReferenceDisplay/ReferenceDisplay.js.map +0 -1
  303. package/dist/esm/ReferenceInput/ReferenceInput.js.map +0 -1
  304. package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.js.map +0 -1
  305. package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.js.map +0 -1
  306. package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.js.map +0 -1
  307. package/dist/esm/ResourceArrayInput/ResourceArrayInput.js.map +0 -1
  308. package/dist/esm/ResourceAvatar/ResourceAvatar.js +0 -24
  309. package/dist/esm/ResourceAvatar/ResourceAvatar.js.map +0 -1
  310. package/dist/esm/ResourceBadge/ResourceBadge.js.map +0 -1
  311. package/dist/esm/ResourceBlame/ResourceBlame.js.map +0 -1
  312. package/dist/esm/ResourceDiff/ResourceDiff.js.map +0 -1
  313. package/dist/esm/ResourceDiffTable/ResourceDiffTable.js.map +0 -1
  314. package/dist/esm/ResourceForm/ResourceForm.js.map +0 -1
  315. package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.js.map +0 -1
  316. package/dist/esm/ResourceInput/ResourceInput.js.map +0 -1
  317. package/dist/esm/ResourceName/ResourceName.js +0 -19
  318. package/dist/esm/ResourceName/ResourceName.js.map +0 -1
  319. package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.js.map +0 -1
  320. package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.js.map +0 -1
  321. package/dist/esm/ResourceTable/ResourceTable.js.map +0 -1
  322. package/dist/esm/ResourceTimeline/ResourceTimeline.js.map +0 -1
  323. package/dist/esm/Scheduler/Scheduler.js.map +0 -1
  324. package/dist/esm/SearchControl/SearchControl.js.map +0 -1
  325. package/dist/esm/SearchControl/SearchControlField.js.map +0 -1
  326. package/dist/esm/SearchControl/SearchUtils.js.map +0 -1
  327. package/dist/esm/SearchFieldEditor/SearchFieldEditor.js.map +0 -1
  328. package/dist/esm/SearchFilterEditor/SearchFilterEditor.js.map +0 -1
  329. package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.js.map +0 -1
  330. package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.js.map +0 -1
  331. package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.js.map +0 -1
  332. package/dist/esm/SearchPopupMenu/SearchPopupMenu.js.map +0 -1
  333. package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.js.map +0 -1
  334. package/dist/esm/StatusBadge/StatusBadge.js.map +0 -1
  335. package/dist/esm/Timeline/Timeline.js.map +0 -1
  336. package/dist/esm/TimingInput/TimingInput.js.map +0 -1
  337. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js +0 -45
  338. package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js.map +0 -1
  339. package/dist/esm/auth/AuthenticationForm.js.map +0 -1
  340. package/dist/esm/auth/ChooseProfileForm.js +0 -32
  341. package/dist/esm/auth/ChooseProfileForm.js.map +0 -1
  342. package/dist/esm/auth/ChooseScopeForm.js.map +0 -1
  343. package/dist/esm/auth/MfaForm.js.map +0 -1
  344. package/dist/esm/auth/NewProjectForm.js.map +0 -1
  345. package/dist/esm/auth/NewUserForm.js.map +0 -1
  346. package/dist/esm/auth/OktaButton.d.ts +0 -5
  347. package/dist/esm/auth/RegisterForm.js.map +0 -1
  348. package/dist/esm/auth/SignInForm.js.map +0 -1
  349. package/dist/esm/constants.js.map +0 -1
  350. package/dist/esm/index.js.map +0 -1
  351. package/dist/esm/index.min.js +0 -2
  352. package/dist/esm/index.min.js.map +0 -1
  353. package/dist/esm/node_modules/tslib/tslib.es6.js +0 -39
  354. package/dist/esm/node_modules/tslib/tslib.es6.js.map +0 -1
  355. package/dist/esm/useResource/useResource.js.map +0 -1
  356. package/dist/esm/utils/blame.js.map +0 -1
  357. package/dist/esm/utils/date.js.map +0 -1
  358. package/dist/esm/utils/diff.js.map +0 -1
  359. package/dist/esm/utils/dom.js.map +0 -1
  360. package/dist/esm/utils/outcomes.js +0 -29
  361. package/dist/esm/utils/outcomes.js.map +0 -1
  362. package/dist/esm/utils/questionnaire.js.map +0 -1
  363. package/dist/esm/utils/recaptcha.js.map +0 -1
  364. package/dist/esm/utils/script.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceDiffTable.mjs","sources":["../../../src/ResourceDiffTable/ResourceDiffTable.tsx"],"sourcesContent":["import { createStyles } from '@mantine/core';\nimport { getPropertyDisplayName, IndexedStructureDefinition, stringify, toTypedValue } from '@medplum/core';\nimport { Resource } from '@medplum/fhirtypes';\nimport React, { useEffect, useState } from 'react';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { getValueAndType, ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay';\n\nconst useStyles = createStyles((theme) => ({\n root: {\n borderCollapse: 'collapse',\n width: '100%',\n\n '& tr': {\n borderTop: `0.1px solid ${theme.colors.gray[3]}`,\n },\n\n '& th, & td': {\n padding: `${theme.spacing.sm}px ${theme.spacing.sm}px`,\n verticalAlign: 'top',\n },\n },\n\n removed: {\n color: theme.colors.red[7],\n textDecoration: 'line-through',\n },\n\n added: {\n color: theme.colors.green[7],\n },\n}));\n\nexport interface ResourceDiffTableProps {\n original: Resource;\n revised: Resource;\n}\n\nexport function ResourceDiffTable(props: ResourceDiffTableProps): JSX.Element | null {\n const { classes } = useStyles();\n const medplum = useMedplum();\n const [schema, setSchema] = useState<IndexedStructureDefinition | undefined>();\n\n useEffect(() => {\n medplum.requestSchema(props.original.resourceType).then(setSchema).catch(console.log);\n }, [medplum, props.original.resourceType]);\n\n if (!schema) {\n return null;\n }\n\n const typeSchema = schema.types[props.original.resourceType];\n if (!typeSchema) {\n return null;\n }\n\n return (\n <table className={classes.root}>\n <colgroup>\n <col style={{ width: '30%' }} />\n <col style={{ width: '35%' }} />\n <col style={{ width: '35%' }} />\n </colgroup>\n <thead>\n <tr>\n <th>Property</th>\n <th>Before</th>\n <th>After</th>\n </tr>\n </thead>\n <tbody>\n {Object.entries(typeSchema.properties).map((entry) => {\n const key = entry[0];\n if (key === 'id' || key === 'meta') {\n return null;\n }\n\n const property = entry[1];\n const [originalPropertyValue, originalPropertyType] = getValueAndType(toTypedValue(props.original), key);\n const [revisedPropertyValue, revisedPropertyType] = getValueAndType(toTypedValue(props.revised), key);\n if (isEmpty(originalPropertyValue) && isEmpty(revisedPropertyValue)) {\n return null;\n }\n\n if (stringify(originalPropertyValue) === stringify(revisedPropertyValue)) {\n return null;\n }\n\n return (\n <tr key={key}>\n <td>{getPropertyDisplayName(key)}</td>\n <td className={classes.removed}>\n <ResourcePropertyDisplay\n property={property}\n propertyType={originalPropertyType}\n value={originalPropertyValue}\n ignoreMissingValues={true}\n />\n </td>\n <td className={classes.added}>\n <ResourcePropertyDisplay\n property={property}\n propertyType={revisedPropertyType}\n value={revisedPropertyValue}\n ignoreMissingValues={true}\n />\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n );\n}\n\nfunction isEmpty(value: unknown): boolean {\n return (\n !value ||\n (Array.isArray(value) && value.length === 0) ||\n (typeof value === 'object' && Object.keys(value).length === 0)\n );\n}\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,MAAM;AACzC,IAAA,IAAI,EAAE;AACJ,QAAA,cAAc,EAAE,UAAU;AAC1B,QAAA,KAAK,EAAE,MAAM;AAEb,QAAA,MAAM,EAAE;YACN,SAAS,EAAE,CAAe,YAAA,EAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAA;AACjD,SAAA;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,OAAO,EAAE,CAAA,EAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAA,GAAA,EAAM,KAAK,CAAC,OAAO,CAAC,EAAE,CAAI,EAAA,CAAA;AACtD,YAAA,aAAa,EAAE,KAAK;AACrB,SAAA;AACF,KAAA;AAED,IAAA,OAAO,EAAE;QACP,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1B,QAAA,cAAc,EAAE,cAAc;AAC/B,KAAA;AAED,IAAA,KAAK,EAAE;QACL,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7B,KAAA;A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,GAAG,EAAA;AACV,gBAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,EAAK,sBAAsB,CAAC,GAAG,CAAC,CAAM;AACtC,gBAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,OAAO,CAAC,OAAO,EAAA;AAC5B,oBAAA,KAAA,CAAA,aAAA,CAAC,uBAAuB,EACtB,EAAA,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,oBAAoB,EAClC,KAAK,EAAE,qBAAqB,EAC5B,mBAAmB,EAAE,IAAI,GACzB,CACC;AACL,gBAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,OAAO,CAAC,KAAK,EAAA;oBAC1B,KAAC,CAAA,aAAA,CAAA,uBAAuB,IACtB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,mBAAmB,EACjC,KAAK,EAAE,oBAAoB,EAC3B,mBAAmB,EAAE,IAAI,EACzB,CAAA,CACC,CACF,EACL;AACJ,SAAC,CAAC,CACI,CACF,EACR;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,KAAc,EAAA;IAC7B,QACE,CAAC,KAAK;AACN,SAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;AAC5C,SAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,EAC9D;AACJ;;;;"}
@@ -1,10 +1,10 @@
1
1
  import { Stack, TextInput, Group, Button } from '@mantine/core';
2
2
  import { capitalize } from '@medplum/core';
3
3
  import React, { useState, useEffect } from 'react';
4
- import { BackboneElementInput } from '../BackboneElementInput/BackboneElementInput.js';
5
- import { FormSection } from '../FormSection/FormSection.js';
6
- import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
7
- import { useResource } from '../useResource/useResource.js';
4
+ import { BackboneElementInput } from '../BackboneElementInput/BackboneElementInput.mjs';
5
+ import { FormSection } from '../FormSection/FormSection.mjs';
6
+ import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
7
+ import { useResource } from '../useResource/useResource.mjs';
8
8
 
9
9
  function ResourceForm(props) {
10
10
  const medplum = useMedplum();
@@ -53,4 +53,4 @@ function setPropertyValue(obj, key, propName, elementDefinition, value) {
53
53
  }
54
54
 
55
55
  export { ResourceForm, setPropertyValue };
56
- //# sourceMappingURL=ResourceForm.js.map
56
+ //# sourceMappingURL=ResourceForm.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceForm.mjs","sources":["../../../src/ResourceForm/ResourceForm.tsx"],"sourcesContent":["import { Button, Group, Stack, TextInput } from '@mantine/core';\nimport { capitalize, IndexedStructureDefinition } from '@medplum/core';\nimport { ElementDefinition, ElementDefinitionType, OperationOutcome, Reference, Resource } from '@medplum/fhirtypes';\nimport React, { useEffect, useState } from 'react';\nimport { BackboneElementInput } from '../BackboneElementInput/BackboneElementInput';\nimport { FormSection } from '../FormSection/FormSection';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { useResource } from '../useResource/useResource';\n\nexport interface ResourceFormProps {\n defaultValue: Resource | Reference;\n outcome?: OperationOutcome;\n onSubmit: (resource: Resource) => void;\n onDelete?: (resource: Resource) => void;\n}\n\nexport function ResourceForm(props: ResourceFormProps): JSX.Element {\n const medplum = useMedplum();\n const defaultValue = useResource(props.defaultValue);\n const [schema, setSchema] = useState<IndexedStructureDefinition | undefined>();\n const [value, setValue] = useState<Resource | undefined>();\n\n useEffect(() => {\n if (defaultValue) {\n setValue(JSON.parse(JSON.stringify(defaultValue)));\n medplum.requestSchema(defaultValue.resourceType).then(setSchema).catch(console.log);\n }\n }, [medplum, defaultValue]);\n\n if (!schema || !value) {\n return <div>Loading...</div>;\n }\n\n return (\n <form\n noValidate\n autoComplete=\"off\"\n onSubmit={(e: React.FormEvent) => {\n e.preventDefault();\n if (props.onSubmit) {\n props.onSubmit(value);\n }\n }}\n >\n <Stack mb=\"xl\">\n <FormSection title=\"Resource Type\" htmlFor=\"resourceType\" outcome={props.outcome}>\n <TextInput name=\"resourceType\" defaultValue={value.resourceType} disabled={true} />\n </FormSection>\n <FormSection title=\"ID\" htmlFor=\"id\" outcome={props.outcome}>\n <TextInput name=\"id\" defaultValue={value.id} disabled={true} />\n </FormSection>\n </Stack>\n <BackboneElementInput\n typeName={value.resourceType}\n defaultValue={value}\n outcome={props.outcome}\n onChange={setValue}\n />\n <Group position=\"right\" mt=\"xl\">\n <Button type=\"submit\">OK</Button>\n {props.onDelete && (\n <Button\n variant=\"outline\"\n color=\"red\"\n type=\"button\"\n onClick={() => {\n (props.onDelete as (resource: Resource) => void)(value);\n }}\n >\n Delete\n </Button>\n )}\n </Group>\n </form>\n );\n}\n\nexport function setPropertyValue(\n obj: any,\n key: string,\n propName: string,\n elementDefinition: ElementDefinition,\n value: any\n): any {\n const types = elementDefinition.type as ElementDefinitionType[];\n if (types.length > 1) {\n for (const type of types) {\n const compoundKey = key.replace('[x]', capitalize(type.code as string));\n if (compoundKey in obj) {\n delete obj[compoundKey];\n }\n }\n }\n obj[propName] = value;\n return obj;\n}\n"],"names":[],"mappings":";;;;;;;;AAgBM,SAAU,YAAY,CAAC,KAAwB,EAAA;AACnD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACrD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAA0C,CAAC;IAC/E,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAwB,CAAC;IAE3D,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,YAAY,EAAE;AAChB,YAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AACnD,YAA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-1,12 +1,11 @@
1
1
  import { Table } from '@mantine/core';
2
2
  import { formatDateTime, normalizeErrorString } from '@medplum/core';
3
3
  import React, { useState, useEffect } from 'react';
4
- import { MedplumLink } from '../MedplumLink/MedplumLink.js';
5
- import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
6
- import { ResourceBadge } from '../ResourceBadge/ResourceBadge.js';
4
+ import { MedplumLink } from '../MedplumLink/MedplumLink.mjs';
5
+ import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
6
+ import { ResourceBadge } from '../ResourceBadge/ResourceBadge.mjs';
7
7
 
8
8
  function ResourceHistoryTable(props) {
9
- var _a;
10
9
  const medplum = useMedplum();
11
10
  const [value, setValue] = useState(props.history);
12
11
  useEffect(() => {
@@ -26,28 +25,26 @@ function ResourceHistoryTable(props) {
26
25
  React.createElement("th", null, "Author"),
27
26
  React.createElement("th", null, "Date"),
28
27
  React.createElement("th", null, "Version"))),
29
- React.createElement("tbody", null, (_a = value.entry) === null || _a === void 0 ? void 0 : _a.map((entry, index) => (React.createElement(HistoryRow, { key: 'entry-' + index, entry: entry }))))));
28
+ React.createElement("tbody", null, value.entry?.map((entry, index) => (React.createElement(HistoryRow, { key: 'entry-' + index, entry: entry }))))));
30
29
  }
31
30
  function HistoryRow(props) {
32
- var _a, _b, _c;
33
31
  const { response, resource } = props.entry;
34
32
  if (resource) {
35
33
  return (React.createElement("tr", null,
36
34
  React.createElement("td", null,
37
- React.createElement(ResourceBadge, { value: (_a = resource.meta) === null || _a === void 0 ? void 0 : _a.author, link: true })),
38
- React.createElement("td", null, formatDateTime((_b = resource.meta) === null || _b === void 0 ? void 0 : _b.lastUpdated)),
35
+ React.createElement(ResourceBadge, { value: resource.meta?.author, link: true })),
36
+ React.createElement("td", null, formatDateTime(resource.meta?.lastUpdated)),
39
37
  React.createElement("td", null,
40
- React.createElement(MedplumLink, { to: getVersionUrl(resource) }, (_c = resource.meta) === null || _c === void 0 ? void 0 : _c.versionId))));
38
+ React.createElement(MedplumLink, { to: getVersionUrl(resource) }, resource.meta?.versionId))));
41
39
  }
42
40
  else {
43
41
  return (React.createElement("tr", null,
44
- React.createElement("td", { colSpan: 3 }, normalizeErrorString(response === null || response === void 0 ? void 0 : response.outcome))));
42
+ React.createElement("td", { colSpan: 3 }, normalizeErrorString(response?.outcome))));
45
43
  }
46
44
  }
47
45
  function getVersionUrl(resource) {
48
- var _a;
49
- return `/${resource.resourceType}/${resource.id}/_history/${(_a = resource.meta) === null || _a === void 0 ? void 0 : _a.versionId}`;
46
+ return `/${resource.resourceType}/${resource.id}/_history/${resource.meta?.versionId}`;
50
47
  }
51
48
 
52
49
  export { ResourceHistoryTable };
53
- //# sourceMappingURL=ResourceHistoryTable.js.map
50
+ //# sourceMappingURL=ResourceHistoryTable.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceHistoryTable.mjs","sources":["../../../src/ResourceHistoryTable/ResourceHistoryTable.tsx"],"sourcesContent":["import { Table } from '@mantine/core';\nimport { formatDateTime, normalizeErrorString } from '@medplum/core';\nimport { Bundle, BundleEntry, Resource, ResourceType } from '@medplum/fhirtypes';\nimport React, { useEffect, useState } from 'react';\nimport { MedplumLink } from '../MedplumLink/MedplumLink';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { ResourceBadge } from '../ResourceBadge/ResourceBadge';\n\nexport interface ResourceHistoryTableProps {\n history?: Bundle;\n resourceType?: string;\n id?: string;\n}\n\nexport function ResourceHistoryTable(props: ResourceHistoryTableProps): JSX.Element {\n const medplum = useMedplum();\n const [value, setValue] = useState<Bundle | undefined>(props.history);\n\n useEffect(() => {\n if (!props.history && props.resourceType && props.id) {\n medplum\n .readHistory(props.resourceType as ResourceType, props.id)\n .then(setValue)\n .catch(console.log);\n }\n }, [medplum, props.history, props.resourceType, props.id]);\n\n if (!value) {\n return <div>Loading...</div>;\n }\n\n return (\n <Table withBorder withColumnBorders>\n <thead>\n <tr>\n <th>Author</th>\n <th>Date</th>\n <th>Version</th>\n </tr>\n </thead>\n <tbody>\n {value.entry?.map((entry, index) => (\n <HistoryRow key={'entry-' + index} entry={entry} />\n ))}\n </tbody>\n </Table>\n );\n}\n\ninterface HistoryRowProps {\n entry: BundleEntry;\n}\n\nfunction HistoryRow(props: HistoryRowProps): JSX.Element {\n const { response, resource } = props.entry;\n if (resource) {\n return (\n <tr>\n <td>\n <ResourceBadge value={resource.meta?.author} link={true} />\n </td>\n <td>{formatDateTime(resource.meta?.lastUpdated)}</td>\n <td>\n <MedplumLink to={getVersionUrl(resource)}>{resource.meta?.versionId}</MedplumLink>\n </td>\n </tr>\n );\n } else {\n return (\n <tr>\n <td colSpan={3}>{normalizeErrorString(response?.outcome)}</td>\n </tr>\n );\n }\n}\n\nfunction getVersionUrl(resource: Resource): string {\n return `/${resource.resourceType}/${resource.id}/_history/${resource.meta?.versionId}`;\n}\n"],"names":[],"mappings":";;;;;;;AAcM,SAAU,oBAAoB,CAAC,KAAgC,EAAA;AACnE,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAC7B,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAqB,KAAK,CAAC,OAAO,CAAC,CAAC;IAEtE,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,EAAE,EAAE;YACpD,OAAO;iBACJ,WAAW,CAAC,KAAK,CAAC,YAA4B,EAAE,KAAK,CAAC,EAAE,CAAC;iBACzD,IAAI,CAAC,QAAQ,CAAC;AACd,iBAAA,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACvB,SAAA;AACH,KAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3D,IAAI,CAAC,KAAK,EAAE;AACV,QAAA,OAAO,8CAAqB,CAAC;AAC9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A,IAAA,EAAA,IAAA;AACE,gBAAA,KAAA,CAAA,aAAA,CAAC,WAAW,EAAC,EAAA,EAAE,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAA,EAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAe,CAC/E,CACF,EACL;AACH,KAAA;AAAM,SAAA;AACL,QAAA,QACE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA;AACE,YAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,OAAO,EAAE,CAAC,EAAA,EAAG,oBAAoB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAM,CAC3D,EACL;AACH,KAAA;AACH,CAAC;AAED,SAAS,aAAa,CAAC,QAAkB,EAAA;AACvC,IAAA,OAAO,CAAI,CAAA,EAAA,QAAQ,CAAC,YAAY,IAAI,QAAQ,CAAC,EAAE,CAAA,UAAA,EAAa,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;AACzF;;;;"}
@@ -1,10 +1,9 @@
1
- import { __rest, __awaiter } from '../node_modules/tslib/tslib.es6.js';
2
1
  import { Group, Text, Autocomplete, Loader } from '@mantine/core';
3
2
  import { getDisplayString } from '@medplum/core';
4
3
  import React, { forwardRef, useState, useEffect } from 'react';
5
- import { useMedplum } from '../MedplumProvider/MedplumProvider.js';
6
- import { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar.js';
7
- import { useResource } from '../useResource/useResource.js';
4
+ import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
5
+ import { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar.mjs';
6
+ import { useResource } from '../useResource/useResource.mjs';
8
7
 
9
8
  /**
10
9
  * Defines which search parameters will be used by the type ahead to search for each resourceType
@@ -34,24 +33,20 @@ function ResourceInput(props) {
34
33
  setValue(getDisplayString(defaultValue));
35
34
  }
36
35
  }, [defaultValue, setValue]);
37
- function loadValues(input) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- setLoading(true);
40
- const searchCode = SEARCH_CODES[props.resourceType] || 'name';
41
- const searchParams = new URLSearchParams({
42
- [searchCode]: input,
43
- _count: '10',
44
- });
45
- const resources = yield medplum.searchResources(props.resourceType, searchParams);
46
- setData(resources.map((resource) => ({ value: getDisplayString(resource), resource })));
47
- setLoading(false);
36
+ async function loadValues(input) {
37
+ setLoading(true);
38
+ const searchCode = SEARCH_CODES[props.resourceType] || 'name';
39
+ const searchParams = new URLSearchParams({
40
+ [searchCode]: input,
41
+ _count: '10',
48
42
  });
43
+ const resources = await medplum.searchResources(props.resourceType, searchParams);
44
+ setData(resources.map((resource) => ({ value: getDisplayString(resource), resource })));
45
+ setLoading(false);
49
46
  }
50
- function handleChange(val) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- setValue(val);
53
- return loadValues(val);
54
- });
47
+ async function handleChange(val) {
48
+ setValue(val);
49
+ return loadValues(val);
55
50
  }
56
51
  function handleSelect(item) {
57
52
  setValue(item.value);
@@ -62,9 +57,8 @@ function ResourceInput(props) {
62
57
  }
63
58
  return (React.createElement(Autocomplete, { itemComponent: ItemComponent, value: value, data: data, placeholder: props.placeholder, onFocus: () => loadValues(value), onChange: handleChange, onItemSubmit: handleSelect, rightSection: loading ? React.createElement(Loader, { size: 16 }) : null }));
64
59
  }
65
- const ItemComponent = forwardRef((_a, ref) => {
66
- var { value, resource } = _a, others = __rest(_a, ["value", "resource"]);
67
- return (React.createElement("div", Object.assign({ ref: ref }, others),
60
+ const ItemComponent = forwardRef(({ value, resource, ...others }, ref) => {
61
+ return (React.createElement("div", { ref: ref, ...others },
68
62
  React.createElement(Group, { noWrap: true },
69
63
  React.createElement(ResourceAvatar, { value: resource }),
70
64
  React.createElement("div", null,
@@ -73,4 +67,4 @@ const ItemComponent = forwardRef((_a, ref) => {
73
67
  });
74
68
 
75
69
  export { ResourceInput };
76
- //# sourceMappingURL=ResourceInput.js.map
70
+ //# sourceMappingURL=ResourceInput.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceInput.mjs","sources":["../../../src/ResourceInput/ResourceInput.tsx"],"sourcesContent":["import { Autocomplete, AutocompleteItem, Group, Loader, Text } from '@mantine/core';\nimport { getDisplayString } from '@medplum/core';\nimport { Patient, Reference, Resource, ResourceType } from '@medplum/fhirtypes';\nimport React, { forwardRef, useEffect, useState } from 'react';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar';\nimport { useResource } from '../useResource/useResource';\n\n/**\n * Defines which search parameters will be used by the type ahead to search for each resourceType\n */\nconst SEARCH_CODES: Record<string, string> = {\n Schedule: '_id',\n Task: '_id',\n Patient: 'name',\n Practitioner: 'name',\n Questionnaire: 'name',\n ServiceRequest: '_id',\n DiagnosticReport: '_id',\n Specimen: '_id',\n Observation: 'code',\n RequestGroup: '_id',\n ActivityDefinition: 'name',\n User: 'email:contains',\n};\n\nexport interface ResourceInputProps<T extends Resource = Resource> {\n readonly resourceType: ResourceType;\n readonly name: string;\n readonly defaultValue?: T | Reference<T>;\n readonly placeholder?: string;\n readonly loadOnFocus?: boolean;\n readonly onChange?: (value: T | undefined) => void;\n}\n\nexport function ResourceInput<T extends Resource = Resource>(props: ResourceInputProps<T>): JSX.Element {\n const medplum = useMedplum();\n const defaultValue = useResource(props.defaultValue);\n const [value, setValue] = useState<string>(defaultValue ? getDisplayString(defaultValue) : '');\n const [loading, setLoading] = useState(false);\n const [data, setData] = useState<AutocompleteItem[]>([]);\n\n useEffect(() => {\n if (defaultValue) {\n setValue(getDisplayString(defaultValue));\n }\n }, [defaultValue, setValue]);\n\n async function loadValues(input: string): Promise<void> {\n setLoading(true);\n const searchCode = SEARCH_CODES[props.resourceType] || 'name';\n const searchParams = new URLSearchParams({\n [searchCode]: input,\n _count: '10',\n });\n\n const resources = await medplum.searchResources(props.resourceType, searchParams);\n setData(resources.map((resource) => ({ value: getDisplayString(resource), resource })));\n setLoading(false);\n }\n\n async function handleChange(val: string): Promise<void> {\n setValue(val);\n return loadValues(val);\n }\n\n function handleSelect(item: AutocompleteItem): void {\n setValue(item.value);\n setData([]);\n if (props.onChange) {\n props.onChange(item.resource);\n }\n }\n\n return (\n <Autocomplete\n itemComponent={ItemComponent}\n value={value}\n data={data}\n placeholder={props.placeholder}\n onFocus={() => loadValues(value)}\n onChange={handleChange}\n onItemSubmit={handleSelect}\n rightSection={loading ? <Loader size={16} /> : null}\n />\n );\n}\n\nconst ItemComponent = forwardRef<HTMLDivElement, any>(({ value, resource, ...others }: any, ref) => {\n return (\n <div ref={ref} {...others}>\n <Group noWrap>\n <ResourceAvatar value={resource} />\n <div>\n <Text>{value}</Text>\n <Text size=\"xs\" color=\"dimmed\">\n {(resource as Patient).birthDate}\n </Text>\n </div>\n </Group>\n </div>\n );\n});\n"],"names":[],"mappings":";;;;;;;AAQA;;AAEG;AACH,MAAM,YAAY,GAA2B;AAC3C,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,IAAI,EAAE,KAAK;AACX,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,YAAY,EAAE,MAAM;AACpB,IAAA,aAAa,EAAE,MAAM;AACrB,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,gBAAgB,EAAE,KAAK;AACvB,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,WAAW,EAAE,MAAM;AACnB,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,kBAAkB,EAAE,MAAM;AAC1B,IAAA,IAAI,EAAE,gBAAgB;CACvB,CAAC;AAWI,SAAU,aAAa,CAAgC,KAA4B,EAAA;AACvF,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACrD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAS,YAAY,GAAG,gBAAgB,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/F,MAAM,CAAC,OAAO,EAAE,UA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,CAAC,QAAQ,CAAC,CAAC;AAC/B,SAAA;KACF;IAED,QACE,KAAC,CAAA,aAAA,CAAA,YAAY,EACX,EAAA,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,OAAO,EAAE,MAAM,UAAU,CAAC,KAAK,CAAC,EAChC,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,GAAG,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAE,EAAE,EAAA,CAAI,GAAG,IAAI,EACnD,CAAA,EACF;AACJ,CAAC;AAED,MAAM,aAAa,GAAG,UAAU,CAAsB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAO,EAAE,GAAG,KAAI;AACjG,IAAA,QACE,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,GAAG,KAAM,MAAM,EAAA;QACvB,KAAC,CAAA,aAAA,CAAA,KAAK,IAAC,MAAM,EAAA,IAAA,EAAA;AACX,YAAA,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,KAAK,EAAE,QAAQ,EAAI,CAAA;AACnC,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;gBACE,KAAC,CAAA,aAAA,CAAA,IAAI,EAAE,IAAA,EAAA,KAAK,CAAQ;AACpB,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,QAAQ,EAC1B,EAAA,QAAoB,CAAC,SAAS,CAC3B,CACH,CACA,CACJ,EACN;AACJ,CAAC,CAAC;;;;"}
@@ -0,0 +1,18 @@
1
+ import { Text } from '@mantine/core';
2
+ import { getDisplayString } from '@medplum/core';
3
+ import React from 'react';
4
+ import { MedplumLink } from '../MedplumLink/MedplumLink.mjs';
5
+ import { useResource } from '../useResource/useResource.mjs';
6
+
7
+ function ResourceName(props) {
8
+ const { value, link, ...rest } = props;
9
+ const resource = useResource(value);
10
+ if (!resource) {
11
+ return null;
12
+ }
13
+ const text = getDisplayString(resource);
14
+ return link ? (React.createElement(MedplumLink, { to: resource, ...rest }, text)) : (React.createElement(Text, { component: "span", ...rest }, text));
15
+ }
16
+
17
+ export { ResourceName };
18
+ //# sourceMappingURL=ResourceName.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceName.mjs","sources":["../../../src/ResourceName/ResourceName.tsx"],"sourcesContent":["import { Text, TextProps } from '@mantine/core';\nimport { getDisplayString } from '@medplum/core';\nimport { Reference, Resource } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { MedplumLink } from '../MedplumLink/MedplumLink';\nimport { useResource } from '../useResource/useResource';\n\nexport interface ResourceNameProps extends TextProps {\n value?: Reference | Resource;\n link?: boolean;\n}\n\nexport function ResourceName(props: ResourceNameProps): JSX.Element | null {\n const { value, link, ...rest } = props;\n const resource = useResource(value);\n if (!resource) {\n return null;\n }\n\n const text = getDisplayString(resource);\n\n return link ? (\n <MedplumLink to={resource} {...rest}>\n {text}\n </MedplumLink>\n ) : (\n <Text component=\"span\" {...rest}>\n {text}\n </Text>\n );\n}\n"],"names":[],"mappings":";;;;;;AAYM,SAAU,YAAY,CAAC,KAAwB,EAAA;IACnD,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;AACvC,IAAA,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,CAAC,QAAQ,EAAE;AACb,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AAED,IAAA,MAAM,IAAI,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AAExC,IAAA,OAAO,IAAI,IACT,KAAC,CAAA,aAAA,CAAA,WAAW,EAAC,EAAA,EAAE,EAAE,QAAQ,EAAM,GAAA,IAAI,IAChC,IAAI,CACO,KAEd,KAAA,CAAA,aAAA,CAAC,IAAI,EAAC,EAAA,SAAS,EAAC,MAAM,KAAK,IAAI,EAAA,EAC5B,IAAI,CACA,CACR,CAAC;AACJ;;;;"}
@@ -1,25 +1,25 @@
1
1
  import { buildTypeName, PropertyType, formatTiming, formatPeriod, formatDateTime, getTypedPropertyValue } from '@medplum/core';
2
2
  import React from 'react';
3
- import { AddressDisplay } from '../AddressDisplay/AddressDisplay.js';
4
- import { AttachmentArrayDisplay } from '../AttachmentArrayDisplay/AttachmentArrayDisplay.js';
5
- import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.js';
6
- import { BackboneElementDisplay } from '../BackboneElementDisplay/BackboneElementDisplay.js';
7
- import { CodeableConceptDisplay } from '../CodeableConceptDisplay/CodeableConceptDisplay.js';
8
- import { CodingDisplay } from '../CodingDisplay/CodingDisplay.js';
9
- import { ContactDetailDisplay } from '../ContactDetailDisplay/ContactDetailDisplay.js';
10
- import { ContactPointDisplay } from '../ContactPointDisplay/ContactPointDisplay.js';
11
- import { HumanNameDisplay } from '../HumanNameDisplay/HumanNameDisplay.js';
12
- import { IdentifierDisplay } from '../IdentifierDisplay/IdentifierDisplay.js';
13
- import { QuantityDisplay } from '../QuantityDisplay/QuantityDisplay.js';
14
- import { RangeDisplay } from '../RangeDisplay/RangeDisplay.js';
15
- import { RatioDisplay } from '../RatioDisplay/RatioDisplay.js';
16
- import { ReferenceDisplay } from '../ReferenceDisplay/ReferenceDisplay.js';
17
- import { ResourceArrayDisplay } from '../ResourceArrayDisplay/ResourceArrayDisplay.js';
3
+ import { AddressDisplay } from '../AddressDisplay/AddressDisplay.mjs';
4
+ import { AttachmentArrayDisplay } from '../AttachmentArrayDisplay/AttachmentArrayDisplay.mjs';
5
+ import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.mjs';
6
+ import { BackboneElementDisplay } from '../BackboneElementDisplay/BackboneElementDisplay.mjs';
7
+ import { CodeableConceptDisplay } from '../CodeableConceptDisplay/CodeableConceptDisplay.mjs';
8
+ import { CodingDisplay } from '../CodingDisplay/CodingDisplay.mjs';
9
+ import { ContactDetailDisplay } from '../ContactDetailDisplay/ContactDetailDisplay.mjs';
10
+ import { ContactPointDisplay } from '../ContactPointDisplay/ContactPointDisplay.mjs';
11
+ import { HumanNameDisplay } from '../HumanNameDisplay/HumanNameDisplay.mjs';
12
+ import { IdentifierDisplay } from '../IdentifierDisplay/IdentifierDisplay.mjs';
13
+ import { MoneyDisplay } from '../MoneyDisplay/MoneyDisplay.mjs';
14
+ import { QuantityDisplay } from '../QuantityDisplay/QuantityDisplay.mjs';
15
+ import { RangeDisplay } from '../RangeDisplay/RangeDisplay.mjs';
16
+ import { RatioDisplay } from '../RatioDisplay/RatioDisplay.mjs';
17
+ import { ReferenceDisplay } from '../ReferenceDisplay/ReferenceDisplay.mjs';
18
+ import { ResourceArrayDisplay } from '../ResourceArrayDisplay/ResourceArrayDisplay.mjs';
18
19
 
19
20
  function ResourcePropertyDisplay(props) {
20
- var _a;
21
21
  const { property, propertyType, value } = props;
22
- if ((property === null || property === void 0 ? void 0 : property.max) === '*' && !props.arrayElement) {
22
+ if (property?.max === '*' && !props.arrayElement) {
23
23
  if (propertyType === 'Attachment') {
24
24
  return React.createElement(AttachmentArrayDisplay, { values: value, maxWidth: props.maxWidth });
25
25
  }
@@ -48,7 +48,7 @@ function ResourcePropertyDisplay(props) {
48
48
  case PropertyType.Address:
49
49
  return React.createElement(AddressDisplay, { value: value });
50
50
  case PropertyType.Annotation:
51
- return React.createElement(React.Fragment, null, value === null || value === void 0 ? void 0 : value.text);
51
+ return React.createElement(React.Fragment, null, value?.text);
52
52
  case PropertyType.Attachment:
53
53
  return React.createElement(AttachmentDisplay, { value: value, maxWidth: props.maxWidth });
54
54
  case PropertyType.CodeableConcept:
@@ -63,6 +63,8 @@ function ResourcePropertyDisplay(props) {
63
63
  return React.createElement(HumanNameDisplay, { value: value });
64
64
  case PropertyType.Identifier:
65
65
  return React.createElement(IdentifierDisplay, { value: value });
66
+ case PropertyType.Money:
67
+ return React.createElement(MoneyDisplay, { value: value });
66
68
  case PropertyType.Period:
67
69
  return React.createElement(React.Fragment, null, formatPeriod(value));
68
70
  case PropertyType.Quantity:
@@ -80,10 +82,10 @@ function ResourcePropertyDisplay(props) {
80
82
  case PropertyType.UsageContext:
81
83
  return (React.createElement(BackboneElementDisplay, { value: { type: propertyType, value }, compact: true, ignoreMissingValues: props.ignoreMissingValues }));
82
84
  default:
83
- if (!(property === null || property === void 0 ? void 0 : property.path)) {
85
+ if (!property?.path) {
84
86
  throw Error(`Displaying property of type ${props.propertyType} requires element definition path`);
85
87
  }
86
- return (React.createElement(BackboneElementDisplay, { value: { type: buildTypeName((_a = property === null || property === void 0 ? void 0 : property.path) === null || _a === void 0 ? void 0 : _a.split('.')), value }, compact: true, ignoreMissingValues: props.ignoreMissingValues }));
88
+ return (React.createElement(BackboneElementDisplay, { value: { type: buildTypeName(property?.path?.split('.')), value }, compact: true, ignoreMissingValues: props.ignoreMissingValues }));
87
89
  }
88
90
  }
89
91
  /**
@@ -108,4 +110,4 @@ function getValueAndType(context, path) {
108
110
  }
109
111
 
110
112
  export { ResourcePropertyDisplay, getValueAndType };
111
- //# sourceMappingURL=ResourcePropertyDisplay.js.map
113
+ //# sourceMappingURL=ResourcePropertyDisplay.mjs.map
@@ -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":";;;;;;;;;;;;;;;;;;;AAsCM,SAAU,uBAAuB,CAAC,KAAmC,EAAA;IACzE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAEhD,IAAI,QAAQ,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;QAChD,IAAI,YAAY,KAAK,YAAY,EAAE;AACjC,YAAA,OAAO,KAAC,CAAA,aAAA,CAAA,sBAAsB,EAAC,EAAA,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAI,CAAC;AAC5E,SAAA;QACD,QACE,KAAC,CAAA,aAAA,CAAA,oBAAoB,EACnB,EAAA,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,KAAK,EACb,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,CAAA,EACF;AACH,KAAA;AAED,IAAA,QAAQ,YAAY;QAClB,KAAK,YAAY,CAAC,OAAO;AACvB,YAAA,OAAO,0CAAG,KAAK,KAAK,SAAS,GAAG,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAI,CAAC;QACrE,KAAK,YAAY,CAAC,YAAY,CAAC;QAC/B,KAAK,YAAY,CAAC,IAAI,CAAC;QACvB,KAAK,YAAY,CAAC,IAAI,CAAC;QACvB,KAAK,YAAY,CAAC,OAAO,CAAC;QAC1B,KAAK,YAAY,CAAC,WAAW,CAAC;QAC9B,KAAK,YAAY,CAA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;;;;"}
@@ -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;AAC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EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAI,CAAC;QACpF,KAAK,YAAY,CAAC,MAAM,CAAC;QACzB,KAAK,YAAY,CAAC,YAAY;YAC5B,QACE,KAAC,CAAA,aAAA,CAAA,oBAAoB,EACnB,EAAA,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,KAAK,EACnB,QAAQ,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;;;;"}