@ampath/esm-dha-workflow-app 4.0.0-next.13 → 4.0.0-next.130
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/1197.js +1 -0
- package/dist/1277.js +1 -0
- package/dist/1277.js.map +1 -0
- package/dist/1558.js +2 -0
- package/dist/{198.js.LICENSE.txt → 1558.js.LICENSE.txt} +0 -10
- package/dist/1558.js.map +1 -0
- package/dist/1729.js +1 -0
- package/dist/1729.js.map +1 -0
- package/dist/182.js +1 -0
- package/dist/182.js.map +1 -0
- package/dist/1826.js +1 -0
- package/dist/1826.js.map +1 -0
- package/dist/1833.js +1 -0
- package/dist/1833.js.map +1 -0
- package/dist/1856.js +1 -0
- package/dist/1856.js.map +1 -0
- package/dist/1925.js +1 -0
- package/dist/1925.js.map +1 -0
- package/dist/2021.js +1 -0
- package/dist/2021.js.map +1 -0
- package/dist/2054.js +1 -0
- package/dist/2054.js.map +1 -0
- package/dist/2177.js +2 -0
- package/dist/2177.js.LICENSE.txt +9 -0
- package/dist/2177.js.map +1 -0
- package/dist/2364.js +2 -0
- package/dist/{200.js.LICENSE.txt → 2364.js.LICENSE.txt} +15 -0
- package/dist/2364.js.map +1 -0
- package/dist/2566.js +1 -0
- package/dist/2566.js.map +1 -0
- package/dist/2801.js +1 -0
- package/dist/2801.js.map +1 -0
- package/dist/2975.js +1 -0
- package/dist/2975.js.map +1 -0
- package/dist/3041.js +1 -0
- package/dist/3041.js.map +1 -0
- package/dist/3099.js +1 -0
- package/dist/3184.js +2 -0
- package/dist/3184.js.map +1 -0
- package/dist/3654.js +1 -0
- package/dist/3654.js.map +1 -0
- package/dist/4055.js +1 -0
- package/dist/4205.js +1 -0
- package/dist/4205.js.map +1 -0
- package/dist/4225.js +1 -0
- package/dist/4225.js.map +1 -0
- package/dist/4300.js +1 -0
- package/dist/4335.js +1 -0
- package/dist/4353.js +1 -0
- package/dist/4353.js.map +1 -0
- package/dist/4517.js +1 -0
- package/dist/4517.js.map +1 -0
- package/dist/4652.js +1 -0
- package/dist/4674.js +1 -0
- package/dist/4674.js.map +1 -0
- package/dist/4947.js +1 -0
- package/dist/4947.js.map +1 -0
- package/dist/5015.js +1 -0
- package/dist/5015.js.map +1 -0
- package/dist/5422.js +1 -0
- package/dist/5422.js.map +1 -0
- package/dist/5428.js +1 -0
- package/dist/5428.js.map +1 -0
- package/dist/5752.js +1 -0
- package/dist/5752.js.map +1 -0
- package/dist/5851.js +1 -0
- package/dist/5851.js.map +1 -0
- package/dist/6264.js +1 -0
- package/dist/6264.js.map +1 -0
- package/dist/6540.js +2 -0
- package/dist/6540.js.map +1 -0
- package/dist/6606.js +1 -0
- package/dist/6606.js.map +1 -0
- package/dist/693.js +1 -0
- package/dist/693.js.map +1 -0
- package/dist/6991.js +1 -0
- package/dist/6991.js.map +1 -0
- package/dist/7076.js +1 -0
- package/dist/7076.js.map +1 -0
- package/dist/7199.js +1 -0
- package/dist/7199.js.map +1 -0
- package/dist/7255.js +1 -0
- package/dist/7255.js.map +1 -0
- package/dist/7258.js +1 -0
- package/dist/7258.js.map +1 -0
- package/dist/7420.js +1 -0
- package/dist/7420.js.map +1 -0
- package/dist/7523.js +1 -0
- package/dist/7523.js.map +1 -0
- package/dist/8114.js +1 -0
- package/dist/8114.js.map +1 -0
- package/dist/8339.js +1 -0
- package/dist/8339.js.map +1 -0
- package/dist/8865.js +1 -0
- package/dist/8865.js.map +1 -0
- package/dist/8895.js +1 -0
- package/dist/8895.js.map +1 -0
- package/dist/9037.js +1 -0
- package/dist/9037.js.map +1 -0
- package/dist/9091.js +1 -0
- package/dist/9091.js.map +1 -0
- package/dist/9093.js +1 -0
- package/dist/9093.js.map +1 -0
- package/dist/9117.js +1 -0
- package/dist/9117.js.map +1 -0
- package/dist/9721.js +1 -0
- package/dist/9721.js.map +1 -0
- package/dist/esm-dha-workflow-app.js +1 -0
- package/dist/esm-dha-workflow-app.js.buildmanifest.json +1570 -0
- package/dist/esm-dha-workflow-app.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +11 -4
- package/src/accounting/accounting.component.tsx +13 -0
- package/src/admissions/admission-request-list/admission-request-list.scss +0 -0
- package/src/admissions/admission-request-list/admission-request-list.tsx +134 -0
- package/src/admissions/admissions-dashboard.component.scss +15 -0
- package/src/admissions/admissions-dashboard.component.tsx +160 -0
- package/src/admissions/admissions.resource.ts +101 -0
- package/src/admissions/admitted-list/admitted-patients-list.tsx +141 -0
- package/src/admissions/constants/index.ts +33 -0
- package/src/admissions/discharged-list/discharged-list.scss +0 -0
- package/src/admissions/discharged-list/discharged-list.tsx +58 -0
- package/src/admissions/inpatient/admission-history/patient-admission-history.tsx +76 -0
- package/src/admissions/inpatient/admission-requests/patient-admission-requests.scss +19 -0
- package/src/admissions/inpatient/admission-requests/patient-admission-requests.tsx +72 -0
- package/src/admissions/inpatient/inpatient-admissions.component.scss +7 -0
- package/src/admissions/inpatient/inpatient-admissions.component.tsx +46 -0
- package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.scss +23 -0
- package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.tsx +156 -0
- package/src/admissions/modal/admit-patient/admit-patient.modal.scss +0 -0
- package/src/admissions/modal/admit-patient/admit-patient.modal.tsx +109 -0
- package/src/admissions/modal/bed-swap/bed-swap.modal.scss +0 -0
- package/src/admissions/modal/bed-swap/bed-swap.modal.tsx +102 -0
- package/src/admissions/modal/cancel-admission-request/cancel-admission-request.scss +11 -0
- package/src/admissions/modal/cancel-admission-request/cancel-admission-request.tsx +105 -0
- package/src/admissions/modal/discharge/discharge-patient.modal.scss +13 -0
- package/src/admissions/modal/discharge/discharge-patient.modal.tsx +84 -0
- package/src/admissions/types/index.ts +192 -0
- package/src/appointments/appointments.component.tsx +13 -0
- package/src/billing/api/billing.api.ts +95 -0
- package/src/billing/billing-root.tsx +20 -0
- package/src/billing/dashboard/billingDashboard.component.scss +0 -0
- package/src/billing/dashboard/billingDashboard.component.tsx +25 -0
- package/src/billing/extensions/visit-billing/visit-billing.extension.scss +0 -0
- package/src/billing/extensions/visit-billing/visit-billing.extension.tsx +409 -0
- package/src/billing/invoice/bill.resource.ts +47 -0
- package/src/billing/invoice/invoice-header/header-card/header-card.scss +17 -0
- package/src/billing/invoice/invoice-header/header-card/header-card.tsx +21 -0
- package/src/billing/invoice/invoice.scss +113 -0
- package/src/billing/invoice/invoice.tsx +1371 -0
- package/src/billing/invoice/line-items/line-items.scss +0 -0
- package/src/billing/invoice/line-items/line-items.tsx +120 -0
- package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.scss +23 -0
- package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.tsx +114 -0
- package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.scss +0 -0
- package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.tsx +122 -0
- package/src/billing/invoice/payment-details/payment-details.scss +0 -0
- package/src/billing/invoice/payment-details/payment-details.tsx +43 -0
- package/src/billing/invoice/print-invoice/print-receipt.component.tsx +44 -0
- package/src/billing/invoice/print-invoice/print-receipt.scss +14 -0
- package/src/billing/types/index.ts +84 -0
- package/src/billing/utils/index.ts +17 -0
- package/src/billing/widgets/billingTotalsRow.component.scss +0 -0
- package/src/billing/widgets/billingTotalsRow.component.tsx +712 -0
- package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.resource.ts +85 -0
- package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.scss +58 -0
- package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.workspace.tsx +330 -0
- package/src/billing/workspaces/create-order-bill-form-workspace/schema.ts +11 -0
- package/src/bookings/bookings.component.scss +7 -0
- package/src/bookings/bookings.component.tsx +31 -0
- package/src/bookings/daily/daily-bookings.component.scss +38 -0
- package/src/bookings/daily/daily-bookings.component.tsx +138 -0
- package/src/bookings/daily/daily-bookings.resource.ts +28 -0
- package/src/bookings/daily/filters/daily-bookings-filter.component.scss +15 -0
- package/src/bookings/daily/filters/daily-bookings-filter.component.tsx +80 -0
- package/src/bookings/daily/patient-list/daily-bookings-patient-list.component.tsx +97 -0
- package/src/bookings/types/index.ts +68 -0
- package/src/config-schema.ts +186 -32
- package/src/createDashboardLink.tsx +9 -0
- package/src/dashboard/charts/chart.component.scss +13 -0
- package/src/dashboard/charts/chart.component.tsx +54 -0
- package/src/dashboard/dashboard.component.scss +7 -0
- package/src/dashboard/dashboard.component.tsx +51 -0
- package/src/dashboard/overview/overview.component.scss +147 -0
- package/src/dashboard/overview/overview.component.tsx +115 -0
- package/src/dashboard/patient-list/patient-list.component.tsx +41 -0
- package/src/dashboard-meta/accounting-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/admissions-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/billing-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/bookings-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/consultation-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/dha-workflow-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/inpatient-admissions.meta.ts +6 -0
- package/src/dashboard-meta/mch-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/pharmacy-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/queue-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/registers-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/registry-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/service-queue-admin.meta.ts +6 -0
- package/src/dashboard-meta/triage-dashboard.meta.ts +6 -0
- package/src/hooks/useActions.ts +165 -0
- package/src/index.ts +118 -1
- package/src/laboratory/laboratory.component.tsx +13 -0
- package/src/left-panel/left-panel.component.tsx +0 -2
- package/src/mch/mch-queues.component.scss +7 -0
- package/src/mch/mch-queues.component.tsx +32 -0
- package/src/mch/queues/consultation/mch-consultation.tsx +18 -0
- package/src/mch/queues/triage/mch-triage.tsx +15 -0
- package/src/modals/sign-off-modal.scss +7 -0
- package/src/modals/sign-off-modal.tsx +52 -0
- package/src/mortuary/mortuary.component.tsx +13 -0
- package/src/pharmacy/pharmacy.component.tsx +13 -0
- package/src/registers/registers.component.tsx +8 -0
- package/src/registry/eligibility/eliigibility-tags/eligibility-tags.scss +6 -0
- package/src/registry/eligibility/eliigibility-tags/eligibility-tags.tsx +137 -0
- package/src/registry/eligibility/modal/eligibility-details.modal.scss +38 -0
- package/src/registry/eligibility/modal/eligibility-details.modal.tsx +131 -0
- package/src/registry/modal/client-details-modal/client-details-modal.tsx +9 -26
- package/src/registry/modal/otp-verification-modal/otp-verification-modal.scss +31 -1
- package/src/registry/modal/otp-verification-modal/otp-verification-modal.tsx +145 -58
- package/src/registry/modal/send-to-triage/send-to-triage.modal.scss +16 -1
- package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +681 -97
- package/src/registry/payment-details/payment-options/payment-options.scss +13 -0
- package/src/registry/payment-details/payment-options/payment-options.tsx +61 -14
- package/src/registry/registry.component.scss +18 -1
- package/src/registry/registry.component.tsx +242 -111
- package/src/registry/registry.resource.ts +8 -5
- package/src/registry/types/index.ts +179 -1
- package/src/registry/utils/error-handler.ts +33 -0
- package/src/registry/utils/format-dependant-display-data.ts +8 -0
- package/src/registry/utils/hie-client-adapter.ts +312 -0
- package/src/registry/utils/mask-data.ts +11 -0
- package/src/resources/dashboard.resource.ts +20 -0
- package/src/resources/hie-amrs-automatic-registration.service.ts +16 -0
- package/src/resources/identifier-types.ts +29 -0
- package/src/resources/patient-resource.ts +62 -0
- package/src/resources/queue.resource.ts +23 -0
- package/src/resources/superset.resource.ts +20 -0
- package/src/resources/visit.resource.ts +19 -1
- package/src/root.component.tsx +32 -6
- package/src/routes.json +232 -7
- package/src/service-queues/action-button.component.tsx +34 -0
- package/src/service-queues/action-overflow-menu-item.component.tsx +34 -0
- package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.scss +31 -0
- package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.tsx +142 -0
- package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.scss +0 -0
- package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.tsx +150 -0
- package/src/service-queues/admin/queue/queue-list/queue-list.scss +33 -0
- package/src/service-queues/admin/queue/queue-list/queue-list.tsx +113 -0
- package/src/service-queues/admin/queue-entry/queue-entry-list.component.scss +6 -0
- package/src/service-queues/admin/queue-entry/queue-entry-list.component.tsx +137 -0
- package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.scss +31 -0
- package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.tsx +137 -0
- package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.scss +0 -0
- package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.tsx +146 -0
- package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.scss +22 -0
- package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.tsx +120 -0
- package/src/service-queues/admin/service-queue-admin-dashboard.component.scss +6 -0
- package/src/service-queues/admin/service-queue-admin-dashboard.component.tsx +34 -0
- package/src/service-queues/consultation/consultation.component.scss +7 -0
- package/src/service-queues/consultation/consultation.component.tsx +15 -0
- package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.scss +30 -0
- package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.tsx +108 -0
- package/src/service-queues/metrics/metrics-cards/attended-patients.extension.tsx +38 -0
- package/src/service-queues/metrics/metrics-cards/metrics-card.component.tsx +86 -0
- package/src/service-queues/metrics/metrics-cards/metrics-card.scss +106 -0
- package/src/service-queues/metrics/metrics-cards/waiting-patients.extension.tsx +34 -0
- package/src/service-queues/metrics/metrics-container.component.tsx +23 -0
- package/src/service-queues/metrics/metrics-container.scss +36 -0
- package/src/service-queues/metrics/metrics.resource.ts +65 -0
- package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.scss +26 -0
- package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.tsx +108 -0
- package/src/service-queues/modals/move/move-patient.component.scss +35 -0
- package/src/service-queues/modals/move/move-patient.component.tsx +152 -0
- package/src/service-queues/modals/serve/serve-patient.comppnent.scss +0 -0
- package/src/service-queues/modals/serve/serve-patient.comppnent.tsx +80 -0
- package/src/service-queues/modals/sign-off/sign-off.modal.scss +0 -0
- package/src/service-queues/modals/sign-off/sign-off.modal.tsx +79 -0
- package/src/service-queues/modals/transition/transition-patient.component.scss +0 -0
- package/src/service-queues/modals/transition/transition-patient.component.tsx +122 -0
- package/src/service-queues/queue-list/check-in.service.ts +26 -0
- package/src/service-queues/queue-list/queue-list.component.scss +36 -0
- package/src/service-queues/queue-list/queue-list.component.tsx +249 -0
- package/src/service-queues/queue-room.component.tsx +39 -0
- package/src/service-queues/room/room.component.tsx +58 -0
- package/src/service-queues/service-queue/service-queue.component.scss +14 -0
- package/src/service-queues/service-queue/service-queue.component.tsx +399 -0
- package/src/service-queues/service-queue/stats/stat-details/stat-details.component.scss +12 -0
- package/src/service-queues/service-queue/stats/stat-details/stat-details.component.tsx +63 -0
- package/src/service-queues/service-queue.scss +27 -0
- package/src/service-queues/service-queue.tsx +37 -0
- package/src/service-queues/service-queues.resource.ts +361 -0
- package/src/service-queues/service.resource.ts +28 -0
- package/src/shared/constants/civil-status.ts +29 -0
- package/src/shared/constants/concepts.ts +15 -0
- package/src/shared/constants/index.ts +1 -2
- package/src/shared/constants/patient-category.ts +6 -0
- package/src/shared/constants/person-attributes.ts +33 -0
- package/src/shared/constants/visit-types.ts +7 -0
- package/src/shared/services/billing.resource.ts +38 -0
- package/src/shared/services/client-payment-mode.resource.ts +27 -0
- package/src/shared/services/client-payment.resource.ts +17 -0
- package/src/shared/services/eligibility.resource.ts +19 -0
- package/src/shared/services/encounters.resource.ts +27 -0
- package/src/shared/services/location.resource.ts +9 -0
- package/src/shared/types/index.ts +152 -0
- package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.scss +42 -0
- package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.tsx +42 -0
- package/src/shared/ui/confirm-modal/confirm.modal.scss +18 -0
- package/src/shared/ui/confirm-modal/confirm.modal.tsx +38 -0
- package/src/shared/ui/otp-input/otp-input.component.scss +14 -0
- package/src/shared/ui/otp-input/otp-input.component.tsx +90 -0
- package/src/shared/ui/stat-card/stat-card.component.scss +10 -0
- package/src/shared/ui/stat-card/stat-card.component.tsx +26 -0
- package/src/shared/ui/timer/timer.component.scss +5 -0
- package/src/shared/ui/timer/timer.component.tsx +40 -0
- package/src/shared/utils/get-base-url.ts +27 -0
- package/src/shared/utils/get-tag-type.ts +66 -0
- package/src/side-nav-menu/nav-link-config.ts +6 -0
- package/src/triage/metrics/attended-patients.extension.tsx +42 -0
- package/src/triage/metrics/metrics.scss +36 -0
- package/src/triage/metrics/triage-metrics.component.tsx +21 -0
- package/src/triage/metrics/waiting-patients.extension.tsx +39 -0
- package/src/triage/room/room.scss +29 -0
- package/src/triage/triage.component.tsx +15 -0
- package/src/triage/triage.resource.ts +19 -0
- package/src/triage/types.ts +16 -0
- package/src/types/types.ts +180 -0
- package/dist/16.js +0 -1
- package/dist/16.js.map +0 -1
- package/dist/184.js +0 -2
- package/dist/184.js.map +0 -1
- package/dist/197.js +0 -1
- package/dist/198.js +0 -2
- package/dist/198.js.map +0 -1
- package/dist/200.js +0 -2
- package/dist/200.js.map +0 -1
- package/dist/255.js +0 -1
- package/dist/255.js.map +0 -1
- package/dist/300.js +0 -1
- package/dist/335.js +0 -1
- package/dist/353.js +0 -1
- package/dist/353.js.map +0 -1
- package/dist/420.js +0 -1
- package/dist/420.js.map +0 -1
- package/dist/540.js +0 -2
- package/dist/540.js.map +0 -1
- package/dist/55.js +0 -1
- package/dist/652.js +0 -1
- package/dist/860.js +0 -1
- package/dist/860.js.map +0 -1
- package/dist/91.js +0 -1
- package/dist/91.js.map +0 -1
- package/dist/93.js +0 -1
- package/dist/93.js.map +0 -1
- package/dist/99.js +0 -1
- package/dist/openmrs-esm-home-app.js +0 -1
- package/dist/openmrs-esm-home-app.js.buildmanifest.json +0 -626
- package/dist/openmrs-esm-home-app.js.map +0 -1
- package/src/consultation/consultation.tsx +0 -7
- /package/dist/{184.js.LICENSE.txt → 3184.js.LICENSE.txt} +0 -0
- /package/dist/{540.js.LICENSE.txt → 6540.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { ComboBox, Modal, ModalBody, Select, SelectItem, TextArea } from "@carbon/react";
|
|
2
|
+
import React, { useMemo, useRef, useState } from "react";
|
|
3
|
+
import styles from './admit-elsewhere.modal.scss'
|
|
4
|
+
import { Location, Patient, showSnackbar, useLocations, useSession, Visit } from "@openmrs/esm-framework";
|
|
5
|
+
import { AdmitPatientDto } from "../../types";
|
|
6
|
+
import { AdmissionConcepts, AdmissionEncounterTypeUuids } from "../../constants";
|
|
7
|
+
import { admitPatientElseWhere } from "../../admissions.resource";
|
|
8
|
+
interface AdmitElsewhereModalProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
patient: Patient;
|
|
11
|
+
visit: Visit;
|
|
12
|
+
onModalClose: () => void;
|
|
13
|
+
onSuccessfullTransfer: () => void;
|
|
14
|
+
}
|
|
15
|
+
const AdmitElsewhereModal: React.FC<AdmitElsewhereModalProps> = ({ open, onModalClose, onSuccessfullTransfer, patient, visit }) => {
|
|
16
|
+
const [transferLocation, setTransferLocation] = useState<string>();
|
|
17
|
+
const locations = useLocations();
|
|
18
|
+
const session = useSession();
|
|
19
|
+
const userLocation = session.sessionLocation;
|
|
20
|
+
const reasonRef = useRef<string>();
|
|
21
|
+
const locationsOptions = useMemo(() => generateLocationOption(), [locations]);
|
|
22
|
+
function generateLocationOption() {
|
|
23
|
+
return locations.filter((l)=>{
|
|
24
|
+
if(!userLocation){
|
|
25
|
+
return true;
|
|
26
|
+
}else{
|
|
27
|
+
return l.uuid !== userLocation.uuid;
|
|
28
|
+
}
|
|
29
|
+
}).map((l: Location) => {
|
|
30
|
+
return {
|
|
31
|
+
id: l.uuid,
|
|
32
|
+
text: l.display,
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const handleTransfer = async () => {
|
|
37
|
+
if(!validateTransferPayload()){
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const transferPatientDto = generateAdmitPatientPayload();
|
|
42
|
+
await admitPatientElseWhere(transferPatientDto);
|
|
43
|
+
showSnackbar({
|
|
44
|
+
kind: 'success',
|
|
45
|
+
title: 'Transfer Request Successful',
|
|
46
|
+
subtitle: 'Patient Transfer Request was Successful',
|
|
47
|
+
});
|
|
48
|
+
onSuccessfullTransfer();
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.log({ error });
|
|
51
|
+
showSnackbar({
|
|
52
|
+
kind: 'error',
|
|
53
|
+
title: 'Transfer Request failed',
|
|
54
|
+
subtitle: error.message ?? 'Patient Transfer Request failed'
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
};
|
|
59
|
+
const validateTransferPayload = ():boolean=>{
|
|
60
|
+
if(!transferLocation){
|
|
61
|
+
showSnackbar({
|
|
62
|
+
kind: 'error',
|
|
63
|
+
title: 'Transfer Location missing',
|
|
64
|
+
subtitle: 'Please select the location to transfer patient'
|
|
65
|
+
});
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if(!reasonRef.current){
|
|
69
|
+
showSnackbar({
|
|
70
|
+
kind: 'error',
|
|
71
|
+
title: 'Missing Transfer reason',
|
|
72
|
+
subtitle: 'Please enter the transfer reason'
|
|
73
|
+
});
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return true;
|
|
77
|
+
};
|
|
78
|
+
const generateAdmitPatientPayload = (): AdmitPatientDto => {
|
|
79
|
+
return {
|
|
80
|
+
patient: patient.uuid,
|
|
81
|
+
encounterType: {
|
|
82
|
+
uuid: AdmissionEncounterTypeUuids.TRANSFER_REQUEST_ENCOUNTER_TYPE_UUID
|
|
83
|
+
},
|
|
84
|
+
location: userLocation.uuid,
|
|
85
|
+
obs: [
|
|
86
|
+
{
|
|
87
|
+
"concept": AdmissionConcepts.INPATIENT_DISPOSITION_CONSTRUCT_UUID,
|
|
88
|
+
"groupMembers": [
|
|
89
|
+
{
|
|
90
|
+
"concept": AdmissionConcepts.INTERNAL_TRANSFER_LOCATION_UUID,
|
|
91
|
+
"value": transferLocation
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"concept": AdmissionConcepts.INPATIENT_PATIENT_DISPOSITION_UUID,
|
|
95
|
+
"value": AdmissionConcepts.TRANSFER_OUT_UUID
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"concept": AdmissionConcepts.CLINICAL_NOTES_UUID,
|
|
99
|
+
"value": reasonRef.current
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
visit: visit.uuid
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const handleReasonText = (reason: string) => {
|
|
108
|
+
reasonRef.current = reason;
|
|
109
|
+
};
|
|
110
|
+
const locationChangeHandler = (location: { selectedItem: { id: string; text: string } }) => {
|
|
111
|
+
const l = location.selectedItem.id;
|
|
112
|
+
setTransferLocation(l);
|
|
113
|
+
};
|
|
114
|
+
return <>
|
|
115
|
+
<Modal
|
|
116
|
+
modalHeading="Transfer Elsewhere"
|
|
117
|
+
open={open}
|
|
118
|
+
size="md"
|
|
119
|
+
onSecondarySubmit={() => onModalClose()}
|
|
120
|
+
onRequestClose={() => onModalClose()}
|
|
121
|
+
onRequestSubmit={handleTransfer}
|
|
122
|
+
primaryButtonText="Send Admission Request"
|
|
123
|
+
secondaryButtonText="Cancel"
|
|
124
|
+
>
|
|
125
|
+
<ModalBody>
|
|
126
|
+
<div className={styles.admitModalLayout}>
|
|
127
|
+
<div className={styles.admitModalContentSection}>
|
|
128
|
+
<div className={styles.formRow}>
|
|
129
|
+
<ComboBox
|
|
130
|
+
onChange={locationChangeHandler}
|
|
131
|
+
id="visit-type-combobox"
|
|
132
|
+
items={locationsOptions}
|
|
133
|
+
itemToString={(item) => (item ? item.text : '')}
|
|
134
|
+
titleText="Select Transfer Location"
|
|
135
|
+
className={styles.locationSelect}
|
|
136
|
+
/>
|
|
137
|
+
</div>
|
|
138
|
+
<div className={styles.formRow}>
|
|
139
|
+
<TextArea
|
|
140
|
+
enableCounter
|
|
141
|
+
helperText=""
|
|
142
|
+
id="transfer-reason"
|
|
143
|
+
labelText="Transfer Reason"
|
|
144
|
+
maxCount={500}
|
|
145
|
+
placeholder=""
|
|
146
|
+
rows={4}
|
|
147
|
+
onChange={(e) => handleReasonText(e.target.value)}
|
|
148
|
+
/>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</ModalBody>
|
|
153
|
+
</Modal>
|
|
154
|
+
</>
|
|
155
|
+
}
|
|
156
|
+
export default AdmitElsewhereModal;
|
|
File without changes
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { AdmitPatientDto, AssignBedToPatientDto, BedLayout, Disposition } from "../../types";
|
|
3
|
+
import { Modal, ModalBody, Select, SelectItem } from "@carbon/react";
|
|
4
|
+
import { Encounter, Patient, showSnackbar, useSession } from "@openmrs/esm-framework";
|
|
5
|
+
import styles from './admit-patient.modal.scss';
|
|
6
|
+
import { AdmissionEncounterTypeUuids } from "../../constants";
|
|
7
|
+
import { admitPatientToWard, assignBedToPatient } from "../../admissions.resource";
|
|
8
|
+
interface AdmitPatientModalProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
disposition: Disposition;
|
|
11
|
+
onModalClose: () => void;
|
|
12
|
+
bedLayouts: BedLayout[];
|
|
13
|
+
onSuccessfullAdmission: () => void;
|
|
14
|
+
}
|
|
15
|
+
const AdmitPatientModal: React.FC<AdmitPatientModalProps> = ({ onModalClose, open, disposition, bedLayouts, onSuccessfullAdmission }) => {
|
|
16
|
+
const [selectedBedId, setSelectedBedId] = useState<number>();
|
|
17
|
+
const session = useSession();
|
|
18
|
+
const location = session.sessionLocation;
|
|
19
|
+
|
|
20
|
+
const admitPatient = async () => {
|
|
21
|
+
try{
|
|
22
|
+
const admitPatientDto = generateAdmitPatientPayload();
|
|
23
|
+
const resp = await admitPatientToWard(admitPatientDto);
|
|
24
|
+
|
|
25
|
+
showSnackbar({
|
|
26
|
+
kind: 'success',
|
|
27
|
+
title: 'Admission Successfull',
|
|
28
|
+
subtitle: 'Patient Successfully Admitted',
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
//assign bed to patient
|
|
32
|
+
const assignBedDto = generateAssignBedPayload(resp);
|
|
33
|
+
await assignBedToPatient(selectedBedId,assignBedDto);
|
|
34
|
+
|
|
35
|
+
showSnackbar({
|
|
36
|
+
kind: 'success',
|
|
37
|
+
title: 'Bed Assignment Successfull',
|
|
38
|
+
subtitle: `Patient Successfully assigned bed ${selectedBedId}`,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
onSuccessfullAdmission();
|
|
42
|
+
|
|
43
|
+
}catch(error){
|
|
44
|
+
console.log({error});
|
|
45
|
+
showSnackbar({
|
|
46
|
+
kind: 'error',
|
|
47
|
+
title: 'Bed Assignment failed',
|
|
48
|
+
subtitle: error.message ?? 'Bed Assignment failed'
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
};
|
|
54
|
+
const bedSelectedHandler = (bedId: number) => {
|
|
55
|
+
setSelectedBedId(bedId);
|
|
56
|
+
};
|
|
57
|
+
const generateAdmitPatientPayload = (): AdmitPatientDto=>{
|
|
58
|
+
return {
|
|
59
|
+
patient: disposition.patient.uuid,
|
|
60
|
+
encounterType: {
|
|
61
|
+
uuid: AdmissionEncounterTypeUuids.ADMIT_ENCOUNTER_TYPE_UUID
|
|
62
|
+
},
|
|
63
|
+
location: location.uuid,
|
|
64
|
+
obs: [],
|
|
65
|
+
visit: disposition.visit.uuid
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const generateAssignBedPayload = (admissionEncounter: Encounter): AssignBedToPatientDto=>{
|
|
69
|
+
return {
|
|
70
|
+
patientUuid: disposition.patient.uuid,
|
|
71
|
+
encounterUuid: admissionEncounter.uuid
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return <>
|
|
75
|
+
<Modal
|
|
76
|
+
modalHeading="Admit Patient"
|
|
77
|
+
open={open}
|
|
78
|
+
size="md"
|
|
79
|
+
onSecondarySubmit={() => onModalClose()}
|
|
80
|
+
onRequestClose={() => onModalClose()}
|
|
81
|
+
onRequestSubmit={admitPatient}
|
|
82
|
+
primaryButtonText="Admit"
|
|
83
|
+
secondaryButtonText="Cancel"
|
|
84
|
+
>
|
|
85
|
+
<ModalBody>
|
|
86
|
+
<div className={styles.serveModalLayout}>
|
|
87
|
+
<div className={styles.serveModalContentSection}>
|
|
88
|
+
<div className={styles.formRow}>
|
|
89
|
+
<Select
|
|
90
|
+
id="ward-beds"
|
|
91
|
+
labelText="Beds"
|
|
92
|
+
onChange={($event) => bedSelectedHandler(parseInt($event.target.value))}
|
|
93
|
+
>
|
|
94
|
+
<SelectItem value="" text="Select" />;
|
|
95
|
+
{bedLayouts &&
|
|
96
|
+
bedLayouts.filter((bl)=>{
|
|
97
|
+
return bl.status === 'AVAILABLE'
|
|
98
|
+
}).map((bl) => {
|
|
99
|
+
return <SelectItem value={bl.bedId} text={`${bl.bedNumber} (${bl.status})`} />;
|
|
100
|
+
})}
|
|
101
|
+
</Select>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</ModalBody>
|
|
106
|
+
</Modal>
|
|
107
|
+
</>
|
|
108
|
+
}
|
|
109
|
+
export default AdmitPatientModal;
|
|
File without changes
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Modal, ModalBody, Select, SelectItem } from "@carbon/react";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { AssignBedToPatientDto, BedLayout, BedSwapDto, Disposition } from "../../types";
|
|
4
|
+
import styles from './bed-swap.modal.scss';
|
|
5
|
+
import { AdmissionEncounterTypeUuids } from "../../constants";
|
|
6
|
+
import { Encounter,Person, showSnackbar, useSession } from "@openmrs/esm-framework";
|
|
7
|
+
import { assignBedToPatient, bedSwapRequest } from "../../admissions.resource";
|
|
8
|
+
interface BedSwapModalProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
disposition: Disposition;
|
|
11
|
+
person: Person;
|
|
12
|
+
onModalClose: () => void;
|
|
13
|
+
bedLayouts: BedLayout[];
|
|
14
|
+
onSuccessfullBedSwap: () => void;
|
|
15
|
+
}
|
|
16
|
+
const BedSwapModal: React.FC<BedSwapModalProps> = ({open,onModalClose,onSuccessfullBedSwap,bedLayouts,disposition,person})=>{
|
|
17
|
+
const [selectedBedId, setSelectedBedId] = useState<number>();
|
|
18
|
+
const session = useSession();
|
|
19
|
+
const location = session.sessionLocation;
|
|
20
|
+
|
|
21
|
+
const swapBed = async ()=>{
|
|
22
|
+
|
|
23
|
+
try{
|
|
24
|
+
const bedSwapPayload = generateBedSwapRequestDto();
|
|
25
|
+
const resp = await bedSwapRequest(bedSwapPayload);
|
|
26
|
+
|
|
27
|
+
//assign bed to patient
|
|
28
|
+
const assignBedDto = generateAssignBedPayload(resp);
|
|
29
|
+
await assignBedToPatient(selectedBedId,assignBedDto);
|
|
30
|
+
showSnackbar({
|
|
31
|
+
kind: 'success',
|
|
32
|
+
title: 'Bed swap Successfull',
|
|
33
|
+
subtitle: `Patient Successfully assigned bed ${selectedBedId}`,
|
|
34
|
+
});
|
|
35
|
+
onSuccessfullBedSwap();
|
|
36
|
+
}catch(error){
|
|
37
|
+
console.log({error});
|
|
38
|
+
showSnackbar({
|
|
39
|
+
kind: 'error',
|
|
40
|
+
title: 'Bed Assignment failed',
|
|
41
|
+
subtitle: error.message ?? 'Bed Assignment failed'
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
const generateAssignBedPayload = (assignEncounter: Encounter): AssignBedToPatientDto=>{
|
|
48
|
+
return {
|
|
49
|
+
patientUuid: person.uuid,
|
|
50
|
+
encounterUuid: assignEncounter.uuid
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const handleBedChange = (bedId: number)=>{
|
|
54
|
+
setSelectedBedId(bedId);
|
|
55
|
+
}
|
|
56
|
+
const generateBedSwapRequestDto = (): BedSwapDto => {
|
|
57
|
+
return {
|
|
58
|
+
"patient": person.uuid,
|
|
59
|
+
"encounterType": {
|
|
60
|
+
"uuid": AdmissionEncounterTypeUuids.BED_ASSIGNMENT_ENCOUNTER_TYPE_UUID,
|
|
61
|
+
},
|
|
62
|
+
"location": location.uuid,
|
|
63
|
+
"obs": [],
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return <>
|
|
68
|
+
<Modal
|
|
69
|
+
modalHeading="Swap Beds"
|
|
70
|
+
open={open}
|
|
71
|
+
size="md"
|
|
72
|
+
onSecondarySubmit={() => onModalClose()}
|
|
73
|
+
onRequestClose={() => onModalClose()}
|
|
74
|
+
onRequestSubmit={swapBed}
|
|
75
|
+
primaryButtonText="Swap Beds"
|
|
76
|
+
secondaryButtonText="Cancel"
|
|
77
|
+
>
|
|
78
|
+
<ModalBody>
|
|
79
|
+
<div className={styles.serveModalLayout}>
|
|
80
|
+
<div className={styles.serveModalContentSection}>
|
|
81
|
+
<div className={styles.formRow}>
|
|
82
|
+
<Select
|
|
83
|
+
id="ward-beds"
|
|
84
|
+
labelText="Beds"
|
|
85
|
+
onChange={($event) => handleBedChange(parseInt($event.target.value))}
|
|
86
|
+
>
|
|
87
|
+
<SelectItem value="" text="Select" />;
|
|
88
|
+
{bedLayouts &&
|
|
89
|
+
bedLayouts.filter((bl)=>{
|
|
90
|
+
return bl.status === 'AVAILABLE'
|
|
91
|
+
}).map((bl) => {
|
|
92
|
+
return <SelectItem value={bl.bedId} text={`${bl.bedNumber} (${bl.status})`} />;
|
|
93
|
+
})}
|
|
94
|
+
</Select>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</ModalBody>
|
|
99
|
+
</Modal>
|
|
100
|
+
</>
|
|
101
|
+
}
|
|
102
|
+
export default BedSwapModal;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import styles from './cancel-admission-request.scss';
|
|
3
|
+
import { Modal, ModalBody, TextArea } from '@carbon/react';
|
|
4
|
+
import { type CancelAdmissionDto, type Disposition } from '../../types';
|
|
5
|
+
import { showSnackbar, useSession } from '@openmrs/esm-framework';
|
|
6
|
+
import { AdmissionConcepts, AdmissionEncounterTypeUuids } from '../../constants';
|
|
7
|
+
import { cancelAdmissionRequest } from '../../admissions.resource';
|
|
8
|
+
|
|
9
|
+
interface CancelAdmissionRequestModalProps {
|
|
10
|
+
open: boolean;
|
|
11
|
+
admissionRequest: Disposition;
|
|
12
|
+
onModalClose: () => void;
|
|
13
|
+
onCancelAdmission: () => void;
|
|
14
|
+
}
|
|
15
|
+
const CancelAdmissionRequestModal: React.FC<CancelAdmissionRequestModalProps> = ({
|
|
16
|
+
open,
|
|
17
|
+
admissionRequest,
|
|
18
|
+
onCancelAdmission,
|
|
19
|
+
onModalClose,
|
|
20
|
+
}) => {
|
|
21
|
+
const reasonRef = useRef<string>();
|
|
22
|
+
const session = useSession();
|
|
23
|
+
const location = session.sessionLocation;
|
|
24
|
+
const handleReasonText = (reason: string) => {
|
|
25
|
+
reasonRef.current = reason;
|
|
26
|
+
};
|
|
27
|
+
const handleCancelRequest = async () => {
|
|
28
|
+
try {
|
|
29
|
+
const cancelAdmissionDto = generateCancelAdmissionRequestDto();
|
|
30
|
+
const resp = await cancelAdmissionRequest(cancelAdmissionDto);
|
|
31
|
+
if (resp) {
|
|
32
|
+
showSnackbar({
|
|
33
|
+
kind: 'success',
|
|
34
|
+
title: 'Cancel request successfull',
|
|
35
|
+
subtitle: 'Admission request succesfully cancelled',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
onCancelAdmission();
|
|
39
|
+
} catch (error) {
|
|
40
|
+
showSnackbar({
|
|
41
|
+
kind: 'error',
|
|
42
|
+
title: 'Bed Assignment failed',
|
|
43
|
+
subtitle: error.message ?? 'Bed Assignment failed',
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const generateCancelAdmissionRequestDto = (): CancelAdmissionDto => {
|
|
48
|
+
return {
|
|
49
|
+
patient: admissionRequest.patient.uuid,
|
|
50
|
+
encounterType: {
|
|
51
|
+
uuid: AdmissionEncounterTypeUuids.CANCEL_ADT_ENCOUNTER_TYPE_UUID,
|
|
52
|
+
},
|
|
53
|
+
location: location.uuid,
|
|
54
|
+
obs: [
|
|
55
|
+
{
|
|
56
|
+
concept: AdmissionConcepts.CLINICAL_NOTES_UUID,
|
|
57
|
+
value: reasonRef.current,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
concept: AdmissionConcepts.ADMISSION_TO_HOSPITAL_DECISION_UUID,
|
|
61
|
+
value: {
|
|
62
|
+
uuid: AdmissionConcepts.ADMISSION_DENIED_UUID,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
visit: admissionRequest.visit.uuid,
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<>
|
|
72
|
+
<Modal
|
|
73
|
+
modalHeading="Cancel Admission Request"
|
|
74
|
+
open={open}
|
|
75
|
+
size="md"
|
|
76
|
+
onSecondarySubmit={onModalClose}
|
|
77
|
+
onRequestClose={onModalClose}
|
|
78
|
+
onRequestSubmit={handleCancelRequest}
|
|
79
|
+
primaryButtonText="Cancel Admission Request"
|
|
80
|
+
secondaryButtonText="Cancel"
|
|
81
|
+
>
|
|
82
|
+
<ModalBody>
|
|
83
|
+
<div className={styles.cancelAdmissionLayout}>
|
|
84
|
+
<div className={styles.contentSection}>
|
|
85
|
+
<div className={styles.formRow}>
|
|
86
|
+
<TextArea
|
|
87
|
+
enableCounter
|
|
88
|
+
helperText=""
|
|
89
|
+
id="cancel-reason"
|
|
90
|
+
labelText="Cancel Reason"
|
|
91
|
+
maxCount={500}
|
|
92
|
+
placeholder=""
|
|
93
|
+
rows={4}
|
|
94
|
+
onChange={(e) => handleReasonText(e.target.value)}
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</ModalBody>
|
|
100
|
+
</Modal>
|
|
101
|
+
</>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export default CancelAdmissionRequestModal;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DischargePatientDto, type Disposition, type UnAssignBedDto } from '../../types';
|
|
3
|
+
import { Modal, ModalBody } from '@carbon/react';
|
|
4
|
+
import styles from './discharge-patient.modal.scss';
|
|
5
|
+
import { AdmissionEncounterTypeUuids } from '../../constants';
|
|
6
|
+
import { type Person, showSnackbar, useSession } from '@openmrs/esm-framework';
|
|
7
|
+
import { dischargePatientFromWard, unassignBed } from '../../admissions.resource';
|
|
8
|
+
interface DischargeModalProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
admissionRequest: Disposition & { bedId: number; person: Person };
|
|
11
|
+
onModalClose: () => void;
|
|
12
|
+
onDischarge: () => void;
|
|
13
|
+
}
|
|
14
|
+
const DischargeModal: React.FC<DischargeModalProps> = ({ open, admissionRequest, onModalClose, onDischarge }) => {
|
|
15
|
+
const session = useSession();
|
|
16
|
+
const location = session.sessionLocation;
|
|
17
|
+
const handleDischarge = async () => {
|
|
18
|
+
try {
|
|
19
|
+
const dischargeDto = generateDischargePatientRequestDto();
|
|
20
|
+
await dischargePatientFromWard(dischargeDto);
|
|
21
|
+
showSnackbar({
|
|
22
|
+
kind: 'success',
|
|
23
|
+
title: 'Discharge request successfull',
|
|
24
|
+
subtitle: 'Patient Succesfully discharged from ward',
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// unassign bed
|
|
28
|
+
const unAssignBedDto = generateUnassignBedDto();
|
|
29
|
+
await unassignBed(unAssignBedDto);
|
|
30
|
+
|
|
31
|
+
showSnackbar({
|
|
32
|
+
kind: 'success',
|
|
33
|
+
title: 'Bed Unassigned successfull',
|
|
34
|
+
subtitle: `Bed ${admissionRequest.bedId} successfully unassigned`,
|
|
35
|
+
});
|
|
36
|
+
onDischarge();
|
|
37
|
+
} catch (error) {
|
|
38
|
+
showSnackbar({
|
|
39
|
+
kind: 'error',
|
|
40
|
+
title: 'Patient Discharge failed',
|
|
41
|
+
subtitle: 'Patient Discharge failed',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const generateDischargePatientRequestDto = (): DischargePatientDto => {
|
|
46
|
+
return {
|
|
47
|
+
patient: admissionRequest.person.uuid,
|
|
48
|
+
encounterType: {
|
|
49
|
+
uuid: AdmissionEncounterTypeUuids.DISCHARGE_ENCOUNTER_TYPE_UUID,
|
|
50
|
+
},
|
|
51
|
+
location: location.uuid,
|
|
52
|
+
obs: [],
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
const generateUnassignBedDto = (): UnAssignBedDto => {
|
|
56
|
+
return {
|
|
57
|
+
patientUuid: admissionRequest.person.uuid,
|
|
58
|
+
bedId: admissionRequest.bedId,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
return (
|
|
62
|
+
<>
|
|
63
|
+
<Modal
|
|
64
|
+
modalHeading="Discharge"
|
|
65
|
+
open={open}
|
|
66
|
+
size="md"
|
|
67
|
+
onSecondarySubmit={onModalClose}
|
|
68
|
+
onRequestClose={onModalClose}
|
|
69
|
+
onRequestSubmit={handleDischarge}
|
|
70
|
+
primaryButtonText="Discharge"
|
|
71
|
+
secondaryButtonText="Cancel"
|
|
72
|
+
>
|
|
73
|
+
<ModalBody>
|
|
74
|
+
<div className={styles.dischargeLayout}>
|
|
75
|
+
<div className={styles.contentSection}>
|
|
76
|
+
<h5>Are you sure you want to discharge Patient from Ward?</h5>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</ModalBody>
|
|
80
|
+
</Modal>
|
|
81
|
+
</>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
export default DischargeModal;
|