@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.
- package/README.md +2 -1
- package/dist/cjs/AsyncAutocomplete/AsyncAutocomplete.d.ts +14 -0
- package/dist/cjs/DiagnosticReportDisplay/DiagnosticReportDisplay.stories.d.ts +1 -0
- package/dist/cjs/FhirPathTable/FhirPathTable.d.ts +2 -2
- package/dist/cjs/MoneyDisplay/MoneyDisplay.d.ts +6 -0
- package/dist/cjs/MoneyInput/MoneyInput.d.ts +10 -0
- package/dist/cjs/MoneyInput/MoneyInput.stories.d.ts +6 -0
- package/dist/cjs/ValueSetAutocomplete/ValueSetAutocomplete.d.ts +3 -6
- package/dist/cjs/auth/ChooseProfileForm.d.ts +2 -1
- package/dist/cjs/auth/ChooseScopeForm.d.ts +2 -1
- package/dist/cjs/auth/MfaForm.d.ts +7 -0
- package/dist/cjs/auth/SignInForm.d.ts +10 -0
- package/dist/cjs/{index.js → index.cjs} +860 -642
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.min.cjs +1 -0
- package/dist/cjs/stories/referenceLab.d.ts +3 -1
- package/dist/esm/AddressDisplay/{AddressDisplay.js → AddressDisplay.mjs} +1 -1
- package/dist/esm/AddressDisplay/AddressDisplay.mjs.map +1 -0
- package/dist/esm/AddressInput/{AddressInput.js → AddressInput.mjs} +9 -9
- package/dist/esm/AddressInput/AddressInput.mjs.map +1 -0
- package/dist/esm/AnnotationInput/{AnnotationInput.js → AnnotationInput.mjs} +2 -2
- package/dist/esm/AnnotationInput/AnnotationInput.mjs.map +1 -0
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.d.ts +14 -0
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs +113 -0
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs.map +1 -0
- package/dist/esm/AttachmentArrayDisplay/{AttachmentArrayDisplay.js → AttachmentArrayDisplay.mjs} +2 -2
- package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs.map +1 -0
- package/dist/esm/AttachmentArrayInput/{AttachmentArrayInput.js → AttachmentArrayInput.mjs} +6 -7
- package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs.map +1 -0
- package/dist/esm/AttachmentButton/{AttachmentButton.js → AttachmentButton.mjs} +5 -7
- package/dist/esm/AttachmentButton/AttachmentButton.mjs.map +1 -0
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs +21 -0
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs.map +1 -0
- package/dist/esm/AttachmentInput/{AttachmentInput.js → AttachmentInput.mjs} +5 -5
- package/dist/esm/AttachmentInput/AttachmentInput.mjs.map +1 -0
- package/dist/esm/BackboneElementDisplay/{BackboneElementDisplay.js → BackboneElementDisplay.mjs} +4 -4
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs.map +1 -0
- package/dist/esm/BackboneElementInput/{BackboneElementInput.js → BackboneElementInput.mjs} +10 -11
- package/dist/esm/BackboneElementInput/BackboneElementInput.mjs.map +1 -0
- package/dist/esm/CalendarInput/{CalendarInput.js → CalendarInput.mjs} +1 -1
- package/dist/esm/CalendarInput/CalendarInput.mjs.map +1 -0
- package/dist/esm/CheckboxFormSection/{CheckboxFormSection.js → CheckboxFormSection.mjs} +1 -1
- package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs.map +1 -0
- package/dist/esm/CodeInput/{CodeInput.js → CodeInput.mjs} +6 -5
- package/dist/esm/CodeInput/CodeInput.mjs.map +1 -0
- package/dist/esm/CodeableConceptDisplay/{CodeableConceptDisplay.js → CodeableConceptDisplay.mjs} +1 -1
- package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs.map +1 -0
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs +36 -0
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs.map +1 -0
- package/dist/esm/CodingDisplay/{CodingDisplay.js → CodingDisplay.mjs} +1 -1
- package/dist/esm/CodingDisplay/CodingDisplay.mjs.map +1 -0
- package/dist/esm/CodingInput/{CodingInput.js → CodingInput.mjs} +5 -4
- package/dist/esm/CodingInput/CodingInput.mjs.map +1 -0
- package/dist/esm/ContactDetailDisplay/{ContactDetailDisplay.js → ContactDetailDisplay.mjs} +4 -5
- package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs.map +1 -0
- package/dist/esm/ContactDetailInput/{ContactDetailInput.js → ContactDetailInput.mjs} +6 -7
- package/dist/esm/ContactDetailInput/ContactDetailInput.mjs.map +1 -0
- package/dist/esm/ContactPointDisplay/{ContactPointDisplay.js → ContactPointDisplay.mjs} +1 -1
- package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs.map +1 -0
- package/dist/esm/ContactPointInput/{ContactPointInput.js → ContactPointInput.mjs} +7 -7
- package/dist/esm/ContactPointInput/ContactPointInput.mjs.map +1 -0
- package/dist/esm/Container/{Container.js → Container.mjs} +3 -4
- package/dist/esm/Container/Container.mjs.map +1 -0
- package/dist/esm/DateTimeInput/{DateTimeInput.js → DateTimeInput.mjs} +2 -2
- package/dist/esm/DateTimeInput/DateTimeInput.mjs.map +1 -0
- package/dist/esm/DefaultResourceTimeline/{DefaultResourceTimeline.js → DefaultResourceTimeline.mjs} +2 -2
- package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs.map +1 -0
- package/dist/esm/DescriptionList/{DescriptionList.js → DescriptionList.mjs} +1 -1
- package/dist/esm/DescriptionList/DescriptionList.mjs.map +1 -0
- package/dist/esm/DiagnosticReportDisplay/{DiagnosticReportDisplay.js → DiagnosticReportDisplay.mjs} +19 -16
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs.map +1 -0
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.stories.d.ts +1 -0
- package/dist/esm/Document/Document.mjs +12 -0
- package/dist/esm/Document/Document.mjs.map +1 -0
- package/dist/esm/EncounterTimeline/{EncounterTimeline.js → EncounterTimeline.mjs} +2 -2
- package/dist/esm/EncounterTimeline/EncounterTimeline.mjs.map +1 -0
- package/dist/esm/ErrorBoundary/{ErrorBoundary.js → ErrorBoundary.mjs} +1 -1
- package/dist/esm/ErrorBoundary/ErrorBoundary.mjs.map +1 -0
- package/dist/esm/ExtensionInput/{ExtensionInput.js → ExtensionInput.mjs} +1 -1
- package/dist/esm/ExtensionInput/ExtensionInput.mjs.map +1 -0
- package/dist/esm/FhirPathDisplay/{FhirPathDisplay.js → FhirPathDisplay.mjs} +2 -2
- package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs.map +1 -0
- package/dist/esm/FhirPathTable/FhirPathTable.d.ts +2 -2
- package/dist/esm/FhirPathTable/{FhirPathTable.js → FhirPathTable.mjs} +14 -17
- package/dist/esm/FhirPathTable/FhirPathTable.mjs.map +1 -0
- package/dist/esm/Form/{Form.js → Form.mjs} +2 -2
- package/dist/esm/Form/Form.mjs.map +1 -0
- package/dist/esm/Form/{FormUtils.js → FormUtils.mjs} +1 -1
- package/dist/esm/Form/FormUtils.mjs.map +1 -0
- package/dist/esm/FormSection/{FormSection.js → FormSection.mjs} +2 -2
- package/dist/esm/FormSection/FormSection.mjs.map +1 -0
- package/dist/esm/GoogleButton/{GoogleButton.js → GoogleButton.mjs} +4 -5
- package/dist/esm/GoogleButton/GoogleButton.mjs.map +1 -0
- package/dist/esm/HumanNameDisplay/{HumanNameDisplay.js → HumanNameDisplay.mjs} +1 -1
- package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs.map +1 -0
- package/dist/esm/HumanNameInput/HumanNameInput.mjs +50 -0
- package/dist/esm/HumanNameInput/HumanNameInput.mjs.map +1 -0
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs +11 -0
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs.map +1 -0
- package/dist/esm/IdentifierInput/{IdentifierInput.js → IdentifierInput.mjs} +3 -3
- package/dist/esm/IdentifierInput/IdentifierInput.mjs.map +1 -0
- package/dist/esm/Logo/{Logo.js → Logo.mjs} +1 -1
- package/dist/esm/Logo/Logo.mjs.map +1 -0
- package/dist/esm/MedplumLink/{MedplumLink.js → MedplumLink.mjs} +5 -6
- package/dist/esm/MedplumLink/MedplumLink.mjs.map +1 -0
- package/dist/esm/MedplumProvider/{MedplumProvider.js → MedplumProvider.mjs} +9 -3
- package/dist/esm/MedplumProvider/MedplumProvider.mjs.map +1 -0
- package/dist/esm/MoneyDisplay/MoneyDisplay.d.ts +6 -0
- package/dist/esm/MoneyDisplay/MoneyDisplay.mjs +9 -0
- package/dist/esm/MoneyDisplay/MoneyDisplay.mjs.map +1 -0
- package/dist/esm/MoneyInput/MoneyInput.d.ts +10 -0
- package/dist/esm/MoneyInput/MoneyInput.mjs +53 -0
- package/dist/esm/MoneyInput/MoneyInput.mjs.map +1 -0
- package/dist/esm/MoneyInput/MoneyInput.stories.d.ts +6 -0
- package/dist/esm/Panel/{Panel.js → Panel.mjs} +3 -4
- package/dist/esm/Panel/Panel.mjs.map +1 -0
- package/dist/esm/PatientTimeline/{PatientTimeline.js → PatientTimeline.mjs} +2 -2
- package/dist/esm/PatientTimeline/PatientTimeline.mjs.map +1 -0
- package/dist/esm/PeriodInput/{PeriodInput.js → PeriodInput.mjs} +4 -4
- package/dist/esm/PeriodInput/PeriodInput.mjs.map +1 -0
- package/dist/esm/PlanDefinitionBuilder/{PlanDefinitionBuilder.js → PlanDefinitionBuilder.mjs} +36 -24
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs.map +1 -0
- package/dist/esm/QuantityDisplay/{QuantityDisplay.js → QuantityDisplay.mjs} +1 -1
- package/dist/esm/QuantityDisplay/QuantityDisplay.mjs.map +1 -0
- package/dist/esm/QuantityInput/{QuantityInput.js → QuantityInput.mjs} +13 -5
- package/dist/esm/QuantityInput/QuantityInput.mjs.map +1 -0
- package/dist/esm/QuestionnaireBuilder/{QuestionnaireBuilder.js → QuestionnaireBuilder.mjs} +45 -27
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs.map +1 -0
- package/dist/esm/QuestionnaireForm/{QuestionnaireForm.js → QuestionnaireForm.mjs} +37 -36
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs.map +1 -0
- package/dist/esm/RangeDisplay/{RangeDisplay.js → RangeDisplay.mjs} +1 -1
- package/dist/esm/RangeDisplay/RangeDisplay.mjs.map +1 -0
- package/dist/esm/RangeInput/{RangeInput.js → RangeInput.mjs} +10 -4
- package/dist/esm/RangeInput/RangeInput.mjs.map +1 -0
- package/dist/esm/RatioDisplay/{RatioDisplay.js → RatioDisplay.mjs} +2 -2
- package/dist/esm/RatioDisplay/RatioDisplay.mjs.map +1 -0
- package/dist/esm/RatioInput/{RatioInput.js → RatioInput.mjs} +10 -4
- package/dist/esm/RatioInput/RatioInput.mjs.map +1 -0
- package/dist/esm/ReferenceDisplay/{ReferenceDisplay.js → ReferenceDisplay.mjs} +2 -2
- package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs.map +1 -0
- package/dist/esm/ReferenceInput/{ReferenceInput.js → ReferenceInput.mjs} +10 -5
- package/dist/esm/ReferenceInput/ReferenceInput.mjs.map +1 -0
- package/dist/esm/ReferenceRangeEditor/{ReferenceRangeEditor.js → ReferenceRangeEditor.mjs} +44 -38
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs.map +1 -0
- package/dist/esm/RequestGroupDisplay/{RequestGroupDisplay.js → RequestGroupDisplay.mjs} +14 -17
- package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs.map +1 -0
- package/dist/esm/ResourceArrayDisplay/{ResourceArrayDisplay.js → ResourceArrayDisplay.mjs} +4 -5
- package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs.map +1 -0
- package/dist/esm/ResourceArrayInput/{ResourceArrayInput.js → ResourceArrayInput.mjs} +3 -3
- package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs.map +1 -0
- package/dist/esm/ResourceAvatar/ResourceAvatar.mjs +23 -0
- package/dist/esm/ResourceAvatar/ResourceAvatar.mjs.map +1 -0
- package/dist/esm/ResourceBadge/{ResourceBadge.js → ResourceBadge.mjs} +3 -3
- package/dist/esm/ResourceBadge/ResourceBadge.mjs.map +1 -0
- package/dist/esm/ResourceBlame/{ResourceBlame.js → ResourceBlame.mjs} +6 -7
- package/dist/esm/ResourceBlame/ResourceBlame.mjs.map +1 -0
- package/dist/esm/ResourceDiff/{ResourceDiff.js → ResourceDiff.mjs} +4 -4
- package/dist/esm/ResourceDiff/ResourceDiff.mjs.map +1 -0
- package/dist/esm/ResourceDiffTable/{ResourceDiffTable.js → ResourceDiffTable.mjs} +3 -3
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs.map +1 -0
- package/dist/esm/ResourceForm/{ResourceForm.js → ResourceForm.mjs} +5 -5
- package/dist/esm/ResourceForm/ResourceForm.mjs.map +1 -0
- package/dist/esm/ResourceHistoryTable/{ResourceHistoryTable.js → ResourceHistoryTable.mjs} +10 -13
- package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs.map +1 -0
- package/dist/esm/ResourceInput/{ResourceInput.js → ResourceInput.mjs} +19 -25
- package/dist/esm/ResourceInput/ResourceInput.mjs.map +1 -0
- package/dist/esm/ResourceName/ResourceName.mjs +18 -0
- package/dist/esm/ResourceName/ResourceName.mjs.map +1 -0
- package/dist/esm/ResourcePropertyDisplay/{ResourcePropertyDisplay.js → ResourcePropertyDisplay.mjs} +23 -21
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs.map +1 -0
- package/dist/esm/ResourcePropertyInput/{ResourcePropertyInput.js → ResourcePropertyInput.mjs} +34 -34
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs.map +1 -0
- package/dist/esm/ResourceTable/{ResourceTable.js → ResourceTable.mjs} +4 -4
- package/dist/esm/ResourceTable/ResourceTable.mjs.map +1 -0
- package/dist/esm/ResourceTimeline/{ResourceTimeline.js → ResourceTimeline.mjs} +26 -30
- package/dist/esm/ResourceTimeline/ResourceTimeline.mjs.map +1 -0
- package/dist/esm/Scheduler/{Scheduler.js → Scheduler.mjs} +8 -9
- package/dist/esm/Scheduler/Scheduler.mjs.map +1 -0
- package/dist/esm/SearchControl/{SearchControl.js → SearchControl.mjs} +66 -50
- package/dist/esm/SearchControl/SearchControl.mjs.map +1 -0
- package/dist/esm/SearchControl/{SearchControlField.js → SearchControlField.mjs} +3 -4
- package/dist/esm/SearchControl/SearchControlField.mjs.map +1 -0
- package/dist/esm/SearchControl/{SearchUtils.js → SearchUtils.mjs} +34 -17
- package/dist/esm/SearchControl/SearchUtils.mjs.map +1 -0
- package/dist/esm/SearchFieldEditor/{SearchFieldEditor.js → SearchFieldEditor.mjs} +28 -21
- package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs.map +1 -0
- package/dist/esm/SearchFilterEditor/{SearchFilterEditor.js → SearchFilterEditor.mjs} +8 -9
- package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs.map +1 -0
- package/dist/esm/SearchFilterValueDialog/{SearchFilterValueDialog.js → SearchFilterValueDialog.mjs} +5 -6
- package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs.map +1 -0
- package/dist/esm/SearchFilterValueDisplay/{SearchFilterValueDisplay.js → SearchFilterValueDisplay.mjs} +3 -4
- package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs.map +1 -0
- package/dist/esm/SearchFilterValueInput/{SearchFilterValueInput.js → SearchFilterValueInput.mjs} +5 -6
- package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs.map +1 -0
- package/dist/esm/SearchPopupMenu/{SearchPopupMenu.js → SearchPopupMenu.mjs} +10 -10
- package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs.map +1 -0
- package/dist/esm/ServiceRequestTimeline/{ServiceRequestTimeline.js → ServiceRequestTimeline.mjs} +2 -2
- package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs.map +1 -0
- package/dist/esm/StatusBadge/{StatusBadge.js → StatusBadge.mjs} +3 -2
- package/dist/esm/StatusBadge/StatusBadge.mjs.map +1 -0
- package/dist/esm/Timeline/{Timeline.js → Timeline.mjs} +11 -13
- package/dist/esm/Timeline/Timeline.mjs.map +1 -0
- package/dist/esm/TimingInput/{TimingInput.js → TimingInput.mjs} +13 -18
- package/dist/esm/TimingInput/TimingInput.mjs.map +1 -0
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.d.ts +3 -6
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs +43 -0
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs.map +1 -0
- package/dist/esm/auth/{AuthenticationForm.js → AuthenticationForm.mjs} +21 -19
- package/dist/esm/auth/AuthenticationForm.mjs.map +1 -0
- package/dist/esm/auth/ChooseProfileForm.d.ts +2 -1
- package/dist/esm/auth/ChooseProfileForm.mjs +29 -0
- package/dist/esm/auth/ChooseProfileForm.mjs.map +1 -0
- package/dist/esm/auth/ChooseScopeForm.d.ts +2 -1
- package/dist/esm/auth/{ChooseScopeForm.js → ChooseScopeForm.mjs} +4 -4
- package/dist/esm/auth/ChooseScopeForm.mjs.map +1 -0
- package/dist/esm/auth/MfaForm.d.ts +7 -0
- package/dist/esm/auth/MfaForm.mjs +34 -0
- package/dist/esm/auth/MfaForm.mjs.map +1 -0
- package/dist/esm/auth/{NewProjectForm.js → NewProjectForm.mjs} +8 -9
- package/dist/esm/auth/NewProjectForm.mjs.map +1 -0
- package/dist/esm/auth/{NewUserForm.js → NewUserForm.mjs} +15 -19
- package/dist/esm/auth/NewUserForm.mjs.map +1 -0
- package/dist/esm/auth/{RegisterForm.js → RegisterForm.mjs} +5 -5
- package/dist/esm/auth/RegisterForm.mjs.map +1 -0
- package/dist/esm/auth/SignInForm.d.ts +10 -0
- package/dist/esm/auth/{SignInForm.js → SignInForm.mjs} +25 -10
- package/dist/esm/auth/SignInForm.mjs.map +1 -0
- package/dist/esm/{constants.js → constants.mjs} +1 -1
- package/dist/esm/constants.mjs.map +1 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.min.mjs +1 -0
- package/dist/esm/{index.js → index.mjs} +88 -85
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/stories/referenceLab.d.ts +3 -1
- package/dist/esm/useResource/{useResource.js → useResource.mjs} +2 -2
- package/dist/esm/useResource/useResource.mjs.map +1 -0
- package/dist/esm/utils/{blame.js → blame.mjs} +6 -9
- package/dist/esm/utils/blame.mjs.map +1 -0
- package/dist/esm/utils/{date.js → date.mjs} +2 -3
- package/dist/esm/utils/date.mjs.map +1 -0
- package/dist/esm/utils/{diff.js → diff.mjs} +1 -1
- package/dist/esm/utils/diff.mjs.map +1 -0
- package/dist/esm/utils/{dom.js → dom.mjs} +1 -1
- package/dist/esm/utils/dom.mjs.map +1 -0
- package/dist/esm/utils/outcomes.mjs +30 -0
- package/dist/esm/utils/outcomes.mjs.map +1 -0
- package/dist/esm/utils/{questionnaire.js → questionnaire.mjs} +1 -1
- package/dist/esm/utils/questionnaire.mjs.map +1 -0
- package/dist/esm/utils/{recaptcha.js → recaptcha.mjs} +5 -6
- package/dist/esm/utils/recaptcha.mjs.map +1 -0
- package/dist/esm/utils/{script.js → script.mjs} +1 -1
- package/dist/esm/utils/script.mjs.map +1 -0
- package/package.json +22 -22
- package/rollup.config.mjs +6 -7
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/index.min.js +0 -2
- package/dist/cjs/index.min.js.map +0 -1
- package/dist/esm/AddressDisplay/AddressDisplay.js.map +0 -1
- package/dist/esm/AddressInput/AddressInput.js.map +0 -1
- package/dist/esm/AnnotationInput/AnnotationInput.js.map +0 -1
- package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.js.map +0 -1
- package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.js.map +0 -1
- package/dist/esm/AttachmentButton/AttachmentButton.js.map +0 -1
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.js +0 -21
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.js.map +0 -1
- package/dist/esm/AttachmentInput/AttachmentInput.js.map +0 -1
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.js.map +0 -1
- package/dist/esm/BackboneElementInput/BackboneElementInput.js.map +0 -1
- package/dist/esm/CalendarInput/CalendarInput.js.map +0 -1
- package/dist/esm/CheckboxFormSection/CheckboxFormSection.js.map +0 -1
- package/dist/esm/CodeInput/CodeInput.js.map +0 -1
- package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.js.map +0 -1
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.js +0 -37
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.js.map +0 -1
- package/dist/esm/CodingDisplay/CodingDisplay.js.map +0 -1
- package/dist/esm/CodingInput/CodingInput.js.map +0 -1
- package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.js.map +0 -1
- package/dist/esm/ContactDetailInput/ContactDetailInput.js.map +0 -1
- package/dist/esm/ContactPointDisplay/ContactPointDisplay.js.map +0 -1
- package/dist/esm/ContactPointInput/ContactPointInput.js.map +0 -1
- package/dist/esm/Container/Container.js.map +0 -1
- package/dist/esm/DateTimeInput/DateTimeInput.js.map +0 -1
- package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.js.map +0 -1
- package/dist/esm/DescriptionList/DescriptionList.js.map +0 -1
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.js.map +0 -1
- package/dist/esm/Document/Document.js +0 -13
- package/dist/esm/Document/Document.js.map +0 -1
- package/dist/esm/EncounterTimeline/EncounterTimeline.js.map +0 -1
- package/dist/esm/ErrorBoundary/ErrorBoundary.js.map +0 -1
- package/dist/esm/ExtensionInput/ExtensionInput.js.map +0 -1
- package/dist/esm/FhirPathDisplay/FhirPathDisplay.js.map +0 -1
- package/dist/esm/FhirPathTable/FhirPathTable.js.map +0 -1
- package/dist/esm/Form/Form.js.map +0 -1
- package/dist/esm/Form/FormUtils.js.map +0 -1
- package/dist/esm/FormSection/FormSection.js.map +0 -1
- package/dist/esm/GoogleButton/GoogleButton.js.map +0 -1
- package/dist/esm/HumanNameDisplay/HumanNameDisplay.js.map +0 -1
- package/dist/esm/HumanNameInput/HumanNameInput.js +0 -39
- package/dist/esm/HumanNameInput/HumanNameInput.js.map +0 -1
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.js +0 -12
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.js.map +0 -1
- package/dist/esm/IdentifierInput/IdentifierInput.js.map +0 -1
- package/dist/esm/Logo/Logo.js.map +0 -1
- package/dist/esm/MedplumLink/MedplumLink.js.map +0 -1
- package/dist/esm/MedplumProvider/MedplumProvider.js.map +0 -1
- package/dist/esm/Panel/Panel.js.map +0 -1
- package/dist/esm/PatientTimeline/PatientTimeline.js.map +0 -1
- package/dist/esm/PeriodInput/PeriodInput.js.map +0 -1
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.js.map +0 -1
- package/dist/esm/QuantityDisplay/QuantityDisplay.js.map +0 -1
- package/dist/esm/QuantityInput/QuantityInput.js.map +0 -1
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.js.map +0 -1
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.js.map +0 -1
- package/dist/esm/RangeDisplay/RangeDisplay.js.map +0 -1
- package/dist/esm/RangeInput/RangeInput.js.map +0 -1
- package/dist/esm/RatioDisplay/RatioDisplay.js.map +0 -1
- package/dist/esm/RatioInput/RatioInput.js.map +0 -1
- package/dist/esm/ReferenceDisplay/ReferenceDisplay.js.map +0 -1
- package/dist/esm/ReferenceInput/ReferenceInput.js.map +0 -1
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.js.map +0 -1
- package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.js.map +0 -1
- package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.js.map +0 -1
- package/dist/esm/ResourceArrayInput/ResourceArrayInput.js.map +0 -1
- package/dist/esm/ResourceAvatar/ResourceAvatar.js +0 -24
- package/dist/esm/ResourceAvatar/ResourceAvatar.js.map +0 -1
- package/dist/esm/ResourceBadge/ResourceBadge.js.map +0 -1
- package/dist/esm/ResourceBlame/ResourceBlame.js.map +0 -1
- package/dist/esm/ResourceDiff/ResourceDiff.js.map +0 -1
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.js.map +0 -1
- package/dist/esm/ResourceForm/ResourceForm.js.map +0 -1
- package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.js.map +0 -1
- package/dist/esm/ResourceInput/ResourceInput.js.map +0 -1
- package/dist/esm/ResourceName/ResourceName.js +0 -19
- package/dist/esm/ResourceName/ResourceName.js.map +0 -1
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.js.map +0 -1
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.js.map +0 -1
- package/dist/esm/ResourceTable/ResourceTable.js.map +0 -1
- package/dist/esm/ResourceTimeline/ResourceTimeline.js.map +0 -1
- package/dist/esm/Scheduler/Scheduler.js.map +0 -1
- package/dist/esm/SearchControl/SearchControl.js.map +0 -1
- package/dist/esm/SearchControl/SearchControlField.js.map +0 -1
- package/dist/esm/SearchControl/SearchUtils.js.map +0 -1
- package/dist/esm/SearchFieldEditor/SearchFieldEditor.js.map +0 -1
- package/dist/esm/SearchFilterEditor/SearchFilterEditor.js.map +0 -1
- package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.js.map +0 -1
- package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.js.map +0 -1
- package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.js.map +0 -1
- package/dist/esm/SearchPopupMenu/SearchPopupMenu.js.map +0 -1
- package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.js.map +0 -1
- package/dist/esm/StatusBadge/StatusBadge.js.map +0 -1
- package/dist/esm/Timeline/Timeline.js.map +0 -1
- package/dist/esm/TimingInput/TimingInput.js.map +0 -1
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js +0 -65
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.js.map +0 -1
- package/dist/esm/auth/AuthenticationForm.js.map +0 -1
- package/dist/esm/auth/ChooseProfileForm.js +0 -32
- package/dist/esm/auth/ChooseProfileForm.js.map +0 -1
- package/dist/esm/auth/ChooseScopeForm.js.map +0 -1
- package/dist/esm/auth/NewProjectForm.js.map +0 -1
- package/dist/esm/auth/NewUserForm.js.map +0 -1
- package/dist/esm/auth/RegisterForm.js.map +0 -1
- package/dist/esm/auth/SignInForm.js.map +0 -1
- package/dist/esm/constants.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.min.js +0 -2
- package/dist/esm/index.min.js.map +0 -1
- package/dist/esm/node_modules/tslib/tslib.es6.js +0 -39
- package/dist/esm/node_modules/tslib/tslib.es6.js.map +0 -1
- package/dist/esm/useResource/useResource.js.map +0 -1
- package/dist/esm/utils/blame.js.map +0 -1
- package/dist/esm/utils/date.js.map +0 -1
- package/dist/esm/utils/diff.js.map +0 -1
- package/dist/esm/utils/dom.js.map +0 -1
- package/dist/esm/utils/outcomes.js +0 -29
- package/dist/esm/utils/outcomes.js.map +0 -1
- package/dist/esm/utils/questionnaire.js.map +0 -1
- package/dist/esm/utils/recaptcha.js.map +0 -1
- package/dist/esm/utils/script.js.map +0 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ContactPointDisplay } from '../ContactPointDisplay/ContactPointDisplay.
|
|
2
|
+
import { ContactPointDisplay } from '../ContactPointDisplay/ContactPointDisplay.mjs';
|
|
3
3
|
|
|
4
4
|
function ContactDetailDisplay(props) {
|
|
5
|
-
var _a;
|
|
6
5
|
const contactDetail = props.value;
|
|
7
6
|
if (!contactDetail) {
|
|
8
7
|
return null;
|
|
9
8
|
}
|
|
10
9
|
return (React.createElement(React.Fragment, null,
|
|
11
10
|
contactDetail.name,
|
|
12
|
-
contactDetail.name && ': ',
|
|
13
|
-
|
|
11
|
+
contactDetail.name && ': ',
|
|
12
|
+
contactDetail.telecom?.map((telecom, index) => (React.createElement(ContactPointDisplay, { key: 'telecom-' + index, value: telecom })))));
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
export { ContactDetailDisplay };
|
|
17
|
-
//# sourceMappingURL=ContactDetailDisplay.
|
|
16
|
+
//# sourceMappingURL=ContactDetailDisplay.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactDetailDisplay.mjs","sources":["../../../src/ContactDetailDisplay/ContactDetailDisplay.tsx"],"sourcesContent":["import { ContactDetail } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { ContactPointDisplay } from '../ContactPointDisplay/ContactPointDisplay';\n\nexport interface ContactDetailDisplayProps {\n value?: ContactDetail;\n}\n\nexport function ContactDetailDisplay(props: ContactDetailDisplayProps): JSX.Element | null {\n const contactDetail = props.value;\n if (!contactDetail) {\n return null;\n }\n\n return (\n <>\n {contactDetail.name}\n {contactDetail.name && ': '}\n {contactDetail.telecom?.map((telecom, index) => (\n <ContactPointDisplay key={'telecom-' + index} value={telecom} />\n ))}\n </>\n );\n}\n"],"names":[],"mappings":";;;AAQM,SAAU,oBAAoB,CAAC,KAAgC,EAAA;AACnE,IAAA,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC;IAClC,IAAI,CAAC,aAAa,EAAE;AAClB,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AAED,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;AACG,QAAA,aAAa,CAAC,IAAI;QAClB,aAAa,CAAC,IAAI,IAAI,IAAI;AAC1B,QAAA,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,MACzC,KAAC,CAAA,aAAA,CAAA,mBAAmB,EAAC,EAAA,GAAG,EAAE,UAAU,GAAG,KAAK,EAAE,KAAK,EAAE,OAAO,EAAI,CAAA,CACjE,CAAC,CACD,EACH;AACJ;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Group, TextInput } from '@mantine/core';
|
|
2
2
|
import React, { useState, useRef } from 'react';
|
|
3
|
-
import { ContactPointInput } from '../ContactPointInput/ContactPointInput.
|
|
3
|
+
import { ContactPointInput } from '../ContactPointInput/ContactPointInput.mjs';
|
|
4
4
|
|
|
5
5
|
function ContactDetailInput(props) {
|
|
6
|
-
var _a;
|
|
7
6
|
const [contactPoint, setContactDetail] = useState(props.defaultValue);
|
|
8
7
|
const ref = useRef();
|
|
9
8
|
ref.current = contactPoint;
|
|
@@ -14,23 +13,23 @@ function ContactDetailInput(props) {
|
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
15
|
function setName(name) {
|
|
17
|
-
const newValue =
|
|
16
|
+
const newValue = { ...ref.current, name };
|
|
18
17
|
if (!name) {
|
|
19
18
|
delete newValue.name;
|
|
20
19
|
}
|
|
21
20
|
setContactDetailWrapper(newValue);
|
|
22
21
|
}
|
|
23
22
|
function setTelecom(telecom) {
|
|
24
|
-
const newValue =
|
|
23
|
+
const newValue = { ...ref.current, telecom: telecom && [telecom] };
|
|
25
24
|
if (!telecom) {
|
|
26
25
|
delete newValue.telecom;
|
|
27
26
|
}
|
|
28
27
|
setContactDetailWrapper(newValue);
|
|
29
28
|
}
|
|
30
29
|
return (React.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
|
|
31
|
-
React.createElement(TextInput, { "data-testid": props.name + '-name', name: props.name + '-name', placeholder: "Name", style: { width: 180 }, defaultValue: contactPoint
|
|
32
|
-
React.createElement(ContactPointInput, { name: props.name + '-telecom', defaultValue:
|
|
30
|
+
React.createElement(TextInput, { "data-testid": props.name + '-name', name: props.name + '-name', placeholder: "Name", style: { width: 180 }, defaultValue: contactPoint?.name, onChange: (e) => setName(e.currentTarget.value) }),
|
|
31
|
+
React.createElement(ContactPointInput, { name: props.name + '-telecom', defaultValue: contactPoint?.telecom?.[0], onChange: setTelecom })));
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
export { ContactDetailInput };
|
|
36
|
-
//# sourceMappingURL=ContactDetailInput.
|
|
35
|
+
//# sourceMappingURL=ContactDetailInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactDetailInput.mjs","sources":["../../../src/ContactDetailInput/ContactDetailInput.tsx"],"sourcesContent":["import { Group, TextInput } from '@mantine/core';\nimport { ContactDetail, ContactPoint } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\nimport { ContactPointInput } from '../ContactPointInput/ContactPointInput';\n\nexport interface ContactDetailInputProps {\n name: string;\n defaultValue?: ContactDetail;\n onChange?: (value: ContactDetail) => void;\n}\n\nexport function ContactDetailInput(props: ContactDetailInputProps): JSX.Element {\n const [contactPoint, setContactDetail] = useState(props.defaultValue);\n\n const ref = useRef<ContactDetail>();\n ref.current = contactPoint;\n\n function setContactDetailWrapper(newValue: ContactDetail): void {\n setContactDetail(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n function setName(name: string): void {\n const newValue: ContactDetail = { ...ref.current, name };\n if (!name) {\n delete newValue.name;\n }\n setContactDetailWrapper(newValue);\n }\n\n function setTelecom(telecom: ContactPoint | undefined): void {\n const newValue: ContactDetail = { ...ref.current, telecom: telecom && [telecom] };\n if (!telecom) {\n delete newValue.telecom;\n }\n setContactDetailWrapper(newValue);\n }\n\n return (\n <Group spacing=\"xs\" grow noWrap>\n <TextInput\n data-testid={props.name + '-name'}\n name={props.name + '-name'}\n placeholder=\"Name\"\n style={{ width: 180 }}\n defaultValue={contactPoint?.name}\n onChange={(e) => setName(e.currentTarget.value)}\n />\n <ContactPointInput\n name={props.name + '-telecom'}\n defaultValue={contactPoint?.telecom?.[0]}\n onChange={setTelecom}\n />\n </Group>\n );\n}\n"],"names":[],"mappings":";;;;AAWM,SAAU,kBA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E,KAAK,EAAE,GAAG,EAAE,EACrB,YAAY,EAAE,YAAY,EAAE,IAAI,EAChC,QAAQ,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAC/C,CAAA;QACF,KAAC,CAAA,aAAA,CAAA,iBAAiB,EAChB,EAAA,IAAI,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,EAC7B,YAAY,EAAE,YAAY,EAAE,OAAO,GAAG,CAAC,CAAC,EACxC,QAAQ,EAAE,UAAU,EAAA,CACpB,CACI,EACR;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactPointDisplay.mjs","sources":["../../../src/ContactPointDisplay/ContactPointDisplay.tsx"],"sourcesContent":["import { ContactPoint } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface ContactPointDisplayProps {\n value?: ContactPoint;\n}\n\nexport function ContactPointDisplay(props: ContactPointDisplayProps): JSX.Element | null {\n const contactPoint = props.value;\n if (!contactPoint) {\n return null;\n }\n\n const builder = [];\n\n if (contactPoint.value) {\n builder.push(contactPoint.value);\n }\n\n if (contactPoint.use || contactPoint.system) {\n builder.push(' [');\n\n if (contactPoint.use) {\n builder.push(contactPoint.use);\n }\n\n if (contactPoint.use && contactPoint.system) {\n builder.push(' ');\n }\n\n if (contactPoint.system) {\n builder.push(contactPoint.system);\n }\n\n builder.push(']');\n }\n\n return <>{builder.join('').trim()}</>;\n}\n"],"names":[],"mappings":";;AAOM,SAAU,mBAAmB,CAAC,KAA+B,EAAA;AACjE,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;IACjC,IAAI,CAAC,YAAY,EAAE;AACjB,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;IAED,MAAM,OAAO,GAAG,EAAE,CAAC;IAEnB,IAAI,YAAY,CAAC,KAAK,EAAE;AACtB,QAAA,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAClC,KAAA;AAED,IAAA,IAAI,YAAY,CAAC,GAAG,IAAI,YAAY,CAAC,MAAM,EAAE;AAC3C,QAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnB,IAAI,YAAY,CAAC,GAAG,EAAE;AACpB,YAAA,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AAChC,SAAA;AAED,QAAA,IAAI,YAAY,CAAC,GAAG,IAAI,YAAY,CAAC,MAAM,EAAE;AAC3C,YAAA,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,SAAA;QAED,IAAI,YAAY,CAAC,MAAM,EAAE;AACvB,YAAA,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACnC,SAAA;AAED,QAAA,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,KAAA;IAED,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAI,CAAC;AACxC;;;;"}
|
|
@@ -15,31 +15,31 @@ function ContactPointInput(props) {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
function setSystem(system) {
|
|
18
|
-
const newValue =
|
|
18
|
+
const newValue = { ...ref.current, system };
|
|
19
19
|
if (!system) {
|
|
20
20
|
delete newValue.system;
|
|
21
21
|
}
|
|
22
22
|
setContactPointWrapper(newValue);
|
|
23
23
|
}
|
|
24
24
|
function setUse(use) {
|
|
25
|
-
const newValue =
|
|
25
|
+
const newValue = { ...ref.current, use };
|
|
26
26
|
if (!use) {
|
|
27
27
|
delete newValue.use;
|
|
28
28
|
}
|
|
29
29
|
setContactPointWrapper(newValue);
|
|
30
30
|
}
|
|
31
31
|
function setValue(value) {
|
|
32
|
-
const newValue =
|
|
32
|
+
const newValue = { ...ref.current, value };
|
|
33
33
|
if (!value) {
|
|
34
34
|
delete newValue.value;
|
|
35
35
|
}
|
|
36
36
|
setContactPointWrapper(newValue);
|
|
37
37
|
}
|
|
38
38
|
return (React.createElement(Group, { spacing: "xs", grow: true, noWrap: true },
|
|
39
|
-
React.createElement(NativeSelect, { "data-testid": "system", defaultValue: contactPoint
|
|
40
|
-
React.createElement(NativeSelect, { "data-testid": "use", defaultValue: contactPoint
|
|
41
|
-
React.createElement(TextInput, { placeholder: "Value", defaultValue: contactPoint
|
|
39
|
+
React.createElement(NativeSelect, { "data-testid": "system", defaultValue: contactPoint?.system, onChange: (e) => setSystem(e.currentTarget.value), data: ['', 'email', 'phone', 'fax', 'pager', 'sms', 'other'] }),
|
|
40
|
+
React.createElement(NativeSelect, { "data-testid": "use", defaultValue: contactPoint?.use, onChange: (e) => setUse(e.currentTarget.value), data: ['', 'home', 'work', 'temp', 'old', 'mobile'] }),
|
|
41
|
+
React.createElement(TextInput, { placeholder: "Value", defaultValue: contactPoint?.value, onChange: (e) => setValue(e.currentTarget.value) })));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export { ContactPointInput };
|
|
45
|
-
//# sourceMappingURL=ContactPointInput.
|
|
45
|
+
//# sourceMappingURL=ContactPointInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactPointInput.mjs","sources":["../../../src/ContactPointInput/ContactPointInput.tsx"],"sourcesContent":["import { Group, NativeSelect, TextInput } from '@mantine/core';\nimport { ContactPoint } from '@medplum/fhirtypes';\nimport React, { useRef, useState } from 'react';\n\nexport interface ContactPointInputProps {\n name: string;\n defaultValue?: ContactPoint;\n onChange?: (value: ContactPoint | undefined) => void;\n}\n\nexport function ContactPointInput(props: ContactPointInputProps): JSX.Element {\n const [contactPoint, setContactPoint] = useState(props.defaultValue);\n\n const ref = useRef<ContactPoint>();\n ref.current = contactPoint;\n\n function setContactPointWrapper(newValue: ContactPoint | undefined): void {\n if (newValue && Object.keys(newValue).length === 0) {\n newValue = undefined;\n }\n setContactPoint(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n }\n\n function setSystem(system: 'url' | 'phone' | 'fax' | 'email' | 'pager' | 'sms' | 'other'): void {\n const newValue: ContactPoint = { ...ref.current, system };\n if (!system) {\n delete newValue.system;\n }\n setContactPointWrapper(newValue);\n }\n\n function setUse(use: 'home' | 'work' | 'temp' | 'old' | 'mobile'): void {\n const newValue: ContactPoint = { ...ref.current, use };\n if (!use) {\n delete newValue.use;\n }\n setContactPointWrapper(newValue);\n }\n\n function setValue(value: string): void {\n const newValue: ContactPoint = { ...ref.current, value };\n if (!value) {\n delete newValue.value;\n }\n setContactPointWrapper(newValue);\n }\n\n return (\n <Group spacing=\"xs\" grow noWrap>\n <NativeSelect\n data-testid=\"system\"\n defaultValue={contactPoint?.system}\n onChange={(e) =>\n setSystem(e.currentTarget.value as 'url' | 'phone' | 'fax' | 'email' | 'pager' | 'sms' | 'other')\n }\n data={['', 'email', 'phone', 'fax', 'pager', 'sms', 'other']}\n />\n <NativeSelect\n data-testid=\"use\"\n defaultValue={contactPoint?.use}\n onChange={(e) => setUse(e.currentTarget.value as 'home' | 'work' | 'temp' | 'old' | 'mobile')}\n data={['', 'home', 'work', 'temp', 'old', 'mobile']}\n />\n <TextInput\n placeholder=\"Value\"\n defaultValue={contactPoint?.value}\n onChange={(e) => setValue(e.currentTarget.value)}\n />\n </Group>\n );\n}\n"],"names":[],"mappings":";;;AAUM,SAAU,iBAAiB,CAAC,KAA6B,EAAA;AAC7D,IAAA,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAErE,IAAA,MAAM,GAAG,GAAG,MAAM,EAAgB,CAAC;AACnC,IAAA,GAAG,CAAC,OAAO,GAAG,YAAY,CAAC;IAE3B,SAAS,sBAAsB,CAAC,QAAkC,EAAA;AAChE,QAAA,IAAI,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CA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AC,aAAa,CAAC,KAAsE,CAAC,EAEnG,IAAI,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,EAC5D,CAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAC,YAAY,EACC,EAAA,aAAA,EAAA,KAAK,EACjB,YAAY,EAAE,YAAY,EAAE,GAAG,EAC/B,QAAQ,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,KAAoD,CAAC,EAC7F,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,EACnD,CAAA;AACF,QAAA,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,WAAW,EAAC,OAAO,EACnB,YAAY,EAAE,YAAY,EAAE,KAAK,EACjC,QAAQ,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAChD,CAAA,CACI,EACR;AACJ;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __rest } from '../node_modules/tslib/tslib.es6.js';
|
|
2
1
|
import { createStyles, Container as Container$1 } from '@mantine/core';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
|
|
@@ -11,10 +10,10 @@ const useStyles = createStyles(() => ({
|
|
|
11
10
|
},
|
|
12
11
|
}));
|
|
13
12
|
function Container(props) {
|
|
14
|
-
const { children
|
|
13
|
+
const { children, ...others } = props;
|
|
15
14
|
const { classes } = useStyles();
|
|
16
|
-
return (React.createElement(Container$1,
|
|
15
|
+
return (React.createElement(Container$1, { className: classes.root, ...others }, children));
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export { Container };
|
|
20
|
-
//# sourceMappingURL=Container.
|
|
19
|
+
//# sourceMappingURL=Container.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.mjs","sources":["../../../src/Container/Container.tsx"],"sourcesContent":["import { Container as MantineContainer, ContainerProps, createStyles } from '@mantine/core';\nimport React from 'react';\n\nconst useStyles = createStyles(() => ({\n root: {\n '@media (max-width: 800px)': {\n paddingLeft: 4,\n paddingRight: 4,\n },\n },\n}));\n\nexport function Container(props: ContainerProps): JSX.Element {\n const { children, ...others } = props;\n const { classes } = useStyles();\n\n return (\n <MantineContainer className={classes.root} {...others}>\n {children}\n </MantineContainer>\n );\n}\n"],"names":["MantineContainer"],"mappings":";;;AAGA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO;AACpC,IAAA,IAAI,EAAE;AACJ,QAAA,2BAA2B,EAAE;AAC3B,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,YAAY,EAAE,CAAC;AAChB,SAAA;AACF,KAAA;AACF,CAAA,CAAC,CAAC,CAAC;AAEE,SAAU,SAAS,CAAC,KAAqB,EAAA;IAC7C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;AACtC,IAAA,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAC;AAEhC,IAAA,QACE,KAAA,CAAA,aAAA,CAACA,WAAgB,EAAA,EAAC,SAAS,EAAE,OAAO,CAAC,IAAI,KAAM,MAAM,EAAA,EAClD,QAAQ,CACQ,EACnB;AACJ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TextInput } from '@mantine/core';
|
|
2
2
|
import { isValidDate } from '@medplum/core';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { getErrorsForInput } from '../utils/outcomes.
|
|
4
|
+
import { getErrorsForInput } from '../utils/outcomes.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The DateTimeInput component is a wrapper around the HTML5 input type="datetime-local".
|
|
@@ -67,4 +67,4 @@ function getInputType() {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export { DateTimeInput, convertIsoToLocal, convertLocalToIso };
|
|
70
|
-
//# sourceMappingURL=DateTimeInput.
|
|
70
|
+
//# sourceMappingURL=DateTimeInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimeInput.mjs","sources":["../../../src/DateTimeInput/DateTimeInput.tsx"],"sourcesContent":["import { TextInput } from '@mantine/core';\nimport { isValidDate } from '@medplum/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { getErrorsForInput } from '../utils/outcomes';\n\nexport interface DateTimeInputProps {\n name?: string;\n placeholder?: string;\n defaultValue?: string;\n outcome?: OperationOutcome;\n onChange?: (value: string) => void;\n}\n\n/**\n * The DateTimeInput component is a wrapper around the HTML5 input type=\"datetime-local\".\n * The main purpose is to reconcile time zones.\n * Most of our date/time values are in ISO-8601, which includes a time zone offset.\n * The datetime-local input does not support the time zone offset.\n * @param props The Input props.\n * @returns The JSX element to render.\n */\nexport function DateTimeInput(props: DateTimeInputProps): JSX.Element {\n return (\n <TextInput\n id={props.name}\n name={props.name}\n data-testid={props.name}\n placeholder={props.placeholder}\n type={getInputType()}\n defaultValue={convertIsoToLocal(props.defaultValue)}\n error={getErrorsForInput(props.outcome, props.name)}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n if (props.onChange) {\n const newValue = e.currentTarget.value;\n props.onChange(convertLocalToIso(newValue));\n }\n }}\n />\n );\n}\n\n/**\n * Converts an ISO-8601 date/time string to a local date/time string.\n * @param isoString The ISO-8601 date/time string to convert.\n * @returns The local date/time string.\n */\nexport function convertIsoToLocal(isoString: string | undefined): string {\n if (!isoString) {\n return '';\n }\n\n // Convert the ISO-8601 date to a local datetime-local value.\n // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Date_and_time_formats#local_date_and_time_strings\n // See: https://stackoverflow.com/a/60368477\n const date = new Date(isoString);\n if (!isValidDate(date)) {\n // If the input string was malformed, return an empty string.\n return '';\n }\n\n return date.toLocaleDateString('sv') + 'T' + date.toLocaleTimeString('sv');\n}\n\n/**\n * Converts a local date/time string to an ISO-8601 date/time string.\n * @param localString The local date/time string to convert.\n * @returns The ISO-8601 date/time string.\n */\nexport function convertLocalToIso(localString: string | undefined): string {\n if (!localString) {\n return '';\n }\n\n // Try to parse the local string as a Date\n // JavaScript's Date() constructor defaults to the local time zone.\n // The Date() constructor will throw if the value is malformed.\n const date = new Date(localString);\n if (!isValidDate(date)) {\n // If the input string was malformed, return an empty string.\n return '';\n }\n\n return date.toISOString();\n}\n\n/**\n * Returns the input type for the requested type.\n * JSDOM does not support many of the valid <input> type attributes.\n * For example, it won't fire change events for <input type=\"datetime-local\">.\n */\nfunction getInputType(): string {\n return process.env.NODE_ENV === 'test' ? 'text' : 'datetime-local';\n}\n"],"names":[],"mappings":";;;;;AAcA;;;;;;;AAOG;AACG,SAAU,aAAa,CAAC,KAAyB,EAAA;IACrD,QACE,KAAC,CAAA,aAAA,CAAA,SAAS,EACR,EAAA,EAAE,EAAE,KAAK,CAAC,IAAI,EACd,IAAI,EAAE,KAAK,CAAC,IAAI,EACH,aAAA,EAAA,KAAK,CAAC,IAAI,EACvB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,IAAI,EAAE,YAAY,EAAE,EACpB,YAAY,EAAE,iBAAiB,CAAC,KAAK,CAAC,YAAY,CAAC,EACnD,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,EACnD,QAAQ,EAAE,CAAC,CAAsC,KAAI;YACnD,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,gBAAA,MAAM,QAAQ,GAAG,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;gBACvC,KAAK,CAAC,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC7C,aAAA;SACF,EAAA,CACD,EACF;AACJ,CAAC;AAED;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,SAA6B,EAAA;IAC7D,IAAI,CAAC,SAAS,EAAE;AACd,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;;;;AAKD,IAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;AACjC,IAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;;AAEtB,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;AAED,IAAA,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC7E,CAAC;AAED;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,WAA+B,EAAA;IAC/D,IAAI,CAAC,WAAW,EAAE;AAChB,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;;;;AAKD,IAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;AACnC,IAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;;AAEtB,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;AAED,IAAA,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5B,CAAC;AAED;;;;AAIG;AACH,SAAS,YAAY,GAAA;AACnB,IAAA,OAAkD,gBAAgB,CAAC;AACrE;;;;"}
|
package/dist/esm/DefaultResourceTimeline/{DefaultResourceTimeline.js → DefaultResourceTimeline.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getReferenceString } from '@medplum/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline.
|
|
3
|
+
import { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline.mjs';
|
|
4
4
|
|
|
5
5
|
function DefaultResourceTimeline(props) {
|
|
6
6
|
return (React.createElement(ResourceTimeline, { value: props.resource, buildSearchRequests: (resource) => ({
|
|
@@ -24,4 +24,4 @@ function DefaultResourceTimeline(props) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export { DefaultResourceTimeline };
|
|
27
|
-
//# sourceMappingURL=DefaultResourceTimeline.
|
|
27
|
+
//# sourceMappingURL=DefaultResourceTimeline.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultResourceTimeline.mjs","sources":["../../../src/DefaultResourceTimeline/DefaultResourceTimeline.tsx"],"sourcesContent":["import { getReferenceString } from '@medplum/core';\nimport { Reference, Resource } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline';\n\nexport interface DefaultResourceTimelineProps {\n resource: Resource | Reference;\n}\n\nexport function DefaultResourceTimeline(props: DefaultResourceTimelineProps): JSX.Element {\n return (\n <ResourceTimeline\n value={props.resource}\n buildSearchRequests={(resource: Resource) => ({\n resourceType: 'Bundle',\n type: 'batch',\n entry: [\n {\n request: {\n method: 'GET',\n url: `${getReferenceString(resource)}/_history`,\n },\n },\n {\n request: {\n method: 'GET',\n url: `AuditEvent?entity=${getReferenceString(resource)}&_sort=-_lastUpdated`,\n },\n },\n ],\n })}\n />\n );\n}\n"],"names":[],"mappings":";;;;AASM,SAAU,uBAAuB,CAAC,KAAmC,EAAA;AACzE,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,gBAAgB,EACf,EAAA,KAAK,EAAE,KAAK,CAAC,QAAQ,EACrB,mBAAmB,EAAE,CAAC,QAAkB,MAAM;AAC5C,YAAA,YAAY,EAAE,QAAQ;AACtB,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,KAAK,EAAE;AACL,gBAAA;AACE,oBAAA,OAAO,EAAE;AACP,wBAAA,MAAM,EAAE,KAAK;AACb,wBAAA,GAAG,EAAE,CAAG,EAAA,kBAAkB,CAAC,QAAQ,CAAC,CAAW,SAAA,CAAA;AAChD,qBAAA;AACF,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE;AACP,wBAAA,MAAM,EAAE,KAAK;AACb,wBAAA,GAAG,EAAE,CAAqB,kBAAA,EAAA,kBAAkB,CAAC,QAAQ,CAAC,CAAsB,oBAAA,CAAA;AAC7E,qBAAA;AACF,iBAAA;AACF,aAAA;SACF,CAAC,EAAA,CACF,EACF;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescriptionList.mjs","sources":["../../../src/DescriptionList/DescriptionList.tsx"],"sourcesContent":["import { createStyles } from '@mantine/core';\nimport React from 'react';\n\nconst useStyles = createStyles((theme) => ({\n root: {\n display: 'grid',\n gridTemplateColumns: '30% 70%',\n margin: 0,\n\n '& > dt, & > dd': {\n padding: `${theme.spacing.sm}px ${theme.spacing.sm}px`,\n borderTop: `0.1px solid ${theme.colors.gray[3]}`,\n margin: 0,\n },\n },\n\n compact: {\n gridTemplateColumns: '20% 80%',\n\n '& > dt, & > dd': {\n padding: `0 ${theme.spacing.xs}px ${theme.spacing.xs}px 0`,\n border: 0,\n },\n },\n}));\n\nexport interface DescriptionListProps {\n children: React.ReactNode;\n compact?: boolean;\n}\n\nexport function DescriptionList(props: DescriptionListProps): JSX.Element {\n const { children, compact } = props;\n const { classes, cx } = useStyles();\n return <dl className={cx(classes.root, { [classes.compact]: compact })}>{children}</dl>;\n}\n\nexport interface DescriptionListEntryProps {\n term: string;\n children: React.ReactNode;\n}\n\nexport function DescriptionListEntry(props: DescriptionListEntryProps): JSX.Element {\n return (\n <>\n <dt>{props.term}</dt>\n <dd>{props.children}</dd>\n </>\n );\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,MAAM;AACzC,IAAA,IAAI,EAAE;AACJ,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,mBAAmB,EAAE,SAAS;AAC9B,QAAA,MAAM,EAAE,CAAC;AAET,QAAA,gBAAgB,EAAE;AAChB,YAAA,OAAO,EAAE,CAAA,EAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAA,GAAA,EAAM,KAAK,CAAC,OAAO,CAAC,EAA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 @@
|
|
|
1
1
|
import { createStyles, Stack, Title, Group, Text } from '@mantine/core';
|
|
2
2
|
import { formatDateTime, capitalize, formatObservationValue } from '@medplum/core';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { CodeableConceptDisplay } from '../CodeableConceptDisplay/CodeableConceptDisplay.
|
|
5
|
-
import { MedplumLink } from '../MedplumLink/MedplumLink.
|
|
6
|
-
import { RangeDisplay } from '../RangeDisplay/RangeDisplay.
|
|
7
|
-
import { ResourceBadge } from '../ResourceBadge/ResourceBadge.
|
|
8
|
-
import {
|
|
4
|
+
import { CodeableConceptDisplay } from '../CodeableConceptDisplay/CodeableConceptDisplay.mjs';
|
|
5
|
+
import { MedplumLink } from '../MedplumLink/MedplumLink.mjs';
|
|
6
|
+
import { RangeDisplay } from '../RangeDisplay/RangeDisplay.mjs';
|
|
7
|
+
import { ResourceBadge } from '../ResourceBadge/ResourceBadge.mjs';
|
|
8
|
+
import { StatusBadge } from '../StatusBadge/StatusBadge.mjs';
|
|
9
|
+
import { useResource } from '../useResource/useResource.mjs';
|
|
9
10
|
|
|
10
11
|
const useStyles = createStyles((theme) => ({
|
|
11
12
|
table: {
|
|
@@ -27,20 +28,19 @@ const useStyles = createStyles((theme) => ({
|
|
|
27
28
|
},
|
|
28
29
|
}));
|
|
29
30
|
function DiagnosticReportDisplay(props) {
|
|
30
|
-
var _a, _b;
|
|
31
31
|
const diagnosticReport = useResource(props.value);
|
|
32
|
-
const specimen = useResource(
|
|
32
|
+
const specimen = useResource(diagnosticReport?.specimen?.[0]);
|
|
33
33
|
if (!diagnosticReport) {
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
36
|
let textContent = '';
|
|
37
37
|
if (diagnosticReport.presentedForm && diagnosticReport.presentedForm.length > 0) {
|
|
38
38
|
const pf = diagnosticReport.presentedForm[0];
|
|
39
|
-
if (
|
|
39
|
+
if (pf.contentType?.startsWith('text/plain') && pf.data) {
|
|
40
40
|
textContent = window.atob(pf.data);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
if (specimen
|
|
43
|
+
if (specimen?.note) {
|
|
44
44
|
for (const note of specimen.note) {
|
|
45
45
|
textContent += note.text + '\n\n';
|
|
46
46
|
}
|
|
@@ -67,7 +67,6 @@ function DiagnosticReportDisplay(props) {
|
|
|
67
67
|
textContent && React.createElement("pre", null, textContent.trim())));
|
|
68
68
|
}
|
|
69
69
|
function ObservationTable(props) {
|
|
70
|
-
var _a;
|
|
71
70
|
const { classes } = useStyles();
|
|
72
71
|
return (React.createElement("table", { className: classes.table },
|
|
73
72
|
React.createElement("thead", null,
|
|
@@ -75,8 +74,10 @@ function ObservationTable(props) {
|
|
|
75
74
|
React.createElement("th", null, "Test"),
|
|
76
75
|
React.createElement("th", null, "Value"),
|
|
77
76
|
React.createElement("th", null, "Reference Range"),
|
|
78
|
-
React.createElement("th", null, "Interpretation")
|
|
79
|
-
|
|
77
|
+
React.createElement("th", null, "Interpretation"),
|
|
78
|
+
React.createElement("th", null, "Category"),
|
|
79
|
+
React.createElement("th", null, "Status"))),
|
|
80
|
+
React.createElement("tbody", null, props.value?.map((observation, index) => (React.createElement(ObservationRow, { key: 'obs-' + index, value: observation }))))));
|
|
80
81
|
}
|
|
81
82
|
function ObservationRow(props) {
|
|
82
83
|
const { classes, cx } = useStyles();
|
|
@@ -93,7 +94,10 @@ function ObservationRow(props) {
|
|
|
93
94
|
React.createElement(ObservationValueDisplay, { value: observation })),
|
|
94
95
|
React.createElement("td", null,
|
|
95
96
|
React.createElement(ReferenceRangeDisplay, { value: observation.referenceRange })),
|
|
96
|
-
React.createElement("td", null, observation.interpretation && observation.interpretation.length > 0 && (React.createElement(CodeableConceptDisplay, { value: observation.interpretation[0] })))
|
|
97
|
+
React.createElement("td", null, observation.interpretation && observation.interpretation.length > 0 && (React.createElement(CodeableConceptDisplay, { value: observation.interpretation[0] }))),
|
|
98
|
+
React.createElement("td", null, observation.category && observation.category.length > 0 && (React.createElement("ul", null, observation.category.map((concept, index) => (React.createElement("li", { key: `category-${index}` },
|
|
99
|
+
React.createElement(CodeableConceptDisplay, { value: concept }))))))),
|
|
100
|
+
React.createElement("td", null, observation.status && React.createElement(StatusBadge, { status: observation.status }))));
|
|
97
101
|
}
|
|
98
102
|
function ObservationValueDisplay(props) {
|
|
99
103
|
const obs = props.value;
|
|
@@ -116,10 +120,9 @@ function ReferenceRangeDisplay(props) {
|
|
|
116
120
|
* @returns True if the FHIR observation is a critical value.
|
|
117
121
|
*/
|
|
118
122
|
function isCritical(observation) {
|
|
119
|
-
|
|
120
|
-
const code = (_d = (_c = (_b = (_a = observation.interpretation) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.coding) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.code;
|
|
123
|
+
const code = observation.interpretation?.[0]?.coding?.[0]?.code;
|
|
121
124
|
return code === 'AA' || code === 'LL' || code === 'HH' || code === 'A';
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
export { DiagnosticReportDisplay, ObservationTable };
|
|
125
|
-
//# sourceMappingURL=DiagnosticReportDisplay.
|
|
128
|
+
//# sourceMappingURL=DiagnosticReportDisplay.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiagnosticReportDisplay.mjs","sources":["../../../src/DiagnosticReportDisplay/DiagnosticReportDisplay.tsx"],"sourcesContent":["import { createStyles, Group, Stack, Text, Title } from '@mantine/core';\nimport { capitalize, formatDateTime, formatObservationValue } from '@medplum/core';\nimport {\n DiagnosticReport,\n Observation,\n ObservationComponent,\n ObservationReferenceRange,\n Reference,\n} from '@medplum/fhirtypes';\nimport React from 'react';\nimport { CodeableConceptDisplay } from '../CodeableConceptDisplay/CodeableConceptDisplay';\nimport { MedplumLink } from '../MedplumLink/MedplumLink';\nimport { RangeDisplay } from '../RangeDisplay/RangeDisplay';\nimport { ResourceBadge } from '../ResourceBadge/ResourceBadge';\nimport { StatusBadge } from '../StatusBadge/StatusBadge';\nimport { useResource } from '../useResource/useResource';\n\nconst useStyles = createStyles((theme) => ({\n table: {\n border: `0.1px solid ${theme.colors.gray[5]}`,\n borderCollapse: 'collapse',\n\n '& td, & th': {\n border: `0.1px solid ${theme.colors.gray[5]}`,\n padding: 4,\n },\n },\n\n criticalRow: {\n background: theme.colorScheme === 'dark' ? theme.colors.red[7] : theme.colors.red[1],\n border: `0.1px solid ${theme.colors.red[5]}`,\n color: theme.colors.red[5],\n fontWeight: 500,\n\n '& td': {\n border: `0.1px solid ${theme.colors.red[5]}`,\n },\n },\n}));\n\nexport interface DiagnosticReportDisplayProps {\n value?: DiagnosticReport | Reference<DiagnosticReport>;\n}\n\nexport function DiagnosticReportDisplay(props: DiagnosticReportDisplayProps): JSX.Element | null {\n const diagnosticReport = useResource(props.value);\n const specimen = useResource(diagnosticReport?.specimen?.[0]);\n\n if (!diagnosticReport) {\n return null;\n }\n\n let textContent = '';\n\n if (diagnosticReport.presentedForm && diagnosticReport.presentedForm.length > 0) {\n const pf = diagnosticReport.presentedForm[0];\n if (pf.contentType?.startsWith('text/plain') && pf.data) {\n textContent = window.atob(pf.data);\n }\n }\n\n if (specimen?.note) {\n for (const note of specimen.note) {\n textContent += note.text + '\\n\\n';\n }\n }\n\n return (\n <Stack>\n <Title>Diagnostic Report</Title>\n <Group mt=\"md\" spacing={30}>\n {diagnosticReport.subject && (\n <div>\n <Text size=\"xs\" transform=\"uppercase\" color=\"dimmed\">\n Subject\n </Text>\n <Text>\n <ResourceBadge value={diagnosticReport.subject} link={true} />\n </Text>\n </div>\n )}\n {diagnosticReport.resultsInterpreter &&\n diagnosticReport.resultsInterpreter.map((interpreter) => (\n <div key={interpreter.reference}>\n <Text size=\"xs\" transform=\"uppercase\" color=\"dimmed\">\n Interpreter\n </Text>\n <Text>\n <ResourceBadge value={interpreter} link={true} />\n </Text>\n </div>\n ))}\n {diagnosticReport.issued && (\n <div>\n <Text size=\"xs\" transform=\"uppercase\" color=\"dimmed\">\n Issued\n </Text>\n <Text>{formatDateTime(diagnosticReport.issued)}</Text>\n </div>\n )}\n {diagnosticReport.status && (\n <div>\n <Text size=\"xs\" transform=\"uppercase\" color=\"dimmed\">\n Status\n </Text>\n <Text>{capitalize(diagnosticReport.status)}</Text>\n </div>\n )}\n </Group>\n {diagnosticReport.result && <ObservationTable value={diagnosticReport.result} />}\n {textContent && <pre>{textContent.trim()}</pre>}\n </Stack>\n );\n}\n\nexport interface ObservationTableProps {\n value?: Observation[] | Reference<Observation>[];\n}\n\nexport function ObservationTable(props: ObservationTableProps): JSX.Element {\n const { classes } = useStyles();\n return (\n <table className={classes.table}>\n <thead>\n <tr>\n <th>Test</th>\n <th>Value</th>\n <th>Reference Range</th>\n <th>Interpretation</th>\n <th>Category</th>\n <th>Status</th>\n </tr>\n </thead>\n <tbody>\n {props.value?.map((observation, index) => (\n <ObservationRow key={'obs-' + index} value={observation} />\n ))}\n </tbody>\n </table>\n );\n}\n\ninterface ObservationRowProps {\n value: Observation | Reference<Observation>;\n}\n\nfunction ObservationRow(props: ObservationRowProps): JSX.Element | null {\n const { classes, cx } = useStyles();\n const observation = useResource(props.value);\n if (!observation) {\n return null;\n }\n\n const critical = isCritical(observation);\n\n return (\n <tr className={cx({ [classes.criticalRow]: critical })}>\n <td>\n <MedplumLink to={observation}>\n <CodeableConceptDisplay value={observation.code} />\n </MedplumLink>\n </td>\n <td>\n <ObservationValueDisplay value={observation} />\n </td>\n <td>\n <ReferenceRangeDisplay value={observation.referenceRange} />\n </td>\n <td>\n {observation.interpretation && observation.interpretation.length > 0 && (\n <CodeableConceptDisplay value={observation.interpretation[0]} />\n )}\n </td>\n <td>\n {observation.category && observation.category.length > 0 && (\n <ul>\n {observation.category.map((concept, index) => (\n <li key={`category-${index}`}>\n <CodeableConceptDisplay value={concept} />\n </li>\n ))}\n </ul>\n )}\n </td>\n <td>{observation.status && <StatusBadge status={observation.status} />}</td>\n </tr>\n );\n}\n\ninterface ObservationValueDisplayProps {\n value?: Observation | ObservationComponent;\n}\n\nfunction ObservationValueDisplay(props: ObservationValueDisplayProps): JSX.Element | null {\n const obs = props.value;\n return <>{formatObservationValue(obs)}</>;\n}\n\ninterface ReferenceRangeProps {\n value?: ObservationReferenceRange[];\n}\n\nfunction ReferenceRangeDisplay(props: ReferenceRangeProps): JSX.Element | null {\n const range = props.value && props.value.length > 0 && props.value[0];\n if (!range) {\n return null;\n }\n if (range.text) {\n return <>{range.text}</>;\n }\n return <RangeDisplay value={range} />;\n}\n\n/**\n * Returns true if the observation is critical.\n * See: https://www.hl7.org/fhir/valueset-observation-interpretation.html\n * @param observation The FHIR observation.\n * @returns True if the FHIR observation is a critical value.\n */\nfunction isCritical(observation: Observation): boolean {\n const code = observation.interpretation?.[0]?.coding?.[0]?.code;\n return code === 'AA' || code === 'LL' || code === 'HH' || code === 'A';\n}\n"],"names":[],"mappings":";;;;;;;;;;AAiBA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,MAAM;AACzC,IAAA,KAAK,EAAE;QACL,MAAM,EAAE,CAAe,YAAA,EAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAA;AAC7C,QAAA,cAAc,EAAE,UAAU;AAE1B,QAAA,YAAY,EAAE;YACZ,MAAM,EAAE,CAAe,YAAA,EAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAA;AAC7C,YAAA,OAAO,EAAE,CAAC;AACX,SAAA;AACF,KAAA;AAED,IAAA,WAAW,EAAE;QACX,UAAU,EAAE,KAAK,CAAC,WAAW,KAAK,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACpF,MAAM,EAAE,CAAe,YAAA,EAAA,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAA;QAC5C,KAAK,EAAE,KAAK,CAAC,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,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtE,IAAI,CAAC,KAAK,EAAE;AACV,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;IACD,IAAI,KAAK,CAAC,IAAI,EAAE;AACd,QAAA,OAAO,KAAG,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,KAAK,CAAC,IAAI,CAAI,CAAC;AAC1B,KAAA;AACD,IAAA,OAAO,oBAAC,YAAY,EAAA,EAAC,KAAK,EAAE,KAAK,GAAI,CAAC;AACxC,CAAC;AAED;;;;;AAKG;AACH,SAAS,UAAU,CAAC,WAAwB,EAAA;AAC1C,IAAA,MAAM,IAAI,GAAG,WAAW,CAAC,cAAc,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC;AAChE,IAAA,OAAO,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC;AACzE;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Container } from '../Container/Container.mjs';
|
|
3
|
+
import { Panel } from '../Panel/Panel.mjs';
|
|
4
|
+
|
|
5
|
+
function Document(props) {
|
|
6
|
+
const { children, ...others } = props;
|
|
7
|
+
return (React.createElement(Container, null,
|
|
8
|
+
React.createElement(Panel, { ...others }, children)));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { Document };
|
|
12
|
+
//# sourceMappingURL=Document.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Document.mjs","sources":["../../../src/Document/Document.tsx"],"sourcesContent":["import React from 'react';\nimport { Container } from '../Container/Container';\nimport { Panel, PanelProps } from '../Panel/Panel';\n\nexport function Document(props: PanelProps): JSX.Element {\n const { children, ...others } = props;\n return (\n <Container>\n <Panel {...others}>{children}</Panel>\n </Container>\n );\n}\n"],"names":[],"mappings":";;;;AAIM,SAAU,QAAQ,CAAC,KAAiB,EAAA;IACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;IACtC,QACE,oBAAC,SAAS,EAAA,IAAA;QACR,KAAC,CAAA,aAAA,CAAA,KAAK,OAAK,MAAM,EAAA,EAAG,QAAQ,CAAS,CAC3B,EACZ;AACJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getReferenceString, createReference } from '@medplum/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline.
|
|
3
|
+
import { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline.mjs';
|
|
4
4
|
|
|
5
5
|
function EncounterTimeline(props) {
|
|
6
6
|
return (React.createElement(ResourceTimeline, { value: props.encounter, buildSearchRequests: (resource) => ({
|
|
@@ -46,4 +46,4 @@ function EncounterTimeline(props) {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export { EncounterTimeline };
|
|
49
|
-
//# sourceMappingURL=EncounterTimeline.
|
|
49
|
+
//# sourceMappingURL=EncounterTimeline.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EncounterTimeline.mjs","sources":["../../../src/EncounterTimeline/EncounterTimeline.tsx"],"sourcesContent":["import { createReference, getReferenceString, ProfileResource } from '@medplum/core';\nimport { Attachment, Encounter, Reference, Resource } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline';\n\nexport interface EncounterTimelineProps {\n encounter: Encounter | Reference<Encounter>;\n}\n\nexport function EncounterTimeline(props: EncounterTimelineProps): JSX.Element {\n return (\n <ResourceTimeline\n value={props.encounter}\n buildSearchRequests={(resource: Resource) => ({\n resourceType: 'Bundle',\n type: 'batch',\n entry: [\n {\n request: {\n method: 'GET',\n url: `${getReferenceString(resource)}/_history`,\n },\n },\n {\n request: {\n method: 'GET',\n url: `Communication?encounter=${getReferenceString(resource)}`,\n },\n },\n {\n request: {\n method: 'GET',\n url: `Media?encounter=${getReferenceString(resource)}`,\n },\n },\n ],\n })}\n createCommunication={(resource: Encounter, sender: ProfileResource, text: string) => ({\n resourceType: 'Communication',\n status: 'completed',\n encounter: createReference(resource),\n subject: resource.subject,\n sender: createReference(sender),\n sent: new Date().toISOString(),\n payload: [{ contentString: text }],\n })}\n createMedia={(resource: Encounter, operator: ProfileResource, content: Attachment) => ({\n resourceType: 'Media',\n status: 'completed',\n encounter: createReference(resource),\n subject: resource.subject,\n operator: createReference(operator),\n issued: new Date().toISOString(),\n content,\n })}\n />\n );\n}\n"],"names":[],"mappings":";;;;AASM,SAAU,iBAAiB,CAAC,KAA6B,EAAA;AAC7D,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,gBAAgB,EACf,EAAA,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,mBAAmB,EAAE,CAAC,QAAkB,MAAM;AAC5C,YAAA,YAAY,EAAE,QAAQ;AACtB,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,KAAK,EAAE;AACL,gBAAA;AACE,oBAAA,OAAO,EAAE;AACP,wBAAA,MAAM,EAAE,KAAK;AACb,wBAAA,GAAG,EAAE,CAAG,EAAA,kBAAkB,CAAC,QAAQ,CAAC,CAAW,SAAA,CAAA;AAChD,qBAAA;AACF,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE;AACP,wBAAA,MAAM,EAAE,KAAK;AACb,wBAAA,GAAG,EAAE,CAA2B,wBAAA,EAAA,kBAAkB,CAAC,QAAQ,CAAC,CAAE,CAAA;AAC/D,qBAAA;AACF,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE;AACP,wBAAA,MAAM,EAAE,KAAK;AACb,wBAAA,GAAG,EAAE,CAAmB,gBAAA,EAAA,kBAAkB,CAAC,QAAQ,CAAC,CAAE,CAAA;AACvD,qBAAA;AACF,iBAAA;AACF,aAAA;AACF,SAAA,CAAC,EACF,mBAAmB,EAAE,CAAC,QAAmB,EAAE,MAAuB,EAAE,IAAY,MAAM;AACpF,YAAA,YAAY,EAAE,eAAe;AAC7B,YAAA,MAAM,EAAE,WAAW;AACnB,YAAA,SAAS,EAAE,eAAe,CAAC,QAAQ,CAAC;YACpC,OAAO,EAAE,QAAQ,CAAC,OAAO;AACzB,YAAA,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC;AAC/B,YAAA,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC9B,YAAA,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AACnC,SAAA,CAAC,EACF,WAAW,EAAE,CAAC,QAAmB,EAAE,QAAyB,EAAE,OAAmB,MAAM;AACrF,YAAA,YAAY,EAAE,OAAO;AACrB,YAAA,MAAM,EAAE,WAAW;AACnB,YAAA,SAAS,EAAE,eAAe,CAAC,QAAQ,CAAC;YACpC,OAAO,EAAE,QAAQ,CAAC,OAAO;AACzB,YAAA,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAAC;AACnC,YAAA,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YAChC,OAAO;SACR,CAAC,EAAA,CACF,EACF;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.mjs","sources":["../../../src/ErrorBoundary/ErrorBoundary.tsx"],"sourcesContent":["import { Alert } from '@mantine/core';\nimport { normalizeErrorString } from '@medplum/core';\nimport { IconAlertCircle } from '@tabler/icons';\nimport React, { ErrorInfo, ReactNode } from 'react';\n\nexport interface ErrorBoundaryProps {\n children: ReactNode;\n}\n\nexport interface ErrorBoundaryState {\n error?: any;\n}\n\n/**\n * ErrorBoundary is a React component that handles errors in its child components.\n * See: https://reactjs.org/docs/error-boundaries.html\n */\nexport class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {\n state: ErrorBoundaryState;\n\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = {};\n }\n\n static getDerivedStateFromError(error: any): ErrorBoundaryState {\n return { error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n console.error('Uncaught error:', error, errorInfo);\n }\n\n render(): ReactNode {\n if (this.state.error) {\n return (\n <Alert icon={<IconAlertCircle size={16} />} title=\"Something went wrong\" color=\"red\">\n {normalizeErrorString(this.state.error)}\n </Alert>\n );\n }\n\n return this.props.children;\n }\n}\n"],"names":[],"mappings":";;;;;AAaA;;;AAGG;AACU,MAAA,aAAc,SAAQ,KAAK,CAAC,SAAiD,CAAA;AAGxF,IAAA,WAAA,CAAY,KAAyB,EAAA;QACnC,KAAK,CAAC,KAAK,CAAC,CAAC;AACb,QAAA,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;KACjB;IAED,OAAO,wBAAwB,CAAC,KAAU,EAAA;QACxC,OAAO,EAAE,KAAK,EAAE,CAAC;KAClB;IAED,iBAAiB,CAAC,KAAY,EAAE,SAAoB,EAAA;QAClD,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;KACpD;IAED,MAAM,GAAA;AACJ,QAAA,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;AACpB,YAAA,QACE,KAAA,CAAA,aAAA,CAAC,KAAK,EAAA,EAAC,IAAI,EAAE,KAAA,CAAA,aAAA,CAAC,eAAe,EAAA,EAAC,IAAI,EAAE,EAAE,EAAA,CAAI,EAAE,KAAK,EAAC,sBAAsB,EAAC,KAAK,EAAC,KAAK,EAAA,EACjF,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CACjC,EACR;AACH,SAAA;AAED,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;KAC5B;AACF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionInput.mjs","sources":["../../../src/ExtensionInput/ExtensionInput.tsx"],"sourcesContent":["import { JsonInput } from '@mantine/core';\nimport { stringify } from '@medplum/core';\nimport { Extension } from '@medplum/fhirtypes';\nimport React from 'react';\n\nexport interface ExtensionInputProps {\n name: string;\n defaultValue?: Extension;\n onChange?: (value: Extension) => void;\n}\n\nexport function ExtensionInput(props: ExtensionInputProps): JSX.Element {\n return (\n <JsonInput\n id={props.name}\n name={props.name}\n data-testid=\"extension-input\"\n defaultValue={stringify(props.defaultValue)}\n onChange={(newValue) => {\n if (props.onChange) {\n props.onChange(JSON.parse(newValue));\n }\n }}\n />\n );\n}\n"],"names":[],"mappings":";;;;AAWM,SAAU,cAAc,CAAC,KAA0B,EAAA;AACvD,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,EAAE,EAAE,KAAK,CAAC,IAAI,EACd,IAAI,EAAE,KAAK,CAAC,IAAI,EAAA,aAAA,EACJ,iBAAiB,EAC7B,YAAY,EAAE,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,EAC3C,QAAQ,EAAE,CAAC,QAAQ,KAAI;YACrB,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtC,aAAA;SACF,EAAA,CACD,EACF;AACJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { evalFhirPath } from '@medplum/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.
|
|
3
|
+
import { ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.mjs';
|
|
4
4
|
|
|
5
5
|
function FhirPathDisplay(props) {
|
|
6
6
|
let value;
|
|
@@ -20,4 +20,4 @@ function FhirPathDisplay(props) {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export { FhirPathDisplay };
|
|
23
|
-
//# sourceMappingURL=FhirPathDisplay.
|
|
23
|
+
//# sourceMappingURL=FhirPathDisplay.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FhirPathDisplay.mjs","sources":["../../../src/FhirPathDisplay/FhirPathDisplay.tsx"],"sourcesContent":["import { evalFhirPath, PropertyType } from '@medplum/core';\nimport { Resource } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay';\n\nexport interface FhirPathDisplayProps {\n resource: Resource;\n path: string;\n propertyType: PropertyType;\n}\n\nexport function FhirPathDisplay(props: FhirPathDisplayProps): JSX.Element | null {\n let value;\n\n try {\n value = evalFhirPath(props.path, props.resource);\n } catch (err) {\n console.warn('FhirPathDisplay:', err);\n return null;\n }\n\n if (value.length > 1) {\n throw new Error(\n `Component \"path\" for \"FhirPathDisplay\" must resolve to a single element. \\\n Received ${value.length} elements \\\n [${JSON.stringify(value, null, 2)}]`\n );\n }\n return <ResourcePropertyDisplay value={value[0] || ''} propertyType={props.propertyType} />;\n}\n"],"names":[],"mappings":";;;;AAWM,SAAU,eAAe,CAAC,KAA2B,EAAA;AACzD,IAAA,IAAI,KAAK,CAAC;IAEV,IAAI;QACF,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClD,KAAA;AAAC,IAAA,OAAO,GAAG,EAAE;AACZ,QAAA,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;AACtC,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AAED,IAAA,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,MAAM,IAAI,KAAK,CACb,CAAA;AACY,gBAAA,EAAA,KAAK,CAAC,MAAM,CAAA;UACpB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAG,CAAA,CAAA,CACtC,CAAC;AACH,KAAA;AACD,IAAA,OAAO,oBAAC,uBAAuB,EAAA,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,GAAI,CAAC;AAC9F;;;;"}
|
|
@@ -2,7 +2,7 @@ import { PropertyType } from '@medplum/core';
|
|
|
2
2
|
import { Resource } from '@medplum/fhirtypes';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { SearchClickEvent } from '../SearchControl/SearchControl';
|
|
5
|
-
export interface
|
|
5
|
+
export interface FhirPathTableField {
|
|
6
6
|
readonly propertyType: PropertyType;
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly fhirPath: string;
|
|
@@ -10,7 +10,7 @@ export interface SmartSearchField {
|
|
|
10
10
|
export interface FhirPathTableProps {
|
|
11
11
|
resourceType: string;
|
|
12
12
|
query: string;
|
|
13
|
-
fields:
|
|
13
|
+
fields: FhirPathTableField[];
|
|
14
14
|
checkboxesEnabled?: boolean;
|
|
15
15
|
onClick?: (e: SearchClickEvent) => void;
|
|
16
16
|
onAuxClick?: (e: SearchClickEvent) => void;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Loader, Table, Button } from '@mantine/core';
|
|
2
2
|
import React, { useState, useRef, useEffect } from 'react';
|
|
3
|
-
import { FhirPathDisplay } from '../FhirPathDisplay/FhirPathDisplay.
|
|
4
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.
|
|
5
|
-
import { SearchClickEvent } from '../SearchControl/SearchControl.
|
|
6
|
-
import { killEvent, isCheckboxCell } from '../utils/dom.
|
|
3
|
+
import { FhirPathDisplay } from '../FhirPathDisplay/FhirPathDisplay.mjs';
|
|
4
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
5
|
+
import { SearchClickEvent } from '../SearchControl/SearchControl.mjs';
|
|
6
|
+
import { killEvent, isCheckboxCell } from '../utils/dom.mjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The FhirPathTable component represents the embeddable search table control.
|
|
10
10
|
*/
|
|
11
11
|
function FhirPathTable(props) {
|
|
12
|
-
var _a, _b, _c, _d, _e;
|
|
13
12
|
const medplum = useMedplum();
|
|
14
13
|
const [schema, setSchema] = useState();
|
|
15
14
|
const [outcome, setOutcome] = useState();
|
|
@@ -28,7 +27,7 @@ function FhirPathTable(props) {
|
|
|
28
27
|
e.stopPropagation();
|
|
29
28
|
const el = e.target;
|
|
30
29
|
const checked = el.checked;
|
|
31
|
-
const newSelected =
|
|
30
|
+
const newSelected = { ...selectedRef.current };
|
|
32
31
|
if (checked) {
|
|
33
32
|
newSelected[id] = true;
|
|
34
33
|
}
|
|
@@ -38,15 +37,14 @@ function FhirPathTable(props) {
|
|
|
38
37
|
setSelected(newSelected);
|
|
39
38
|
}
|
|
40
39
|
function handleAllCheckboxClick(e) {
|
|
41
|
-
var _a, _b;
|
|
42
40
|
e.stopPropagation();
|
|
43
41
|
const el = e.target;
|
|
44
42
|
const checked = el.checked;
|
|
45
43
|
const newSelected = {};
|
|
46
|
-
const resources =
|
|
44
|
+
const resources = responseRef.current?.data?.ResourceList;
|
|
47
45
|
if (checked && resources) {
|
|
48
46
|
resources.forEach((resource) => {
|
|
49
|
-
if (resource
|
|
47
|
+
if (resource?.id) {
|
|
50
48
|
newSelected[resource.id] = true;
|
|
51
49
|
}
|
|
52
50
|
});
|
|
@@ -54,13 +52,12 @@ function FhirPathTable(props) {
|
|
|
54
52
|
setSelected(newSelected);
|
|
55
53
|
}
|
|
56
54
|
function isAllSelected() {
|
|
57
|
-
|
|
58
|
-
const resources = (_b = (_a = responseRef.current) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.ResourceList;
|
|
55
|
+
const resources = responseRef.current?.data?.ResourceList;
|
|
59
56
|
if (!resources || resources.length === 0) {
|
|
60
57
|
return false;
|
|
61
58
|
}
|
|
62
59
|
for (const resource of resources) {
|
|
63
|
-
if (
|
|
60
|
+
if (resource?.id && !selectedRef.current[resource.id]) {
|
|
64
61
|
return false;
|
|
65
62
|
}
|
|
66
63
|
}
|
|
@@ -85,11 +82,11 @@ function FhirPathTable(props) {
|
|
|
85
82
|
.then((newSchema) => {
|
|
86
83
|
// The schema could have the same object identity,
|
|
87
84
|
// so need to use the spread operator to kick React re-render.
|
|
88
|
-
setSchema(
|
|
85
|
+
setSchema({ ...newSchema });
|
|
89
86
|
})
|
|
90
87
|
.catch(console.log);
|
|
91
88
|
}, [medplum, props.resourceType]);
|
|
92
|
-
const typeSchema =
|
|
89
|
+
const typeSchema = schema?.types?.[props.resourceType];
|
|
93
90
|
if (!typeSchema) {
|
|
94
91
|
return React.createElement(Loader, null);
|
|
95
92
|
}
|
|
@@ -101,14 +98,14 @@ function FhirPathTable(props) {
|
|
|
101
98
|
checkboxColumn && (React.createElement("th", null,
|
|
102
99
|
React.createElement("input", { type: "checkbox", value: "checked", "aria-label": "all-checkbox", "data-testid": "all-checkbox", checked: isAllSelected(), onChange: (e) => handleAllCheckboxClick(e) }))),
|
|
103
100
|
fields.map((field) => (React.createElement("th", { key: field.name }, field.name))))),
|
|
104
|
-
React.createElement("tbody", null,
|
|
101
|
+
React.createElement("tbody", null, response?.data?.ResourceList?.map((resource) => resource && (React.createElement("tr", { key: resource.id, "data-testid": "search-control-row", onClick: (e) => handleRowClick(e, resource), onAuxClick: (e) => handleRowClick(e, resource) },
|
|
105
102
|
checkboxColumn && (React.createElement("td", null,
|
|
106
103
|
React.createElement("input", { type: "checkbox", value: "checked", "data-testid": "row-checkbox", "aria-label": `Checkbox for ${resource.id}`, checked: !!selected[resource.id], onChange: (e) => handleSingleCheckboxClick(e, resource.id) }))),
|
|
107
104
|
fields.map((field) => {
|
|
108
105
|
return (React.createElement("td", { key: field.name },
|
|
109
106
|
React.createElement(FhirPathDisplay, { propertyType: field.propertyType, path: field.fhirPath, resource: resource })));
|
|
110
107
|
})))))),
|
|
111
|
-
|
|
108
|
+
response?.data?.ResourceList?.length === 0 && React.createElement("div", { "data-testid": "empty-search" }, "No results"),
|
|
112
109
|
outcome && (React.createElement("div", { "data-testid": "search-error" },
|
|
113
110
|
React.createElement("pre", { style: { textAlign: 'left' } }, JSON.stringify(outcome, undefined, 2)))),
|
|
114
111
|
props.onBulk && (React.createElement(Button, { onClick: () => props.onBulk(Object.keys(selectedRef.current)) }, "Bulk..."))));
|
|
@@ -116,4 +113,4 @@ function FhirPathTable(props) {
|
|
|
116
113
|
const MemoizedFhirPathTable = React.memo(FhirPathTable);
|
|
117
114
|
|
|
118
115
|
export { FhirPathTable, MemoizedFhirPathTable };
|
|
119
|
-
//# sourceMappingURL=FhirPathTable.
|
|
116
|
+
//# sourceMappingURL=FhirPathTable.mjs.map
|