@kenyaemr/esm-ward-app 8.5.4-pre.96 → 8.5.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/.turbo/turbo-build.log +5 -5
- package/dist/1033.js +1 -0
- package/dist/1033.js.map +1 -0
- package/dist/1364.js +1 -0
- package/dist/1364.js.map +1 -0
- package/dist/1480.js +1 -0
- package/dist/1480.js.map +1 -0
- package/dist/1613.css +1 -0
- package/dist/1613.css.map +1 -0
- package/dist/1613.js +1 -0
- package/dist/1613.js.map +1 -0
- package/dist/1646.js +1 -0
- package/dist/1646.js.map +1 -0
- package/dist/1744.js +1 -0
- package/dist/1744.js.map +1 -0
- package/dist/1869.js +1 -0
- package/dist/1869.js.map +1 -0
- package/dist/1877.js +1 -0
- package/dist/1877.js.map +1 -0
- package/dist/193.js +1 -0
- package/dist/193.js.map +1 -0
- package/dist/1992.css +1 -0
- package/dist/1992.css.map +1 -0
- package/dist/1992.js +1 -0
- package/dist/1992.js.map +1 -0
- package/dist/2007.js +1 -0
- package/dist/2007.js.map +1 -0
- package/dist/2101.css +1 -0
- package/dist/2101.css.map +1 -0
- package/dist/2101.js +1 -0
- package/dist/2101.js.map +1 -0
- package/dist/2304.js +1 -0
- package/dist/2304.js.map +1 -0
- package/dist/2317.js +1 -0
- package/dist/2317.js.map +1 -0
- package/dist/2326.css +1 -0
- package/dist/2326.css.map +1 -0
- package/dist/2326.js +1 -0
- package/dist/2326.js.map +1 -0
- package/dist/2416.js +1 -0
- package/dist/2416.js.map +1 -0
- package/dist/2446.css +1 -0
- package/dist/2446.css.map +1 -0
- package/dist/2446.js +1 -0
- package/dist/2446.js.map +1 -0
- package/dist/2724.css +1 -0
- package/dist/2724.css.map +1 -0
- package/dist/2724.js +1 -0
- package/dist/2724.js.map +1 -0
- package/dist/2764.js +1 -0
- package/dist/2764.js.map +1 -0
- package/dist/282.js +1 -0
- package/dist/282.js.map +1 -0
- package/dist/2881.js +1 -0
- package/dist/2881.js.map +1 -0
- package/dist/297.js +1 -0
- package/dist/297.js.map +1 -0
- package/dist/2988.js +1 -0
- package/dist/2988.js.map +1 -0
- package/dist/3012.css +1 -0
- package/dist/3012.css.map +1 -0
- package/dist/3012.js +43 -0
- package/dist/3012.js.map +1 -0
- package/dist/3253.css +1 -0
- package/dist/3253.css.map +1 -0
- package/dist/3253.js +1 -0
- package/dist/3253.js.map +1 -0
- package/dist/3276.css +1 -0
- package/dist/3276.css.map +1 -0
- package/dist/3276.js +1 -0
- package/dist/3276.js.map +1 -0
- package/dist/3378.js +1 -0
- package/dist/3378.js.map +1 -0
- package/dist/3428.css +1 -0
- package/dist/3428.css.map +1 -0
- package/dist/3428.js +1 -0
- package/dist/3428.js.map +1 -0
- package/dist/3446.css +1 -0
- package/dist/3446.css.map +1 -0
- package/dist/3446.js +1 -0
- package/dist/3446.js.map +1 -0
- package/dist/3720.js +1 -0
- package/dist/3720.js.map +1 -0
- package/dist/3824.js +1 -0
- package/dist/3824.js.map +1 -0
- package/dist/3877.js +1 -0
- package/dist/3877.js.map +1 -0
- package/dist/3963.js +1 -0
- package/dist/3963.js.map +1 -0
- package/dist/3989.js +1 -0
- package/dist/3989.js.map +1 -0
- package/dist/4106.js +1 -0
- package/dist/4106.js.map +1 -0
- package/dist/4111.js +1 -0
- package/dist/4111.js.map +1 -0
- package/dist/4145.js +1 -0
- package/dist/4145.js.map +1 -0
- package/dist/4162.js +1 -0
- package/dist/4162.js.map +1 -0
- package/dist/4266.css +1 -0
- package/dist/4266.css.map +1 -0
- package/dist/4266.js +1 -0
- package/dist/4266.js.map +1 -0
- package/dist/4304.js +1 -0
- package/dist/4304.js.map +1 -0
- package/dist/434.js +1 -0
- package/dist/434.js.map +1 -0
- package/dist/4348.js +1 -0
- package/dist/4348.js.map +1 -0
- package/dist/4383.js +1 -0
- package/dist/4383.js.map +1 -0
- package/dist/4658.js +1 -0
- package/dist/4658.js.map +1 -0
- package/dist/466.js +1 -0
- package/dist/466.js.map +1 -0
- package/dist/4777.js +1 -0
- package/dist/4777.js.map +1 -0
- package/dist/4847.css +1 -0
- package/dist/4847.css.map +1 -0
- package/dist/4847.js +1 -0
- package/dist/4847.js.map +1 -0
- package/dist/4883.css +1 -0
- package/dist/4883.css.map +1 -0
- package/dist/4883.js +1 -0
- package/dist/4883.js.map +1 -0
- package/dist/502.js +1 -0
- package/dist/502.js.map +1 -0
- package/dist/5050.css +1 -0
- package/dist/5050.css.map +1 -0
- package/dist/5050.js +1 -0
- package/dist/5050.js.map +1 -0
- package/dist/5060.css +1 -0
- package/dist/5060.css.map +1 -0
- package/dist/5060.js +1 -0
- package/dist/5060.js.map +1 -0
- package/dist/5117.js +1 -0
- package/dist/5117.js.map +1 -0
- package/dist/5132.js +1 -0
- package/dist/5132.js.map +1 -0
- package/dist/5145.js +1 -0
- package/dist/5145.js.map +1 -0
- package/dist/5181.js +1 -0
- package/dist/5181.js.map +1 -0
- package/dist/5460.css +1 -0
- package/dist/5460.css.map +1 -0
- package/dist/5460.js +1 -0
- package/dist/5460.js.map +1 -0
- package/dist/5493.css +1 -0
- package/dist/5493.css.map +1 -0
- package/dist/5493.js +1 -0
- package/dist/5493.js.map +1 -0
- package/dist/5503.js +1 -0
- package/dist/5503.js.map +1 -0
- package/dist/5576.js +1 -0
- package/dist/5576.js.map +1 -0
- package/dist/5591.css +1 -0
- package/dist/5591.css.map +1 -0
- package/dist/5591.js +1 -0
- package/dist/5591.js.map +1 -0
- package/dist/5644.js +1 -0
- package/dist/5644.js.map +1 -0
- package/dist/5650.js +1 -0
- package/dist/5650.js.map +1 -0
- package/dist/5697.js +1 -0
- package/dist/5697.js.map +1 -0
- package/dist/5862.css +1 -0
- package/dist/5862.css.map +1 -0
- package/dist/5862.js +1 -0
- package/dist/5862.js.map +1 -0
- package/dist/5940.js +1 -0
- package/dist/5940.js.map +1 -0
- package/dist/5976.js +1 -0
- package/dist/5976.js.map +1 -0
- package/dist/6047.js +1 -0
- package/dist/6047.js.map +1 -0
- package/dist/6079.css +1 -0
- package/dist/6079.css.map +1 -0
- package/dist/6079.js +1 -0
- package/dist/6079.js.map +1 -0
- package/dist/6126.js +1 -0
- package/dist/6126.js.map +1 -0
- package/dist/6196.js +1 -0
- package/dist/6196.js.map +1 -0
- package/dist/6358.js +1 -0
- package/dist/6358.js.map +1 -0
- package/dist/636.js +1 -0
- package/dist/636.js.map +1 -0
- package/dist/6371.js +1 -0
- package/dist/6371.js.map +1 -0
- package/dist/6377.js +1 -0
- package/dist/6377.js.map +1 -0
- package/dist/6380.css +1 -0
- package/dist/6380.css.map +1 -0
- package/dist/6380.js +1 -0
- package/dist/6380.js.map +1 -0
- package/dist/6444.js +1 -0
- package/dist/6444.js.map +1 -0
- package/dist/6482.css +1 -0
- package/dist/6482.css.map +1 -0
- package/dist/6482.js +1 -0
- package/dist/6482.js.map +1 -0
- package/dist/6508.js +1 -0
- package/dist/6508.js.map +1 -0
- package/dist/6703.css +1 -0
- package/dist/6703.css.map +1 -0
- package/dist/6703.js +1 -0
- package/dist/6703.js.map +1 -0
- package/dist/6724.js +1 -0
- package/dist/6724.js.map +1 -0
- package/dist/689.js +1 -0
- package/dist/689.js.map +1 -0
- package/dist/6904.js +1 -0
- package/dist/6904.js.map +1 -0
- package/dist/7045.js +1 -0
- package/dist/7045.js.map +1 -0
- package/dist/7175.js +1 -0
- package/dist/7175.js.map +1 -0
- package/dist/7240.css +1 -0
- package/dist/7240.css.map +1 -0
- package/dist/7240.js +1 -0
- package/dist/7240.js.map +1 -0
- package/dist/7683.js +1 -0
- package/dist/7683.js.map +1 -0
- package/dist/7742.js +1 -0
- package/dist/7742.js.map +1 -0
- package/dist/7849.js +1 -0
- package/dist/7849.js.map +1 -0
- package/dist/7891.css +1 -0
- package/dist/7891.css.map +1 -0
- package/dist/7891.js +1 -0
- package/dist/7891.js.map +1 -0
- package/dist/7912.js +1 -0
- package/dist/7912.js.map +1 -0
- package/dist/7984.js +1 -0
- package/dist/7984.js.map +1 -0
- package/dist/8202.js +20 -0
- package/dist/8202.js.map +1 -0
- package/dist/8302.css +1 -0
- package/dist/8302.css.map +1 -0
- package/dist/8302.js +1 -0
- package/dist/8302.js.map +1 -0
- package/dist/8358.js +1 -0
- package/dist/8358.js.map +1 -0
- package/dist/8359.js +1 -0
- package/dist/8359.js.map +1 -0
- package/dist/8448.css +1 -0
- package/dist/8448.css.map +1 -0
- package/dist/8448.js +1 -0
- package/dist/8448.js.map +1 -0
- package/dist/8502.js +1 -0
- package/dist/8502.js.map +1 -0
- package/dist/8695.js +1 -0
- package/dist/8695.js.map +1 -0
- package/dist/8923.css +1 -0
- package/dist/8923.css.map +1 -0
- package/dist/8923.js +24 -0
- package/dist/8923.js.map +1 -0
- package/dist/8990.js +1 -0
- package/dist/8990.js.map +1 -0
- package/dist/9011.js +1 -0
- package/dist/9011.js.map +1 -0
- package/dist/903.js +1 -0
- package/dist/903.js.map +1 -0
- package/dist/9049.js +1 -0
- package/dist/9049.js.map +1 -0
- package/dist/9061.js +1 -0
- package/dist/9061.js.map +1 -0
- package/dist/9072.js +1 -0
- package/dist/9072.js.map +1 -0
- package/dist/9080.css +1 -0
- package/dist/9080.css.map +1 -0
- package/dist/9080.js +1 -0
- package/dist/9080.js.map +1 -0
- package/dist/9124.css +1 -0
- package/dist/9124.css.map +1 -0
- package/dist/9124.js +1 -0
- package/dist/9124.js.map +1 -0
- package/dist/9143.js +1 -0
- package/dist/9143.js.map +1 -0
- package/dist/9301.js +1 -0
- package/dist/9301.js.map +1 -0
- package/dist/9309.css +1 -0
- package/dist/9309.css.map +1 -0
- package/dist/9427.js +1 -0
- package/dist/9427.js.map +1 -0
- package/dist/9456.css +1 -0
- package/dist/9456.css.map +1 -0
- package/dist/9456.js +1 -0
- package/dist/9456.js.map +1 -0
- package/dist/9712.js +1 -0
- package/dist/9712.js.map +1 -0
- package/dist/9771.js +1 -0
- package/dist/9771.js.map +1 -0
- package/dist/9806.js +1 -0
- package/dist/9806.js.map +1 -0
- package/dist/9875.css +1 -0
- package/dist/9875.css.map +1 -0
- package/dist/9875.js +60 -0
- package/dist/9875.js.map +1 -0
- package/dist/9926.css +1 -0
- package/dist/9926.css.map +1 -0
- package/dist/9926.js +1 -0
- package/dist/9926.js.map +1 -0
- package/dist/9976.css +1 -0
- package/dist/9976.css.map +1 -0
- package/dist/9976.js +1 -0
- package/dist/9976.js.map +1 -0
- package/dist/kenyaemr-esm-ward-app.js +3 -5
- package/dist/kenyaemr-esm-ward-app.js.buildmanifest.json +1137 -943
- package/dist/kenyaemr-esm-ward-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +5 -4
- package/rspack.config.js +3 -1
- package/src/autosuggest/autosuggest.component.tsx +203 -0
- package/src/autosuggest/autosuggest.scss +75 -0
- package/src/autosuggest/patient-search-info.component.tsx +40 -0
- package/src/autosuggest/patient-search-info.scss +37 -0
- package/src/autosuggest/search-empty-state.component.tsx +27 -0
- package/src/autosuggest/search-empty-state.scss +18 -0
- package/src/billing/create-bill.resource.ts +147 -0
- package/src/billing/create-bill.scss +122 -0
- package/src/billing/create-bill.workspace.tsx +468 -0
- package/src/config-schema.ts +224 -5
- package/src/declarations.d.ts +1 -0
- package/src/discharge-printouts/discharge-printout.preview-modal.scss +21 -0
- package/src/discharge-printouts/discharge-printout.preview-modal.tsx +67 -21
- package/src/discharge-printouts/discharge-printout.resource.ts +100 -45
- package/src/discharge-printouts/discharge-printouts.scss +9 -1
- package/src/discharge-printouts/discharge-summary.tsx +76 -50
- package/src/discharge-printouts/investigations-and-procedures.scss +48 -0
- package/src/discharge-printouts/investigrations-and-procedures.components.tsx +134 -0
- package/src/discharge-printouts/lab-results.tsx +1 -2
- package/src/discharge-printouts/use-print-preview.ts +35 -0
- package/src/hooks/critical-care-ward.utils.ts +136 -0
- package/src/hooks/use-patient-summary.tsx +101 -0
- package/src/hooks/useCriticalCareWardTab.ts +94 -0
- package/src/hooks/useEbolaIsolationSuspects.test.ts +24 -0
- package/src/hooks/useEbolaIsolationSuspects.ts +51 -0
- package/src/hooks/useFacilityRegistry.ts +32 -0
- package/src/hooks/useIpdDischargeEncounter.ts +3 -0
- package/src/hooks/useIsIsolationWard.ts +51 -0
- package/src/hooks/useSelectableWards.ts +72 -0
- package/src/hooks/useSummaryMetrics.ts +14 -4
- package/src/hooks/useWardPatientGrouping.ts +4 -4
- package/src/in-patient/admission-request.component.tsx +1 -1
- package/src/in-patient/bloodTransfusion/blood-transfusion-dashboard.component.tsx +15 -0
- package/src/in-patient/bloodTransfusion/components/blood-transfusion-chart.component.tsx +635 -0
- package/src/in-patient/bloodTransfusion/components/blood-transfusion-form.component.tsx +849 -0
- package/src/in-patient/bloodTransfusion/components/blood-transfusion.scss +741 -0
- package/src/in-patient/bloodTransfusion/components/provider-search.component.tsx +111 -0
- package/src/in-patient/bloodTransfusion/components/provider-search.scss +49 -0
- package/src/in-patient/bloodTransfusion/components/transfusion-time-picker.component.tsx +231 -0
- package/src/in-patient/bloodTransfusion/components/transfusion-time-picker.scss +142 -0
- package/src/in-patient/bloodTransfusion/config/blood-transfusion.defaults.ts +164 -0
- package/src/in-patient/bloodTransfusion/resources/blood-transfusion.resource.ts +238 -0
- package/src/in-patient/bloodTransfusion/resources/openmrs-encounter-search.ts +41 -0
- package/src/in-patient/bloodTransfusion/resources/provider.resource.ts +30 -0
- package/src/in-patient/bloodTransfusion/resources/resolve-encounter-type.ts +135 -0
- package/src/in-patient/bloodTransfusion/types/blood-transfusion.types.ts +90 -0
- package/src/in-patient/bloodTransfusion/utils/blood-transfusion-obs.mapper.ts +404 -0
- package/src/in-patient/bloodTransfusion/utils/blood-transfusion.utils.ts +356 -0
- package/src/in-patient/bloodTransfusion/utils/encounter-datetime.utils.ts +27 -0
- package/src/in-patient/bloodTransfusion/utils/openmrs-concept-metadata.ts +512 -0
- package/src/in-patient/bloodTransfusion/utils/openmrs-concept.utils.ts +41 -0
- package/src/in-patient/bloodTransfusion/utils/openmrs-error.utils.ts +79 -0
- package/src/in-patient/bloodTransfusion/utils/timezone.utils.ts +159 -0
- package/src/in-patient/bloodTransfusion/utils/variant-class.utils.ts +11 -0
- package/src/in-patient/ebola/case-followup-day-picker.component.tsx +217 -0
- package/src/in-patient/ebola/case-followup.component.test.tsx +373 -0
- package/src/in-patient/ebola/case-followup.component.tsx +569 -0
- package/src/in-patient/ebola/case-followup.resource.test.ts +205 -0
- package/src/in-patient/ebola/case-followup.resource.ts +509 -0
- package/src/in-patient/ebola/case-followup.scss +506 -0
- package/src/in-patient/ebola/case-followup.utils.test.ts +414 -0
- package/src/in-patient/ebola/case-followup.utils.ts +725 -0
- package/src/in-patient/ebola/case-identification-finding/case-identification-finding.component.test.tsx +88 -0
- package/src/in-patient/ebola/case-identification-finding/case-identification-finding.component.tsx +208 -0
- package/src/in-patient/ebola/case-identification-finding/case-identification-finding.resource.ts +32 -0
- package/src/in-patient/ebola/case-identification-finding/case-identification-finding.scss +39 -0
- package/src/in-patient/ebola/contact-list/add-contact-form.workspace.tsx +465 -0
- package/src/in-patient/ebola/contact-list/adresshierarchy.component.tsx +32 -0
- package/src/in-patient/ebola/contact-list/contact-list-form.scss +29 -0
- package/src/in-patient/ebola/contact-list/contact-list.resource.tsx +371 -0
- package/src/in-patient/ebola/contact-list/contact-list.types.ts +41 -0
- package/src/in-patient/ebola/contact-list/contact-listing.component.tsx +179 -0
- package/src/in-patient/ebola/contact-list/contact-listing.scss +15 -0
- package/src/in-patient/ebola/contact-list/contact-tracing-history.component.tsx +159 -0
- package/src/in-patient/ebola/contact-list/contact-tracing.resource.tsx +125 -0
- package/src/in-patient/ebola/contact-list/relationship-type.component.tsx +31 -0
- package/src/in-patient/ebola/contact-list/use-contact-mapping.ts +247 -0
- package/src/in-patient/ebola/index.ts +20 -0
- package/src/in-patient/in-patient.resource.tsx +0 -32
- package/src/in-patient/inpatient-detail-view.component.tsx +20 -5
- package/src/in-patient/inpatient-forms.component.tsx +2 -2
- package/src/in-patient/inpatient-tabs.component.tsx +29 -79
- package/src/in-patient/inpatient.scss +5 -0
- package/src/in-patient/labourCareGuide/alert-rules.ts +4 -5
- package/src/in-patient/labourCareGuide/components/summary-of-labour-section.component.tsx +408 -0
- package/src/in-patient/labourCareGuide/constants/admission-form.constants.ts +3 -0
- package/src/in-patient/labourCareGuide/constants/summary-of-labour.constants.ts +102 -0
- package/src/in-patient/labourCareGuide/forms/admission-details-form.component.tsx +58 -7
- package/src/in-patient/labourCareGuide/forms/baby-form.component.tsx +18 -3
- package/src/in-patient/labourCareGuide/forms/index.ts +1 -0
- package/src/in-patient/labourCareGuide/forms/labour-care-guide-forms.component.tsx +54 -1
- package/src/in-patient/labourCareGuide/forms/lcg-session-correction-wizard.component.tsx +122 -75
- package/src/in-patient/labourCareGuide/forms/shared-decision-making-form.component.tsx +229 -227
- package/src/in-patient/labourCareGuide/forms/summary-of-labour-form.component.tsx +887 -0
- package/src/in-patient/labourCareGuide/forms/time-picker-dropdown.component.tsx +47 -62
- package/src/in-patient/labourCareGuide/forms/time-picker-dropdown.scss +3 -2
- package/src/in-patient/labourCareGuide/forms/vital-range-limits.test.tsx +140 -0
- package/src/in-patient/labourCareGuide/forms/woman-form.component.tsx +23 -3
- package/src/in-patient/labourCareGuide/graphs/baby.component.tsx +1 -1
- package/src/in-patient/labourCareGuide/hooks/use-lcg-data.ts +47 -2
- package/src/in-patient/labourCareGuide/labour-care-guide-header.component.tsx +17 -3
- package/src/in-patient/labourCareGuide/labour-care-guide.component.tsx +378 -59
- package/src/in-patient/labourCareGuide/labour-care-guide.scss +209 -0
- package/src/in-patient/labourCareGuide/maternity-inpatient-form.workspace.tsx +75 -0
- package/src/in-patient/labourCareGuide/partography-data-form.scss +121 -40
- package/src/in-patient/labourCareGuide/partography.resource.ts +21 -88
- package/src/in-patient/labourCareGuide/resources/admission-details.resource.ts +10 -10
- package/src/in-patient/labourCareGuide/resources/baby.resource.ts +35 -12
- package/src/in-patient/labourCareGuide/resources/labour-progress.resource.ts +9 -6
- package/src/in-patient/labourCareGuide/resources/labour-time-set-select-setup.resource.ts +7 -6
- package/src/in-patient/labourCareGuide/resources/lcg-encounter-fetch.ts +98 -0
- package/src/in-patient/labourCareGuide/resources/lcg-session-correction.resource.ts +24 -13
- package/src/in-patient/labourCareGuide/resources/medication.resource.ts +6 -5
- package/src/in-patient/labourCareGuide/resources/shared-decision-making.resource.ts +6 -4
- package/src/in-patient/labourCareGuide/resources/summary-of-labour.resource.ts +472 -0
- package/src/in-patient/labourCareGuide/resources/supportive-care.resource.ts +13 -9
- package/src/in-patient/labourCareGuide/summary-of-labour-prefill.utils.ts +436 -0
- package/src/in-patient/labourCareGuide/time-slot-utils.ts +33 -4
- package/src/in-patient/labourCareGuide/types/concept-uuids.constants.ts +1 -0
- package/src/in-patient/labourCareGuide/types/index.ts +21 -6
- package/src/in-patient/partograph.component.tsx +1 -13
- package/src/in-patient/time-ago.ts +34 -0
- package/src/in-patient/treatmentChart/nursing-cardex-plan.resource.ts +111 -20
- package/src/in-patient/treatmentChart/nursing-cardex-plan.workspace.scss +30 -0
- package/src/in-patient/treatmentChart/nursing-cardex-plan.workspace.tsx +223 -25
- package/src/in-patient/treatmentChart/nursing-treatment-sheet.resource.ts +90 -0
- package/src/in-patient/treatmentChart/nursing-treatment-sheet.utils.test.ts +272 -0
- package/src/in-patient/treatmentChart/nursing-treatment-sheet.utils.ts +169 -0
- package/src/in-patient/treatmentChart/use-nursing-cardex-form-schema.ts +2 -14
- package/src/index.ts +17 -0
- package/src/routes.json +78 -2
- package/src/types/index.ts +3 -3
- package/src/ward-patients/admitted-patients.tsx +61 -56
- package/src/ward-patients/awaiting-admission-patients.tsx +70 -52
- package/src/ward-patients/discharge-in-patients.tsx +102 -48
- package/src/ward-patients/discharge-patient-action.component.tsx +80 -0
- package/src/ward-patients/discharge-patients.tsx +73 -62
- package/src/ward-patients/ebola-awaiting-admission-patients.tsx +213 -0
- package/src/ward-patients/patient-cells.scss +13 -0
- package/src/ward-patients/patient-cells.tsx +75 -19
- package/src/ward-patients/table-state-components.tsx +48 -3
- package/src/ward-patients/unassigned-patient.scss +9 -0
- package/src/ward-patients/unassigned-patients.tsx +215 -0
- package/src/ward-patients/ward-patient.scss +121 -15
- package/src/ward-patients/ward-patients-slots.ts +12 -0
- package/src/ward-patients/ward-patients-table.test.tsx +65 -17
- package/src/ward-patients/ward-patients-table.tsx +90 -23
- package/src/ward-view/_ward-theme.scss +16 -0
- package/src/ward-view/default-ward/default-ward-view.component.tsx +40 -8
- package/src/ward-view/linelist-wards/Filters.tsx +27 -13
- package/src/ward-view/linelist-wards/Header.tsx +28 -14
- package/src/ward-view/linelist-wards/Metrics.tsx +52 -11
- package/src/ward-view/linelist-wards/linelist-wards.scss +169 -17
- package/src/ward-view/materal-ward/ward-switch.scss +66 -0
- package/src/ward-view/ward-switch.modal.tsx +74 -35
- package/src/ward-view/ward-view-content-wrapper.tsx +46 -18
- package/src/ward-view/ward-view-ui.store.ts +53 -0
- package/src/ward-view/ward-view.resource.ts +5 -5
- package/src/ward-view/ward-view.scss +96 -8
- package/src/ward-workspace/admission-request-workspace/admission-requests-workspace.test.tsx +3 -1
- package/src/ward-workspace/admit-patient-button.component.tsx +24 -2
- package/src/ward-workspace/admit-patient-button.test.tsx +131 -0
- package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.test.tsx +34 -0
- package/src/ward-workspace/admit-patient-form-workspace/admit-patient-form.workspace.tsx +7 -187
- package/src/ward-workspace/admit-patient-form-workspace/facility-bed-capacity-notification.component.tsx +41 -0
- package/src/ward-workspace/admit-patient-form-workspace/patient-admission.resources.ts +0 -49
- package/src/ward-workspace/create-admission-encounter/create-admission-encounter.test.tsx +3 -1
- package/src/ward-workspace/kenya-emr-patient-discharge/patient-discharge.resource.tsx +25 -23
- package/src/ward-workspace/kenya-emr-patient-discharge/patient-discharge.workspace.tsx +24 -10
- package/translations/am.json +7 -1
- package/translations/en.json +223 -25
- package/translations/fr.json +169 -26
- package/translations/sw.json +7 -1
- package/dist/1084.js +0 -1
- package/dist/1084.js.map +0 -1
- package/dist/1189.js +0 -1
- package/dist/1189.js.map +0 -1
- package/dist/12.js +0 -17
- package/dist/12.js.map +0 -1
- package/dist/126.js +0 -1
- package/dist/1308.js +0 -1
- package/dist/1308.js.map +0 -1
- package/dist/1374.js +0 -1
- package/dist/1374.js.map +0 -1
- package/dist/1387.js +0 -1
- package/dist/1387.js.map +0 -1
- package/dist/15.js +0 -1
- package/dist/1564.js +0 -1
- package/dist/1567.js +0 -1
- package/dist/1567.js.map +0 -1
- package/dist/1739.js +0 -1
- package/dist/1739.js.map +0 -1
- package/dist/1845.js +0 -1
- package/dist/1972.js +0 -1
- package/dist/1972.js.map +0 -1
- package/dist/2016.js +0 -1
- package/dist/2016.js.map +0 -1
- package/dist/2117.js +0 -1
- package/dist/2117.js.map +0 -1
- package/dist/215.js +0 -1
- package/dist/2178.js +0 -1
- package/dist/239.js +0 -1
- package/dist/239.js.map +0 -1
- package/dist/2486.js +0 -1
- package/dist/2486.js.map +0 -1
- package/dist/2512.js +0 -1
- package/dist/2512.js.map +0 -1
- package/dist/2566.js +0 -1
- package/dist/2710.js +0 -1
- package/dist/2710.js.map +0 -1
- package/dist/2759.js +0 -1
- package/dist/2823.js +0 -15
- package/dist/2823.js.map +0 -1
- package/dist/3089.js +0 -1
- package/dist/3089.js.map +0 -1
- package/dist/3230.js +0 -1
- package/dist/3261.js +0 -1
- package/dist/3261.js.map +0 -1
- package/dist/3321.js +0 -1
- package/dist/3321.js.map +0 -1
- package/dist/3350.js +0 -1
- package/dist/3399.js +0 -1
- package/dist/3399.js.map +0 -1
- package/dist/3441.js +0 -1
- package/dist/3547.js +0 -1
- package/dist/3547.js.map +0 -1
- package/dist/3548.js +0 -1
- package/dist/3548.js.map +0 -1
- package/dist/3565.js +0 -1
- package/dist/3571.js +0 -1
- package/dist/3571.js.map +0 -1
- package/dist/364.js +0 -1
- package/dist/364.js.map +0 -1
- package/dist/3746.js +0 -1
- package/dist/3837.js +0 -1
- package/dist/3837.js.map +0 -1
- package/dist/3925.js +0 -1
- package/dist/3946.js +0 -1
- package/dist/400.js +0 -1
- package/dist/400.js.map +0 -1
- package/dist/401.js +0 -1
- package/dist/401.js.map +0 -1
- package/dist/4206.js +0 -1
- package/dist/4206.js.map +0 -1
- package/dist/4480.js +0 -1
- package/dist/4480.js.map +0 -1
- package/dist/4635.js +0 -1
- package/dist/4635.js.map +0 -1
- package/dist/4684.js +0 -1
- package/dist/4684.js.map +0 -1
- package/dist/4735.js +0 -1
- package/dist/4735.js.map +0 -1
- package/dist/4744.js +0 -1
- package/dist/4744.js.map +0 -1
- package/dist/4894.js +0 -1
- package/dist/4970.js +0 -1
- package/dist/4970.js.map +0 -1
- package/dist/5069.js +0 -1
- package/dist/5069.js.map +0 -1
- package/dist/5090.js +0 -1
- package/dist/5090.js.map +0 -1
- package/dist/5130.js +0 -1
- package/dist/5187.js +0 -1
- package/dist/5411.js +0 -1
- package/dist/5411.js.map +0 -1
- package/dist/5441.js +0 -1
- package/dist/5441.js.map +0 -1
- package/dist/5463.js +0 -1
- package/dist/5463.js.map +0 -1
- package/dist/5491.js +0 -1
- package/dist/5491.js.map +0 -1
- package/dist/5496.js +0 -1
- package/dist/5496.js.map +0 -1
- package/dist/5595.js +0 -1
- package/dist/5659.js +0 -1
- package/dist/5659.js.map +0 -1
- package/dist/5706.js +0 -1
- package/dist/5706.js.map +0 -1
- package/dist/5930.js +0 -1
- package/dist/5930.js.map +0 -1
- package/dist/5961.js +0 -1
- package/dist/6061.js +0 -1
- package/dist/6061.js.map +0 -1
- package/dist/6133.js +0 -1
- package/dist/6180.js +0 -1
- package/dist/6180.js.map +0 -1
- package/dist/6296.js +0 -1
- package/dist/6296.js.map +0 -1
- package/dist/6322.js +0 -1
- package/dist/6322.js.map +0 -1
- package/dist/6455.js +0 -1
- package/dist/6455.js.map +0 -1
- package/dist/6456.js +0 -1
- package/dist/6466.js +0 -1
- package/dist/6613.js +0 -1
- package/dist/6783.js +0 -1
- package/dist/6925.js +0 -1
- package/dist/6925.js.map +0 -1
- package/dist/7091.js +0 -1
- package/dist/7091.js.map +0 -1
- package/dist/7263.js +0 -1
- package/dist/7263.js.map +0 -1
- package/dist/7348.js +0 -1
- package/dist/7431.js +0 -1
- package/dist/7431.js.map +0 -1
- package/dist/7543.js +0 -1
- package/dist/7607.js +0 -1
- package/dist/772.js +0 -1
- package/dist/775.js +0 -1
- package/dist/775.js.map +0 -1
- package/dist/7783.js +0 -1
- package/dist/7783.js.map +0 -1
- package/dist/7844.js +0 -1
- package/dist/7844.js.map +0 -1
- package/dist/7965.js +0 -1
- package/dist/7965.js.map +0 -1
- package/dist/8171.js +0 -1
- package/dist/8171.js.map +0 -1
- package/dist/8488.js +0 -1
- package/dist/8488.js.map +0 -1
- package/dist/8660.js +0 -1
- package/dist/8660.js.map +0 -1
- package/dist/8727.js +0 -1
- package/dist/8736.js +0 -1
- package/dist/8736.js.map +0 -1
- package/dist/8847.js +0 -1
- package/dist/9009.js +0 -1
- package/dist/9009.js.map +0 -1
- package/dist/9015.js +0 -1
- package/dist/906.js +0 -1
- package/dist/9065.js +0 -1
- package/dist/9182.js +0 -1
- package/dist/9314.js +0 -1
- package/dist/9314.js.map +0 -1
- package/dist/9339.js +0 -1
- package/dist/9361.js +0 -1
- package/dist/9361.js.map +0 -1
- package/dist/9453.js +0 -1
- package/dist/9535.js +0 -22
- package/dist/9535.js.map +0 -1
- package/dist/9610.js +0 -1
- package/dist/9610.js.map +0 -1
- package/dist/9668.js +0 -1
- package/dist/9668.js.map +0 -1
- package/dist/9727.js +0 -1
- package/dist/9727.js.map +0 -1
- package/dist/9734.js +0 -1
- package/dist/9734.js.map +0 -1
- package/dist/9833.js +0 -1
- package/dist/9833.js.map +0 -1
- package/dist/9848.js +0 -1
- package/dist/9848.js.map +0 -1
- package/dist/9876.js +0 -1
- package/dist/9876.js.map +0 -1
- package/dist/9920.js +0 -1
- package/dist/9938.js +0 -1
- package/dist/main.js +0 -5
- package/dist/main.js.map +0 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import useSWR from 'swr';
|
|
2
|
+
import { openmrsFetch, restBaseUrl, type Visit } from '@openmrs/esm-framework';
|
|
3
|
+
|
|
4
|
+
export interface VitalItem {
|
|
5
|
+
value: number | string | null;
|
|
6
|
+
unit: string;
|
|
7
|
+
interpretation: { system: string; code: string; display: string } | null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface VisitSummary {
|
|
11
|
+
visitUuid: string;
|
|
12
|
+
visitDate: string;
|
|
13
|
+
visitStopDate: string;
|
|
14
|
+
visitType: string;
|
|
15
|
+
location: string;
|
|
16
|
+
vitals: {
|
|
17
|
+
weight: VitalItem;
|
|
18
|
+
height: VitalItem;
|
|
19
|
+
temperature: VitalItem;
|
|
20
|
+
pulse: VitalItem;
|
|
21
|
+
bpSystolic: VitalItem;
|
|
22
|
+
bpDiastolic: VitalItem;
|
|
23
|
+
bloodPressure: VitalItem;
|
|
24
|
+
respiratoryRate: VitalItem;
|
|
25
|
+
oxygenSaturation: VitalItem;
|
|
26
|
+
muac: VitalItem;
|
|
27
|
+
};
|
|
28
|
+
complaints: Array<{ duration: string; complaint: string; onsetStatus: string }>;
|
|
29
|
+
conditions: Array<{ name: string; onsetDate: string; status: string }>;
|
|
30
|
+
allergies: Array<{ allergen: string; allergenType: string; severity: string; reactions: string[] }>;
|
|
31
|
+
diagnoses: Array<{ diagnosis: string; certainty: string; rank: number; date: string }>;
|
|
32
|
+
medications: Array<{
|
|
33
|
+
drug: string;
|
|
34
|
+
dose: string;
|
|
35
|
+
frequency: string;
|
|
36
|
+
duration: string;
|
|
37
|
+
route: string;
|
|
38
|
+
dateActivated: string;
|
|
39
|
+
autoExpireDate: string;
|
|
40
|
+
}>;
|
|
41
|
+
clinicalNotes: Array<{ encounterType: string; date: string; note: string }>;
|
|
42
|
+
procedures: Array<{
|
|
43
|
+
procedure: string;
|
|
44
|
+
procedureUuid: string;
|
|
45
|
+
orderNumber: string;
|
|
46
|
+
action: string;
|
|
47
|
+
urgency: string;
|
|
48
|
+
status: string;
|
|
49
|
+
orderedDate: string;
|
|
50
|
+
instructions: string;
|
|
51
|
+
orderer: string;
|
|
52
|
+
procedureReport: string;
|
|
53
|
+
results: unknown[];
|
|
54
|
+
}>;
|
|
55
|
+
imaging: Array<{
|
|
56
|
+
procedure: string;
|
|
57
|
+
procedureUuid: string;
|
|
58
|
+
orderNumber: string;
|
|
59
|
+
action: string;
|
|
60
|
+
urgency: string;
|
|
61
|
+
status: string;
|
|
62
|
+
orderedDate: string;
|
|
63
|
+
instructions: string;
|
|
64
|
+
orderer: string;
|
|
65
|
+
procedureReport: string;
|
|
66
|
+
impression?: string;
|
|
67
|
+
results: unknown[];
|
|
68
|
+
}>;
|
|
69
|
+
labResults: Array<{
|
|
70
|
+
panel: string | null;
|
|
71
|
+
panelUuid: string | null;
|
|
72
|
+
isPanel: boolean;
|
|
73
|
+
results: Array<{
|
|
74
|
+
test: string;
|
|
75
|
+
testUuid: string;
|
|
76
|
+
value: string;
|
|
77
|
+
date: string;
|
|
78
|
+
units: string;
|
|
79
|
+
lowNormal: number | null;
|
|
80
|
+
hiNormal: number | null;
|
|
81
|
+
lowCritical: number | null;
|
|
82
|
+
hiCritical: number | null;
|
|
83
|
+
interpretation: { system: string; code: string; display: string } | null;
|
|
84
|
+
}>;
|
|
85
|
+
}>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function useVisitSummary(visitUuid: string) {
|
|
89
|
+
const url = visitUuid ? `/ws/rest/v1/kenyaemr/visitSummary?visitUuid=${visitUuid}` : null;
|
|
90
|
+
const { data, error, isLoading } = useSWR<{ data: VisitSummary }>(url, openmrsFetch);
|
|
91
|
+
return { summary: data?.data, error, isLoading };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function usePatientVisits(patientUuid: string) {
|
|
95
|
+
const url = patientUuid ? `${restBaseUrl}/visit?patient=${patientUuid}&v=default&includeInactive=true` : null;
|
|
96
|
+
const { data, error, isLoading } = useSWR<{ data: { results: Array<Visit> } }>(url, openmrsFetch);
|
|
97
|
+
const visits = (data?.data?.results ?? []).sort(
|
|
98
|
+
(a, b) => new Date(b.startDatetime).getTime() - new Date(a.startDatetime).getTime(),
|
|
99
|
+
);
|
|
100
|
+
return { visits, error, isLoading };
|
|
101
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { useConfig } from '@openmrs/esm-framework';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
import type { WardConfigObject } from '../config-schema';
|
|
5
|
+
import useWardLocation from '../hooks/useWardLocation';
|
|
6
|
+
import { useAdmissionLocationTags } from '../in-patient/in-patient.resource';
|
|
7
|
+
|
|
8
|
+
export type CriticalCareWardKind = 'icu' | 'hdu' | 'nicu' | 'picu';
|
|
9
|
+
|
|
10
|
+
export type CriticalCareWardTab = {
|
|
11
|
+
kind: CriticalCareWardKind;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const KIND_PRIORITY: CriticalCareWardKind[] = ['nicu', 'picu', 'icu', 'hdu'];
|
|
16
|
+
|
|
17
|
+
const KIND_LABELS: Record<CriticalCareWardKind, string> = {
|
|
18
|
+
icu: 'ICU',
|
|
19
|
+
hdu: 'HDU',
|
|
20
|
+
nicu: 'NICU',
|
|
21
|
+
picu: 'PICU',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* When the selected admissions ward is ICU / HDU / NICU / PICU, returns the tab
|
|
26
|
+
* label to show next to Discharged. Labour and other wards return null.
|
|
27
|
+
*/
|
|
28
|
+
export function useCriticalCareWardTab(): {
|
|
29
|
+
tab: CriticalCareWardTab | null;
|
|
30
|
+
locationUuid?: string;
|
|
31
|
+
isLoading: boolean;
|
|
32
|
+
} {
|
|
33
|
+
const { inpatientLocationTags } = useConfig<WardConfigObject>();
|
|
34
|
+
const { location, isLoadingLocation } = useWardLocation();
|
|
35
|
+
const { tags, isLoading: isLoadingTags } = useAdmissionLocationTags(location?.uuid);
|
|
36
|
+
|
|
37
|
+
const tab = useMemo(() => {
|
|
38
|
+
if (!location?.uuid || !tags.length) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const configured: Record<CriticalCareWardKind, string | undefined> = {
|
|
43
|
+
icu: inpatientLocationTags?.icuWard,
|
|
44
|
+
hdu: inpatientLocationTags?.hduWard,
|
|
45
|
+
nicu: inpatientLocationTags?.nicuWard,
|
|
46
|
+
picu: inpatientLocationTags?.picuWard,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const present = new Set(tags.map((tag) => tag.uuid?.toLowerCase()).filter(Boolean));
|
|
50
|
+
|
|
51
|
+
for (const kind of KIND_PRIORITY) {
|
|
52
|
+
const uuid = configured[kind]?.toLowerCase();
|
|
53
|
+
if (uuid && present.has(uuid)) {
|
|
54
|
+
return { kind, label: KIND_LABELS[kind] };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Fallback: match display/name when tag UUIDs are missing on the location payload.
|
|
59
|
+
const display = tags
|
|
60
|
+
.map((tag) => `${tag.name || ''} ${tag.display || ''}`)
|
|
61
|
+
.join(' ')
|
|
62
|
+
.toLowerCase();
|
|
63
|
+
const locationDisplay = `${location.display || ''}`.toLowerCase();
|
|
64
|
+
const haystack = `${display} ${locationDisplay}`;
|
|
65
|
+
|
|
66
|
+
for (const kind of KIND_PRIORITY) {
|
|
67
|
+
if (kind === 'nicu' && (/\bnicu\b/.test(haystack) || haystack.includes('neonatal'))) {
|
|
68
|
+
return { kind, label: KIND_LABELS[kind] };
|
|
69
|
+
}
|
|
70
|
+
if (
|
|
71
|
+
kind === 'picu' &&
|
|
72
|
+
(/\bpicu\b/.test(haystack) ||
|
|
73
|
+
haystack.includes('paediatric intensive') ||
|
|
74
|
+
haystack.includes('pediatric intensive'))
|
|
75
|
+
) {
|
|
76
|
+
return { kind, label: KIND_LABELS[kind] };
|
|
77
|
+
}
|
|
78
|
+
if (kind === 'hdu' && (/\bhdu\b/.test(haystack) || haystack.includes('high dependency'))) {
|
|
79
|
+
return { kind, label: KIND_LABELS[kind] };
|
|
80
|
+
}
|
|
81
|
+
if (kind === 'icu' && (/\bicu\b/.test(haystack) || haystack.includes('intensive care'))) {
|
|
82
|
+
return { kind, label: KIND_LABELS[kind] };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return null;
|
|
87
|
+
}, [inpatientLocationTags, location?.display, location?.uuid, tags]);
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
tab,
|
|
91
|
+
locationUuid: location?.uuid,
|
|
92
|
+
isLoading: isLoadingLocation || isLoadingTags,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { excludeAdmittedIsolationSuspects, type EbolaIsolationSuspect } from './useEbolaIsolationSuspects';
|
|
2
|
+
|
|
3
|
+
const suspect = (uuid: string): EbolaIsolationSuspect =>
|
|
4
|
+
({
|
|
5
|
+
patient: { uuid },
|
|
6
|
+
visit: { uuid: `visit-${uuid}` },
|
|
7
|
+
dispositionType: 'ADMIT',
|
|
8
|
+
}) as EbolaIsolationSuspect;
|
|
9
|
+
|
|
10
|
+
describe('excludeAdmittedIsolationSuspects', () => {
|
|
11
|
+
it('keeps suspects who are not yet in a bed or unassigned', () => {
|
|
12
|
+
const queued = excludeAdmittedIsolationSuspects(
|
|
13
|
+
[suspect('a'), suspect('b'), suspect('c')],
|
|
14
|
+
['b'],
|
|
15
|
+
[{ patient: { uuid: 'c' } }],
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
expect(queued.map((row) => row.patient.uuid)).toEqual(['a']);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('returns an empty list when every suspect is already admitted', () => {
|
|
22
|
+
expect(excludeAdmittedIsolationSuspects([suspect('a')], ['a'], [])).toEqual([]);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { openmrsFetch, restBaseUrl, type Patient, type Visit } from '@openmrs/esm-framework';
|
|
2
|
+
import useSWR from 'swr';
|
|
3
|
+
|
|
4
|
+
export type EbolaIsolationSuspect = {
|
|
5
|
+
patient: Patient;
|
|
6
|
+
visit: Visit;
|
|
7
|
+
dispositionType: 'ADMIT';
|
|
8
|
+
dateQueued?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type SuspectsResponse = { results?: Array<EbolaIsolationSuspect> };
|
|
12
|
+
|
|
13
|
+
export function excludeAdmittedIsolationSuspects(
|
|
14
|
+
suspects: EbolaIsolationSuspect[],
|
|
15
|
+
admittedPatientUuids?: Iterable<string> | null,
|
|
16
|
+
unassignedAdmissions?: Array<{ patient?: { uuid?: string } }> | null,
|
|
17
|
+
): EbolaIsolationSuspect[] {
|
|
18
|
+
const admitted = new Set<string>(admittedPatientUuids ?? []);
|
|
19
|
+
for (const admission of unassignedAdmissions ?? []) {
|
|
20
|
+
if (admission?.patient?.uuid) {
|
|
21
|
+
admitted.add(admission.patient.uuid);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return suspects.filter((row) => Boolean(row?.patient?.uuid) && !admitted.has(row.patient.uuid));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function useEbolaIsolationSuspects(enabled: boolean) {
|
|
28
|
+
const url = enabled ? `${restBaseUrl}/kenyaemr/ebola-isolation-suspects` : null;
|
|
29
|
+
const { data, error, isLoading, mutate } = useSWR<SuspectsResponse>(url, async (requestUrl: string) => {
|
|
30
|
+
const response = await openmrsFetch(requestUrl);
|
|
31
|
+
return response.data;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
suspects: data?.results ?? [],
|
|
36
|
+
error,
|
|
37
|
+
isLoading,
|
|
38
|
+
mutate,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function createIsolationAdmissionRequest(patientUuid: string, visitUuid: string, locationUuid?: string) {
|
|
43
|
+
const params = new URLSearchParams({ patientUuid, visitUuid });
|
|
44
|
+
if (locationUuid) {
|
|
45
|
+
params.set('locationUuid', locationUuid);
|
|
46
|
+
}
|
|
47
|
+
return openmrsFetch(`${restBaseUrl}/kenyaemr/ebola-isolation-admission-request?${params.toString()}`, {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
headers: { 'Content-Type': 'application/json' },
|
|
50
|
+
});
|
|
51
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type FetchResponse, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import useSWRImmutable from 'swr/immutable';
|
|
3
|
+
|
|
4
|
+
export interface FacilityRegistryBedOccupancy {
|
|
5
|
+
totalBeds?: number;
|
|
6
|
+
normalBeds?: number;
|
|
7
|
+
icuBeds?: number;
|
|
8
|
+
hduBeds?: number;
|
|
9
|
+
dialysisBeds?: number;
|
|
10
|
+
numberOfCots?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface FacilityRegistryResponse {
|
|
14
|
+
fr_code?: string;
|
|
15
|
+
official_name?: string;
|
|
16
|
+
keph_level?: string;
|
|
17
|
+
bed_occupancy?: FacilityRegistryBedOccupancy;
|
|
18
|
+
last_synced_at?: string;
|
|
19
|
+
last_sync_status?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function useFacilityRegistry() {
|
|
23
|
+
const url = `${restBaseUrl}/virtualclaims/facility-registry`;
|
|
24
|
+
const { data, error, isLoading } = useSWRImmutable<FetchResponse<FacilityRegistryResponse>>(url, openmrsFetch);
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
facility: data?.data,
|
|
28
|
+
bedOccupancy: data?.data?.bed_occupancy,
|
|
29
|
+
isLoading,
|
|
30
|
+
error,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -106,8 +106,11 @@ export const useIpdDischargeEncounter = () => {
|
|
|
106
106
|
return (data ?? []).map((entry) => {
|
|
107
107
|
const { name, openmrsId } = parseDisplayText(entry.subject.display);
|
|
108
108
|
const patientUuid = entry.subject.reference.split('/').at(-1);
|
|
109
|
+
// In OpenMRS FHIR, an encounter's `partOf` references its visit.
|
|
110
|
+
const visitUuid = entry.partOf?.reference?.split('/').at(-1);
|
|
109
111
|
return {
|
|
110
112
|
uuid: entry?.id,
|
|
113
|
+
visitUuid,
|
|
111
114
|
patient: { uuid: patientUuid, openmrsId, name },
|
|
112
115
|
encounterDateTime: entry.period?.start,
|
|
113
116
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useConfig } from '@openmrs/esm-framework';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
import type { WardConfigObject } from '../config-schema';
|
|
5
|
+
import { useAdmissionLocationTags } from '../in-patient/in-patient.resource';
|
|
6
|
+
import useWardLocation from './useWardLocation';
|
|
7
|
+
|
|
8
|
+
export const isIsolationLocation = (
|
|
9
|
+
locationUuid: string | undefined,
|
|
10
|
+
tags: Array<{ uuid: string }>,
|
|
11
|
+
isolationUuid?: string,
|
|
12
|
+
) => {
|
|
13
|
+
if (!locationUuid || !isolationUuid) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return locationUuid === isolationUuid || tags.some((tag) => tag.uuid === isolationUuid);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* True when the selected admissions location has the configured isolation ward tag UUID.
|
|
21
|
+
*/
|
|
22
|
+
export function useIsIsolationWard(overrideLocation?: string) {
|
|
23
|
+
const { inpatientLocationTags } = useConfig<WardConfigObject>();
|
|
24
|
+
const { location, isLoadingLocation } = useWardLocation(overrideLocation);
|
|
25
|
+
const { tags, isLoading: isLoadingTags } = useAdmissionLocationTags(location?.uuid);
|
|
26
|
+
const isolationUuid = inpatientLocationTags?.isolationWard;
|
|
27
|
+
|
|
28
|
+
const isIsolationWard = useMemo(
|
|
29
|
+
() => isIsolationLocation(location?.uuid, tags, isolationUuid),
|
|
30
|
+
[isolationUuid, location?.uuid, tags],
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
isIsolationWard,
|
|
35
|
+
isolationUuid,
|
|
36
|
+
location,
|
|
37
|
+
isLoading: isLoadingLocation || isLoadingTags,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function useIsIsolationAdmission(locationUuid?: string) {
|
|
42
|
+
const { inpatientLocationTags } = useConfig<WardConfigObject>();
|
|
43
|
+
const { tags, isLoading } = useAdmissionLocationTags(locationUuid);
|
|
44
|
+
const isolationUuid = inpatientLocationTags?.isolationWard;
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
isIsolationAdmission: isIsolationLocation(locationUuid, tags, isolationUuid),
|
|
48
|
+
hasAdmissionLocation: Boolean(locationUuid),
|
|
49
|
+
isLoading,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { openmrsFetch, restBaseUrl, useConfig, type FetchResponse } from '@openmrs/esm-framework';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import useSWRImmutable from 'swr/immutable';
|
|
4
|
+
import { type Location } from '@openmrs/esm-emr-api';
|
|
5
|
+
|
|
6
|
+
import { type WardConfigObject } from '../config-schema';
|
|
7
|
+
import { criticalCareWardDisplay } from './critical-care-ward.utils';
|
|
8
|
+
import { useLocationsByTag } from './useAdmissionLocation';
|
|
9
|
+
|
|
10
|
+
const LOCATION_REP = 'custom:(uuid,display,name,tags:(uuid,display,name))';
|
|
11
|
+
|
|
12
|
+
function useLocationsForConfiguredWard(uuid: string | undefined, label: 'NICU' | 'PICU') {
|
|
13
|
+
const byUuidUrl = uuid ? `${restBaseUrl}/location/${uuid}?v=${LOCATION_REP}` : null;
|
|
14
|
+
const byTagUrl = uuid ? `${restBaseUrl}/location?tag=${encodeURIComponent(uuid)}&v=${LOCATION_REP}` : null;
|
|
15
|
+
const byUuid = useSWRImmutable<FetchResponse<Location>>(byUuidUrl, openmrsFetch);
|
|
16
|
+
const byTag = useSWRImmutable<FetchResponse<{ results: Array<Location> }>>(byTagUrl, openmrsFetch);
|
|
17
|
+
|
|
18
|
+
const locations = useMemo(() => {
|
|
19
|
+
const fromTag = byTag.data?.data?.results ?? [];
|
|
20
|
+
const direct = byUuid.data?.data?.uuid ? [byUuid.data.data] : [];
|
|
21
|
+
const merged = new Map<string, Location>();
|
|
22
|
+
for (const location of [...fromTag, ...direct]) {
|
|
23
|
+
if (!location?.uuid) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const display = criticalCareWardDisplay(location.display || location.name, label);
|
|
27
|
+
const key = `${location.uuid}:${display}`;
|
|
28
|
+
if (!merged.has(key)) {
|
|
29
|
+
merged.set(key, { ...location, display });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return [...merged.values()];
|
|
33
|
+
}, [byTag.data, byUuid.data, label]);
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
locations,
|
|
37
|
+
isLoading: Boolean(uuid) && ((byUuidUrl && byUuid.isLoading) || (byTagUrl && byTag.isLoading)),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Admission wards plus NICU and PICU.
|
|
43
|
+
* NICU/PICU are included even when those locations are not tagged "Admission Location".
|
|
44
|
+
*/
|
|
45
|
+
export function useSelectableWards() {
|
|
46
|
+
const { inpatientLocationTags } = useConfig<WardConfigObject>();
|
|
47
|
+
const admission = useLocationsByTag('Admission Location');
|
|
48
|
+
const nicu = useLocationsForConfiguredWard(inpatientLocationTags?.nicuWard, 'NICU');
|
|
49
|
+
const picu = useLocationsForConfiguredWard(inpatientLocationTags?.picuWard, 'PICU');
|
|
50
|
+
|
|
51
|
+
const locations = useMemo(() => {
|
|
52
|
+
const seen = new Set<string>();
|
|
53
|
+
const items: Array<Location> = [];
|
|
54
|
+
for (const location of [...(admission.locations ?? []), ...nicu.locations, ...picu.locations]) {
|
|
55
|
+
const key = `${location.uuid}:${location.display}`;
|
|
56
|
+
if (!location.uuid || seen.has(key)) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
seen.add(key);
|
|
60
|
+
items.push(location);
|
|
61
|
+
}
|
|
62
|
+
return items;
|
|
63
|
+
}, [admission.locations, nicu.locations, picu.locations]);
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
locations,
|
|
67
|
+
nicuLocations: nicu.locations,
|
|
68
|
+
picuLocations: picu.locations,
|
|
69
|
+
isLoading: admission.isLoading || nicu.isLoading || picu.isLoading,
|
|
70
|
+
error: admission.error,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -2,7 +2,9 @@ import { type OpenmrsResource, restBaseUrl, useConfig, useOpenmrsFetchAll } from
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import type { WardConfigObject } from '../config-schema';
|
|
4
4
|
import type { AdmissionLocationFetchResponse } from '../types';
|
|
5
|
+
import { excludeAdmittedIsolationSuspects, useEbolaIsolationSuspects } from './useEbolaIsolationSuspects';
|
|
5
6
|
import { useIpdDischargeEncounter } from './useIpdDischargeEncounter';
|
|
7
|
+
import { useIsIsolationWard } from './useIsIsolationWard';
|
|
6
8
|
import { useWardPatientGrouping } from './useWardPatientGrouping';
|
|
7
9
|
|
|
8
10
|
export const useWardsSummaryMetrics = () => {
|
|
@@ -91,10 +93,18 @@ export const useWardSummaryMetrics = () => {
|
|
|
91
93
|
});
|
|
92
94
|
return { admittedPatients, dischargeInPatients };
|
|
93
95
|
}, [wardPatientGroupDetails, config]);
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
const { isIsolationWard } = useIsIsolationWard();
|
|
97
|
+
const { suspects } = useEbolaIsolationSuspects(isIsolationWard);
|
|
98
|
+
const awaitingAdmissionPatient = useMemo(() => {
|
|
99
|
+
if (isIsolationWard) {
|
|
100
|
+
return excludeAdmittedIsolationSuspects(
|
|
101
|
+
suspects,
|
|
102
|
+
wardPatientGroupDetails?.wardAdmittedPatientsWithBed?.keys(),
|
|
103
|
+
wardPatientGroupDetails?.wardUnassignedPatientsList,
|
|
104
|
+
).length;
|
|
105
|
+
}
|
|
106
|
+
return wardPatientGroupDetails.inpatientRequestResponse?.inpatientRequests?.length ?? 0;
|
|
107
|
+
}, [isIsolationWard, suspects, wardPatientGroupDetails]);
|
|
98
108
|
return {
|
|
99
109
|
dischargedPatients,
|
|
100
110
|
admittedPatients,
|
|
@@ -2,8 +2,8 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import { createAndGetWardPatientGrouping } from '../ward-view/ward-view.resource';
|
|
3
3
|
import { useAdmissionLocation } from './useAdmissionLocation';
|
|
4
4
|
import { useInpatientAdmission } from './useInpatientAdmission';
|
|
5
|
-
import { useInpatientRequest } from './useInpatientRequest';
|
|
6
5
|
import { useInpatientAdmissionByPatients } from './useInpatientAdmissionByPatients';
|
|
6
|
+
import { useInpatientRequest } from './useInpatientRequest';
|
|
7
7
|
import useWardLocation from './useWardLocation';
|
|
8
8
|
|
|
9
9
|
export function useWardPatientGrouping(overrideLocation?: string) {
|
|
@@ -24,8 +24,8 @@ export function useWardPatientGrouping(overrideLocation?: string) {
|
|
|
24
24
|
if (admissionLocation && inpatientAdmissions && inpatientRequests) {
|
|
25
25
|
const _patientsNotInCurrentWard = new Set<string>();
|
|
26
26
|
|
|
27
|
-
for (const bedLayout of admissionLocation.bedLayouts) {
|
|
28
|
-
for (const bedPatient of bedLayout.patients) {
|
|
27
|
+
for (const bedLayout of admissionLocation.bedLayouts ?? []) {
|
|
28
|
+
for (const bedPatient of bedLayout.patients ?? []) {
|
|
29
29
|
_patientsNotInCurrentWard.add(bedPatient.uuid);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -36,7 +36,7 @@ export function useWardPatientGrouping(overrideLocation?: string) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
for (const admission of inpatientAdmissions) {
|
|
39
|
-
_patientsNotInCurrentWard.delete(admission
|
|
39
|
+
_patientsNotInCurrentWard.delete(admission?.patient?.uuid);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
return _patientsNotInCurrentWard;
|
|
@@ -25,7 +25,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
25
25
|
|
|
26
26
|
import type { WardConfigObject } from '../config-schema';
|
|
27
27
|
import useCurrentPatientAdmissionEncounter from '../hooks/useCurrentPatientAdmissionEncounter';
|
|
28
|
-
import { usePatientChartStore } from '@openmrs/esm-patient-common-lib
|
|
28
|
+
import { usePatientChartStore } from '@openmrs/esm-patient-common-lib';
|
|
29
29
|
import { useAdmissionRequest } from './in-patient.resource';
|
|
30
30
|
|
|
31
31
|
type AdmissionRequestProps = {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { type FC } from 'react';
|
|
2
|
+
import BloodTransfusionChart from './components/blood-transfusion-chart.component';
|
|
3
|
+
|
|
4
|
+
type BloodTransfusionDashboardProps = {
|
|
5
|
+
patientUuid: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const BloodTransfusionDashboard: FC<BloodTransfusionDashboardProps> = ({ patientUuid }) => {
|
|
9
|
+
if (!patientUuid) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return <BloodTransfusionChart patientUuid={patientUuid} />;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default BloodTransfusionDashboard;
|