@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,80 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal, ModalBody } from '@carbon/react';
|
|
3
|
+
import { type QueueEntryResult } from '../../../registry/types';
|
|
4
|
+
import styles from './serve-patient.comppnent.scss';
|
|
5
|
+
import { type TransitionQueueEntryDto } from '../../../types/types';
|
|
6
|
+
import { QUEUE_STATUS_UUIDS } from '../../../shared/constants/concepts';
|
|
7
|
+
import { transitionQueueEntry } from '../../service.resource';
|
|
8
|
+
import { showSnackbar } from '@openmrs/esm-framework';
|
|
9
|
+
|
|
10
|
+
interface ServePatientModal {
|
|
11
|
+
open: boolean;
|
|
12
|
+
onModalClose: () => void;
|
|
13
|
+
currentQueueEntry: QueueEntryResult;
|
|
14
|
+
onSuccessfullServe: () => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const ServePatientModal: React.FC<ServePatientModal> = ({
|
|
18
|
+
open,
|
|
19
|
+
onModalClose,
|
|
20
|
+
currentQueueEntry,
|
|
21
|
+
onSuccessfullServe,
|
|
22
|
+
}) => {
|
|
23
|
+
const servePatient = async () => {
|
|
24
|
+
const payload = getServePatientPayload();
|
|
25
|
+
try {
|
|
26
|
+
await transitionQueueEntry(payload);
|
|
27
|
+
showAlert('success', 'Client succesfully served', '');
|
|
28
|
+
onSuccessfullServe();
|
|
29
|
+
} catch (e) {
|
|
30
|
+
showAlert('error', e.message, '');
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const showAlert = (alertType: 'error' | 'success', title: string, subtitle: string) => {
|
|
34
|
+
showSnackbar({
|
|
35
|
+
kind: alertType,
|
|
36
|
+
title: title,
|
|
37
|
+
subtitle: subtitle,
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
const getServePatientPayload = (): TransitionQueueEntryDto => {
|
|
41
|
+
const payload: TransitionQueueEntryDto = {
|
|
42
|
+
queueEntryToTransition: currentQueueEntry.queue_entry_uuid,
|
|
43
|
+
newQueue: currentQueueEntry.service_uuid,
|
|
44
|
+
newStatus: QUEUE_STATUS_UUIDS.IN_SERVICE_UUID,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return payload;
|
|
48
|
+
};
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<Modal
|
|
52
|
+
modalHeading="Serve Client"
|
|
53
|
+
open={open}
|
|
54
|
+
size="md"
|
|
55
|
+
onSecondarySubmit={() => onModalClose()}
|
|
56
|
+
onRequestClose={() => onModalClose()}
|
|
57
|
+
onRequestSubmit={servePatient}
|
|
58
|
+
primaryButtonText="Serve"
|
|
59
|
+
secondaryButtonText="Cancel"
|
|
60
|
+
>
|
|
61
|
+
<ModalBody>
|
|
62
|
+
<div className={styles.serveModalLayout}>
|
|
63
|
+
<div className={styles.serveModalContentSection}>
|
|
64
|
+
<div className={styles.formRow}>
|
|
65
|
+
<p>
|
|
66
|
+
Name: {currentQueueEntry.family_name} {currentQueueEntry.middle_name} {currentQueueEntry.given_name}
|
|
67
|
+
</p>
|
|
68
|
+
<p>Ticket No: {currentQueueEntry.queue_entry_id}</p>
|
|
69
|
+
<p>Status: {currentQueueEntry.status}</p>
|
|
70
|
+
<p>Priority: {currentQueueEntry.priority}</p>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</ModalBody>
|
|
75
|
+
</Modal>
|
|
76
|
+
</>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export default ServePatientModal;
|
|
File without changes
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal, ModalBody, TextInput } from '@carbon/react';
|
|
3
|
+
import { type EndVisitDto, type QueueEntryResult } from '../../../registry/types';
|
|
4
|
+
import styles from './sign-off.modal.scss';
|
|
5
|
+
import { showSnackbar } from '@openmrs/esm-framework';
|
|
6
|
+
import { endVisit } from '../../../resources/visit.resource';
|
|
7
|
+
import { closeQueueEntry } from '../../service-queues.resource';
|
|
8
|
+
|
|
9
|
+
interface SignOffEntryModalProps {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onModalClose: () => void;
|
|
12
|
+
currentQueueEntry: QueueEntryResult;
|
|
13
|
+
onSuccessfullSignOff: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const SignOffEntryModal: React.FC<SignOffEntryModalProps> = ({
|
|
17
|
+
open,
|
|
18
|
+
onModalClose,
|
|
19
|
+
currentQueueEntry,
|
|
20
|
+
onSuccessfullSignOff,
|
|
21
|
+
}) => {
|
|
22
|
+
const signOffEntry = async () => {
|
|
23
|
+
const payload = getEndVisitPayload();
|
|
24
|
+
try {
|
|
25
|
+
await removePatientFromQueue(currentQueueEntry);
|
|
26
|
+
await endVisit(currentQueueEntry.visit_uuid, payload);
|
|
27
|
+
showAlert('success', 'Visit Ended successfully', '');
|
|
28
|
+
onSuccessfullSignOff();
|
|
29
|
+
} catch (e) {
|
|
30
|
+
showAlert('error', e.message, '');
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const showAlert = (alertType: 'error' | 'success', title: string, subtitle: string) => {
|
|
34
|
+
showSnackbar({
|
|
35
|
+
kind: alertType,
|
|
36
|
+
title: title,
|
|
37
|
+
subtitle: subtitle,
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
const getEndVisitPayload = (): EndVisitDto => {
|
|
41
|
+
return {
|
|
42
|
+
stopDatetime: new Date().toISOString(),
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const removePatientFromQueue = async (currentQueueEntry: QueueEntryResult) => {
|
|
46
|
+
try {
|
|
47
|
+
await closeQueueEntry(currentQueueEntry.queue_entry_uuid);
|
|
48
|
+
showAlert('success', 'Patient removal from queue successfully!', '');
|
|
49
|
+
} catch (e) {
|
|
50
|
+
showAlert('error', 'Patient removal from queue failed!', '');
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
<Modal
|
|
56
|
+
modalHeading="Sign Off"
|
|
57
|
+
open={open}
|
|
58
|
+
size="md"
|
|
59
|
+
onSecondarySubmit={() => onModalClose()}
|
|
60
|
+
onRequestClose={() => onModalClose()}
|
|
61
|
+
onRequestSubmit={signOffEntry}
|
|
62
|
+
primaryButtonText="Sign Off"
|
|
63
|
+
secondaryButtonText="Cancel"
|
|
64
|
+
>
|
|
65
|
+
<ModalBody>
|
|
66
|
+
<div className={styles.serveModalLayout}>
|
|
67
|
+
<div className={styles.serveModalContentSection}>
|
|
68
|
+
<div className={styles.formRow}>
|
|
69
|
+
<TextInput id="health-worker-id" labelText="Enter your Provider ID" onChange={() => {}} type="text" />
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</ModalBody>
|
|
74
|
+
</Modal>
|
|
75
|
+
</>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default SignOffEntryModal;
|
|
File without changes
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Modal, ModalBody, Select, SelectItem, TextArea } from '@carbon/react';
|
|
3
|
+
import styles from './transition-patient.component.scss';
|
|
4
|
+
import { type QueueEntryResult } from '../../../registry/types';
|
|
5
|
+
import { transitionQueueEntry } from '../../service.resource';
|
|
6
|
+
import { type TransitionQueueEntryDto } from '../../../types/types';
|
|
7
|
+
import { QUEUE_PRIORITIES_UUIDS, QUEUE_STATUS_UUIDS } from '../../../shared/constants/concepts';
|
|
8
|
+
import { showSnackbar } from '@openmrs/esm-framework';
|
|
9
|
+
interface TransitionPatientModalProps {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onModalClose: () => void;
|
|
12
|
+
currentQueueEntry: QueueEntryResult;
|
|
13
|
+
}
|
|
14
|
+
const TransitionPatientModal: React.FC<TransitionPatientModalProps> = ({ open, onModalClose, currentQueueEntry }) => {
|
|
15
|
+
const [selectedComment, setSelectedComment] = useState<string>();
|
|
16
|
+
const [selectedPriority, setSelectedPriority] = useState<string>();
|
|
17
|
+
const [selectedStatus, setSelectedStatus] = useState<string>();
|
|
18
|
+
|
|
19
|
+
const statusChangeHandler = (statusUuid: string) => {
|
|
20
|
+
setSelectedStatus(statusUuid);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const transtionQueueEntry = async () => {
|
|
24
|
+
const payload = getTransitionQueueEntryPayload();
|
|
25
|
+
try {
|
|
26
|
+
await transitionQueueEntry(payload);
|
|
27
|
+
showAlert('success', 'Client succesfully Transitioned', '');
|
|
28
|
+
onModalClose();
|
|
29
|
+
} catch (e) {
|
|
30
|
+
showAlert('error', e.message, '');
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const showAlert = (alertType: 'error' | 'success', title: string, subtitle: string) => {
|
|
35
|
+
showSnackbar({
|
|
36
|
+
kind: alertType,
|
|
37
|
+
title: title,
|
|
38
|
+
subtitle: subtitle,
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
const getTransitionQueueEntryPayload = (): TransitionQueueEntryDto => {
|
|
42
|
+
const payload: TransitionQueueEntryDto = {
|
|
43
|
+
queueEntryToTransition: currentQueueEntry.queue_entry_uuid,
|
|
44
|
+
newQueue: currentQueueEntry.service_uuid,
|
|
45
|
+
newStatus: selectedStatus,
|
|
46
|
+
newPriority: selectedPriority,
|
|
47
|
+
newPriorityComment: selectedComment,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return payload;
|
|
51
|
+
};
|
|
52
|
+
const priorityChangeHandler = (priorityUuid: string) => {
|
|
53
|
+
setSelectedPriority(priorityUuid);
|
|
54
|
+
};
|
|
55
|
+
const handleCommentChange = (comment: string) => {
|
|
56
|
+
setSelectedComment(comment);
|
|
57
|
+
};
|
|
58
|
+
return (
|
|
59
|
+
<>
|
|
60
|
+
<Modal
|
|
61
|
+
open={open}
|
|
62
|
+
size="md"
|
|
63
|
+
onSecondarySubmit={() => onModalClose()}
|
|
64
|
+
onRequestClose={() => onModalClose()}
|
|
65
|
+
onRequestSubmit={transtionQueueEntry}
|
|
66
|
+
primaryButtonText="Transition"
|
|
67
|
+
secondaryButtonText="Cancel"
|
|
68
|
+
>
|
|
69
|
+
<ModalBody>
|
|
70
|
+
<div className={styles.modelLayout}>
|
|
71
|
+
<div className={styles.sectionHeader}>
|
|
72
|
+
<h4>Move Client</h4>
|
|
73
|
+
</div>
|
|
74
|
+
<div className={styles.formSection}>
|
|
75
|
+
<div className={styles.formRow}>
|
|
76
|
+
<div className={styles.formControl}>
|
|
77
|
+
<Select
|
|
78
|
+
id="queue-status"
|
|
79
|
+
labelText="Select Queue Status"
|
|
80
|
+
onChange={(e) => statusChangeHandler(e.target.value)}
|
|
81
|
+
>
|
|
82
|
+
<SelectItem value="" text="" />;
|
|
83
|
+
<SelectItem value={QUEUE_STATUS_UUIDS.WAITING_UUID} text="IN WAITING" />;
|
|
84
|
+
<SelectItem value={QUEUE_STATUS_UUIDS.IN_SERVICE_UUID} text="IN SERVICE" />;
|
|
85
|
+
<SelectItem value={QUEUE_STATUS_UUIDS.COMPLETED_UUID} text="COMPLETED" />;
|
|
86
|
+
</Select>
|
|
87
|
+
</div>
|
|
88
|
+
<div className={styles.formControl}>
|
|
89
|
+
<Select
|
|
90
|
+
id="priority"
|
|
91
|
+
labelText="Select a Priority"
|
|
92
|
+
onChange={(e) => priorityChangeHandler(e.target.value)}
|
|
93
|
+
>
|
|
94
|
+
<SelectItem value="" text="Select" />;
|
|
95
|
+
<SelectItem value={QUEUE_PRIORITIES_UUIDS.NORMAL_PRIORITY_UUID} text="NORMAL" />;
|
|
96
|
+
<SelectItem value={QUEUE_PRIORITIES_UUIDS.EMERGENCY_PRIORITY_UUID} text="EMERGENCY" />;
|
|
97
|
+
</Select>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
<div className={styles.formRow}>
|
|
101
|
+
<div className={styles.formControl}>
|
|
102
|
+
<TextArea
|
|
103
|
+
enableCounter
|
|
104
|
+
helperText="Comment"
|
|
105
|
+
id="comment"
|
|
106
|
+
labelText="Comment"
|
|
107
|
+
maxCount={500}
|
|
108
|
+
placeholder="Comment"
|
|
109
|
+
onChange={(e) => handleCommentChange(e.target.value)}
|
|
110
|
+
rows={4}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</ModalBody>
|
|
117
|
+
</Modal>
|
|
118
|
+
</>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export default TransitionPatientModal;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const CHECKIN_KEY = 'checkin';
|
|
2
|
+
export const checkInRoom = (providerUuid: string, queueRoom: string) => {
|
|
3
|
+
const checkInVal = formatCheckinValue(providerUuid, queueRoom);
|
|
4
|
+
localStorage.setItem(CHECKIN_KEY, checkInVal);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const formatCheckinValue = (providerUuid: string, queueRoom: string): string => {
|
|
8
|
+
return (queueRoom + providerUuid).replaceAll(' ', '');
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const getCheckinValue = (): string | null => {
|
|
12
|
+
return localStorage.getItem(CHECKIN_KEY) ?? null;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const checkOutRoom = () => {
|
|
16
|
+
localStorage.removeItem(CHECKIN_KEY);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const isCheckedIn = (providerUuid: string, queueRoom): boolean => {
|
|
20
|
+
if (!providerUuid || !queueRoom) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
const checkInVal = formatCheckinValue(providerUuid, queueRoom);
|
|
24
|
+
const cachedCheckedInVal = getCheckinValue();
|
|
25
|
+
return checkInVal === cachedCheckedInVal;
|
|
26
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.queueListLayout{
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
row-gap: 15px;
|
|
6
|
+
padding: 5px 5px;
|
|
7
|
+
}
|
|
8
|
+
.actionHeader{
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
justify-content: flex-end;
|
|
12
|
+
width: 100%;
|
|
13
|
+
column-gap: 10px;
|
|
14
|
+
}
|
|
15
|
+
.tableSection{
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
width: 100%;
|
|
19
|
+
row-gap: 10px;
|
|
20
|
+
}
|
|
21
|
+
.searchInput{
|
|
22
|
+
width: 40%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.nonUrgentTag{
|
|
26
|
+
background-color:rgb(167, 240, 186);
|
|
27
|
+
color:rgb(14, 96, 39);
|
|
28
|
+
}
|
|
29
|
+
.emergencyTag{
|
|
30
|
+
background-color:rgb(255, 215, 217);
|
|
31
|
+
color:rgb(162, 25, 31);
|
|
32
|
+
}
|
|
33
|
+
.priorityTag{
|
|
34
|
+
background-color:rgb(248,237,98);
|
|
35
|
+
color:brown;
|
|
36
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Link,
|
|
4
|
+
OverflowMenu,
|
|
5
|
+
OverflowMenuItem,
|
|
6
|
+
Table,
|
|
7
|
+
TableBody,
|
|
8
|
+
TableCell,
|
|
9
|
+
TableHead,
|
|
10
|
+
TableHeader,
|
|
11
|
+
TableRow,
|
|
12
|
+
Tag,
|
|
13
|
+
TextInput,
|
|
14
|
+
} from '@carbon/react';
|
|
15
|
+
import { type QueueEntryResult } from '../../registry/types';
|
|
16
|
+
import React, { useMemo, useState } from 'react';
|
|
17
|
+
import styles from './queue-list.component.scss';
|
|
18
|
+
import { QueueEntryPriority, QueueEntryStatus, type TagColor } from '../../types/types';
|
|
19
|
+
import { getTagClassByPriority } from '../../shared/utils/get-tag-type';
|
|
20
|
+
import { useSession } from '@openmrs/esm-framework';
|
|
21
|
+
import { checkInRoom, checkOutRoom, isCheckedIn } from './check-in.service';
|
|
22
|
+
|
|
23
|
+
interface QueueListProps {
|
|
24
|
+
queueRoom: string;
|
|
25
|
+
queueEntries: QueueEntryResult[];
|
|
26
|
+
handleMovePatient: (queueEntryResult: QueueEntryResult) => void;
|
|
27
|
+
handleTransitionPatient: (queueEntryResult: QueueEntryResult) => void;
|
|
28
|
+
handleServePatient: (queueEntryResult: QueueEntryResult) => void;
|
|
29
|
+
handleSignOff: (queueEntryResult: QueueEntryResult) => void;
|
|
30
|
+
handleRemovePatient: (queueEntryResult: QueueEntryResult) => void;
|
|
31
|
+
showComingFromCol: boolean;
|
|
32
|
+
handleClearQueue: (queueEntryResults: QueueEntryResult[]) => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const QueueList: React.FC<QueueListProps> = ({
|
|
36
|
+
queueRoom,
|
|
37
|
+
queueEntries,
|
|
38
|
+
handleMovePatient,
|
|
39
|
+
handleTransitionPatient,
|
|
40
|
+
handleServePatient,
|
|
41
|
+
handleSignOff,
|
|
42
|
+
handleRemovePatient,
|
|
43
|
+
showComingFromCol,
|
|
44
|
+
handleClearQueue,
|
|
45
|
+
}) => {
|
|
46
|
+
const session = useSession();
|
|
47
|
+
const provider = session.currentProvider;
|
|
48
|
+
const [checkIn, setCheckin] = useState<boolean>(isProviderCheckedIn());
|
|
49
|
+
|
|
50
|
+
const [searchString, setSearchString] = useState<string>();
|
|
51
|
+
const urgentEntries = useMemo(
|
|
52
|
+
() => sortQueueByPriorityAndWaitTime(queueEntries, QueueEntryPriority.Emergency),
|
|
53
|
+
[queueEntries],
|
|
54
|
+
);
|
|
55
|
+
const priorityEntries = useMemo(
|
|
56
|
+
() => sortQueueByPriorityAndWaitTime(queueEntries, QueueEntryPriority.Priority),
|
|
57
|
+
[queueEntries],
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const nonUrgentEntries = useMemo(
|
|
61
|
+
() => sortQueueByPriorityAndWaitTime(queueEntries, QueueEntryPriority.NonUrgent),
|
|
62
|
+
[queueEntries],
|
|
63
|
+
);
|
|
64
|
+
const sortedQueueEntries = useMemo(() => generatePatientWaitingList(), [queueEntries]);
|
|
65
|
+
const filteredQueueEntries = useMemo(() => filterQueueBySearchString(), [queueEntries, searchString]);
|
|
66
|
+
function generatePatientWaitingList() {
|
|
67
|
+
return [...urgentEntries, ...priorityEntries, ...nonUrgentEntries];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function sortQueueByPriorityAndWaitTime(queueEntries: QueueEntryResult[], priority: QueueEntryPriority) {
|
|
71
|
+
return queueEntries
|
|
72
|
+
.filter((q) => {
|
|
73
|
+
return q.priority === priority;
|
|
74
|
+
})
|
|
75
|
+
.sort((a, b) => {
|
|
76
|
+
return b.wait_time_in_min - a.wait_time_in_min;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function isProviderCheckedIn() {
|
|
80
|
+
return isCheckedIn(provider.uuid, queueRoom);
|
|
81
|
+
}
|
|
82
|
+
const handleCheckin = () => {
|
|
83
|
+
checkInRoom(provider.uuid, queueRoom);
|
|
84
|
+
setCheckin(isProviderCheckedIn());
|
|
85
|
+
};
|
|
86
|
+
const handleCheckout = () => {
|
|
87
|
+
checkOutRoom();
|
|
88
|
+
setCheckin(isProviderCheckedIn());
|
|
89
|
+
};
|
|
90
|
+
const getTagTypeByStatus = (status: string): TagColor => {
|
|
91
|
+
let type: TagColor;
|
|
92
|
+
switch (status) {
|
|
93
|
+
case QueueEntryStatus.Completed:
|
|
94
|
+
type = 'green';
|
|
95
|
+
break;
|
|
96
|
+
case QueueEntryStatus.Waiting:
|
|
97
|
+
type = 'gray';
|
|
98
|
+
break;
|
|
99
|
+
case QueueEntryStatus.InService:
|
|
100
|
+
type = 'blue';
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
type = 'gray';
|
|
104
|
+
}
|
|
105
|
+
return type;
|
|
106
|
+
};
|
|
107
|
+
const clearQueue = () => {
|
|
108
|
+
handleClearQueue(sortedQueueEntries);
|
|
109
|
+
};
|
|
110
|
+
const handlQueueSearch = (searchTerm: string) => {
|
|
111
|
+
setSearchString(searchTerm);
|
|
112
|
+
};
|
|
113
|
+
function filterQueueBySearchString(): QueueEntryResult[] {
|
|
114
|
+
if (!searchString) {
|
|
115
|
+
return sortedQueueEntries;
|
|
116
|
+
}
|
|
117
|
+
return sortedQueueEntries.filter((qe) => {
|
|
118
|
+
const fullName = `${qe.family_name} ${qe.middle_name} ${qe.given_name}`;
|
|
119
|
+
return fullName.trim().toLowerCase().includes(searchString.trim().toLowerCase());
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function formatPatientName(qe: QueueEntryResult) {
|
|
123
|
+
return `${formatName(qe.family_name)} ${formatName(qe.middle_name)} ${formatName(qe.given_name)}`;
|
|
124
|
+
}
|
|
125
|
+
function formatName(name: string) {
|
|
126
|
+
if (name === 'NULL' || !name) {
|
|
127
|
+
return '';
|
|
128
|
+
} else {
|
|
129
|
+
return name;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return (
|
|
133
|
+
<>
|
|
134
|
+
<div className={styles.queueListLayout}>
|
|
135
|
+
<div className={styles.actionHeader}>
|
|
136
|
+
<>
|
|
137
|
+
<div className={styles.searchInput}>
|
|
138
|
+
<TextInput
|
|
139
|
+
id="queue-search"
|
|
140
|
+
labelText=""
|
|
141
|
+
onChange={(e) => handlQueueSearch(e.target.value)}
|
|
142
|
+
placeholder="Enter patient name to filter"
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
145
|
+
{checkIn ? (
|
|
146
|
+
<>
|
|
147
|
+
<Button kind="secondary" onClick={handleCheckout}>
|
|
148
|
+
Check Out
|
|
149
|
+
</Button>
|
|
150
|
+
{sortedQueueEntries.length > 0 ? (
|
|
151
|
+
<>
|
|
152
|
+
<Button kind="danger" onClick={clearQueue}>
|
|
153
|
+
Clear Queue
|
|
154
|
+
</Button>
|
|
155
|
+
</>
|
|
156
|
+
) : (
|
|
157
|
+
<></>
|
|
158
|
+
)}
|
|
159
|
+
</>
|
|
160
|
+
) : (
|
|
161
|
+
<>
|
|
162
|
+
<Button kind="primary" onClick={handleCheckin}>
|
|
163
|
+
Check In
|
|
164
|
+
</Button>
|
|
165
|
+
</>
|
|
166
|
+
)}
|
|
167
|
+
</>
|
|
168
|
+
</div>
|
|
169
|
+
<div className={styles.tableSection}>
|
|
170
|
+
<Table>
|
|
171
|
+
<TableHead>
|
|
172
|
+
<TableRow>
|
|
173
|
+
<TableHeader>No</TableHeader>
|
|
174
|
+
<TableHeader>Name</TableHeader>
|
|
175
|
+
<TableHeader>Age</TableHeader>
|
|
176
|
+
<TableHeader>Phone Number</TableHeader>
|
|
177
|
+
<TableHeader>Identifiers</TableHeader>
|
|
178
|
+
<TableHeader>Coming From</TableHeader>
|
|
179
|
+
<TableHeader>Ticket</TableHeader>
|
|
180
|
+
<TableHeader>Status</TableHeader>
|
|
181
|
+
<TableHeader>Priority</TableHeader>
|
|
182
|
+
<TableHeader>Wait Time</TableHeader>
|
|
183
|
+
<TableHeader>Action</TableHeader>
|
|
184
|
+
</TableRow>
|
|
185
|
+
</TableHead>
|
|
186
|
+
<TableBody>
|
|
187
|
+
{filteredQueueEntries.map((val, index) => (
|
|
188
|
+
<TableRow id={val.queue_entry_uuid}>
|
|
189
|
+
<TableCell>{index + 1}</TableCell>
|
|
190
|
+
<TableCell>
|
|
191
|
+
{checkIn && val.status !== QueueEntryStatus.Waiting ? (
|
|
192
|
+
<Link href={`${window.spaBase}/patient/${val.patient_uuid}/chart/`}>
|
|
193
|
+
{formatPatientName(val)}
|
|
194
|
+
</Link>
|
|
195
|
+
) : (
|
|
196
|
+
<>{formatPatientName(val)}</>
|
|
197
|
+
)}
|
|
198
|
+
</TableCell>
|
|
199
|
+
<TableCell>{val.age ?? ''}</TableCell>
|
|
200
|
+
<TableCell>{val.phone_number ?? ''}</TableCell>
|
|
201
|
+
<TableCell>{val.identifiers ?? ''}</TableCell>
|
|
202
|
+
<TableCell>{showComingFromCol ? val.queue_coming_from : ''}</TableCell>
|
|
203
|
+
<TableCell>{val.queue_entry_id}</TableCell>
|
|
204
|
+
<TableCell>
|
|
205
|
+
<Tag size="md" type={getTagTypeByStatus(val.status)}>
|
|
206
|
+
{val.status}
|
|
207
|
+
</Tag>
|
|
208
|
+
</TableCell>
|
|
209
|
+
<TableCell>
|
|
210
|
+
<Tag size="md" className={styles[getTagClassByPriority(val.priority)]}>
|
|
211
|
+
{val.priority}
|
|
212
|
+
</Tag>
|
|
213
|
+
</TableCell>
|
|
214
|
+
<TableCell>{`${val.wait_time_in_min} minute(s)`}</TableCell>
|
|
215
|
+
<TableCell>
|
|
216
|
+
{val.status === QueueEntryStatus.Waiting ? (
|
|
217
|
+
<>
|
|
218
|
+
<Button kind="ghost" disabled={!checkIn} onClick={() => handleServePatient(val)}>
|
|
219
|
+
Serve
|
|
220
|
+
</Button>
|
|
221
|
+
</>
|
|
222
|
+
) : (
|
|
223
|
+
<>
|
|
224
|
+
{checkIn ? (
|
|
225
|
+
<>
|
|
226
|
+
<OverflowMenu aria-label="overflow-menu">
|
|
227
|
+
<OverflowMenuItem itemText="Transfer" onClick={() => handleMovePatient(val)} />
|
|
228
|
+
<OverflowMenuItem itemText="Transition" onClick={() => handleTransitionPatient(val)} />
|
|
229
|
+
<OverflowMenuItem itemText="Sign Off" onClick={() => handleSignOff(val)} />
|
|
230
|
+
<OverflowMenuItem itemText="Remove Patient" onClick={() => handleRemovePatient(val)} />
|
|
231
|
+
</OverflowMenu>
|
|
232
|
+
</>
|
|
233
|
+
) : (
|
|
234
|
+
<></>
|
|
235
|
+
)}
|
|
236
|
+
</>
|
|
237
|
+
)}
|
|
238
|
+
</TableCell>
|
|
239
|
+
</TableRow>
|
|
240
|
+
))}
|
|
241
|
+
</TableBody>
|
|
242
|
+
</Table>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
</>
|
|
246
|
+
);
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export default QueueList;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { MetricsCard, MetricsCardBody } from './metrics/metrics-cards/metrics-card.component';
|
|
3
|
+
import { Button, InlineLoading, Stack, Tag } from '@carbon/react';
|
|
4
|
+
import styles from './service-queue.scss';
|
|
5
|
+
import { useQueues } from './service-queues.resource';
|
|
6
|
+
import { Room } from './room/room.component';
|
|
7
|
+
import { type QueueEntryAction } from '../config-schema';
|
|
8
|
+
|
|
9
|
+
interface QueueRoomProps {
|
|
10
|
+
serviceUuid: string;
|
|
11
|
+
overflowMenuKeys: QueueEntryAction[];
|
|
12
|
+
defaultMenuKey: QueueEntryAction;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const QueueRoom: React.FC<QueueRoomProps> = ({ serviceUuid, defaultMenuKey, overflowMenuKeys }) => {
|
|
16
|
+
const { data: queuesData, isLoading: isLoadingQueues } = useQueues(serviceUuid);
|
|
17
|
+
const [checkedInRoomUuids, setCheckedInRoomUuids] = useState([]);
|
|
18
|
+
|
|
19
|
+
return <Stack orientation='horizontal' gap={1} className={styles.cardContainer}>
|
|
20
|
+
{
|
|
21
|
+
isLoadingQueues ? <InlineLoading /> : queuesData.data.results.map((queue, index) => (
|
|
22
|
+
<MetricsCard key={index} >
|
|
23
|
+
<Stack as="div" orientation='horizontal' gap={4} className={styles.cardHeaderStack}>
|
|
24
|
+
<p>{queue.display}</p>
|
|
25
|
+
<Tag type="blue" size="sm">
|
|
26
|
+
0 patient(s)
|
|
27
|
+
</Tag>
|
|
28
|
+
<Button kind={checkedInRoomUuids.includes(queue.uuid) ? 'danger' : 'primary'} size='sm' onClick={() => setCheckedInRoomUuids((prev) => (prev.includes(queue.uuid) ? prev.filter(q => q !== queue.uuid) : [...prev, queue.uuid]))}> {!checkedInRoomUuids.includes(queue.uuid) ? 'Check in' : 'Check out'}</Button>
|
|
29
|
+
</Stack>
|
|
30
|
+
<MetricsCardBody>
|
|
31
|
+
<Room checkedInRoomUuids={checkedInRoomUuids} queueUuid={queue.uuid} overflowMenuKeys={overflowMenuKeys} defaultMenuKey={defaultMenuKey}/>
|
|
32
|
+
</MetricsCardBody>
|
|
33
|
+
</MetricsCard>
|
|
34
|
+
))
|
|
35
|
+
}
|
|
36
|
+
</Stack>
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default QueueRoom;
|