@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestGroupDisplay.mjs","sources":["../../../src/RequestGroupDisplay/RequestGroupDisplay.tsx"],"sourcesContent":["import { Button, Grid, Text } from '@mantine/core';\nimport { formatDateTime, getReferenceString } from '@medplum/core';\nimport { Bundle, BundleEntry, Reference, RequestGroup, Resource, Task } from '@medplum/fhirtypes';\nimport { IconCheckbox, IconSquare } from '@tabler/icons';\nimport React, { useEffect, useState } from 'react';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { ResourceName } from '../ResourceName/ResourceName';\nimport { StatusBadge } from '../StatusBadge/StatusBadge';\nimport { useResource } from '../useResource/useResource';\n\nexport interface RequestGroupDisplayProps {\n value?: RequestGroup | Reference<RequestGroup>;\n onStart: (task: Task, input: Reference) => void;\n onEdit: (task: Task, input: Reference, output: Reference) => void;\n}\n\nexport function RequestGroupDisplay(props: RequestGroupDisplayProps): JSX.Element | null {\n const medplum = useMedplum();\n const requestGroup = useResource(props.value);\n const [startedLoading, setStartedLoading] = useState(false);\n const [responseBundle, setResponseBundle] = useState<Bundle>();\n\n useEffect(() => {\n if (requestGroup && !startedLoading) {\n medplum.executeBatch(buildBatchRequest(requestGroup)).then(setResponseBundle).catch(console.log);\n setStartedLoading(true);\n }\n }, [medplum, requestGroup, startedLoading]);\n\n if (!requestGroup || !responseBundle) {\n return null;\n }\n\n return (\n <Grid>\n {requestGroup.action?.map((action, index) => {\n const task = action.resource && findBundleEntry(action.resource as Reference<Task>);\n const taskInput = task?.input?.[0]?.valueReference;\n const taskOutput = task?.output?.[0]?.valueReference;\n return (\n <React.Fragment key={`action-${index}`}>\n <Grid.Col span={1} p=\"md\">\n {task?.status === 'completed' ? <IconCheckbox /> : <IconSquare color=\"gray\" />}\n </Grid.Col>\n <Grid.Col span={9} p=\"xs\">\n <Text weight={500}>{action.title}</Text>\n {action.description && <div>{action.description}</div>}\n <div>\n Last edited by \n <ResourceName value={task?.meta?.author as Reference} />\n on \n {formatDateTime(task?.meta?.lastUpdated)}\n </div>\n <div>\n Status: <StatusBadge status={task?.status || 'unknown'} />\n </div>\n </Grid.Col>\n <Grid.Col span={2} p=\"md\">\n {taskInput && !taskOutput && <Button onClick={() => props.onStart(task, taskInput)}>Start</Button>}\n {taskInput && taskOutput && (\n <Button onClick={() => props.onEdit(task, taskInput, taskOutput)}>Edit</Button>\n )}\n </Grid.Col>\n </React.Fragment>\n );\n })}\n </Grid>\n );\n\n function buildBatchRequest(request: RequestGroup): Bundle {\n const batchEntries = [] as BundleEntry[];\n if (request.action) {\n for (const action of request.action) {\n if (action.resource?.reference) {\n batchEntries.push({ request: { method: 'GET', url: action.resource.reference } });\n }\n }\n }\n\n return {\n resourceType: 'Bundle',\n type: 'batch',\n entry: batchEntries,\n };\n }\n\n function findBundleEntry<T extends Resource>(reference: Reference<T>): T | undefined {\n for (const entry of responseBundle?.entry as BundleEntry[]) {\n if (entry.resource && reference.reference === getReferenceString(entry.resource)) {\n return entry.resource as T;\n }\n }\n return undefined;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAgBM,SAAU,mBAAmB,CAAC,KAA+B,EAAA;AACjE,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5D,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,EAAU,CAAC;IAE/D,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,YAAY,IAAI,CAAC,cAAc,EAAE;YACnC,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACjG,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACzB,SAAA;KACF,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC;AAE5C,IAAA,IAAI,CAAC,YAAY,IAAI,CAAC,cAAc,EAAE;AACpC,QAAA,OAAO,IAAI,CAAC;AACb,KAAA;AAED,IAAA,QACE,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,IAAA,EACF,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,KAAI;AAC1C,QAAA,MAAM,IAAI,GAAG,MAAM,CA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AK,CAAC,QAAQ,CAAC,EAAE;gBAChF,OAAO,KAAK,CAAC,QAAa,CAAC;AAC5B,aAAA;AACF,SAAA;AACD,QAAA,OAAO,SAAS,CAAC;KAClB;AACH;;;;"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.
|
|
2
|
+
import { ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.mjs';
|
|
3
3
|
|
|
4
4
|
function ResourceArrayDisplay(props) {
|
|
5
|
-
var _a, _b, _c;
|
|
6
5
|
const property = props.property;
|
|
7
|
-
const values =
|
|
8
|
-
const propertyType =
|
|
6
|
+
const values = props.values ?? [];
|
|
7
|
+
const propertyType = property.type?.[0]?.code;
|
|
9
8
|
return (React.createElement(React.Fragment, null, values.map((v, index) => (React.createElement("div", { key: `${index}-${values.length}` },
|
|
10
9
|
React.createElement(ResourcePropertyDisplay, { arrayElement: true, property: property, propertyType: propertyType, value: v, ignoreMissingValues: props.ignoreMissingValues, link: props.link }))))));
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
export { ResourceArrayDisplay };
|
|
14
|
-
//# sourceMappingURL=ResourceArrayDisplay.
|
|
13
|
+
//# sourceMappingURL=ResourceArrayDisplay.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceArrayDisplay.mjs","sources":["../../../src/ResourceArrayDisplay/ResourceArrayDisplay.tsx"],"sourcesContent":["import { PropertyType } from '@medplum/core';\nimport { ElementDefinition } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay';\n\ninterface ResourceArrayDisplayProps {\n property: ElementDefinition;\n values: any[];\n arrayElement?: boolean;\n ignoreMissingValues?: boolean;\n link?: boolean;\n}\n\nexport function ResourceArrayDisplay(props: ResourceArrayDisplayProps): JSX.Element {\n const property = props.property;\n const values = props.values ?? [];\n const propertyType = property.type?.[0]?.code as PropertyType;\n return (\n <>\n {values.map((v: any, index: number) => (\n <div key={`${index}-${values.length}`}>\n <ResourcePropertyDisplay\n arrayElement={true}\n property={property}\n propertyType={propertyType}\n value={v}\n ignoreMissingValues={props.ignoreMissingValues}\n link={props.link}\n />\n </div>\n ))}\n </>\n );\n}\n"],"names":[],"mappings":";;;AAaM,SAAU,oBAAoB,CAAC,KAAgC,EAAA;AACnE,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;AAChC,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;IAClC,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,IAAoB,CAAC;IAC9D,QACE,0CACG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,KAAa,MAChC,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,CAAA,EAAG,KAAK,CAAI,CAAA,EAAA,MAAM,CAAC,MAAM,CAAE,CAAA,EAAA;AACnC,QAAA,KAAA,CAAA,aAAA,CAAC,uBAAuB,EAAA,EACtB,YAAY,EAAE,IAAI,EAClB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,CAAC,EACR,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,IAAI,EAAE,KAAK,CAAC,IAAI,GAChB,CACE,CACP,CAAC,CACD,EACH;AACJ;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ActionIcon } from '@mantine/core';
|
|
2
2
|
import { IconCircleMinus, IconCirclePlus } from '@tabler/icons';
|
|
3
3
|
import React, { useState, useRef } from 'react';
|
|
4
|
-
import { ResourcePropertyInput } from '../ResourcePropertyInput/ResourcePropertyInput.
|
|
5
|
-
import { killEvent } from '../utils/dom.
|
|
4
|
+
import { ResourcePropertyInput } from '../ResourcePropertyInput/ResourcePropertyInput.mjs';
|
|
5
|
+
import { killEvent } from '../utils/dom.mjs';
|
|
6
6
|
|
|
7
7
|
function ResourceArrayInput(props) {
|
|
8
8
|
const [values, setValues] = useState(props.defaultValue && Array.isArray(props.defaultValue) ? props.defaultValue : []);
|
|
@@ -47,4 +47,4 @@ function ResourceArrayInput(props) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export { ResourceArrayInput };
|
|
50
|
-
//# sourceMappingURL=ResourceArrayInput.
|
|
50
|
+
//# sourceMappingURL=ResourceArrayInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceArrayInput.mjs","sources":["../../../src/ResourceArrayInput/ResourceArrayInput.tsx"],"sourcesContent":["import { ActionIcon } from '@mantine/core';\nimport { ElementDefinition } from '@medplum/fhirtypes';\nimport { IconCircleMinus, IconCirclePlus } from '@tabler/icons';\nimport React, { useRef, useState } from 'react';\nimport { ResourcePropertyInput } from '../ResourcePropertyInput/ResourcePropertyInput';\nimport { killEvent } from '../utils/dom';\n\ninterface ResourceArrayInputProps {\n property: ElementDefinition;\n name: string;\n defaultValue?: any[];\n arrayElement?: boolean;\n onChange?: (value: any[]) => void;\n}\n\nexport function ResourceArrayInput(props: ResourceArrayInputProps): JSX.Element {\n const [values, setValues] = useState(\n props.defaultValue && Array.isArray(props.defaultValue) ? props.defaultValue : []\n );\n\n const valuesRef = useRef<any[]>();\n valuesRef.current = values;\n\n function setValuesWrapper(newValues: any[]): void {\n setValues(newValues);\n if (props.onChange) {\n props.onChange(newValues);\n }\n }\n\n return (\n <table style={{ width: '100%', borderCollapse: 'collapse' }}>\n <colgroup>\n <col width=\"97%\" />\n <col width=\"3%\" />\n </colgroup>\n <tbody>\n {values.map((v, index) => (\n <tr key={`${index}-${values.length}`}>\n <td>\n <ResourcePropertyInput\n arrayElement={true}\n property={props.property}\n name={props.name + '.' + index}\n defaultValue={v}\n onChange={(newValue: any) => {\n const copy = [...(valuesRef.current as any[])];\n copy[index] = newValue;\n setValuesWrapper(copy);\n }}\n />\n </td>\n <td style={{ textAlign: 'right' }}>\n <ActionIcon\n title=\"Remove\"\n size=\"sm\"\n onClick={(e: React.MouseEvent) => {\n killEvent(e);\n const copy = [...(valuesRef.current as any[])];\n copy.splice(index, 1);\n setValuesWrapper(copy);\n }}\n >\n <IconCircleMinus />\n </ActionIcon>\n </td>\n </tr>\n ))}\n <tr>\n <td></td>\n <td style={{ textAlign: 'right' }}>\n <ActionIcon\n title=\"Add\"\n size=\"sm\"\n color=\"green\"\n onClick={(e: React.MouseEvent) => {\n killEvent(e);\n const copy = [...(valuesRef.current as any[])];\n copy.push(undefined);\n setValuesWrapper(copy);\n }}\n >\n <IconCirclePlus />\n </ActionIcon>\n </td>\n </tr>\n </tbody>\n </table>\n );\n}\n"],"names":[],"mappings":";;;;;;AAeM,SAAU,kBAAkB,CAAC,KAA8B,EAAA;AAC/D,IAAA,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAClC,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,YAAY,GAAG,EAAE,CAClF,CAAC;AAEF,IAAA,MAAM,SAAS,GAAG,MAAM,EAAS,CAAC;AAClC,IAAA,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC;IAE3B,SAAS,gBAAgB,CAAC,SAAgB,EAAA;QACxC,SAAS,CAAC,SAAS,CAAC,CAAC;QACrB,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,YAAA,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAC3B,SAAA;KACF;AAED,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,EAAA;AACzD,QAAA,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,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A,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;4BACtB,gBAAgB,CAAC,IAAI,CAAC,CAAC;yBACxB,EAAA;AAED,wBAAA,KAAA,CAAA,aAAA,CAAC,eAAe,EAAG,IAAA,CAAA,CACR,CACV,CACF,CACN,CAAC;AACF,YAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA;gBACE,KAAS,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,CAAA;AACT,gBAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAA;AAC/B,oBAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EACT,EAAA,KAAK,EAAC,KAAK,EACX,IAAI,EAAC,IAAI,EACT,KAAK,EAAC,OAAO,EACb,OAAO,EAAE,CAAC,CAAmB,KAAI;4BAC/B,SAAS,CAAC,CAAC,CAAC,CAAC;4BACb,MAAM,IAAI,GAAG,CAAC,GAAI,SAAS,CAAC,OAAiB,CAAC,CAAC;AAC/C,4BAAA,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;4BACrB,gBAAgB,CAAC,IAAI,CAAC,CAAC;yBACxB,EAAA;wBAED,KAAC,CAAA,aAAA,CAAA,cAAc,OAAG,CACP,CACV,CACF,CACC,CACF,EACR;AACJ;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Avatar } from '@mantine/core';
|
|
2
|
+
import { getDisplayString, getImageSrc } 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 ResourceAvatar(props) {
|
|
8
|
+
const resource = useResource(props.value);
|
|
9
|
+
const text = resource ? getDisplayString(resource) : props.alt ?? '';
|
|
10
|
+
const imageUrl = (resource && getImageSrc(resource)) ?? props.src;
|
|
11
|
+
const radius = props.radius ?? 'xl';
|
|
12
|
+
const avatarProps = { ...props };
|
|
13
|
+
delete avatarProps.value;
|
|
14
|
+
delete avatarProps.link;
|
|
15
|
+
if (props.link) {
|
|
16
|
+
return (React.createElement(MedplumLink, { to: resource },
|
|
17
|
+
React.createElement(Avatar, { src: imageUrl, alt: text, radius: radius, ...avatarProps })));
|
|
18
|
+
}
|
|
19
|
+
return React.createElement(Avatar, { src: imageUrl, alt: text, radius: radius, ...avatarProps });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { ResourceAvatar };
|
|
23
|
+
//# sourceMappingURL=ResourceAvatar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceAvatar.mjs","sources":["../../../src/ResourceAvatar/ResourceAvatar.tsx"],"sourcesContent":["import { Avatar, AvatarProps } from '@mantine/core';\nimport { getDisplayString, getImageSrc } 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 ResourceAvatarProps extends AvatarProps {\n value?: Reference | Resource;\n link?: boolean;\n}\n\nexport function ResourceAvatar(props: ResourceAvatarProps): JSX.Element {\n const resource = useResource(props.value);\n const text = resource ? getDisplayString(resource) : props.alt ?? '';\n const imageUrl = (resource && getImageSrc(resource)) ?? props.src;\n const radius = props.radius ?? 'xl';\n\n const avatarProps = { ...props };\n delete avatarProps.value;\n delete avatarProps.link;\n\n if (props.link) {\n return (\n <MedplumLink to={resource}>\n <Avatar src={imageUrl} alt={text} radius={radius} {...avatarProps} />\n </MedplumLink>\n );\n }\n\n return <Avatar src={imageUrl} alt={text} radius={radius} {...avatarProps} />;\n}\n"],"names":[],"mappings":";;;;;;AAYM,SAAU,cAAc,CAAC,KAA0B,EAAA;IACvD,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC1C,IAAA,MAAM,IAAI,GAAG,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC;AACrE,IAAA,MAAM,QAAQ,GAAG,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC;AAClE,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC;AAEpC,IAAA,MAAM,WAAW,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IACjC,OAAO,WAAW,CAAC,KAAK,CAAC;IACzB,OAAO,WAAW,CAAC,IAAI,CAAC;IAExB,IAAI,KAAK,CAAC,IAAI,EAAE;AACd,QAAA,QACE,KAAC,CAAA,aAAA,CAAA,WAAW,EAAC,EAAA,EAAE,EAAE,QAAQ,EAAA;AACvB,YAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAC,EAAA,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAA,GAAM,WAAW,EAAI,CAAA,CACzD,EACd;AACH,KAAA;AAED,IAAA,OAAO,oBAAC,MAAM,EAAA,EAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAM,GAAA,WAAW,GAAI,CAAC;AAC/E;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Group } from '@mantine/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar.
|
|
4
|
-
import { ResourceName } from '../ResourceName/ResourceName.
|
|
3
|
+
import { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar.mjs';
|
|
4
|
+
import { ResourceName } from '../ResourceName/ResourceName.mjs';
|
|
5
5
|
|
|
6
6
|
function ResourceBadge(props) {
|
|
7
7
|
return (React.createElement(Group, { spacing: "xs" },
|
|
@@ -10,4 +10,4 @@ function ResourceBadge(props) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export { ResourceBadge };
|
|
13
|
-
//# sourceMappingURL=ResourceBadge.
|
|
13
|
+
//# sourceMappingURL=ResourceBadge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceBadge.mjs","sources":["../../../src/ResourceBadge/ResourceBadge.tsx"],"sourcesContent":["import { Group } from '@mantine/core';\nimport { Reference, Resource } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar';\nimport { ResourceName } from '../ResourceName/ResourceName';\n\nexport interface ResourceBadgeProps {\n value?: Reference | Resource;\n link?: boolean;\n}\n\nexport function ResourceBadge(props: ResourceBadgeProps): JSX.Element {\n return (\n <Group spacing=\"xs\">\n <ResourceAvatar size={24} radius={12} value={props.value} link={props.link} />\n <ResourceName value={props.value} link={props.link} />\n </Group>\n );\n}\n"],"names":[],"mappings":";;;;;AAWM,SAAU,aAAa,CAAC,KAAyB,EAAA;AACrD,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,KAAK,EAAC,EAAA,OAAO,EAAC,IAAI,EAAA;QACjB,KAAC,CAAA,aAAA,CAAA,cAAc,IAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAI,CAAA;AAC9E,QAAA,KAAA,CAAA,aAAA,CAAC,YAAY,EAAC,EAAA,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAI,CAAA,CAChD,EACR;AACJ;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createStyles } from '@mantine/core';
|
|
2
2
|
import React, { useState, useEffect } from 'react';
|
|
3
|
-
import { MedplumLink } from '../MedplumLink/MedplumLink.
|
|
4
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.
|
|
5
|
-
import { ResourceBadge } from '../ResourceBadge/ResourceBadge.
|
|
6
|
-
import { blame } from '../utils/blame.
|
|
3
|
+
import { MedplumLink } from '../MedplumLink/MedplumLink.mjs';
|
|
4
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
5
|
+
import { ResourceBadge } from '../ResourceBadge/ResourceBadge.mjs';
|
|
6
|
+
import { blame } from '../utils/blame.mjs';
|
|
7
7
|
|
|
8
8
|
const useStyles = createStyles((theme) => ({
|
|
9
9
|
container: {
|
|
@@ -53,7 +53,6 @@ const useStyles = createStyles((theme) => ({
|
|
|
53
53
|
},
|
|
54
54
|
}));
|
|
55
55
|
function ResourceBlame(props) {
|
|
56
|
-
var _a, _b;
|
|
57
56
|
const { classes } = useStyles();
|
|
58
57
|
const medplum = useMedplum();
|
|
59
58
|
const [value, setValue] = useState(props.history);
|
|
@@ -65,7 +64,7 @@ function ResourceBlame(props) {
|
|
|
65
64
|
if (!value) {
|
|
66
65
|
return React.createElement("div", null, "Loading...");
|
|
67
66
|
}
|
|
68
|
-
const resource =
|
|
67
|
+
const resource = value.entry?.[0]?.resource;
|
|
69
68
|
const table = blame(value);
|
|
70
69
|
return (React.createElement("div", { className: classes.container },
|
|
71
70
|
React.createElement("table", { className: classes.root },
|
|
@@ -111,4 +110,4 @@ function pluralizeTime(count, noun) {
|
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
export { ResourceBlame, getTimeString };
|
|
114
|
-
//# sourceMappingURL=ResourceBlame.
|
|
113
|
+
//# sourceMappingURL=ResourceBlame.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceBlame.mjs","sources":["../../../src/ResourceBlame/ResourceBlame.tsx"],"sourcesContent":["import { createStyles } from '@mantine/core';\nimport { Bundle, 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';\nimport { blame } from '../utils/blame';\n\nconst useStyles = createStyles((theme) => ({\n container: {\n overflowX: 'auto',\n },\n\n root: {\n border: `0.1px solid ${theme.colors.gray[3]}`,\n borderCollapse: 'collapse',\n borderRadius: theme.radius.sm,\n borderSpacing: 0,\n fontSize: theme.fontSizes.xs,\n width: '100%',\n\n '& td': {\n padding: '2px 4px 0 4px',\n verticalAlign: 'top',\n whiteSpace: 'nowrap',\n },\n },\n\n startRow: {\n borderTop: `0.1px solid ${theme.colors.gray[3]}`,\n },\n\n normalRow: {\n borderTop: 0,\n },\n\n author: {\n lineHeight: '10px',\n },\n\n dateTime: {\n borderRight: `0.1px solid ${theme.colors.gray[3]}`,\n lineHeight: '20px',\n },\n\n lineNumber: {\n backgroundColor: theme.colors.gray[1],\n border: 0,\n color: theme.colors.gray[5],\n fontFamily: theme.fontFamilyMonospace,\n padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`,\n textAlign: 'right',\n },\n\n line: {\n fontFamily: theme.fontFamilyMonospace,\n fontSize: theme.fontSizes.sm,\n padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`,\n },\n\n pre: {\n margin: 0,\n },\n}));\n\nexport interface ResourceBlameProps {\n history?: Bundle;\n resourceType?: ResourceType;\n id?: string;\n}\n\nexport function ResourceBlame(props: ResourceBlameProps): JSX.Element {\n const { classes } = useStyles();\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.readHistory(props.resourceType, props.id).then(setValue).catch(console.log);\n }\n }, [medplum, props.history, props.resourceType, props.id]);\n\n if (!value) {\n return <div>Loading...</div>;\n }\n\n const resource = value.entry?.[0]?.resource as Resource;\n const table = blame(value);\n return (\n <div className={classes.container}>\n <table className={classes.root}>\n <tbody>\n {table.map((row, index) => (\n <tr key={'row-' + index} className={row.span > 0 ? classes.startRow : classes.normalRow}>\n {row.span > 0 && (\n <>\n <td className={classes.author} rowSpan={row.span}>\n <ResourceBadge value={row.meta.author} link={true} />\n </td>\n <td className={classes.dateTime} rowSpan={row.span}>\n <MedplumLink to={getVersionUrl(resource, row.meta.versionId as string)}>\n {getTimeString(row.meta.lastUpdated as string)}\n </MedplumLink>\n </td>\n </>\n )}\n <td className={classes.lineNumber}>{index + 1}</td>\n <td className={classes.line}>\n <pre className={classes.pre}>{row.value}</pre>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\nfunction getVersionUrl(resource: Resource, versionId: string): string {\n return `/${resource.resourceType}/${resource.id}/_history/${versionId}`;\n}\n\nexport function getTimeString(lastUpdated: string): string {\n const seconds = Math.floor((Date.now() - Date.parse(lastUpdated)) / 1000);\n\n const years = Math.floor(seconds / 31536000);\n if (years > 0) {\n return pluralizeTime(years, 'year');\n }\n\n const months = Math.floor(seconds / 2592000);\n if (months > 0) {\n return pluralizeTime(months, 'month');\n }\n\n const days = Math.floor(seconds / 86400);\n if (days > 0) {\n return pluralizeTime(days, 'day');\n }\n\n const hours = Math.floor(seconds / 3600);\n if (hours > 0) {\n return pluralizeTime(hours, 'hour');\n }\n\n const minutes = Math.floor(seconds / 60);\n if (minutes > 0) {\n return pluralizeTime(minutes, 'minute');\n }\n\n return pluralizeTime(seconds, 'second');\n}\n\nfunction pluralizeTime(count: number, noun: string): string {\n return `${count} ${count === 1 ? noun : noun + 's'} ago`;\n}\n"],"names":[],"mappings":";;;;;;;AAQA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,MAAM;AACzC,IAAA,SAAS,EAAE;AACT,QAAA,SAAS,EAAE,MAAM;AAClB,KAAA;AAED,IAAA,IAAI,EAAE;QACJ,MAAM,EAAE,CAAe,YAAA,EAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAA;AAC7C,QAAA,cAAc,EAAE,UAAU;AAC1B,QAAA,YAAY,EA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,QAAA,OAAO,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACrC,KAAA;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACzC,IAAI,OAAO,GAAG,CAAC,EAAE;AACf,QAAA,OAAO,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACzC,KAAA;AAED,IAAA,OAAO,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,aAAa,CAAC,KAAa,EAAE,IAAY,EAAA;AAChD,IAAA,OAAO,GAAG,KAAK,CAAA,CAAA,EAAI,KAAK,KAAK,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,MAAM,CAAC;AAC3D;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createStyles } from '@mantine/core';
|
|
2
2
|
import { stringify } from '@medplum/core';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { diff } from '../utils/diff.
|
|
4
|
+
import { diff } from '../utils/diff.mjs';
|
|
5
5
|
|
|
6
6
|
const useStyles = createStyles((theme) => ({
|
|
7
7
|
removed: {
|
|
@@ -16,8 +16,8 @@ function ResourceDiff(props) {
|
|
|
16
16
|
let originalResource = props.original;
|
|
17
17
|
let revisedResource = props.revised;
|
|
18
18
|
if (props.ignoreMeta) {
|
|
19
|
-
originalResource =
|
|
20
|
-
revisedResource =
|
|
19
|
+
originalResource = { ...originalResource, meta: undefined };
|
|
20
|
+
revisedResource = { ...revisedResource, meta: undefined };
|
|
21
21
|
}
|
|
22
22
|
const original = stringify(originalResource, true).match(/[^\r\n]+/g);
|
|
23
23
|
const revised = stringify(revisedResource, true).match(/[^\r\n]+/g);
|
|
@@ -36,4 +36,4 @@ function ChangeDiff(props) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export { ResourceDiff };
|
|
39
|
-
//# sourceMappingURL=ResourceDiff.
|
|
39
|
+
//# sourceMappingURL=ResourceDiff.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceDiff.mjs","sources":["../../../src/ResourceDiff/ResourceDiff.tsx"],"sourcesContent":["import { createStyles } from '@mantine/core';\nimport { stringify } from '@medplum/core';\nimport { Resource } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { Delta, diff } from '../utils/diff';\n\nconst useStyles = createStyles((theme) => ({\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 ResourceDiffProps {\n original: Resource;\n revised: Resource;\n ignoreMeta?: boolean;\n}\n\nexport function ResourceDiff(props: ResourceDiffProps): JSX.Element {\n let originalResource = props.original;\n let revisedResource = props.revised;\n\n if (props.ignoreMeta) {\n originalResource = { ...originalResource, meta: undefined };\n revisedResource = { ...revisedResource, meta: undefined };\n }\n\n const original = stringify(originalResource, true).match(/[^\\r\\n]+/g) as string[];\n const revised = stringify(revisedResource, true).match(/[^\\r\\n]+/g) as string[];\n const deltas = diff(original, revised);\n return (\n <pre style={{ color: 'gray' }}>\n {deltas.map((delta, index) => (\n <ChangeDiff key={'delta' + index} delta={delta} />\n ))}\n </pre>\n );\n}\n\nfunction ChangeDiff(props: { delta: Delta }): JSX.Element {\n const { classes } = useStyles();\n return (\n <>\n ...\n <br />\n {props.delta.original.lines.length > 0 && (\n <div className={classes.removed}>{props.delta.original.lines.join('\\n')}</div>\n )}\n {props.delta.revised.lines.length > 0 && (\n <div className={classes.added}>{props.delta.revised.lines.join('\\n')}</div>\n )}\n ...\n <br />\n </>\n );\n}\n"],"names":[],"mappings":";;;;;AAMA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,MAAM;AACzC,IAAA,OAAO,EAAE;QACP,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1B,QAAA,cAAc,EAAE,cAAc;AAC/B,KAAA;AAED,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M,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,CAAA;AACL,QAAA,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,KACpC,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,OAAO,CAAC,OAAO,EAAG,EAAA,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAO,CAC/E;AACA,QAAA,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,KACnC,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,OAAO,CAAC,KAAK,EAAG,EAAA,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAO,CAC5E;;QAED,KAAM,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,CAAA,CACL,EACH;AACJ;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createStyles } from '@mantine/core';
|
|
2
2
|
import { toTypedValue, stringify, getPropertyDisplayName } from '@medplum/core';
|
|
3
3
|
import React, { useState, useEffect } from 'react';
|
|
4
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.
|
|
5
|
-
import { getValueAndType, ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.
|
|
4
|
+
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
5
|
+
import { getValueAndType, ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.mjs';
|
|
6
6
|
|
|
7
7
|
const useStyles = createStyles((theme) => ({
|
|
8
8
|
root: {
|
|
@@ -77,4 +77,4 @@ function isEmpty(value) {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export { ResourceDiffTable };
|
|
80
|
-
//# sourceMappingURL=ResourceDiffTable.
|
|
80
|
+
//# sourceMappingURL=ResourceDiffTable.mjs.map
|
|
@@ -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;A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AE;AACxE,gBAAA,OAAO,IAAI,CAAC;AACb,aAAA;AAED,YAAA,QACE,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,GAAG,EAAE,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.
|
|
5
|
-
import { FormSection } from '../FormSection/FormSection.
|
|
6
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.
|
|
7
|
-
import { useResource } from '../useResource/useResource.
|
|
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.
|
|
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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AAC,IAAI,CAAC,IAAc,CAAC,CAAC,CAAC;YACxE,IAAI,WAAW,IAAI,GAAG,EAAE;AACtB,gBAAA,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC;AACzB,aAAA;AACF,SAAA;AACF,KAAA;AACD,IAAA,GAAG,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;AACtB,IAAA,OAAO,GAAG,CAAC;AACb;;;;"}
|
|
@@ -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.
|
|
5
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.
|
|
6
|
-
import { ResourceBadge } from '../ResourceBadge/ResourceBadge.
|
|
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,
|
|
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:
|
|
38
|
-
React.createElement("td", null, formatDateTime(
|
|
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) },
|
|
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
|
|
42
|
+
React.createElement("td", { colSpan: 3 }, normalizeErrorString(response?.outcome))));
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
45
|
function getVersionUrl(resource) {
|
|
48
|
-
|
|
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.
|
|
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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A,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA;AACE,YAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA;AACE,gBAAA,KAAA,CAAA,aAAA,CAAC,aAAa,EAAA,EAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAI,CACxD;YACL,KAAK,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,EAAA,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAM;AACrD,YAAA,KAAA,CAAA,aAAA,CAAA,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.
|
|
6
|
-
import { ResourceAvatar } from '../ResourceAvatar/ResourceAvatar.
|
|
7
|
-
import { useResource } from '../useResource/useResource.
|
|
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
|
|
@@ -21,7 +20,7 @@ const SEARCH_CODES = {
|
|
|
21
20
|
Observation: 'code',
|
|
22
21
|
RequestGroup: '_id',
|
|
23
22
|
ActivityDefinition: 'name',
|
|
24
|
-
User: 'email',
|
|
23
|
+
User: 'email:contains',
|
|
25
24
|
};
|
|
26
25
|
function ResourceInput(props) {
|
|
27
26
|
const medplum = useMedplum();
|
|
@@ -34,24 +33,20 @@ function ResourceInput(props) {
|
|
|
34
33
|
setValue(getDisplayString(defaultValue));
|
|
35
34
|
}
|
|
36
35
|
}, [defaultValue, setValue]);
|
|
37
|
-
function loadValues(input) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
52
|
-
|
|
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((
|
|
66
|
-
|
|
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.
|
|
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,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAqB,EAAE,CAAC,CAAC;IAEzD,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,YAAY,EAAE;AAChB,YAAA,QAAQ,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;AAC1C,SAAA;AACH,KAAC,EAAE,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CA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AAO,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;;;;"}
|
package/dist/esm/ResourcePropertyDisplay/{ResourcePropertyDisplay.js → ResourcePropertyDisplay.mjs}
RENAMED
|
@@ -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.
|
|
4
|
-
import { AttachmentArrayDisplay } from '../AttachmentArrayDisplay/AttachmentArrayDisplay.
|
|
5
|
-
import { AttachmentDisplay } from '../AttachmentDisplay/AttachmentDisplay.
|
|
6
|
-
import { BackboneElementDisplay } from '../BackboneElementDisplay/BackboneElementDisplay.
|
|
7
|
-
import { CodeableConceptDisplay } from '../CodeableConceptDisplay/CodeableConceptDisplay.
|
|
8
|
-
import { CodingDisplay } from '../CodingDisplay/CodingDisplay.
|
|
9
|
-
import { ContactDetailDisplay } from '../ContactDetailDisplay/ContactDetailDisplay.
|
|
10
|
-
import { ContactPointDisplay } from '../ContactPointDisplay/ContactPointDisplay.
|
|
11
|
-
import { HumanNameDisplay } from '../HumanNameDisplay/HumanNameDisplay.
|
|
12
|
-
import { IdentifierDisplay } from '../IdentifierDisplay/IdentifierDisplay.
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
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 (
|
|
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
|
|
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 (!
|
|
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(
|
|
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.
|
|
113
|
+
//# sourceMappingURL=ResourcePropertyDisplay.mjs.map
|