@medplum/react 2.0.24 → 2.0.25
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/index.cjs +11 -7714
- package/dist/cjs/index.cjs.map +7 -1
- package/dist/esm/index.mjs +67 -92
- package/dist/esm/index.mjs.map +7 -1
- package/package.json +5 -8
- package/dist/cjs/index.min.cjs +0 -1
- package/dist/esm/AddressDisplay/AddressDisplay.mjs +0 -13
- package/dist/esm/AddressDisplay/AddressDisplay.mjs.map +0 -1
- package/dist/esm/AddressInput/AddressInput.mjs +0 -57
- package/dist/esm/AddressInput/AddressInput.mjs.map +0 -1
- package/dist/esm/AnnotationInput/AnnotationInput.mjs +0 -28
- package/dist/esm/AnnotationInput/AnnotationInput.mjs.map +0 -1
- package/dist/esm/AppShell/AppShell.mjs +0 -37
- package/dist/esm/AppShell/AppShell.mjs.map +0 -1
- package/dist/esm/AppShell/Header.mjs +0 -88
- package/dist/esm/AppShell/Header.mjs.map +0 -1
- package/dist/esm/AppShell/HeaderSearchInput.mjs +0 -230
- package/dist/esm/AppShell/HeaderSearchInput.mjs.map +0 -1
- package/dist/esm/AppShell/Navbar.mjs +0 -169
- package/dist/esm/AppShell/Navbar.mjs.map +0 -1
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs +0 -121
- package/dist/esm/AsyncAutocomplete/AsyncAutocomplete.mjs.map +0 -1
- package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs +0 -10
- package/dist/esm/AttachmentArrayDisplay/AttachmentArrayDisplay.mjs.map +0 -1
- package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs +0 -45
- package/dist/esm/AttachmentArrayInput/AttachmentArrayInput.mjs.map +0 -1
- package/dist/esm/AttachmentButton/AttachmentButton.mjs +0 -55
- package/dist/esm/AttachmentButton/AttachmentButton.mjs.map +0 -1
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs +0 -21
- package/dist/esm/AttachmentDisplay/AttachmentDisplay.mjs.map +0 -1
- package/dist/esm/AttachmentInput/AttachmentInput.mjs +0 -27
- package/dist/esm/AttachmentInput/AttachmentInput.mjs.map +0 -1
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs +0 -49
- package/dist/esm/BackboneElementDisplay/BackboneElementDisplay.mjs.map +0 -1
- package/dist/esm/BackboneElementInput/BackboneElementInput.mjs +0 -52
- package/dist/esm/BackboneElementInput/BackboneElementInput.mjs.map +0 -1
- package/dist/esm/BookmarkDialog/BookmarkDialog.mjs +0 -47
- package/dist/esm/BookmarkDialog/BookmarkDialog.mjs.map +0 -1
- package/dist/esm/CalendarInput/CalendarInput.mjs +0 -133
- package/dist/esm/CalendarInput/CalendarInput.mjs.map +0 -1
- package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs +0 -12
- package/dist/esm/CheckboxFormSection/CheckboxFormSection.mjs.map +0 -1
- package/dist/esm/CodeInput/CodeInput.mjs +0 -24
- package/dist/esm/CodeInput/CodeInput.mjs.map +0 -1
- package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs +0 -9
- package/dist/esm/CodeableConceptDisplay/CodeableConceptDisplay.mjs.map +0 -1
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs +0 -36
- package/dist/esm/CodeableConceptInput/CodeableConceptInput.mjs.map +0 -1
- package/dist/esm/CodingDisplay/CodingDisplay.mjs +0 -9
- package/dist/esm/CodingDisplay/CodingDisplay.mjs.map +0 -1
- package/dist/esm/CodingInput/CodingInput.mjs +0 -32
- package/dist/esm/CodingInput/CodingInput.mjs.map +0 -1
- package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs +0 -16
- package/dist/esm/ContactDetailDisplay/ContactDetailDisplay.mjs.map +0 -1
- package/dist/esm/ContactDetailInput/ContactDetailInput.mjs +0 -35
- package/dist/esm/ContactDetailInput/ContactDetailInput.mjs.map +0 -1
- package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs +0 -29
- package/dist/esm/ContactPointDisplay/ContactPointDisplay.mjs.map +0 -1
- package/dist/esm/ContactPointInput/ContactPointInput.mjs +0 -45
- package/dist/esm/ContactPointInput/ContactPointInput.mjs.map +0 -1
- package/dist/esm/Container/Container.mjs +0 -19
- package/dist/esm/Container/Container.mjs.map +0 -1
- package/dist/esm/DateTimeInput/DateTimeInput.mjs +0 -71
- package/dist/esm/DateTimeInput/DateTimeInput.mjs.map +0 -1
- package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs +0 -16
- package/dist/esm/DefaultResourceTimeline/DefaultResourceTimeline.mjs.map +0 -1
- package/dist/esm/DescriptionList/DescriptionList.mjs +0 -35
- package/dist/esm/DescriptionList/DescriptionList.mjs.map +0 -1
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs +0 -172
- package/dist/esm/DiagnosticReportDisplay/DiagnosticReportDisplay.mjs.map +0 -1
- package/dist/esm/Document/Document.mjs +0 -12
- package/dist/esm/Document/Document.mjs.map +0 -1
- package/dist/esm/EncounterTimeline/EncounterTimeline.mjs +0 -32
- package/dist/esm/EncounterTimeline/EncounterTimeline.mjs.map +0 -1
- package/dist/esm/ErrorBoundary/ErrorBoundary.mjs +0 -30
- package/dist/esm/ErrorBoundary/ErrorBoundary.mjs.map +0 -1
- package/dist/esm/ExtensionInput/ExtensionInput.mjs +0 -14
- package/dist/esm/ExtensionInput/ExtensionInput.mjs.map +0 -1
- package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs +0 -23
- package/dist/esm/FhirPathDisplay/FhirPathDisplay.mjs.map +0 -1
- package/dist/esm/FhirPathTable/FhirPathTable.mjs +0 -122
- package/dist/esm/FhirPathTable/FhirPathTable.mjs.map +0 -1
- package/dist/esm/Form/Form.mjs +0 -15
- package/dist/esm/Form/Form.mjs.map +0 -1
- package/dist/esm/Form/FormUtils.mjs +0 -50
- package/dist/esm/Form/FormUtils.mjs.map +0 -1
- package/dist/esm/FormSection/FormSection.mjs +0 -10
- package/dist/esm/FormSection/FormSection.mjs.map +0 -1
- package/dist/esm/GoogleButton/GoogleButton.mjs +0 -49
- package/dist/esm/GoogleButton/GoogleButton.mjs.map +0 -1
- package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs +0 -13
- package/dist/esm/HumanNameDisplay/HumanNameDisplay.mjs.map +0 -1
- package/dist/esm/HumanNameInput/HumanNameInput.mjs +0 -50
- package/dist/esm/HumanNameInput/HumanNameInput.mjs.map +0 -1
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs +0 -11
- package/dist/esm/IdentifierDisplay/IdentifierDisplay.mjs.map +0 -1
- package/dist/esm/IdentifierInput/IdentifierInput.mjs +0 -18
- package/dist/esm/IdentifierInput/IdentifierInput.mjs.map +0 -1
- package/dist/esm/Loading/Loading.mjs +0 -10
- package/dist/esm/Loading/Loading.mjs.map +0 -1
- package/dist/esm/Logo/Logo.mjs +0 -14
- package/dist/esm/Logo/Logo.mjs.map +0 -1
- package/dist/esm/MedplumLink/MedplumLink.mjs +0 -52
- package/dist/esm/MedplumLink/MedplumLink.mjs.map +0 -1
- package/dist/esm/MedplumProvider/MedplumProvider.mjs +0 -84
- package/dist/esm/MedplumProvider/MedplumProvider.mjs.map +0 -1
- package/dist/esm/MoneyDisplay/MoneyDisplay.mjs +0 -9
- package/dist/esm/MoneyDisplay/MoneyDisplay.mjs.map +0 -1
- package/dist/esm/MoneyInput/MoneyInput.mjs +0 -53
- package/dist/esm/MoneyInput/MoneyInput.mjs.map +0 -1
- package/dist/esm/NoteDisplay/NoteDisplay.mjs +0 -18
- package/dist/esm/NoteDisplay/NoteDisplay.mjs.map +0 -1
- package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs +0 -14
- package/dist/esm/OperationOutcomeAlert/OperationOutcomeAlert.mjs.map +0 -1
- package/dist/esm/Panel/Panel.mjs +0 -34
- package/dist/esm/Panel/Panel.mjs.map +0 -1
- package/dist/esm/PatientTimeline/PatientTimeline.mjs +0 -38
- package/dist/esm/PatientTimeline/PatientTimeline.mjs.map +0 -1
- package/dist/esm/PeriodInput/PeriodInput.mjs +0 -19
- package/dist/esm/PeriodInput/PeriodInput.mjs.map +0 -1
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs +0 -258
- package/dist/esm/PlanDefinitionBuilder/PlanDefinitionBuilder.mjs.map +0 -1
- package/dist/esm/QuantityDisplay/QuantityDisplay.mjs +0 -9
- package/dist/esm/QuantityDisplay/QuantityDisplay.mjs.map +0 -1
- package/dist/esm/QuantityInput/QuantityInput.mjs +0 -40
- package/dist/esm/QuantityInput/QuantityInput.mjs.map +0 -1
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs +0 -288
- package/dist/esm/QuestionnaireBuilder/QuestionnaireBuilder.mjs.map +0 -1
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs +0 -276
- package/dist/esm/QuestionnaireForm/QuestionnaireForm.mjs.map +0 -1
- package/dist/esm/RangeDisplay/RangeDisplay.mjs +0 -9
- package/dist/esm/RangeDisplay/RangeDisplay.mjs.map +0 -1
- package/dist/esm/RangeInput/RangeInput.mjs +0 -31
- package/dist/esm/RangeInput/RangeInput.mjs.map +0 -1
- package/dist/esm/RatioDisplay/RatioDisplay.mjs +0 -16
- package/dist/esm/RatioDisplay/RatioDisplay.mjs.map +0 -1
- package/dist/esm/RatioInput/RatioInput.mjs +0 -31
- package/dist/esm/RatioInput/RatioInput.mjs.map +0 -1
- package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs +0 -21
- package/dist/esm/ReferenceDisplay/ReferenceDisplay.mjs.map +0 -1
- package/dist/esm/ReferenceInput/ReferenceInput.mjs +0 -45
- package/dist/esm/ReferenceInput/ReferenceInput.mjs.map +0 -1
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs +0 -286
- package/dist/esm/ReferenceRangeEditor/ReferenceRangeEditor.mjs.map +0 -1
- package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs +0 -72
- package/dist/esm/RequestGroupDisplay/RequestGroupDisplay.mjs.map +0 -1
- package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs +0 -13
- package/dist/esm/ResourceArrayDisplay/ResourceArrayDisplay.mjs.map +0 -1
- package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs +0 -51
- package/dist/esm/ResourceArrayInput/ResourceArrayInput.mjs.map +0 -1
- package/dist/esm/ResourceAvatar/ResourceAvatar.mjs +0 -23
- package/dist/esm/ResourceAvatar/ResourceAvatar.mjs.map +0 -1
- package/dist/esm/ResourceBadge/ResourceBadge.mjs +0 -13
- package/dist/esm/ResourceBadge/ResourceBadge.mjs.map +0 -1
- package/dist/esm/ResourceBlame/ResourceBlame.mjs +0 -113
- package/dist/esm/ResourceBlame/ResourceBlame.mjs.map +0 -1
- package/dist/esm/ResourceDiff/ResourceDiff.mjs +0 -39
- package/dist/esm/ResourceDiff/ResourceDiff.mjs.map +0 -1
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs +0 -80
- package/dist/esm/ResourceDiffTable/ResourceDiffTable.mjs.map +0 -1
- package/dist/esm/ResourceForm/ResourceForm.mjs +0 -56
- package/dist/esm/ResourceForm/ResourceForm.mjs.map +0 -1
- package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs +0 -50
- package/dist/esm/ResourceHistoryTable/ResourceHistoryTable.mjs.map +0 -1
- package/dist/esm/ResourceInput/ResourceInput.mjs +0 -70
- package/dist/esm/ResourceInput/ResourceInput.mjs.map +0 -1
- package/dist/esm/ResourceName/ResourceName.mjs +0 -25
- package/dist/esm/ResourceName/ResourceName.mjs.map +0 -1
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs +0 -119
- package/dist/esm/ResourcePropertyDisplay/ResourcePropertyDisplay.mjs.map +0 -1
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs +0 -171
- package/dist/esm/ResourcePropertyInput/ResourcePropertyInput.mjs.map +0 -1
- package/dist/esm/ResourceTable/ResourceTable.mjs +0 -25
- package/dist/esm/ResourceTable/ResourceTable.mjs.map +0 -1
- package/dist/esm/ResourceTimeline/ResourceTimeline.mjs +0 -309
- package/dist/esm/ResourceTimeline/ResourceTimeline.mjs.map +0 -1
- package/dist/esm/Scheduler/Scheduler.mjs +0 -98
- package/dist/esm/Scheduler/Scheduler.mjs.map +0 -1
- package/dist/esm/SearchControl/SearchControl.mjs +0 -337
- package/dist/esm/SearchControl/SearchControl.mjs.map +0 -1
- package/dist/esm/SearchControl/SearchControlField.mjs +0 -95
- package/dist/esm/SearchControl/SearchControlField.mjs.map +0 -1
- package/dist/esm/SearchControl/SearchUtils.mjs +0 -497
- package/dist/esm/SearchControl/SearchUtils.mjs.map +0 -1
- package/dist/esm/SearchExportDialog/SearchExportDialog.mjs +0 -19
- package/dist/esm/SearchExportDialog/SearchExportDialog.mjs.map +0 -1
- package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs +0 -196
- package/dist/esm/SearchFieldEditor/SearchFieldEditor.mjs.map +0 -1
- package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs +0 -97
- package/dist/esm/SearchFilterEditor/SearchFilterEditor.mjs.map +0 -1
- package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs +0 -22
- package/dist/esm/SearchFilterValueDialog/SearchFilterValueDialog.mjs.map +0 -1
- package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs +0 -22
- package/dist/esm/SearchFilterValueDisplay/SearchFilterValueDisplay.mjs.map +0 -1
- package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs +0 -57
- package/dist/esm/SearchFilterValueInput/SearchFilterValueInput.mjs.map +0 -1
- package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs +0 -134
- package/dist/esm/SearchPopupMenu/SearchPopupMenu.mjs.map +0 -1
- package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs +0 -36
- package/dist/esm/ServiceRequestTimeline/ServiceRequestTimeline.mjs.map +0 -1
- package/dist/esm/StatusBadge/StatusBadge.mjs +0 -63
- package/dist/esm/StatusBadge/StatusBadge.mjs.map +0 -1
- package/dist/esm/Timeline/Timeline.mjs +0 -40
- package/dist/esm/Timeline/Timeline.mjs.map +0 -1
- package/dist/esm/TimingInput/TimingInput.mjs +0 -76
- package/dist/esm/TimingInput/TimingInput.mjs.map +0 -1
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs +0 -58
- package/dist/esm/ValueSetAutocomplete/ValueSetAutocomplete.mjs.map +0 -1
- package/dist/esm/auth/AuthenticationForm.mjs +0 -89
- package/dist/esm/auth/AuthenticationForm.mjs.map +0 -1
- package/dist/esm/auth/ChooseProfileForm.mjs +0 -33
- package/dist/esm/auth/ChooseProfileForm.mjs.map +0 -1
- package/dist/esm/auth/ChooseScopeForm.mjs +0 -28
- package/dist/esm/auth/ChooseScopeForm.mjs.map +0 -1
- package/dist/esm/auth/MfaForm.mjs +0 -34
- package/dist/esm/auth/MfaForm.mjs.map +0 -1
- package/dist/esm/auth/NewProjectForm.mjs +0 -39
- package/dist/esm/auth/NewProjectForm.mjs.map +0 -1
- package/dist/esm/auth/NewUserForm.mjs +0 -84
- package/dist/esm/auth/NewUserForm.mjs.map +0 -1
- package/dist/esm/auth/RegisterForm.mjs +0 -39
- package/dist/esm/auth/RegisterForm.mjs.map +0 -1
- package/dist/esm/auth/SignInForm.mjs +0 -100
- package/dist/esm/auth/SignInForm.mjs.map +0 -1
- package/dist/esm/constants.mjs +0 -12
- package/dist/esm/constants.mjs.map +0 -1
- package/dist/esm/index.min.mjs +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs +0 -70
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs +0 -18
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs +0 -25
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAdjustmentsHorizontal.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs +0 -15
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs +0 -19
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleach.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBleachOff.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs +0 -26
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBoxMultiple.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs +0 -17
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBracketsContain.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucket.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs +0 -27
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconBucketOff.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs +0 -24
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs +0 -13
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCheckbox.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.mjs +0 -13
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs +0 -14
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleMinus.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs +0 -15
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs +0 -21
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCloudUpload.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconColumns.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconCurrencyDollar.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs +0 -15
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs +0 -27
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEdit.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs +0 -14
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqual.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs +0 -15
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconEqualNot.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs +0 -22
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFileAlert.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs +0 -22
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilePlus.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs +0 -19
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconFilter.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs +0 -30
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconListDetails.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconLogout.mjs +0 -21
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconLogout.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs +0 -13
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathGreater.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs +0 -13
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMathLower.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs +0 -21
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconMessage.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs +0 -21
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPin.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs +0 -22
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPinnedOff.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.mjs +0 -14
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs +0 -14
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSettings.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs +0 -17
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortAscending.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs +0 -17
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSortDescending.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs +0 -19
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSquare.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSwitchHorizontal.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconSwitchHorizontal.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs +0 -23
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTableExport.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs +0 -20
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.mjs.map +0 -1
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs +0 -14
- package/dist/esm/node_modules/@tabler/icons-react/dist/esm/icons/IconX.mjs.map +0 -1
- package/dist/esm/useResource/useResource.mjs +0 -68
- package/dist/esm/useResource/useResource.mjs.map +0 -1
- package/dist/esm/utils/blame.mjs +0 -72
- package/dist/esm/utils/blame.mjs.map +0 -1
- package/dist/esm/utils/date.mjs +0 -56
- package/dist/esm/utils/date.mjs.map +0 -1
- package/dist/esm/utils/diff.mjs +0 -118
- package/dist/esm/utils/diff.mjs.map +0 -1
- package/dist/esm/utils/dom.mjs +0 -34
- package/dist/esm/utils/dom.mjs.map +0 -1
- package/dist/esm/utils/outcomes.mjs +0 -30
- package/dist/esm/utils/outcomes.mjs.map +0 -1
- package/dist/esm/utils/questionnaire.mjs +0 -26
- package/dist/esm/utils/questionnaire.mjs.map +0 -1
- package/dist/esm/utils/recaptcha.mjs +0 -32
- package/dist/esm/utils/recaptcha.mjs.map +0 -1
- package/dist/esm/utils/script.mjs +0 -16
- package/dist/esm/utils/script.mjs.map +0 -1
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { createStyles } from '@mantine/core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
const useStyles = createStyles((theme) => ({
|
|
5
|
-
root: {
|
|
6
|
-
display: 'grid',
|
|
7
|
-
gridTemplateColumns: '30% 70%',
|
|
8
|
-
margin: 0,
|
|
9
|
-
'& > dt, & > dd': {
|
|
10
|
-
padding: `${theme.spacing.sm} ${theme.spacing.sm}`,
|
|
11
|
-
borderTop: `0.1px solid ${theme.colors.gray[3]}`,
|
|
12
|
-
margin: 0,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
compact: {
|
|
16
|
-
gridTemplateColumns: '20% 80%',
|
|
17
|
-
'& > dt, & > dd': {
|
|
18
|
-
padding: `0 ${theme.spacing.xs} ${theme.spacing.xs} 0`,
|
|
19
|
-
border: 0,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
}));
|
|
23
|
-
function DescriptionList(props) {
|
|
24
|
-
const { children, compact } = props;
|
|
25
|
-
const { classes, cx } = useStyles();
|
|
26
|
-
return React.createElement("dl", { className: cx(classes.root, { [classes.compact]: compact }) }, children);
|
|
27
|
-
}
|
|
28
|
-
function DescriptionListEntry(props) {
|
|
29
|
-
return (React.createElement(React.Fragment, null,
|
|
30
|
-
React.createElement("dt", null, props.term),
|
|
31
|
-
React.createElement("dd", null, props.children)));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { DescriptionList, DescriptionListEntry };
|
|
35
|
-
//# sourceMappingURL=DescriptionList.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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} ${theme.spacing.sm}`,\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} ${theme.spacing.xs} 0`,\n border: 0,\n },\n },\n}));\n\nexport interface DescriptionListProps {\n children: React.ReactNode;\n compact?: boolean;\n}\n\nexport function DescriptionList(props: DescriptionListProps): JSX.Element {\n const { children, compact } = props;\n const { classes, cx } = useStyles();\n return <dl className={cx(classes.root, { [classes.compact]: compact })}>{children}</dl>;\n}\n\nexport interface DescriptionListEntryProps {\n term: string;\n children: React.ReactNode;\n}\n\nexport function DescriptionListEntry(props: DescriptionListEntryProps): JSX.Element {\n return (\n <>\n <dt>{props.term}</dt>\n <dd>{props.children}</dd>\n </>\n );\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,MAAM;AACzC,IAAA,IAAI,EAAE;AACJ,QAAA,OA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CAAM;AACrB,QAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,IAAA,EAAK,KAAK,CAAC,QAAQ,CAAM,CACxB,EACH;AACJ;;;;"}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { createStyles, Stack, Title, Group, Text, List } from '@mantine/core';
|
|
2
|
-
import { formatDateTime, capitalize, formatObservationValue } from '@medplum/core';
|
|
3
|
-
import React, { useState, useEffect } from 'react';
|
|
4
|
-
import { CodeableConceptDisplay } from '../CodeableConceptDisplay/CodeableConceptDisplay.mjs';
|
|
5
|
-
import { MedplumLink } from '../MedplumLink/MedplumLink.mjs';
|
|
6
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
7
|
-
import { NoteDisplay } from '../NoteDisplay/NoteDisplay.mjs';
|
|
8
|
-
import { RangeDisplay } from '../RangeDisplay/RangeDisplay.mjs';
|
|
9
|
-
import { ReferenceDisplay } from '../ReferenceDisplay/ReferenceDisplay.mjs';
|
|
10
|
-
import { ResourceBadge } from '../ResourceBadge/ResourceBadge.mjs';
|
|
11
|
-
import { StatusBadge } from '../StatusBadge/StatusBadge.mjs';
|
|
12
|
-
import { useResource } from '../useResource/useResource.mjs';
|
|
13
|
-
|
|
14
|
-
const useStyles = createStyles((theme) => ({
|
|
15
|
-
table: {
|
|
16
|
-
border: `0.1px solid ${theme.colors.gray[5]}`,
|
|
17
|
-
borderCollapse: 'collapse',
|
|
18
|
-
'& td, & th': {
|
|
19
|
-
border: `0.1px solid ${theme.colors.gray[5]}`,
|
|
20
|
-
padding: 4,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
criticalRow: {
|
|
24
|
-
background: theme.colorScheme === 'dark' ? theme.colors.red[7] : theme.colors.red[1],
|
|
25
|
-
border: `0.1px solid ${theme.colors.red[5]}`,
|
|
26
|
-
color: theme.colors.red[5],
|
|
27
|
-
fontWeight: 500,
|
|
28
|
-
'& td': {
|
|
29
|
-
border: `0.1px solid ${theme.colors.red[5]}`,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
noteBody: { fontSize: theme.fontSizes.sm },
|
|
33
|
-
noteCite: { fontSize: theme.fontSizes.xs, marginBlockStart: 3 },
|
|
34
|
-
noteRoot: { padding: 5 },
|
|
35
|
-
}));
|
|
36
|
-
DiagnosticReportDisplay.defaultProps = {
|
|
37
|
-
hideObservationNotes: false,
|
|
38
|
-
hideSpecimenInfo: false,
|
|
39
|
-
};
|
|
40
|
-
function DiagnosticReportDisplay(props) {
|
|
41
|
-
const medplum = useMedplum();
|
|
42
|
-
const diagnosticReport = useResource(props.value);
|
|
43
|
-
const [specimens, setSpecimens] = useState();
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (diagnosticReport?.specimen) {
|
|
46
|
-
Promise.allSettled(diagnosticReport.specimen.map((ref) => medplum.readReference(ref)))
|
|
47
|
-
.then((outcomes) => outcomes
|
|
48
|
-
.filter((outcome) => outcome.status === 'fulfilled')
|
|
49
|
-
.map((outcome) => outcome.value))
|
|
50
|
-
.then(setSpecimens)
|
|
51
|
-
.catch(console.error);
|
|
52
|
-
}
|
|
53
|
-
}, [medplum, diagnosticReport]);
|
|
54
|
-
if (!diagnosticReport) {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
const specimenNotes = specimens?.flatMap((spec) => spec.note || []) || [];
|
|
58
|
-
if (diagnosticReport.presentedForm && diagnosticReport.presentedForm.length > 0) {
|
|
59
|
-
const pf = diagnosticReport.presentedForm[0];
|
|
60
|
-
if (pf.contentType?.startsWith('text/plain') && pf.data) {
|
|
61
|
-
specimenNotes.push({ text: window.atob(pf.data) });
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return (React.createElement(Stack, null,
|
|
65
|
-
React.createElement(Title, null, "Diagnostic Report"),
|
|
66
|
-
React.createElement(DiagnosticReportHeader, { value: diagnosticReport }),
|
|
67
|
-
!props.hideSpecimenInfo && SpecimenInfo(specimens),
|
|
68
|
-
diagnosticReport.result && (React.createElement(ObservationTable, { hideObservationNotes: props.hideObservationNotes, value: diagnosticReport.result })),
|
|
69
|
-
specimenNotes.length > 0 && React.createElement(NoteDisplay, { value: specimenNotes })));
|
|
70
|
-
}
|
|
71
|
-
function DiagnosticReportHeader({ value }) {
|
|
72
|
-
return (React.createElement(Group, { mt: "md", spacing: 30 },
|
|
73
|
-
value.subject && (React.createElement("div", null,
|
|
74
|
-
React.createElement(Text, { size: "xs", transform: "uppercase", color: "dimmed" }, "Subject"),
|
|
75
|
-
React.createElement(Text, null,
|
|
76
|
-
React.createElement(ResourceBadge, { value: value.subject, link: true })))),
|
|
77
|
-
value.resultsInterpreter?.map((interpreter) => (React.createElement("div", { key: interpreter.reference },
|
|
78
|
-
React.createElement(Text, { size: "xs", transform: "uppercase", color: "dimmed" }, "Interpreter"),
|
|
79
|
-
React.createElement(Text, null,
|
|
80
|
-
React.createElement(ResourceBadge, { value: interpreter, link: true }))))),
|
|
81
|
-
value.performer?.map((performer) => (React.createElement("div", { key: performer.reference },
|
|
82
|
-
React.createElement(Text, { size: "xs", transform: "uppercase", color: "dimmed" }, "Performer"),
|
|
83
|
-
React.createElement(Text, null,
|
|
84
|
-
React.createElement(ResourceBadge, { value: performer, link: true }))))),
|
|
85
|
-
value.issued && (React.createElement("div", null,
|
|
86
|
-
React.createElement(Text, { size: "xs", transform: "uppercase", color: "dimmed" }, "Issued"),
|
|
87
|
-
React.createElement(Text, null, formatDateTime(value.issued)))),
|
|
88
|
-
value.status && (React.createElement("div", null,
|
|
89
|
-
React.createElement(Text, { size: "xs", transform: "uppercase", color: "dimmed" }, "Status"),
|
|
90
|
-
React.createElement(Text, null, capitalize(value.status))))));
|
|
91
|
-
}
|
|
92
|
-
function SpecimenInfo(specimens) {
|
|
93
|
-
return (React.createElement(Stack, { spacing: 'xs' },
|
|
94
|
-
React.createElement(Title, { order: 2, size: "h6" }, "Specimens"),
|
|
95
|
-
React.createElement(List, { type: "ordered" }, specimens?.map((specimen, index) => (React.createElement(List.Item, { ml: 'sm', key: `specimen-${specimen.id}-${index}` },
|
|
96
|
-
React.createElement(Group, { spacing: 20 },
|
|
97
|
-
React.createElement(Group, { spacing: 5 },
|
|
98
|
-
React.createElement(Text, { fw: 500 }, "Collected:"),
|
|
99
|
-
" ",
|
|
100
|
-
formatDateTime(specimen.collection?.collectedDateTime)),
|
|
101
|
-
React.createElement(Group, { spacing: 5 },
|
|
102
|
-
React.createElement(Text, { fw: 500 }, "Received:"),
|
|
103
|
-
" ",
|
|
104
|
-
formatDateTime(specimen.receivedTime)))))))));
|
|
105
|
-
}
|
|
106
|
-
function ObservationTable(props) {
|
|
107
|
-
const { classes } = useStyles();
|
|
108
|
-
return (React.createElement("table", { className: classes.table },
|
|
109
|
-
React.createElement("thead", null,
|
|
110
|
-
React.createElement("tr", null,
|
|
111
|
-
React.createElement("th", null, "Test"),
|
|
112
|
-
React.createElement("th", null, "Value"),
|
|
113
|
-
React.createElement("th", null, "Reference Range"),
|
|
114
|
-
React.createElement("th", null, "Interpretation"),
|
|
115
|
-
React.createElement("th", null, "Category"),
|
|
116
|
-
React.createElement("th", null, "Performer"),
|
|
117
|
-
React.createElement("th", null, "Status"))),
|
|
118
|
-
React.createElement("tbody", null, props.value?.map((observation, index) => (React.createElement(ObservationRow, { key: `obs-${observation.id}-${index}`, hideObservationNotes: props.hideObservationNotes, value: observation }))))));
|
|
119
|
-
}
|
|
120
|
-
function ObservationRow(props) {
|
|
121
|
-
const { classes, cx } = useStyles();
|
|
122
|
-
const observation = useResource(props.value);
|
|
123
|
-
if (!observation) {
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
const displayNotes = !props.hideObservationNotes && observation.note;
|
|
127
|
-
const critical = isCritical(observation);
|
|
128
|
-
return (React.createElement(React.Fragment, null,
|
|
129
|
-
React.createElement("tr", { className: cx({ [classes.criticalRow]: critical }) },
|
|
130
|
-
React.createElement("td", { rowSpan: displayNotes ? 2 : 1 },
|
|
131
|
-
React.createElement(MedplumLink, { to: observation },
|
|
132
|
-
React.createElement(CodeableConceptDisplay, { value: observation.code }))),
|
|
133
|
-
React.createElement("td", null,
|
|
134
|
-
React.createElement(ObservationValueDisplay, { value: observation })),
|
|
135
|
-
React.createElement("td", null,
|
|
136
|
-
React.createElement(ReferenceRangeDisplay, { value: observation.referenceRange })),
|
|
137
|
-
React.createElement("td", null, observation.interpretation && observation.interpretation.length > 0 && (React.createElement(CodeableConceptDisplay, { value: observation.interpretation[0] }))),
|
|
138
|
-
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}` },
|
|
139
|
-
React.createElement(CodeableConceptDisplay, { value: concept }))))))),
|
|
140
|
-
React.createElement("td", null, observation.performer?.map((performer) => (React.createElement(ReferenceDisplay, { key: performer.reference, value: performer })))),
|
|
141
|
-
React.createElement("td", null, observation.status && React.createElement(StatusBadge, { status: observation.status }))),
|
|
142
|
-
displayNotes && (React.createElement("tr", null,
|
|
143
|
-
React.createElement("td", { colSpan: 6 },
|
|
144
|
-
React.createElement(NoteDisplay, { value: observation.note }))))));
|
|
145
|
-
}
|
|
146
|
-
function ObservationValueDisplay(props) {
|
|
147
|
-
const obs = props.value;
|
|
148
|
-
return React.createElement(React.Fragment, null, formatObservationValue(obs));
|
|
149
|
-
}
|
|
150
|
-
function ReferenceRangeDisplay(props) {
|
|
151
|
-
const range = props.value && props.value.length > 0 && props.value[0];
|
|
152
|
-
if (!range) {
|
|
153
|
-
return null;
|
|
154
|
-
}
|
|
155
|
-
if (range.text) {
|
|
156
|
-
return React.createElement(React.Fragment, null, range.text);
|
|
157
|
-
}
|
|
158
|
-
return React.createElement(RangeDisplay, { value: range });
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Returns true if the observation is critical.
|
|
162
|
-
* See: https://www.hl7.org/fhir/valueset-observation-interpretation.html
|
|
163
|
-
* @param observation The FHIR observation.
|
|
164
|
-
* @returns True if the FHIR observation is a critical value.
|
|
165
|
-
*/
|
|
166
|
-
function isCritical(observation) {
|
|
167
|
-
const code = observation.interpretation?.[0]?.coding?.[0]?.code;
|
|
168
|
-
return code === 'AA' || code === 'LL' || code === 'HH' || code === 'A';
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export { DiagnosticReportDisplay, ObservationTable };
|
|
172
|
-
//# sourceMappingURL=DiagnosticReportDisplay.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DiagnosticReportDisplay.mjs","sources":["../../../src/DiagnosticReportDisplay/DiagnosticReportDisplay.tsx"],"sourcesContent":["import { createStyles, Group, List, 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 Specimen,\n} from '@medplum/fhirtypes';\nimport React, { useEffect, useState } from 'react';\nimport { CodeableConceptDisplay } from '../CodeableConceptDisplay/CodeableConceptDisplay';\nimport { MedplumLink } from '../MedplumLink/MedplumLink';\nimport { useMedplum } from '../MedplumProvider/MedplumProvider';\nimport { NoteDisplay } from '../NoteDisplay/NoteDisplay';\nimport { RangeDisplay } from '../RangeDisplay/RangeDisplay';\nimport { ReferenceDisplay } from '../ReferenceDisplay/ReferenceDisplay';\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 hideSpecimenInfo?: boolean;\n}\n\nDiagnosticReportDisplay.defaultProps = {\n hideObservationNotes: false,\n hideSpecimenInfo: false,\n} as DiagnosticReportDisplayProps;\n\nexport function DiagnosticReportDisplay(props: DiagnosticReportDisplayProps): JSX.Element | null {\n const medplum = useMedplum();\n const diagnosticReport = useResource(props.value);\n const [specimens, setSpecimens] = useState<Specimen[]>();\n\n useEffect(() => {\n if (diagnosticReport?.specimen) {\n Promise.allSettled(diagnosticReport.specimen.map((ref) => medplum.readReference(ref)))\n .then((outcomes) =>\n outcomes\n .filter((outcome) => outcome.status === 'fulfilled')\n .map((outcome) => (outcome as PromiseFulfilledResult<Specimen>).value)\n )\n .then(setSpecimens)\n .catch(console.error);\n }\n }, [medplum, diagnosticReport]);\n\n if (!diagnosticReport) {\n return null;\n }\n\n const specimenNotes: Annotation[] = specimens?.flatMap((spec) => spec.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 <DiagnosticReportHeader value={diagnosticReport} />\n {!props.hideSpecimenInfo && SpecimenInfo(specimens)}\n {diagnosticReport.result && (\n <ObservationTable hideObservationNotes={props.hideObservationNotes} value={diagnosticReport.result} />\n )}\n {specimenNotes.length > 0 && <NoteDisplay value={specimenNotes} />}\n </Stack>\n );\n}\n\ninterface DiagnosticReportHeaderProps {\n value: DiagnosticReport;\n}\n\nfunction DiagnosticReportHeader({ value }: DiagnosticReportHeaderProps): JSX.Element {\n return (\n <Group mt=\"md\" spacing={30}>\n {value.subject && (\n <div>\n <Text size=\"xs\" transform=\"uppercase\" color=\"dimmed\">\n Subject\n </Text>\n <Text>\n <ResourceBadge value={value.subject} link={true} />\n </Text>\n </div>\n )}\n {value.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 {value.performer?.map((performer) => (\n <div key={performer.reference}>\n <Text size=\"xs\" transform=\"uppercase\" color=\"dimmed\">\n Performer\n </Text>\n <Text>\n <ResourceBadge value={performer} link={true} />\n </Text>\n </div>\n ))}\n {value.issued && (\n <div>\n <Text size=\"xs\" transform=\"uppercase\" color=\"dimmed\">\n Issued\n </Text>\n <Text>{formatDateTime(value.issued)}</Text>\n </div>\n )}\n {value.status && (\n <div>\n <Text size=\"xs\" transform=\"uppercase\" color=\"dimmed\">\n Status\n </Text>\n <Text>{capitalize(value.status)}</Text>\n </div>\n )}\n </Group>\n );\n}\n\nfunction SpecimenInfo(specimens: Specimen[] | undefined): JSX.Element {\n return (\n <Stack spacing={'xs'}>\n <Title order={2} size=\"h6\">\n Specimens\n </Title>\n\n <List type=\"ordered\">\n {specimens?.map((specimen, index) => (\n <List.Item ml={'sm'} key={`specimen-${specimen.id}-${index}`}>\n <Group spacing={20}>\n <Group spacing={5}>\n <Text fw={500}>Collected:</Text> {formatDateTime(specimen.collection?.collectedDateTime)}\n </Group>\n <Group spacing={5}>\n <Text fw={500}>Received:</Text> {formatDateTime(specimen.receivedTime)}\n </Group>\n </Group>\n </List.Item>\n ))}\n </List>\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>Performer</th>\n <th>Status</th>\n </tr>\n </thead>\n <tbody>\n {props.value?.map((observation, index) => (\n <ObservationRow\n key={`obs-${observation.id}-${index}`}\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>\n {observation.performer?.map((performer) => (\n <ReferenceDisplay key={performer.reference} value={performer} />\n ))}\n </td>\n <td>{observation.status && <StatusBadge status={observation.status} />}</td>\n </tr>\n {displayNotes && (\n <tr>\n <td colSpan={6}>\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":";;;;;;;;;;;;;AAsBA,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,KAAK,MAAM;AACzC,IAAA,KAAK,EAAE;QACL,MAAM,EAAE,CAAe,YAAA,EAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAA;AAC7C,QAAA,cAAc,EAAE,UAAU;AAE1B,QAAA,YAAY,EAAE;YACZ,MAAM,EAAE,CAAe,YAAA,EAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAA;AAC7C,YAAA,OAAO,EAAE,CAAC;AACX,SAAA;AACF,KAAA;AAED,IAAA,WAAW,EAAE;QACX,UAAU,EAAE,KAAK,CAAC,WAAW,KAAK,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACpF,MAAM,EAAE,CAAe,YAAA,EAAA,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAA;QAC5C,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1B,QAAA,UAAU,EAAE,GAAG;AAEf,QAAA,MAAM,EAAE;YACN,MAAM,EAAE,CAAe,YAAA,EAAA,KAAK,C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EAAA,KAAK,CAAC,IAAI,CAAI,CAAC;AAC1B,KAAA;AACD,IAAA,OAAO,oBAAC,YAAY,EAAA,EAAC,KAAK,EAAE,KAAK,GAAI,CAAC;AACxC,CAAC;AAED;;;;;AAKG;AACH,SAAS,UAAU,CAAC,WAAwB,EAAA;AAC1C,IAAA,MAAM,IAAI,GAAG,WAAW,CAAC,cAAc,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC;AAChE,IAAA,OAAO,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC;AACzE;;;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Container } from '../Container/Container.mjs';
|
|
3
|
-
import { Panel } from '../Panel/Panel.mjs';
|
|
4
|
-
|
|
5
|
-
function Document(props) {
|
|
6
|
-
const { children, ...others } = props;
|
|
7
|
-
return (React.createElement(Container, null,
|
|
8
|
-
React.createElement(Panel, { ...others }, children)));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { Document };
|
|
12
|
-
//# sourceMappingURL=Document.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,32 +0,0 @@
|
|
|
1
|
-
import { createReference } from '@medplum/core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ResourceTimeline } from '../ResourceTimeline/ResourceTimeline.mjs';
|
|
4
|
-
|
|
5
|
-
function EncounterTimeline(props) {
|
|
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
|
-
]);
|
|
12
|
-
}, createCommunication: (resource, sender, text) => ({
|
|
13
|
-
resourceType: 'Communication',
|
|
14
|
-
status: 'completed',
|
|
15
|
-
encounter: createReference(resource),
|
|
16
|
-
subject: resource.subject,
|
|
17
|
-
sender: createReference(sender),
|
|
18
|
-
sent: new Date().toISOString(),
|
|
19
|
-
payload: [{ contentString: text }],
|
|
20
|
-
}), createMedia: (resource, operator, content) => ({
|
|
21
|
-
resourceType: 'Media',
|
|
22
|
-
status: 'completed',
|
|
23
|
-
encounter: createReference(resource),
|
|
24
|
-
subject: resource.subject,
|
|
25
|
-
operator: createReference(operator),
|
|
26
|
-
issued: new Date().toISOString(),
|
|
27
|
-
content,
|
|
28
|
-
}) }));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { EncounterTimeline };
|
|
32
|
-
//# sourceMappingURL=EncounterTimeline.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,30 +0,0 @@
|
|
|
1
|
-
import { Alert } from '@mantine/core';
|
|
2
|
-
import { normalizeErrorString } from '@medplum/core';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import IconAlertCircle from '../node_modules/@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* ErrorBoundary is a React component that handles errors in its child components.
|
|
8
|
-
* See: https://reactjs.org/docs/error-boundaries.html
|
|
9
|
-
*/
|
|
10
|
-
class ErrorBoundary extends React.Component {
|
|
11
|
-
constructor(props) {
|
|
12
|
-
super(props);
|
|
13
|
-
this.state = {};
|
|
14
|
-
}
|
|
15
|
-
static getDerivedStateFromError(error) {
|
|
16
|
-
return { error };
|
|
17
|
-
}
|
|
18
|
-
componentDidCatch(error, errorInfo) {
|
|
19
|
-
console.error('Uncaught error:', error, errorInfo);
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
if (this.state.error) {
|
|
23
|
-
return (React.createElement(Alert, { icon: React.createElement(IconAlertCircle, { size: 16 }), title: "Something went wrong", color: "red" }, normalizeErrorString(this.state.error)));
|
|
24
|
-
}
|
|
25
|
-
return this.props.children;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { ErrorBoundary };
|
|
30
|
-
//# sourceMappingURL=ErrorBoundary.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import { JsonInput } from '@mantine/core';
|
|
2
|
-
import { stringify } from '@medplum/core';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
function ExtensionInput(props) {
|
|
6
|
-
return (React.createElement(JsonInput, { id: props.name, name: props.name, "data-testid": "extension-input", defaultValue: stringify(props.defaultValue), deserialize: JSON.parse, onChange: (newValue) => {
|
|
7
|
-
if (props.onChange) {
|
|
8
|
-
props.onChange(JSON.parse(newValue));
|
|
9
|
-
}
|
|
10
|
-
} }));
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { ExtensionInput };
|
|
14
|
-
//# sourceMappingURL=ExtensionInput.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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 deserialize={JSON.parse}\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,KAAC,CAAA,aAAA,CAAA,SAAS,EACR,EAAA,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,WAAW,EAAE,IAAI,CAAC,KAAK,EACvB,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,23 +0,0 @@
|
|
|
1
|
-
import { evalFhirPath } from '@medplum/core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ResourcePropertyDisplay } from '../ResourcePropertyDisplay/ResourcePropertyDisplay.mjs';
|
|
4
|
-
|
|
5
|
-
function FhirPathDisplay(props) {
|
|
6
|
-
let value;
|
|
7
|
-
try {
|
|
8
|
-
value = evalFhirPath(props.path, props.resource);
|
|
9
|
-
}
|
|
10
|
-
catch (err) {
|
|
11
|
-
console.warn('FhirPathDisplay:', err);
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
if (value.length > 1) {
|
|
15
|
-
throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. \
|
|
16
|
-
Received ${value.length} elements \
|
|
17
|
-
[${JSON.stringify(value, null, 2)}]`);
|
|
18
|
-
}
|
|
19
|
-
return React.createElement(ResourcePropertyDisplay, { value: value[0] || '', propertyType: props.propertyType });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { FhirPathDisplay };
|
|
23
|
-
//# sourceMappingURL=FhirPathDisplay.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,122 +0,0 @@
|
|
|
1
|
-
import { Loader, Table, Button } from '@mantine/core';
|
|
2
|
-
import { normalizeOperationOutcome } from '@medplum/core';
|
|
3
|
-
import React, { useState, useRef, useEffect } from 'react';
|
|
4
|
-
import { FhirPathDisplay } from '../FhirPathDisplay/FhirPathDisplay.mjs';
|
|
5
|
-
import { useMedplum } from '../MedplumProvider/MedplumProvider.mjs';
|
|
6
|
-
import { SearchClickEvent } from '../SearchControl/SearchControl.mjs';
|
|
7
|
-
import { killEvent, isCheckboxCell } from '../utils/dom.mjs';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The FhirPathTable component represents the embeddable search table control.
|
|
11
|
-
* @param props FhirPathTable React props.
|
|
12
|
-
* @returns FhirPathTable React node.
|
|
13
|
-
*/
|
|
14
|
-
function FhirPathTable(props) {
|
|
15
|
-
const medplum = useMedplum();
|
|
16
|
-
const [schema, setSchema] = useState();
|
|
17
|
-
const [outcome, setOutcome] = useState();
|
|
18
|
-
const { query, fields } = props;
|
|
19
|
-
const [response, setResponse] = useState();
|
|
20
|
-
const [selected, setSelected] = useState({});
|
|
21
|
-
const responseRef = useRef();
|
|
22
|
-
responseRef.current = response;
|
|
23
|
-
const selectedRef = useRef({});
|
|
24
|
-
selectedRef.current = selected;
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
setOutcome(undefined);
|
|
27
|
-
medplum
|
|
28
|
-
.graphql(query)
|
|
29
|
-
.then(setResponse)
|
|
30
|
-
.catch((err) => setOutcome(normalizeOperationOutcome(err)));
|
|
31
|
-
}, [medplum, query]);
|
|
32
|
-
function handleSingleCheckboxClick(e, id) {
|
|
33
|
-
e.stopPropagation();
|
|
34
|
-
const el = e.target;
|
|
35
|
-
const checked = el.checked;
|
|
36
|
-
const newSelected = { ...selectedRef.current };
|
|
37
|
-
if (checked) {
|
|
38
|
-
newSelected[id] = true;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
delete newSelected[id];
|
|
42
|
-
}
|
|
43
|
-
setSelected(newSelected);
|
|
44
|
-
}
|
|
45
|
-
function handleAllCheckboxClick(e) {
|
|
46
|
-
e.stopPropagation();
|
|
47
|
-
const el = e.target;
|
|
48
|
-
const checked = el.checked;
|
|
49
|
-
const newSelected = {};
|
|
50
|
-
const resources = responseRef.current?.data.ResourceList;
|
|
51
|
-
if (checked && resources) {
|
|
52
|
-
resources.forEach((resource) => {
|
|
53
|
-
if (resource.id) {
|
|
54
|
-
newSelected[resource.id] = true;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
setSelected(newSelected);
|
|
59
|
-
}
|
|
60
|
-
function isAllSelected() {
|
|
61
|
-
const resources = responseRef.current?.data.ResourceList;
|
|
62
|
-
if (!resources || resources.length === 0) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
for (const resource of resources) {
|
|
66
|
-
if (resource.id && !selectedRef.current[resource.id]) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
function handleRowClick(e, resource) {
|
|
73
|
-
if (isCheckboxCell(e.target)) {
|
|
74
|
-
// Ignore clicks on checkboxes
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
killEvent(e);
|
|
78
|
-
if (e.button !== 1 && props.onClick) {
|
|
79
|
-
props.onClick(new SearchClickEvent(resource, e));
|
|
80
|
-
}
|
|
81
|
-
if (e.button === 1 && props.onAuxClick) {
|
|
82
|
-
props.onAuxClick(new SearchClickEvent(resource, e));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
medplum
|
|
87
|
-
.requestSchema(props.resourceType)
|
|
88
|
-
.then((newSchema) => {
|
|
89
|
-
// The schema could have the same object identity,
|
|
90
|
-
// so need to use the spread operator to kick React re-render.
|
|
91
|
-
setSchema({ ...newSchema });
|
|
92
|
-
})
|
|
93
|
-
.catch(console.log);
|
|
94
|
-
}, [medplum, props.resourceType]);
|
|
95
|
-
const typeSchema = schema?.types[props.resourceType];
|
|
96
|
-
if (!typeSchema) {
|
|
97
|
-
return React.createElement(Loader, null);
|
|
98
|
-
}
|
|
99
|
-
const checkboxColumn = props.checkboxesEnabled;
|
|
100
|
-
return (React.createElement("div", { onContextMenu: (e) => killEvent(e), "data-testid": "search-control" },
|
|
101
|
-
React.createElement(Table, null,
|
|
102
|
-
React.createElement("thead", null,
|
|
103
|
-
React.createElement("tr", null,
|
|
104
|
-
checkboxColumn && (React.createElement("th", null,
|
|
105
|
-
React.createElement("input", { type: "checkbox", value: "checked", "aria-label": "all-checkbox", "data-testid": "all-checkbox", checked: isAllSelected(), onChange: (e) => handleAllCheckboxClick(e) }))),
|
|
106
|
-
fields.map((field) => (React.createElement("th", { key: field.name }, field.name))))),
|
|
107
|
-
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) },
|
|
108
|
-
checkboxColumn && (React.createElement("td", null,
|
|
109
|
-
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) }))),
|
|
110
|
-
fields.map((field) => {
|
|
111
|
-
return (React.createElement("td", { key: field.name },
|
|
112
|
-
React.createElement(FhirPathDisplay, { propertyType: field.propertyType, path: field.fhirPath, resource: resource })));
|
|
113
|
-
})))))),
|
|
114
|
-
response?.data.ResourceList.length === 0 && React.createElement("div", { "data-testid": "empty-search" }, "No results"),
|
|
115
|
-
outcome && (React.createElement("div", { "data-testid": "search-error" },
|
|
116
|
-
React.createElement("pre", { style: { textAlign: 'left' } }, JSON.stringify(outcome, undefined, 2)))),
|
|
117
|
-
props.onBulk && (React.createElement(Button, { onClick: () => props.onBulk(Object.keys(selectedRef.current)) }, "Bulk..."))));
|
|
118
|
-
}
|
|
119
|
-
const MemoizedFhirPathTable = React.memo(FhirPathTable);
|
|
120
|
-
|
|
121
|
-
export { FhirPathTable, MemoizedFhirPathTable };
|
|
122
|
-
//# sourceMappingURL=FhirPathTable.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FhirPathTable.mjs","sources":["../../../src/FhirPathTable/FhirPathTable.tsx"],"sourcesContent":["import { Button, Loader, Table } from '@mantine/core';\nimport { IndexedStructureDefinition, normalizeOperationOutcome, 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 * @param props FhirPathTable React props.\n * @returns FhirPathTable React node.\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\n .graphql(query)\n .then(setResponse)\n .catch((err) => setOutcome(normalizeOperationOutcome(err)));\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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AExF,CACV,CACG,EACN;AACJ,CAAC;AAEY,MAAA,qBAAqB,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa;;;;"}
|
package/dist/esm/Form/Form.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { parseForm } from './FormUtils.mjs';
|
|
3
|
-
|
|
4
|
-
function Form(props) {
|
|
5
|
-
return (React.createElement("form", { style: props.style, "data-testid": props.testid, onSubmit: (e) => {
|
|
6
|
-
e.preventDefault();
|
|
7
|
-
const formData = parseForm(e.target);
|
|
8
|
-
if (props.onSubmit) {
|
|
9
|
-
props.onSubmit(formData);
|
|
10
|
-
}
|
|
11
|
-
} }, props.children));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { Form };
|
|
15
|
-
//# sourceMappingURL=Form.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;"}
|