@ampath/esm-dha-workflow-app 4.0.0-next.13 → 4.0.0-next.131
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/3485.js +1 -0
- package/dist/3485.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/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/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 +1546 -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 +113 -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 +215 -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 -4
- 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,54 @@
|
|
|
1
|
+
import { embedDashboard } from '@superset-ui/embedded-sdk';
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { fetchGuestToken } from '../../resources/superset.resource';
|
|
4
|
+
import { useSession } from '@openmrs/esm-framework';
|
|
5
|
+
|
|
6
|
+
import { getSubDomainUrl } from '../../shared/utils/get-base-url';
|
|
7
|
+
|
|
8
|
+
import styles from './chart.component.scss';
|
|
9
|
+
|
|
10
|
+
interface ChartProps {}
|
|
11
|
+
|
|
12
|
+
const Chart: React.FC<ChartProps> = () => {
|
|
13
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
14
|
+
const session = useSession();
|
|
15
|
+
const locationUuid = session.sessionLocation.uuid;
|
|
16
|
+
const [subDomainUrl, setSubDomainUrl] = useState<string | null>(null);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const fetchSubDomainUrl = async () => {
|
|
19
|
+
const url = await getSubDomainUrl();
|
|
20
|
+
setSubDomainUrl(url);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
fetchSubDomainUrl();
|
|
24
|
+
}, []);
|
|
25
|
+
const container = document.getElementById('my-superset-container');
|
|
26
|
+
|
|
27
|
+
const firstChild = container?.children?.[0] as HTMLElement | undefined;
|
|
28
|
+
|
|
29
|
+
if (firstChild) {
|
|
30
|
+
firstChild.style.width = '100%';
|
|
31
|
+
firstChild.style.height = '100%';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
embedDashboard({
|
|
36
|
+
id: '81cc98fd-5195-4404-bf38-2c8cd5509747',
|
|
37
|
+
supersetDomain: `${subDomainUrl}/superset`,
|
|
38
|
+
mountPoint: ref.current!,
|
|
39
|
+
fetchGuestToken: async () => await fetchGuestToken(locationUuid),
|
|
40
|
+
dashboardUiConfig: {
|
|
41
|
+
hideTitle: true,
|
|
42
|
+
filters: {
|
|
43
|
+
expanded: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}, [subDomainUrl]);
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
<div id="my-superset-container" className={styles.container} ref={ref}></div>
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
export default Chart;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Tab, TabList, TabPanel, TabPanels, Tabs } from '@carbon/react';
|
|
3
|
+
|
|
4
|
+
import styles from './dashboard.component.scss';
|
|
5
|
+
import Overview from './overview/overview.component';
|
|
6
|
+
import { getServiceQueueByLocationUuid } from '../service-queues/service-queues.resource';
|
|
7
|
+
import { type QueueEntryResult } from '../registry/types';
|
|
8
|
+
import { useSession } from '@openmrs/esm-framework';
|
|
9
|
+
import { QUEUE_SERVICE_UUIDS } from '../shared/constants/concepts';
|
|
10
|
+
import { getDashBoardSummary } from '../resources/dashboard.resource';
|
|
11
|
+
|
|
12
|
+
interface DashboardProps {}
|
|
13
|
+
|
|
14
|
+
const Dashboard: React.FC<DashboardProps> = () => {
|
|
15
|
+
const [triageQueueEntries, setTriageQueueEntries] = useState<QueueEntryResult[]>([]);
|
|
16
|
+
const [consultationQueueEntries, setConsultationQueueEntries] = useState<QueueEntryResult[]>([]);
|
|
17
|
+
const [dashboardSummary, setDashboardSummary] = useState<any[]>([]);
|
|
18
|
+
const session = useSession();
|
|
19
|
+
const locationUuid = session.sessionLocation.uuid;
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
getDashBoardData();
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
const getDashBoardData = async () => {
|
|
25
|
+
const res = await getDashBoardSummary(locationUuid);
|
|
26
|
+
setDashboardSummary(res[0]);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div className={styles.container}>
|
|
31
|
+
<Tabs>
|
|
32
|
+
<TabList contained scrollDebounceWait={200}>
|
|
33
|
+
<Tab>
|
|
34
|
+
<span className={styles.tabText}>Overview</span>
|
|
35
|
+
</Tab>
|
|
36
|
+
</TabList>
|
|
37
|
+
<TabPanels>
|
|
38
|
+
<TabPanel>
|
|
39
|
+
<Overview
|
|
40
|
+
triageCount={triageQueueEntries}
|
|
41
|
+
consultationCount={consultationQueueEntries}
|
|
42
|
+
dashboardSummary={dashboardSummary}
|
|
43
|
+
/>
|
|
44
|
+
</TabPanel>
|
|
45
|
+
</TabPanels>
|
|
46
|
+
</Tabs>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default Dashboard;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
justify-content: flex-start;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
gap: 1rem;
|
|
7
|
+
|
|
8
|
+
.card {
|
|
9
|
+
border: 1px solid grey;
|
|
10
|
+
border-radius: 5px;
|
|
11
|
+
background-color: white;
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
flex: 0 0 250px;
|
|
14
|
+
height: 5rem;
|
|
15
|
+
min-width: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.title {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 0.5rem;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (max-width: 1584px) {
|
|
27
|
+
.container .card {
|
|
28
|
+
flex: 0 0 calc(20% - 1rem);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.text {
|
|
32
|
+
font-size: 1rem;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
@media (max-width: 1456px) {
|
|
36
|
+
.container .card {
|
|
37
|
+
flex: 0 0 calc(25% - 1rem);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.text {
|
|
41
|
+
font-size: 1rem;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (max-width: 1356px) {
|
|
46
|
+
.container .card {
|
|
47
|
+
flex: 0 0 calc(25% - 1rem);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.text {
|
|
51
|
+
font-size: 1rem;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (max-width: 1264px) {
|
|
56
|
+
.container .card {
|
|
57
|
+
flex: 0 0 calc(30% - 1rem);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.text {
|
|
61
|
+
font-size: 1rem;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@media (max-width: 1095px) {
|
|
66
|
+
.container .card {
|
|
67
|
+
flex: 0 0 calc(30% - 1rem);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.text {
|
|
71
|
+
font-size: 1rem;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@media (max-width: 1024px) {
|
|
76
|
+
.container .card {
|
|
77
|
+
flex: 0 0 calc(50% - 1rem);
|
|
78
|
+
}
|
|
79
|
+
.text {
|
|
80
|
+
font-size: 1rem;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@media (max-width: 600px) {
|
|
85
|
+
.container .card {
|
|
86
|
+
flex: 0 0 100%;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
h4 {
|
|
92
|
+
font-weight: bold;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.dropdownItem {
|
|
96
|
+
display: flex;
|
|
97
|
+
justify-self: flex-end;
|
|
98
|
+
width: 25%;
|
|
99
|
+
min-width: 180px;
|
|
100
|
+
max-width: 280px;
|
|
101
|
+
margin-top: 5rem;
|
|
102
|
+
margin-bottom: 5rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.dropdownContainer {
|
|
106
|
+
.cds--list-box__menu-item__option {
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.cds--list-box__field {
|
|
111
|
+
font-weight: 600;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.opd {
|
|
116
|
+
background-color: #2B579A !important;
|
|
117
|
+
}
|
|
118
|
+
.completed {
|
|
119
|
+
background-color: #4CAF50 !important;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.uncompleted {
|
|
123
|
+
background-color: #FFC107 !important;
|
|
124
|
+
}
|
|
125
|
+
.emergencies {
|
|
126
|
+
background-color: lightcoral !important;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.waitingTime {
|
|
130
|
+
background-color: lightblue !important;
|
|
131
|
+
}
|
|
132
|
+
.labs {
|
|
133
|
+
background-color: lightgrey !important;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.pharmacy {
|
|
137
|
+
background-color: lightgreen !important;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.text {
|
|
141
|
+
color: white;
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: 0.5rem;
|
|
145
|
+
white-space: nowrap;
|
|
146
|
+
font-size: 1rem;
|
|
147
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { FluidDropdown, Tile } from '@carbon/react';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { UserMultiple, CheckmarkFilled, Time, Hospital, Chemistry, Medication } from '@carbon/react/icons';
|
|
4
|
+
|
|
5
|
+
import styles from './overview.component.scss';
|
|
6
|
+
import { type QueueEntryResult } from '../../registry/types';
|
|
7
|
+
import PatientList from '../patient-list/patient-list.component';
|
|
8
|
+
import Chart from '../charts/chart.component';
|
|
9
|
+
|
|
10
|
+
interface OverviewProps {
|
|
11
|
+
triageCount?: QueueEntryResult[];
|
|
12
|
+
consultationCount?: QueueEntryResult[];
|
|
13
|
+
dashboardSummary?: any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const Overview: React.FC<OverviewProps> = ({ triageCount, consultationCount, dashboardSummary }) => {
|
|
17
|
+
const totalPatients: QueueEntryResult[] = [...triageCount, ...consultationCount];
|
|
18
|
+
const patientsInQueue = totalPatients.filter(
|
|
19
|
+
(patient) => patient.status === 'WAITING' || patient.status === 'IN SERVICE',
|
|
20
|
+
).length;
|
|
21
|
+
const [selected, setSelected] = useState<string | null>(null);
|
|
22
|
+
const triagePatients = triageCount?.length ?? 0;
|
|
23
|
+
const consultationPatients = consultationCount?.length ?? 0;
|
|
24
|
+
const dropDownItems = [
|
|
25
|
+
'Total Patients',
|
|
26
|
+
'Triage Patients',
|
|
27
|
+
'Consultation Patients',
|
|
28
|
+
'Walk-In Patients',
|
|
29
|
+
'Emergency Patients',
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const handleDropdownChange = (data: { selectedItem: string }) => {
|
|
33
|
+
const value = data.selectedItem;
|
|
34
|
+
setSelected(value);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
let selectedPatients: QueueEntryResult[] = [];
|
|
38
|
+
|
|
39
|
+
switch (selected) {
|
|
40
|
+
case 'Triage Patients':
|
|
41
|
+
selectedPatients = triageCount ?? [];
|
|
42
|
+
break;
|
|
43
|
+
|
|
44
|
+
case 'Consultation Patients':
|
|
45
|
+
selectedPatients = consultationCount ?? [];
|
|
46
|
+
break;
|
|
47
|
+
case 'Walk-In Patients':
|
|
48
|
+
selectedPatients = [];
|
|
49
|
+
break;
|
|
50
|
+
case 'Emergency Patients':
|
|
51
|
+
selectedPatients = [];
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
case 'Total Patients':
|
|
55
|
+
selectedPatients = [...(triageCount ?? []), ...(consultationCount ?? [])];
|
|
56
|
+
break;
|
|
57
|
+
|
|
58
|
+
default:
|
|
59
|
+
selectedPatients = [...(triageCount ?? []), ...(consultationCount ?? [])];
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<div className={styles.container}>
|
|
66
|
+
<Tile className={`${styles.card} ${styles.opd}`}>
|
|
67
|
+
<h4 className={styles.text}>
|
|
68
|
+
<UserMultiple size={24} />
|
|
69
|
+
Total OPD Visits
|
|
70
|
+
</h4>
|
|
71
|
+
<h4 className={styles.text}>{dashboardSummary?.total_opd_visits ?? 0}</h4>
|
|
72
|
+
</Tile>
|
|
73
|
+
<Tile className={`${styles.card} ${styles.completed}`}>
|
|
74
|
+
<h4 className={styles.text}>
|
|
75
|
+
<CheckmarkFilled size={20} /> Completed Visits
|
|
76
|
+
</h4>
|
|
77
|
+
<h4 className={styles.text}>{dashboardSummary?.completed_visits ?? 0}</h4>
|
|
78
|
+
</Tile>
|
|
79
|
+
<Tile className={`${styles.card} ${styles.uncompleted}`}>
|
|
80
|
+
<h4 className={styles.text}>
|
|
81
|
+
<Time size={20} /> Uncompleted visits
|
|
82
|
+
</h4>
|
|
83
|
+
<h4 className={styles.text}>{dashboardSummary?.uncompleted_visits ?? 0}</h4>
|
|
84
|
+
</Tile>
|
|
85
|
+
<Tile className={`${styles.card} ${styles.labs}`}>
|
|
86
|
+
<h4 className={styles.text}>
|
|
87
|
+
<Chemistry size={20} /> Labs
|
|
88
|
+
</h4>
|
|
89
|
+
<h4 className={styles.text}>{dashboardSummary?.labs ?? 0}</h4>
|
|
90
|
+
</Tile>
|
|
91
|
+
<Tile className={`${styles.card} ${styles.pharmacy}`}>
|
|
92
|
+
<h4 className={styles.text}>
|
|
93
|
+
<Medication size={20} /> Pharmacy
|
|
94
|
+
</h4>
|
|
95
|
+
<h4 className={styles.text}>{dashboardSummary?.pharmacy ?? 0}</h4>
|
|
96
|
+
</Tile>
|
|
97
|
+
<Tile className={`${styles.card} ${styles.emergencies}`}>
|
|
98
|
+
<h4 className={styles.text}>
|
|
99
|
+
<Hospital size={20} /> Emergencies
|
|
100
|
+
</h4>
|
|
101
|
+
<h4 className={styles.text}>{dashboardSummary?.emergencies ?? 0}</h4>
|
|
102
|
+
</Tile>
|
|
103
|
+
<Tile className={`${styles.card} ${styles.waitingTime}`}>
|
|
104
|
+
<h4 className={styles.text}>
|
|
105
|
+
<Time size={20} /> Avg. Waiting Time
|
|
106
|
+
</h4>
|
|
107
|
+
<h4 className={styles.text}>{dashboardSummary?.average_waiting_minutes ?? 0} mins</h4>
|
|
108
|
+
</Tile>
|
|
109
|
+
</div>
|
|
110
|
+
<Chart />
|
|
111
|
+
</>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export default Overview;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type QueueEntryResult } from '../../registry/types';
|
|
3
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@carbon/react';
|
|
4
|
+
import { isDesktop, useLayoutType } from '@openmrs/esm-framework';
|
|
5
|
+
|
|
6
|
+
interface PatientListProps {
|
|
7
|
+
patients?: QueueEntryResult[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const PatientList: React.FC<PatientListProps> = ({ patients }) => {
|
|
11
|
+
const layout = useLayoutType();
|
|
12
|
+
const desktop = isDesktop(layout);
|
|
13
|
+
return (
|
|
14
|
+
<Table size={desktop ? 'sm' : 'lg'}>
|
|
15
|
+
<TableHead>
|
|
16
|
+
<TableRow>
|
|
17
|
+
<TableHeader>No</TableHeader>
|
|
18
|
+
<TableHeader>Name</TableHeader>
|
|
19
|
+
<TableHeader>Ticket</TableHeader>
|
|
20
|
+
<TableHeader>Status</TableHeader>
|
|
21
|
+
<TableHeader>Priority</TableHeader>
|
|
22
|
+
</TableRow>
|
|
23
|
+
</TableHead>
|
|
24
|
+
<TableBody>
|
|
25
|
+
{patients?.map((patient, index) => {
|
|
26
|
+
return (
|
|
27
|
+
<TableRow>
|
|
28
|
+
<TableCell>{index + 1}</TableCell>
|
|
29
|
+
<TableCell>{`${patient.given_name} ${patient.middle_name} ${patient.family_name}`}</TableCell>
|
|
30
|
+
<TableCell>{patient.queue_id}</TableCell>
|
|
31
|
+
<TableCell>{patient.status}</TableCell>
|
|
32
|
+
<TableCell>{patient.priority}</TableCell>
|
|
33
|
+
</TableRow>
|
|
34
|
+
);
|
|
35
|
+
})}
|
|
36
|
+
</TableBody>
|
|
37
|
+
</Table>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default PatientList;
|