@medplum/react 2.0.2 → 2.0.4
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/dist/cjs/OperationOutcomeAlert/OperationOutcomeAlert.d.ts +2 -1
- package/dist/cjs/ResourceDiffTable/ResourceDiffTable.stories.d.ts +5 -0
- package/dist/cjs/ResourceTable/ResourceTable.d.ts +13 -0
- package/dist/cjs/ResourceTimeline/ResourceTimeline.d.ts +2 -2
- package/dist/cjs/auth/AuthenticationForm.d.ts +2 -1
- package/dist/cjs/auth/SignInForm.d.ts +1 -0
- package/dist/cjs/index.cjs +1834 -1212
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.min.cjs +1 -1
- package/dist/cjs/useResource/useResource.d.ts +2 -2
- package/dist/cjs/utils/date.d.ts +2 -1
- package/dist/esm/AddressDisplay/AddressDisplay.mjs +2 -2
- package/dist/esm/AddressDisplay/AddressDisplay.mjs.map +1 -1
- package/dist/esm/AddressInput/AddressInput.mjs +9 -9
- package/dist/esm/AddressInput/AddressInput.mjs.map +1 -1
- package/dist/esm/AnnotationInput/AnnotationInput.mjs +2 -2
- package/dist/esm/AnnotationInput/AnnotationInput.mjs.map +1 -1
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs +2 -2
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs.map +1 -1
- package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs +4 -4
- package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs.map +1 -1
- package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs +20 -19
- package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs.map +1 -1
- package/dist/esm/AttachmentButton/AttachmentButton.mjs +3 -3
- package/dist/esm/AttachmentButton/AttachmentButton.mjs.map +1 -1
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs +9 -9
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs.map +1 -1
- package/dist/esm/AttachmentInput/AttachmentInput.mjs +5 -5
- package/dist/esm/AttachmentInput/AttachmentInput.mjs.map +1 -1
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs +6 -6
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs.map +1 -1
- package/dist/esm/BackboneElementInput/BackboneElementInput.mjs +7 -7
- package/dist/esm/BackboneElementInput/BackboneElementInput.mjs.map +1 -1
- package/dist/esm/CalendarInput/CalendarInput.mjs +18 -18
- package/dist/esm/CalendarInput/CalendarInput.mjs.map +1 -1
- package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs +5 -5
- package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs.map +1 -1
- package/dist/esm/CodeInput/CodeInput.mjs +2 -2
- package/dist/esm/CodeInput/CodeInput.mjs.map +1 -1
- package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs +2 -2
- package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs.map +1 -1
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs +2 -2
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs.map +1 -1
- package/dist/esm/CodingDisplay/CodingDisplay.mjs +2 -2
- package/dist/esm/CodingDisplay/CodingDisplay.mjs.map +1 -1
- package/dist/esm/CodingInput/CodingInput.mjs +2 -2
- package/dist/esm/CodingInput/CodingInput.mjs.map +1 -1
- package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs +3 -3
- package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs.map +1 -1
- package/dist/esm/ContactDetailInput/ContactDetailInput.mjs +4 -4
- package/dist/esm/ContactDetailInput/ContactDetailInput.mjs.map +1 -1
- package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs +2 -2
- package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs.map +1 -1
- package/dist/esm/ContactPointInput/ContactPointInput.mjs +5 -5
- package/dist/esm/ContactPointInput/ContactPointInput.mjs.map +1 -1
- package/dist/esm/Container/Container.mjs +2 -2
- package/dist/esm/Container/Container.mjs.map +1 -1
- package/dist/esm/DateTimeInput/DateTimeInput.mjs +2 -2
- package/dist/esm/DateTimeInput/DateTimeInput.mjs.map +1 -1
- package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs +3 -7
- package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs.map +1 -1
- package/dist/esm/DescriptionList/DescriptionList.mjs +5 -5
- package/dist/esm/DescriptionList/DescriptionList.mjs.map +1 -1
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs +49 -49
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs.map +1 -1
- package/dist/esm/Document/Document.mjs +3 -3
- package/dist/esm/Document/Document.mjs.map +1 -1
- package/dist/esm/EncounterTimeline/EncounterTimeline.mjs +7 -7
- package/dist/esm/EncounterTimeline/EncounterTimeline.mjs.map +1 -1
- package/dist/esm/ErrorBoundary/ErrorBoundary.mjs +4 -4
- package/dist/esm/ErrorBoundary/ErrorBoundary.mjs.map +1 -1
- package/dist/esm/ExtensionInput/ExtensionInput.mjs +2 -2
- package/dist/esm/ExtensionInput/ExtensionInput.mjs.map +1 -1
- package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs +2 -2
- package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs.map +1 -1
- package/dist/esm/FhirPathTable/FhirPathTable.mjs +19 -19
- package/dist/esm/FhirPathTable/FhirPathTable.mjs.map +1 -1
- package/dist/esm/Form/Form.mjs +2 -2
- package/dist/esm/Form/Form.mjs.map +1 -1
- package/dist/esm/FormSection/FormSection.mjs +2 -2
- package/dist/esm/FormSection/FormSection.mjs.map +1 -1
- package/dist/esm/GoogleButton/GoogleButton.mjs +4 -4
- package/dist/esm/GoogleButton/GoogleButton.mjs.map +1 -1
- package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs +2 -2
- package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs.map +1 -1
- package/dist/esm/HumanNameInput/HumanNameInput.mjs +7 -7
- package/dist/esm/HumanNameInput/HumanNameInput.mjs.map +1 -1
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs +2 -2
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs.map +1 -1
- package/dist/esm/IdentifierInput/IdentifierInput.mjs +4 -4
- package/dist/esm/IdentifierInput/IdentifierInput.mjs.map +1 -1
- package/dist/esm/Logo/Logo.mjs +8 -8
- package/dist/esm/Logo/Logo.mjs.map +1 -1
- package/dist/esm/MedplumLink/MedplumLink.mjs +2 -2
- package/dist/esm/MedplumLink/MedplumLink.mjs.map +1 -1
- package/dist/esm/MedplumProvider/MedplumProvider.mjs +2 -2
- package/dist/esm/MedplumProvider/MedplumProvider.mjs.map +1 -1
- package/dist/esm/MoneyDisplay/MoneyDisplay.mjs +2 -2
- package/dist/esm/MoneyDisplay/MoneyDisplay.mjs.map +1 -1
- package/dist/esm/MoneyInput/MoneyInput.mjs +4 -4
- package/dist/esm/MoneyInput/MoneyInput.mjs.map +1 -1
- package/dist/esm/NoteDisplay/NoteDisplay.mjs +2 -2
- package/dist/esm/NoteDisplay/NoteDisplay.mjs.map +1 -1
- package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.d.ts +2 -1
- package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs +5 -4
- package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs.map +1 -1
- package/dist/esm/Panel/Panel.mjs +2 -2
- package/dist/esm/Panel/Panel.mjs.map +1 -1
- package/dist/esm/PatientTimeline/PatientTimeline.mjs +12 -12
- package/dist/esm/PatientTimeline/PatientTimeline.mjs.map +1 -1
- package/dist/esm/PeriodInput/PeriodInput.mjs +4 -4
- package/dist/esm/PeriodInput/PeriodInput.mjs.map +1 -1
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs +34 -34
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs.map +1 -1
- package/dist/esm/QuantityDisplay/QuantityDisplay.mjs +2 -2
- package/dist/esm/QuantityDisplay/QuantityDisplay.mjs.map +1 -1
- package/dist/esm/QuantityInput/QuantityInput.mjs +5 -5
- package/dist/esm/QuantityInput/QuantityInput.mjs.map +1 -1
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs +31 -31
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs.map +1 -1
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs +32 -32
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs.map +1 -1
- package/dist/esm/RangeDisplay/RangeDisplay.mjs +2 -2
- package/dist/esm/RangeDisplay/RangeDisplay.mjs.map +1 -1
- package/dist/esm/RangeInput/RangeInput.mjs +4 -4
- package/dist/esm/RangeInput/RangeInput.mjs.map +1 -1
- package/dist/esm/RatioDisplay/RatioDisplay.mjs +4 -4
- package/dist/esm/RatioDisplay/RatioDisplay.mjs.map +1 -1
- package/dist/esm/RatioInput/RatioInput.mjs +4 -4
- package/dist/esm/RatioInput/RatioInput.mjs.map +1 -1
- package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs +3 -3
- package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs.map +1 -1
- package/dist/esm/ReferenceInput/ReferenceInput.mjs +4 -4
- package/dist/esm/ReferenceInput/ReferenceInput.mjs.map +1 -1
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs +32 -31
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs.map +1 -1
- package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs +16 -15
- package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs.map +1 -1
- package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs +3 -3
- package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs.map +1 -1
- package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs +19 -18
- package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs.map +1 -1
- package/dist/esm/ResourceAvatar/ResourceAvatar.mjs +4 -4
- package/dist/esm/ResourceAvatar/ResourceAvatar.mjs.map +1 -1
- package/dist/esm/ResourceBadge/ResourceBadge.mjs +4 -4
- package/dist/esm/ResourceBadge/ResourceBadge.mjs.map +1 -1
- package/dist/esm/ResourceBlame/ResourceBlame.mjs +13 -13
- package/dist/esm/ResourceBlame/ResourceBlame.mjs.map +1 -1
- package/dist/esm/ResourceDiff/ResourceDiff.mjs +7 -7
- package/dist/esm/ResourceDiff/ResourceDiff.mjs.map +1 -1
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs +18 -18
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs.map +1 -1
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.stories.d.ts +5 -0
- package/dist/esm/ResourceForm/ResourceForm.mjs +12 -12
- package/dist/esm/ResourceForm/ResourceForm.mjs.map +1 -1
- package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs +17 -17
- package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs.map +1 -1
- package/dist/esm/ResourceInput/ResourceInput.mjs +8 -8
- package/dist/esm/ResourceInput/ResourceInput.mjs.map +1 -1
- package/dist/esm/ResourceName/ResourceName.mjs +2 -2
- package/dist/esm/ResourceName/ResourceName.mjs.map +1 -1
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs +26 -26
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs.map +1 -1
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs +34 -34
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs.map +1 -1
- package/dist/esm/ResourceTable/ResourceTable.d.ts +13 -0
- package/dist/esm/ResourceTable/ResourceTable.mjs +5 -2
- package/dist/esm/ResourceTable/ResourceTable.mjs.map +1 -1
- package/dist/esm/ResourceTimeline/ResourceTimeline.d.ts +2 -2
- package/dist/esm/ResourceTimeline/ResourceTimeline.mjs +105 -76
- package/dist/esm/ResourceTimeline/ResourceTimeline.mjs.map +1 -1
- package/dist/esm/Scheduler/Scheduler.mjs +22 -22
- package/dist/esm/Scheduler/Scheduler.mjs.map +1 -1
- package/dist/esm/SearchControl/SearchControl.mjs +55 -49
- package/dist/esm/SearchControl/SearchControl.mjs.map +1 -1
- package/dist/esm/SearchControl/SearchUtils.mjs +4 -4
- package/dist/esm/SearchControl/SearchUtils.mjs.map +1 -1
- package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs +25 -25
- package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs.map +1 -1
- package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs +37 -37
- package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs.map +1 -1
- package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs +6 -6
- package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs.map +1 -1
- package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs +4 -4
- package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs.map +1 -1
- package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs +8 -8
- package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs.map +1 -1
- package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs +75 -62
- package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs.map +1 -1
- package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs +8 -8
- package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs.map +1 -1
- package/dist/esm/StatusBadge/StatusBadge.mjs +2 -2
- package/dist/esm/StatusBadge/StatusBadge.mjs.map +1 -1
- package/dist/esm/Timeline/Timeline.mjs +20 -20
- package/dist/esm/Timeline/Timeline.mjs.map +1 -1
- package/dist/esm/TimingInput/TimingInput.mjs +19 -19
- package/dist/esm/TimingInput/TimingInput.mjs.map +1 -1
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs +2 -2
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs.map +1 -1
- package/dist/esm/auth/AuthenticationForm.d.ts +2 -1
- package/dist/esm/auth/AuthenticationForm.mjs +23 -23
- package/dist/esm/auth/AuthenticationForm.mjs.map +1 -1
- package/dist/esm/auth/ChooseProfileForm.mjs +11 -11
- package/dist/esm/auth/ChooseProfileForm.mjs.map +1 -1
- package/dist/esm/auth/ChooseScopeForm.mjs +9 -9
- package/dist/esm/auth/ChooseScopeForm.mjs.map +1 -1
- package/dist/esm/auth/MfaForm.mjs +12 -12
- package/dist/esm/auth/MfaForm.mjs.map +1 -1
- package/dist/esm/auth/NewProjectForm.mjs +12 -12
- package/dist/esm/auth/NewProjectForm.mjs.map +1 -1
- package/dist/esm/auth/NewUserForm.mjs +22 -22
- package/dist/esm/auth/NewUserForm.mjs.map +1 -1
- package/dist/esm/auth/RegisterForm.mjs +5 -5
- package/dist/esm/auth/RegisterForm.mjs.map +1 -1
- package/dist/esm/auth/SignInForm.d.ts +1 -0
- package/dist/esm/auth/SignInForm.mjs +8 -8
- package/dist/esm/auth/SignInForm.mjs.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.min.mjs +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs +69 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs +18 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs +24 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs +14 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs +18 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs +19 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs +25 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs +16 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs +19 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs +26 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs +23 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs +12 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs +19 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs +13 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs +14 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs +20 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs +19 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs +19 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs +14 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs +26 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs +13 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs +14 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs +21 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs +21 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs +18 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs +29 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs +12 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs +12 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs +20 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs +20 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs +21 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs +19 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs +16 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs +16 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs +18 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs +18 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs +19 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs.map +1 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs +13 -0
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs.map +1 -0
- package/dist/esm/useResource/useResource.d.ts +2 -2
- package/dist/esm/useResource/useResource.mjs +62 -42
- package/dist/esm/useResource/useResource.mjs.map +1 -1
- package/dist/esm/utils/date.d.ts +2 -1
- package/dist/esm/utils/date.mjs +31 -25
- package/dist/esm/utils/date.mjs.map +1 -1
- package/icons-unique.txt +36 -0
- package/icons.txt +44 -0
- package/package.json +13 -13
- package/dist/esm/node_modules/@tabler/icons/icons-react/dist/index.esm.mjs +0 -6
- package/dist/esm/node_modules/@tabler/icons/icons-react/dist/index.esm.mjs.map +0 -1
|
@@ -1 +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":[
|
|
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,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AAA,QAAA,EAAA,IAAA;QACE,KAAK,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,EAAA,KAAK,CAAC,IAAI,CAAM;AACrB,QAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,EAAK,KAAK,CAAC,QAAQ,CAAM,CACxB,EACH;AACJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createStyles, Stack, Title, Group, Text } from '@mantine/core';
|
|
2
2
|
import { formatDateTime, capitalize, formatObservationValue } from '@medplum/core';
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import { CodeableConceptDisplay } from '../CodeableConceptDisplay/CodeableConceptDisplay.mjs';
|
|
5
5
|
import { MedplumLink } from '../MedplumLink/MedplumLink.mjs';
|
|
6
6
|
import { NoteDisplay } from '../NoteDisplay/NoteDisplay.mjs';
|
|
@@ -44,39 +44,39 @@ function DiagnosticReportDisplay(props) {
|
|
|
44
44
|
specimenNotes.push({ text: window.atob(pf.data) });
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
return (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
diagnosticReport.subject && (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
return (React.createElement(Stack, null,
|
|
48
|
+
React.createElement(Title, null, "Diagnostic Report"),
|
|
49
|
+
React.createElement(Group, { mt: "md", spacing: 30 },
|
|
50
|
+
diagnosticReport.subject && (React.createElement("div", null,
|
|
51
|
+
React.createElement(Text, { size: "xs", transform: "uppercase", color: "dimmed" }, "Subject"),
|
|
52
|
+
React.createElement(Text, null,
|
|
53
|
+
React.createElement(ResourceBadge, { value: diagnosticReport.subject, link: true })))),
|
|
54
54
|
diagnosticReport.resultsInterpreter &&
|
|
55
|
-
diagnosticReport.resultsInterpreter.map((interpreter) => (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
diagnosticReport.issued && (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
diagnosticReport.status && (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
diagnosticReport.result && (
|
|
66
|
-
specimenNotes.length > 0 &&
|
|
55
|
+
diagnosticReport.resultsInterpreter.map((interpreter) => (React.createElement("div", { key: interpreter.reference },
|
|
56
|
+
React.createElement(Text, { size: "xs", transform: "uppercase", color: "dimmed" }, "Interpreter"),
|
|
57
|
+
React.createElement(Text, null,
|
|
58
|
+
React.createElement(ResourceBadge, { value: interpreter, link: true }))))),
|
|
59
|
+
diagnosticReport.issued && (React.createElement("div", null,
|
|
60
|
+
React.createElement(Text, { size: "xs", transform: "uppercase", color: "dimmed" }, "Issued"),
|
|
61
|
+
React.createElement(Text, null, formatDateTime(diagnosticReport.issued)))),
|
|
62
|
+
diagnosticReport.status && (React.createElement("div", null,
|
|
63
|
+
React.createElement(Text, { size: "xs", transform: "uppercase", color: "dimmed" }, "Status"),
|
|
64
|
+
React.createElement(Text, null, capitalize(diagnosticReport.status))))),
|
|
65
|
+
diagnosticReport.result && (React.createElement(ObservationTable, { hideObservationNotes: props.hideObservationNotes, value: diagnosticReport.result })),
|
|
66
|
+
specimenNotes.length > 0 && React.createElement(NoteDisplay, { value: specimenNotes })));
|
|
67
67
|
}
|
|
68
68
|
function ObservationTable(props) {
|
|
69
69
|
const { classes } = useStyles();
|
|
70
|
-
return (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
return (React.createElement("table", { className: classes.table },
|
|
71
|
+
React.createElement("thead", null,
|
|
72
|
+
React.createElement("tr", null,
|
|
73
|
+
React.createElement("th", null, "Test"),
|
|
74
|
+
React.createElement("th", null, "Value"),
|
|
75
|
+
React.createElement("th", null, "Reference Range"),
|
|
76
|
+
React.createElement("th", null, "Interpretation"),
|
|
77
|
+
React.createElement("th", null, "Category"),
|
|
78
|
+
React.createElement("th", null, "Status"))),
|
|
79
|
+
React.createElement("tbody", null, props.value?.map((observation, index) => (React.createElement(ObservationRow, { key: `obs-${index}-${observation.id}`, hideObservationNotes: props.hideObservationNotes, value: observation }))))));
|
|
80
80
|
}
|
|
81
81
|
function ObservationRow(props) {
|
|
82
82
|
const { classes, cx } = useStyles();
|
|
@@ -86,26 +86,26 @@ function ObservationRow(props) {
|
|
|
86
86
|
}
|
|
87
87
|
const displayNotes = !props.hideObservationNotes && observation?.note;
|
|
88
88
|
const critical = isCritical(observation);
|
|
89
|
-
return (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
displayNotes && (
|
|
103
|
-
|
|
104
|
-
|
|
89
|
+
return (React.createElement(React.Fragment, null,
|
|
90
|
+
React.createElement("tr", { className: cx({ [classes.criticalRow]: critical }) },
|
|
91
|
+
React.createElement("td", { rowSpan: displayNotes ? 2 : 1 },
|
|
92
|
+
React.createElement(MedplumLink, { to: observation },
|
|
93
|
+
React.createElement(CodeableConceptDisplay, { value: observation.code }))),
|
|
94
|
+
React.createElement("td", null,
|
|
95
|
+
React.createElement(ObservationValueDisplay, { value: observation })),
|
|
96
|
+
React.createElement("td", null,
|
|
97
|
+
React.createElement(ReferenceRangeDisplay, { value: observation.referenceRange })),
|
|
98
|
+
React.createElement("td", null, observation.interpretation && observation.interpretation.length > 0 && (React.createElement(CodeableConceptDisplay, { value: observation.interpretation[0] }))),
|
|
99
|
+
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}` },
|
|
100
|
+
React.createElement(CodeableConceptDisplay, { value: concept }))))))),
|
|
101
|
+
React.createElement("td", null, observation.status && React.createElement(StatusBadge, { status: observation.status }))),
|
|
102
|
+
displayNotes && (React.createElement("tr", null,
|
|
103
|
+
React.createElement("td", { colSpan: 5 },
|
|
104
|
+
React.createElement(NoteDisplay, { value: observation.note }))))));
|
|
105
105
|
}
|
|
106
106
|
function ObservationValueDisplay(props) {
|
|
107
107
|
const obs = props.value;
|
|
108
|
-
return
|
|
108
|
+
return React.createElement(React.Fragment, null, formatObservationValue(obs));
|
|
109
109
|
}
|
|
110
110
|
function ReferenceRangeDisplay(props) {
|
|
111
111
|
const range = props.value && props.value.length > 0 && props.value[0];
|
|
@@ -113,9 +113,9 @@ function ReferenceRangeDisplay(props) {
|
|
|
113
113
|
return null;
|
|
114
114
|
}
|
|
115
115
|
if (range.text) {
|
|
116
|
-
return
|
|
116
|
+
return React.createElement(React.Fragment, null, range.text);
|
|
117
117
|
}
|
|
118
|
-
return
|
|
118
|
+
return React.createElement(RangeDisplay, { value: range });
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
121
|
* Returns true if the observation is critical.
|
|
@@ -1 +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 Annotation,\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 { NoteDisplay } from '../NoteDisplay/NoteDisplay';\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 noteBody: { fontSize: theme.fontSizes.sm },\n noteCite: { fontSize: theme.fontSizes.xs, marginBlockStart: 3 },\n noteRoot: { padding: 5 },\n}));\n\nexport interface DiagnosticReportDisplayProps {\n value?: DiagnosticReport | Reference<DiagnosticReport>;\n hideObservationNotes?: boolean;\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 const specimenNotes: Annotation[] = specimen?.note || [];\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 specimenNotes.push({ text: window.atob(pf.data) });\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 && (\n <ObservationTable hideObservationNotes={props.hideObservationNotes} value={diagnosticReport.result} />\n )}\n {specimenNotes.length > 0 && <NoteDisplay value={specimenNotes} />}\n </Stack>\n );\n}\n\nexport interface ObservationTableProps {\n value?: Observation[] | Reference<Observation>[];\n hideObservationNotes?: boolean;\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\n key={`obs-${index}-${observation.id}`}\n hideObservationNotes={props.hideObservationNotes}\n value={observation}\n />\n ))}\n </tbody>\n </table>\n );\n}\n\ninterface ObservationRowProps {\n value: Observation | Reference<Observation>;\n hideObservationNotes?: boolean;\n}\n\nfunction ObservationRow(props: ObservationRowProps): JSX.Element | null {\n const { classes, cx } = useStyles();\n const observation = useResource(props.value);\n\n if (!observation) {\n return null;\n }\n const displayNotes = !props.hideObservationNotes && observation?.note;\n\n const critical = isCritical(observation);\n\n return (\n <>\n <tr className={cx({ [classes.criticalRow]: critical })}>\n <td rowSpan={displayNotes ? 2 : 1}>\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 {displayNotes && (\n <tr>\n <td colSpan={5}>\n <NoteDisplay value={observation.note} />\n </td>\n </tr>\n )}\n </>\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":["React"],"mappings":";;;;;;;;;;;AAmBA,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,GA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,aAAA,CAAAA,UAAA,CAAA,QAAA,EAAA,IAAA,EAAA,KAAK,CAAC,IAAI,CAAI,CAAC;AAC1B,KAAA;AACD,IAAA,OAAOA,yBAAC,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;;;;"}
|
|
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 Annotation,\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 { NoteDisplay } from '../NoteDisplay/NoteDisplay';\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 noteBody: { fontSize: theme.fontSizes.sm },\n noteCite: { fontSize: theme.fontSizes.xs, marginBlockStart: 3 },\n noteRoot: { padding: 5 },\n}));\n\nexport interface DiagnosticReportDisplayProps {\n value?: DiagnosticReport | Reference<DiagnosticReport>;\n hideObservationNotes?: boolean;\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 const specimenNotes: Annotation[] = specimen?.note || [];\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 specimenNotes.push({ text: window.atob(pf.data) });\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 && (\n <ObservationTable hideObservationNotes={props.hideObservationNotes} value={diagnosticReport.result} />\n )}\n {specimenNotes.length > 0 && <NoteDisplay value={specimenNotes} />}\n </Stack>\n );\n}\n\nexport interface ObservationTableProps {\n value?: Observation[] | Reference<Observation>[];\n hideObservationNotes?: boolean;\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\n key={`obs-${index}-${observation.id}`}\n hideObservationNotes={props.hideObservationNotes}\n value={observation}\n />\n ))}\n </tbody>\n </table>\n );\n}\n\ninterface ObservationRowProps {\n value: Observation | Reference<Observation>;\n hideObservationNotes?: boolean;\n}\n\nfunction ObservationRow(props: ObservationRowProps): JSX.Element | null {\n const { classes, cx } = useStyles();\n const observation = useResource(props.value);\n\n if (!observation) {\n return null;\n }\n const displayNotes = !props.hideObservationNotes && observation?.note;\n\n const critical = isCritical(observation);\n\n return (\n <>\n <tr className={cx({ [classes.criticalRow]: critical })}>\n <td rowSpan={displayNotes ? 2 : 1}>\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 {displayNotes && (\n <tr>\n <td colSpan={5}>\n <NoteDisplay value={observation.note} />\n </td>\n </tr>\n )}\n </>\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":";;;;;;;;;;;AAmBA,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,CAA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AC;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;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Container } from '../Container/Container.mjs';
|
|
3
3
|
import { Panel } from '../Panel/Panel.mjs';
|
|
4
4
|
|
|
5
5
|
function Document(props) {
|
|
6
6
|
const { children, ...others } = props;
|
|
7
|
-
return (
|
|
8
|
-
|
|
7
|
+
return (React.createElement(Container, null,
|
|
8
|
+
React.createElement(Panel, { ...others }, children)));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export { Document };
|
|
@@ -1 +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":[
|
|
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,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { createReference } from '@medplum/core';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline.mjs';
|
|
4
4
|
|
|
5
5
|
function EncounterTimeline(props) {
|
|
6
|
-
return (
|
|
7
|
-
return Promise.
|
|
8
|
-
medplum.readHistory('Encounter',
|
|
9
|
-
medplum.search('Communication', 'encounter=' +
|
|
10
|
-
medplum.search('Media', 'encounter=' +
|
|
6
|
+
return (React.createElement(ResourceTimeline, { value: props.encounter, loadTimelineResources: async (medplum, _resourceType, id) => {
|
|
7
|
+
return Promise.allSettled([
|
|
8
|
+
medplum.readHistory('Encounter', id),
|
|
9
|
+
medplum.search('Communication', 'encounter=Encounter/' + id),
|
|
10
|
+
medplum.search('Media', 'encounter=Encounter/' + id),
|
|
11
11
|
]);
|
|
12
12
|
}, createCommunication: (resource, sender, text) => ({
|
|
13
13
|
resourceType: 'Communication',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EncounterTimeline.mjs","sources":["../../../src/EncounterTimeline/EncounterTimeline.tsx"],"sourcesContent":["import { createReference,
|
|
1
|
+
{"version":3,"file":"EncounterTimeline.mjs","sources":["../../../src/EncounterTimeline/EncounterTimeline.tsx"],"sourcesContent":["import { createReference, MedplumClient, ProfileResource } from '@medplum/core';\nimport { Attachment, Encounter, Reference, ResourceType } 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 loadTimelineResources={async (medplum: MedplumClient, _resourceType: ResourceType, id: string) => {\n return Promise.allSettled([\n medplum.readHistory('Encounter', id),\n medplum.search('Communication', 'encounter=Encounter/' + id),\n medplum.search('Media', 'encounter=Encounter/' + id),\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;IAC7D,QACE,oBAAC,gBAAgB,EAAA,EACf,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,qBAAqB,EAAE,OAAO,OAAsB,EAAE,aAA2B,EAAE,EAAU,KAAI;YAC/F,OAAO,OAAO,CAAC,UAAU,CAAC;AACxB,gBAAA,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,CAAC;gBACpC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,sBAAsB,GAAG,EAAE,CAAC;gBAC5D,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,EAAE,CAAC;AACrD,aAAA,CAAC,CAAC;AACL,SAAC,EACD,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;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Alert } from '@mantine/core';
|
|
2
2
|
import { normalizeErrorString } from '@medplum/core';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import IconAlertCircle from '../node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* ErrorBoundary is a React component that handles errors in its child components.
|
|
8
8
|
* See: https://reactjs.org/docs/error-boundaries.html
|
|
9
9
|
*/
|
|
10
|
-
class ErrorBoundary extends
|
|
10
|
+
class ErrorBoundary extends React.Component {
|
|
11
11
|
constructor(props) {
|
|
12
12
|
super(props);
|
|
13
13
|
this.state = {};
|
|
@@ -20,7 +20,7 @@ class ErrorBoundary extends e__default.Component {
|
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
22
|
if (this.state.error) {
|
|
23
|
-
return (
|
|
23
|
+
return (React.createElement(Alert, { icon: React.createElement(IconAlertCircle, { size: 16 }), title: "Something went wrong", color: "red" }, normalizeErrorString(this.state.error)));
|
|
24
24
|
}
|
|
25
25
|
return this.props.children;
|
|
26
26
|
}
|
|
@@ -1 +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":[
|
|
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-react';\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;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { JsonInput } from '@mantine/core';
|
|
2
2
|
import { stringify } from '@medplum/core';
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
4
|
|
|
5
5
|
function ExtensionInput(props) {
|
|
6
|
-
return (
|
|
6
|
+
return (React.createElement(JsonInput, { id: props.name, name: props.name, "data-testid": "extension-input", defaultValue: stringify(props.defaultValue), onChange: (newValue) => {
|
|
7
7
|
if (props.onChange) {
|
|
8
8
|
props.onChange(JSON.parse(newValue));
|
|
9
9
|
}
|
|
@@ -1 +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":[
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { evalFhirPath } from '@medplum/core';
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.mjs';
|
|
4
4
|
|
|
5
5
|
function FhirPathDisplay(props) {
|
|
@@ -16,7 +16,7 @@ function FhirPathDisplay(props) {
|
|
|
16
16
|
Received ${value.length} elements \
|
|
17
17
|
[${JSON.stringify(value, null, 2)}]`);
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return React.createElement(ResourcePropertyDisplay, { value: value[0] || '', propertyType: props.propertyType });
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export { FhirPathDisplay };
|
|
@@ -1 +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":[
|
|
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;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Loader, Table, Button } from '@mantine/core';
|
|
2
|
-
import
|
|
2
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
3
3
|
import { FhirPathDisplay } from '../FhirPathDisplay/FhirPathDisplay.mjs';
|
|
4
4
|
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
5
5
|
import { SearchClickEvent } from '../SearchControl/SearchControl.mjs';
|
|
@@ -88,29 +88,29 @@ function FhirPathTable(props) {
|
|
|
88
88
|
}, [medplum, props.resourceType]);
|
|
89
89
|
const typeSchema = schema?.types?.[props.resourceType];
|
|
90
90
|
if (!typeSchema) {
|
|
91
|
-
return
|
|
91
|
+
return React.createElement(Loader, null);
|
|
92
92
|
}
|
|
93
93
|
const checkboxColumn = props.checkboxesEnabled;
|
|
94
|
-
return (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
checkboxColumn && (
|
|
99
|
-
|
|
100
|
-
fields.map((field) => (
|
|
101
|
-
|
|
102
|
-
checkboxColumn && (
|
|
103
|
-
|
|
94
|
+
return (React.createElement("div", { onContextMenu: (e) => killEvent(e), "data-testid": "search-control" },
|
|
95
|
+
React.createElement(Table, null,
|
|
96
|
+
React.createElement("thead", null,
|
|
97
|
+
React.createElement("tr", null,
|
|
98
|
+
checkboxColumn && (React.createElement("th", null,
|
|
99
|
+
React.createElement("input", { type: "checkbox", value: "checked", "aria-label": "all-checkbox", "data-testid": "all-checkbox", checked: isAllSelected(), onChange: (e) => handleAllCheckboxClick(e) }))),
|
|
100
|
+
fields.map((field) => (React.createElement("th", { key: field.name }, field.name))))),
|
|
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) },
|
|
102
|
+
checkboxColumn && (React.createElement("td", null,
|
|
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) }))),
|
|
104
104
|
fields.map((field) => {
|
|
105
|
-
return (
|
|
106
|
-
|
|
105
|
+
return (React.createElement("td", { key: field.name },
|
|
106
|
+
React.createElement(FhirPathDisplay, { propertyType: field.propertyType, path: field.fhirPath, resource: resource })));
|
|
107
107
|
})))))),
|
|
108
|
-
response?.data?.ResourceList?.length === 0 &&
|
|
109
|
-
outcome && (
|
|
110
|
-
|
|
111
|
-
props.onBulk && (
|
|
108
|
+
response?.data?.ResourceList?.length === 0 && React.createElement("div", { "data-testid": "empty-search" }, "No results"),
|
|
109
|
+
outcome && (React.createElement("div", { "data-testid": "search-error" },
|
|
110
|
+
React.createElement("pre", { style: { textAlign: 'left' } }, JSON.stringify(outcome, undefined, 2)))),
|
|
111
|
+
props.onBulk && (React.createElement(Button, { onClick: () => props.onBulk(Object.keys(selectedRef.current)) }, "Bulk..."))));
|
|
112
112
|
}
|
|
113
|
-
const MemoizedFhirPathTable =
|
|
113
|
+
const MemoizedFhirPathTable = React.memo(FhirPathTable);
|
|
114
114
|
|
|
115
115
|
export { FhirPathTable, MemoizedFhirPathTable };
|
|
116
116
|
//# sourceMappingURL=FhirPathTable.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FhirPathTable.mjs","sources":["../../../src/FhirPathTable/FhirPathTable.tsx"],"sourcesContent":["import { Button, Loader, Table } from '@mantine/core';\nimport { IndexedStructureDefinition, PropertyType } from '@medplum/core';\nimport { OperationOutcome, Resource } from '@medplum/fhirtypes';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { FhirPathDisplay } from '../FhirPathDisplay/FhirPathDisplay';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { SearchClickEvent } from '../SearchControl/SearchControl';\nimport { isCheckboxCell, killEvent } from '../utils/dom';\n\nexport interface FhirPathTableField {\n readonly propertyType: PropertyType;\n readonly name: string;\n readonly fhirPath: string;\n}\n\nexport interface FhirPathTableProps {\n resourceType: string;\n query: string;\n fields: FhirPathTableField[];\n checkboxesEnabled?: boolean;\n onClick?: (e: SearchClickEvent) => void;\n onAuxClick?: (e: SearchClickEvent) => void;\n onBulk?: (ids: string[]) => void;\n}\n\nexport interface SmartSearchResponse {\n data: {\n ResourceList: Resource[];\n };\n}\n\n/**\n * The FhirPathTable component represents the embeddable search table control.\n */\nexport function FhirPathTable(props: FhirPathTableProps): JSX.Element {\n const medplum = useMedplum();\n const [schema, setSchema] = useState<IndexedStructureDefinition | undefined>();\n const [outcome, setOutcome] = useState<OperationOutcome | undefined>();\n const { query, fields } = props;\n const [response, setResponse] = useState<SmartSearchResponse | undefined>();\n const [selected, setSelected] = useState<{ [id: string]: boolean }>({});\n\n const responseRef = useRef<SmartSearchResponse>();\n responseRef.current = response;\n\n const selectedRef = useRef<{ [id: string]: boolean }>({});\n selectedRef.current = selected;\n\n useEffect(() => {\n setOutcome(undefined);\n medplum.graphql(query).then(setResponse).catch(setOutcome);\n }, [medplum, query]);\n\n function handleSingleCheckboxClick(e: React.ChangeEvent, id: string): void {\n e.stopPropagation();\n\n const el = e.target as HTMLInputElement;\n const checked = el.checked;\n const newSelected = { ...selectedRef.current };\n if (checked) {\n newSelected[id] = true;\n } else {\n delete newSelected[id];\n }\n setSelected(newSelected);\n }\n\n function handleAllCheckboxClick(e: React.ChangeEvent): void {\n e.stopPropagation();\n\n const el = e.target as HTMLInputElement;\n const checked = el.checked;\n const newSelected = {} as { [id: string]: boolean };\n const resources = responseRef.current?.data?.ResourceList;\n if (checked && resources) {\n resources.forEach((resource) => {\n if (resource?.id) {\n newSelected[resource.id] = true;\n }\n });\n }\n setSelected(newSelected);\n }\n\n function isAllSelected(): boolean {\n const resources = responseRef.current?.data?.ResourceList;\n if (!resources || resources.length === 0) {\n return false;\n }\n for (const resource of resources) {\n if (resource?.id && !selectedRef.current[resource.id]) {\n return false;\n }\n }\n return true;\n }\n\n function handleRowClick(e: React.MouseEvent, resource: Resource): void {\n if (isCheckboxCell(e.target as Element)) {\n // Ignore clicks on checkboxes\n return;\n }\n\n killEvent(e);\n\n if (e.button !== 1 && props.onClick) {\n props.onClick(new SearchClickEvent(resource, e));\n }\n\n if (e.button === 1 && props.onAuxClick) {\n props.onAuxClick(new SearchClickEvent(resource, e));\n }\n }\n\n useEffect(() => {\n medplum\n .requestSchema(props.resourceType)\n .then((newSchema) => {\n // The schema could have the same object identity,\n // so need to use the spread operator to kick React re-render.\n setSchema({ ...newSchema });\n })\n .catch(console.log);\n }, [medplum, props.resourceType]);\n\n const typeSchema = schema?.types?.[props.resourceType];\n if (!typeSchema) {\n return <Loader />;\n }\n\n const checkboxColumn = props.checkboxesEnabled;\n\n return (\n <div onContextMenu={(e) => killEvent(e)} data-testid=\"search-control\">\n <Table>\n <thead>\n <tr>\n {checkboxColumn && (\n <th>\n <input\n type=\"checkbox\"\n value=\"checked\"\n aria-label=\"all-checkbox\"\n data-testid=\"all-checkbox\"\n checked={isAllSelected()}\n onChange={(e) => handleAllCheckboxClick(e)}\n />\n </th>\n )}\n {fields.map((field) => (\n <th key={field.name}>{field.name}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {response?.data?.ResourceList?.map(\n (resource) =>\n resource && (\n <tr\n key={resource.id}\n data-testid=\"search-control-row\"\n onClick={(e) => handleRowClick(e, resource)}\n onAuxClick={(e) => handleRowClick(e, resource)}\n >\n {checkboxColumn && (\n <td>\n <input\n type=\"checkbox\"\n value=\"checked\"\n data-testid=\"row-checkbox\"\n aria-label={`Checkbox for ${resource.id}`}\n checked={!!selected[resource.id as string]}\n onChange={(e) => handleSingleCheckboxClick(e, resource.id as string)}\n />\n </td>\n )}\n {fields.map((field) => {\n return (\n <td key={field.name}>\n <FhirPathDisplay propertyType={field.propertyType} path={field.fhirPath} resource={resource} />\n </td>\n );\n })}\n </tr>\n )\n )}\n </tbody>\n </Table>\n {response?.data?.ResourceList?.length === 0 && <div data-testid=\"empty-search\">No results</div>}\n {outcome && (\n <div data-testid=\"search-error\">\n <pre style={{ textAlign: 'left' }}>{JSON.stringify(outcome, undefined, 2)}</pre>\n </div>\n )}\n {props.onBulk && (\n <Button onClick={() => (props.onBulk as (ids: string[]) => any)(Object.keys(selectedRef.current))}>\n Bulk...\n </Button>\n )}\n </div>\n );\n}\n\nexport const MemoizedFhirPathTable = React.memo(FhirPathTable);\n"],"names":["React"],"mappings":";;;;;;;AA+BA;;AAEG;AACG,SAAU,aAAa,CAAC,KAAyB,EAAA;AACrD,IAAA,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAA0C,CAAC;IAC/E,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAgC,CAAC;AACvE,IAAA,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAChC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,EAAmC,CAAC;IAC5E,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAA4B,EAAE,CAAC,CAAC;AAExE,IAAA,MAAM,WAAW,GAAG,MAAM,EAAuB,CAAC;AAClD,IAAA,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;AAE/B,IAAA,MAAM,WAAW,GAAG,MAAM,CAA4B,EAAE,CAAC,CAAC;AAC1D,IAAA,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IAE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Ac,EAAiB,EAAA,YAAA,CAAA;QAC9F,OAAO,KACNA,UAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAiB,cAAc,EAAA;YAC7BA,UAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,CAAO,CAC5E,CACP;AACA,QAAA,KAAK,CAAC,MAAM,KACXA,UAAC,CAAA,aAAA,CAAA,MAAM,EAAC,EAAA,OAAO,EAAE,MAAO,KAAK,CAAC,MAAiC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAA,EAAA,SAAA,CAExF,CACV,CACG,EACN;AACJ,CAAC;AAEY,MAAA,qBAAqB,GAAGA,UAAK,CAAC,IAAI,CAAC,aAAa;;;;"}
|
|
1
|
+
{"version":3,"file":"FhirPathTable.mjs","sources":["../../../src/FhirPathTable/FhirPathTable.tsx"],"sourcesContent":["import { Button, Loader, Table } from '@mantine/core';\nimport { IndexedStructureDefinition, PropertyType } from '@medplum/core';\nimport { OperationOutcome, Resource } from '@medplum/fhirtypes';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { FhirPathDisplay } from '../FhirPathDisplay/FhirPathDisplay';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { SearchClickEvent } from '../SearchControl/SearchControl';\nimport { isCheckboxCell, killEvent } from '../utils/dom';\n\nexport interface FhirPathTableField {\n readonly propertyType: PropertyType;\n readonly name: string;\n readonly fhirPath: string;\n}\n\nexport interface FhirPathTableProps {\n resourceType: string;\n query: string;\n fields: FhirPathTableField[];\n checkboxesEnabled?: boolean;\n onClick?: (e: SearchClickEvent) => void;\n onAuxClick?: (e: SearchClickEvent) => void;\n onBulk?: (ids: string[]) => void;\n}\n\nexport interface SmartSearchResponse {\n data: {\n ResourceList: Resource[];\n };\n}\n\n/**\n * The FhirPathTable component represents the embeddable search table control.\n */\nexport function FhirPathTable(props: FhirPathTableProps): JSX.Element {\n const medplum = useMedplum();\n const [schema, setSchema] = useState<IndexedStructureDefinition | undefined>();\n const [outcome, setOutcome] = useState<OperationOutcome | undefined>();\n const { query, fields } = props;\n const [response, setResponse] = useState<SmartSearchResponse | undefined>();\n const [selected, setSelected] = useState<{ [id: string]: boolean }>({});\n\n const responseRef = useRef<SmartSearchResponse>();\n responseRef.current = response;\n\n const selectedRef = useRef<{ [id: string]: boolean }>({});\n selectedRef.current = selected;\n\n useEffect(() => {\n setOutcome(undefined);\n medplum.graphql(query).then(setResponse).catch(setOutcome);\n }, [medplum, query]);\n\n function handleSingleCheckboxClick(e: React.ChangeEvent, id: string): void {\n e.stopPropagation();\n\n const el = e.target as HTMLInputElement;\n const checked = el.checked;\n const newSelected = { ...selectedRef.current };\n if (checked) {\n newSelected[id] = true;\n } else {\n delete newSelected[id];\n }\n setSelected(newSelected);\n }\n\n function handleAllCheckboxClick(e: React.ChangeEvent): void {\n e.stopPropagation();\n\n const el = e.target as HTMLInputElement;\n const checked = el.checked;\n const newSelected = {} as { [id: string]: boolean };\n const resources = responseRef.current?.data?.ResourceList;\n if (checked && resources) {\n resources.forEach((resource) => {\n if (resource?.id) {\n newSelected[resource.id] = true;\n }\n });\n }\n setSelected(newSelected);\n }\n\n function isAllSelected(): boolean {\n const resources = responseRef.current?.data?.ResourceList;\n if (!resources || resources.length === 0) {\n return false;\n }\n for (const resource of resources) {\n if (resource?.id && !selectedRef.current[resource.id]) {\n return false;\n }\n }\n return true;\n }\n\n function handleRowClick(e: React.MouseEvent, resource: Resource): void {\n if (isCheckboxCell(e.target as Element)) {\n // Ignore clicks on checkboxes\n return;\n }\n\n killEvent(e);\n\n if (e.button !== 1 && props.onClick) {\n props.onClick(new SearchClickEvent(resource, e));\n }\n\n if (e.button === 1 && props.onAuxClick) {\n props.onAuxClick(new SearchClickEvent(resource, e));\n }\n }\n\n useEffect(() => {\n medplum\n .requestSchema(props.resourceType)\n .then((newSchema) => {\n // The schema could have the same object identity,\n // so need to use the spread operator to kick React re-render.\n setSchema({ ...newSchema });\n })\n .catch(console.log);\n }, [medplum, props.resourceType]);\n\n const typeSchema = schema?.types?.[props.resourceType];\n if (!typeSchema) {\n return <Loader />;\n }\n\n const checkboxColumn = props.checkboxesEnabled;\n\n return (\n <div onContextMenu={(e) => killEvent(e)} data-testid=\"search-control\">\n <Table>\n <thead>\n <tr>\n {checkboxColumn && (\n <th>\n <input\n type=\"checkbox\"\n value=\"checked\"\n aria-label=\"all-checkbox\"\n data-testid=\"all-checkbox\"\n checked={isAllSelected()}\n onChange={(e) => handleAllCheckboxClick(e)}\n />\n </th>\n )}\n {fields.map((field) => (\n <th key={field.name}>{field.name}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {response?.data?.ResourceList?.map(\n (resource) =>\n resource && (\n <tr\n key={resource.id}\n data-testid=\"search-control-row\"\n onClick={(e) => handleRowClick(e, resource)}\n onAuxClick={(e) => handleRowClick(e, resource)}\n >\n {checkboxColumn && (\n <td>\n <input\n type=\"checkbox\"\n value=\"checked\"\n data-testid=\"row-checkbox\"\n aria-label={`Checkbox for ${resource.id}`}\n checked={!!selected[resource.id as string]}\n onChange={(e) => handleSingleCheckboxClick(e, resource.id as string)}\n />\n </td>\n )}\n {fields.map((field) => {\n return (\n <td key={field.name}>\n <FhirPathDisplay propertyType={field.propertyType} path={field.fhirPath} resource={resource} />\n </td>\n );\n })}\n </tr>\n )\n )}\n </tbody>\n </Table>\n {response?.data?.ResourceList?.length === 0 && <div data-testid=\"empty-search\">No results</div>}\n {outcome && (\n <div data-testid=\"search-error\">\n <pre style={{ textAlign: 'left' }}>{JSON.stringify(outcome, undefined, 2)}</pre>\n </div>\n )}\n {props.onBulk && (\n <Button onClick={() => (props.onBulk as (ids: string[]) => any)(Object.keys(selectedRef.current))}>\n Bulk...\n </Button>\n )}\n </div>\n );\n}\n\nexport const MemoizedFhirPathTable = React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G,KAAK,CAAC,IAAI,CAAC,aAAa;;;;"}
|
package/dist/esm/Form/Form.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { parseForm } from './FormUtils.mjs';
|
|
3
3
|
|
|
4
4
|
function Form(props) {
|
|
5
|
-
return (
|
|
5
|
+
return (React.createElement("form", { style: props.style, "data-testid": props.testid, onSubmit: (e) => {
|
|
6
6
|
e.preventDefault();
|
|
7
7
|
const formData = parseForm(e.target);
|
|
8
8
|
if (props.onSubmit) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.mjs","sources":["../../../src/Form/Form.tsx"],"sourcesContent":["import React, { CSSProperties } from 'react';\nimport { parseForm } from './FormUtils';\n\nexport interface FormProps {\n onSubmit?: (formData: Record<string, string>) => void;\n style?: CSSProperties;\n children?: React.ReactNode;\n testid?: string;\n}\n\nexport function Form(props: FormProps): JSX.Element {\n return (\n <form\n style={props.style}\n data-testid={props.testid}\n onSubmit={(e: React.SyntheticEvent) => {\n e.preventDefault();\n const formData = parseForm(e.target as HTMLFormElement);\n if (props.onSubmit) {\n props.onSubmit(formData);\n }\n }}\n >\n {props.children}\n </form>\n );\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"Form.mjs","sources":["../../../src/Form/Form.tsx"],"sourcesContent":["import React, { CSSProperties } from 'react';\nimport { parseForm } from './FormUtils';\n\nexport interface FormProps {\n onSubmit?: (formData: Record<string, string>) => void;\n style?: CSSProperties;\n children?: React.ReactNode;\n testid?: string;\n}\n\nexport function Form(props: FormProps): JSX.Element {\n return (\n <form\n style={props.style}\n data-testid={props.testid}\n onSubmit={(e: React.SyntheticEvent) => {\n e.preventDefault();\n const formData = parseForm(e.target as HTMLFormElement);\n if (props.onSubmit) {\n props.onSubmit(formData);\n }\n }}\n >\n {props.children}\n </form>\n );\n}\n"],"names":[],"mappings":";;;AAUM,SAAU,IAAI,CAAC,KAAgB,EAAA;AACnC,IAAA,QACE,KACE,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,KAAK,EAAE,KAAK,CAAC,KAAK,EAAA,aAAA,EACL,KAAK,CAAC,MAAM,EACzB,QAAQ,EAAE,CAAC,CAAuB,KAAI;YACpC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,MAAyB,CAAC,CAAC;YACxD,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,gBAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1B,aAAA;AACH,SAAC,IAEA,KAAK,CAAC,QAAQ,CACV,EACP;AACJ;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Input } from '@mantine/core';
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { getErrorsForInput } from '../utils/outcomes.mjs';
|
|
4
4
|
|
|
5
5
|
function FormSection(props) {
|
|
6
|
-
return (
|
|
6
|
+
return (React.createElement(Input.Wrapper, { id: props.htmlFor, label: props.title, description: props.description, error: getErrorsForInput(props.outcome, props.htmlFor) }, props.children));
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export { FormSection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSection.mjs","sources":["../../../src/FormSection/FormSection.tsx"],"sourcesContent":["import { Input } from '@mantine/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { getErrorsForInput } from '../utils/outcomes';\n\nexport interface FormSectionProps {\n title?: string;\n htmlFor?: string;\n description?: string;\n outcome?: OperationOutcome;\n children?: React.ReactNode;\n}\n\nexport function FormSection(props: FormSectionProps): JSX.Element {\n return (\n <Input.Wrapper\n id={props.htmlFor}\n label={props.title}\n description={props.description}\n error={getErrorsForInput(props.outcome, props.htmlFor)}\n >\n {props.children}\n </Input.Wrapper>\n );\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"FormSection.mjs","sources":["../../../src/FormSection/FormSection.tsx"],"sourcesContent":["import { Input } from '@mantine/core';\nimport { OperationOutcome } from '@medplum/fhirtypes';\nimport React from 'react';\nimport { getErrorsForInput } from '../utils/outcomes';\n\nexport interface FormSectionProps {\n title?: string;\n htmlFor?: string;\n description?: string;\n outcome?: OperationOutcome;\n children?: React.ReactNode;\n}\n\nexport function FormSection(props: FormSectionProps): JSX.Element {\n return (\n <Input.Wrapper\n id={props.htmlFor}\n label={props.title}\n description={props.description}\n error={getErrorsForInput(props.outcome, props.htmlFor)}\n >\n {props.children}\n </Input.Wrapper>\n );\n}\n"],"names":[],"mappings":";;;;AAaM,SAAU,WAAW,CAAC,KAAuB,EAAA;AACjD,IAAA,QACE,KAAC,CAAA,aAAA,CAAA,KAAK,CAAC,OAAO,EAAA,EACZ,EAAE,EAAE,KAAK,CAAC,OAAO,EACjB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAErD,EAAA,KAAK,CAAC,QAAQ,CACD,EAChB;AACJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
3
3
|
import { createScriptTag } from '../utils/script.mjs';
|
|
4
4
|
|
|
@@ -29,7 +29,7 @@ function GoogleButton(props) {
|
|
|
29
29
|
if (!googleClientId) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return React.createElement("div", { ref: parentRef });
|
|
33
33
|
}
|
|
34
34
|
function getGoogleClientId(clientId) {
|
|
35
35
|
if (clientId) {
|
|
@@ -37,9 +37,9 @@ function getGoogleClientId(clientId) {
|
|
|
37
37
|
}
|
|
38
38
|
if (typeof window !== 'undefined') {
|
|
39
39
|
const origin = window.location.protocol + '//' + window.location.host;
|
|
40
|
-
const authorizedOrigins = "
|
|
40
|
+
const authorizedOrigins = "http://localhost:3000,http://127.0.0.1:3000,http://localhost:6006,http://127.0.0.1:6006,https://app.medplum.com,https://docs.medplum.com,https://storybook.medplum.com,https://graphiql.medplum.com,https://www.medplum.com"?.split(',') ?? [];
|
|
41
41
|
if (authorizedOrigins.includes(origin)) {
|
|
42
|
-
return "
|
|
42
|
+
return "921088377005-3j1sa10vr6hj86jgmdfh2l53v3mp7lfi.apps.googleusercontent.com";
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
return undefined;
|