@ampath/esm-dha-workflow-app 4.0.0-next.15 → 4.0.0-next.151
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/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.map +1 -0
- package/dist/2333.js +1 -0
- package/dist/2333.js.map +1 -0
- package/dist/2364.js +2 -0
- package/dist/{388.js.LICENSE.txt → 2364.js.LICENSE.txt} +15 -0
- package/dist/2364.js.map +1 -0
- package/dist/2801.js +1 -0
- package/dist/2801.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/6260.js +1 -0
- package/dist/6260.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/{709.js → 693.js} +1 -1
- 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/8235.js +1 -0
- package/dist/8235.js.map +1 -0
- package/dist/8339.js +1 -0
- package/dist/8339.js.map +1 -0
- package/dist/8558.js +1 -0
- package/dist/8558.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 -1
- package/dist/esm-dha-workflow-app.js.buildmanifest.json +990 -215
- package/dist/esm-dha-workflow-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +10 -3
- 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 +107 -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 +508 -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 +1441 -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 +103 -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 +349 -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 +91 -1
- package/src/createDashboardLink.tsx +9 -0
- package/src/dashboard/charts/chart.component.scss +13 -0
- package/src/dashboard/charts/chart.component.tsx +56 -0
- package/src/dashboard/dashboard.component.scss +7 -0
- package/src/dashboard/dashboard.component.tsx +51 -0
- package/src/dashboard/overview/overview.component.scss +150 -0
- package/src/dashboard/overview/overview.component.tsx +134 -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/maternity-dashboard.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 +19 -2
- package/src/index.ts +110 -15
- package/src/laboratory/laboratory.component.tsx +13 -0
- package/src/mnch/maternity/maternity-queues.component.scss +7 -0
- package/src/mnch/maternity/maternity-queues.component.tsx +28 -0
- package/src/mnch/maternity/queues/triage/maternity-triage.tsx +15 -0
- package/src/mnch/mch/mch-queues.component.scss +7 -0
- package/src/mnch/mch/mch-queues.component.tsx +32 -0
- package/src/mnch/mch/queues/consultation/mch-consultation.tsx +18 -0
- package/src/mnch/mch/queues/triage/mch-triage.tsx +15 -0
- package/src/mnch/mnch-root.tsx +17 -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 +139 -54
- package/src/registry/modal/send-to-triage/send-to-triage.modal.scss +9 -1
- package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +665 -45
- 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 +6 -0
- package/src/registry/registry.component.tsx +94 -27
- package/src/registry/registry.resource.ts +10 -6
- package/src/registry/types/index.ts +120 -0
- package/src/registry/utils/hie-client-adapter.ts +3 -0
- package/src/registry/utils/mask-data.ts +11 -0
- package/src/resources/dashboard.resource.ts +20 -0
- package/src/resources/identifier-types.ts +2 -0
- package/src/resources/patient-resource.ts +3 -1
- package/src/resources/queue.resource.ts +24 -1
- package/src/resources/superset.resource.ts +21 -0
- package/src/resources/visit.resource.ts +19 -1
- package/src/root.component.tsx +27 -6
- package/src/routes.json +222 -15
- package/src/{consultation → service-queues}/action-button.component.tsx +2 -2
- package/src/{consultation → service-queues}/action-overflow-menu-item.component.tsx +2 -2
- 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 +143 -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 +154 -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/waiting-patients.extension.tsx +34 -0
- package/src/service-queues/metrics/metrics-container.component.tsx +23 -0
- package/src/{metrics → service-queues/metrics}/metrics.resource.ts +0 -36
- 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 +50 -0
- package/src/service-queues/queue-list/queue-list.component.tsx +302 -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 +303 -4
- package/src/service-queues/service.resource.ts +28 -0
- package/src/shared/constants/concepts.ts +18 -0
- package/src/shared/constants/index.ts +1 -2
- package/src/shared/constants/patient-category.ts +6 -0
- package/src/shared/constants/patient-type.ts +10 -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/mnch-nav-link-config.ts +16 -0
- package/src/side-nav-menu/mnch-nav-links.tsx +42 -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 +82 -2
- package/dist/104.js +0 -2
- package/dist/104.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/255.js +0 -1
- package/dist/255.js.map +0 -1
- package/dist/300.js +0 -1
- package/dist/306.js +0 -1
- package/dist/306.js.map +0 -1
- package/dist/335.js +0 -1
- package/dist/353.js +0 -1
- package/dist/353.js.map +0 -1
- package/dist/388.js +0 -2
- package/dist/388.js.map +0 -1
- package/dist/420.js +0 -1
- package/dist/420.js.map +0 -1
- package/dist/460.js +0 -1
- package/dist/460.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/560.js +0 -1
- package/dist/560.js.map +0 -1
- package/dist/635.js +0 -1
- package/dist/635.js.map +0 -1
- package/dist/652.js +0 -1
- package/dist/695.js +0 -1
- package/dist/695.js.map +0 -1
- package/dist/709.js.map +0 -1
- package/dist/710.js +0 -2
- package/dist/710.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/978.js +0 -1
- package/dist/978.js.map +0 -1
- package/dist/99.js +0 -1
- package/src/consultation/consultation-room.component.tsx +0 -60
- package/src/consultation/consultation.scss +0 -5
- package/src/consultation/consultation.tsx +0 -14
- package/src/hooks/useQueueEntries.ts +0 -35
- package/src/metrics/metrics-cards/attended-patients.extension.tsx +0 -18
- package/src/metrics/metrics-cards/waiting-patients.extension.tsx +0 -18
- package/src/metrics/metrics-container.component.tsx +0 -16
- package/src/registry/mock-client.ts +0 -627
- /package/dist/{710.js.LICENSE.txt → 1558.js.LICENSE.txt} +0 -0
- /package/dist/{104.js.LICENSE.txt → 2177.js.LICENSE.txt} +0 -0
- /package/dist/{184.js.LICENSE.txt → 3184.js.LICENSE.txt} +0 -0
- /package/dist/{540.js.LICENSE.txt → 6540.js.LICENSE.txt} +0 -0
- /package/src/{metrics → service-queues/metrics}/metrics-cards/metrics-card.component.tsx +0 -0
- /package/src/{metrics → service-queues/metrics}/metrics-cards/metrics-card.scss +0 -0
- /package/src/{metrics → service-queues/metrics}/metrics-container.scss +0 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import styles from './daily-bookings.component.scss';
|
|
3
|
+
import { Button, InlineLoading, Tab, TabList, TabPanel, TabPanels, Tabs } from '@carbon/react';
|
|
4
|
+
import DailyBookingsFilter from './filters/daily-bookings-filter.component';
|
|
5
|
+
import { showSnackbar } from '@openmrs/esm-framework';
|
|
6
|
+
import { type DailyBookingsResult, type BookingFilter, DailyBookingType } from '../types';
|
|
7
|
+
import DailiyBookingsPatientList from './patient-list/daily-bookings-patient-list.component';
|
|
8
|
+
import { getDailyBookings } from './daily-bookings.resource';
|
|
9
|
+
|
|
10
|
+
interface DailyBookingsProps {}
|
|
11
|
+
const DailyBookings: React.FC<DailyBookingsProps> = () => {
|
|
12
|
+
const [filters, setFilters] = useState<BookingFilter>();
|
|
13
|
+
const [appointments, setAppointments] = useState<DailyBookingsResult[]>([]);
|
|
14
|
+
const [visits, setVisits] = useState<DailyBookingsResult[]>([]);
|
|
15
|
+
const [hasNotReturned, setHasNotReturned] = useState<DailyBookingsResult[]>([]);
|
|
16
|
+
const [selectedTab, setSelectedTab] = useState<DailyBookingType>(DailyBookingType.Appointments);
|
|
17
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (filters) {
|
|
21
|
+
getDailyBookingsByType(selectedTab);
|
|
22
|
+
}
|
|
23
|
+
}, [filters]);
|
|
24
|
+
|
|
25
|
+
const handleFilterSelected = (filters: BookingFilter) => {
|
|
26
|
+
setFilters(filters);
|
|
27
|
+
};
|
|
28
|
+
const handleSelectedTab = (userSelectedTab: DailyBookingType) => {
|
|
29
|
+
setSelectedTab(userSelectedTab);
|
|
30
|
+
};
|
|
31
|
+
const getDailyBookingsByType = async (dailyBookingType: DailyBookingType) => {
|
|
32
|
+
const isValidFilter = isValidFilterset(filters);
|
|
33
|
+
if (!isValidFilter) return;
|
|
34
|
+
setLoading(true);
|
|
35
|
+
try {
|
|
36
|
+
const resp = await getDailyBookings(filters, dailyBookingType);
|
|
37
|
+
if (selectedTab === DailyBookingType.Appointments) {
|
|
38
|
+
setAppointments(resp);
|
|
39
|
+
}
|
|
40
|
+
if (selectedTab === DailyBookingType.Visits) {
|
|
41
|
+
setVisits(resp);
|
|
42
|
+
}
|
|
43
|
+
if (selectedTab === DailyBookingType.HasNotReturned) {
|
|
44
|
+
setHasNotReturned(resp);
|
|
45
|
+
}
|
|
46
|
+
} catch (e) {
|
|
47
|
+
showSnackbar({
|
|
48
|
+
kind: 'error',
|
|
49
|
+
title: e.message ?? 'An error ocurred while fetching data',
|
|
50
|
+
subtitle: '',
|
|
51
|
+
});
|
|
52
|
+
} finally {
|
|
53
|
+
setLoading(false);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const isValidFilterset = (filters: BookingFilter) => {
|
|
57
|
+
if (!filters) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
if (!filters.startDate) {
|
|
61
|
+
showSnackbar({
|
|
62
|
+
kind: 'error',
|
|
63
|
+
title: 'Start Date not set',
|
|
64
|
+
subtitle: '',
|
|
65
|
+
});
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
if (!filters.locationUuids) {
|
|
69
|
+
showSnackbar({
|
|
70
|
+
kind: 'error',
|
|
71
|
+
title: 'User location not set',
|
|
72
|
+
subtitle: '',
|
|
73
|
+
});
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
if (!filters.department) {
|
|
77
|
+
showSnackbar({
|
|
78
|
+
kind: 'error',
|
|
79
|
+
title: 'Department not set',
|
|
80
|
+
subtitle: '',
|
|
81
|
+
});
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
};
|
|
86
|
+
const handleRefresh = () => {
|
|
87
|
+
getDailyBookingsByType(selectedTab);
|
|
88
|
+
};
|
|
89
|
+
return (
|
|
90
|
+
<>
|
|
91
|
+
<div className={styles.bookingsLayout}>
|
|
92
|
+
<div className={styles.bookingsHeader}>
|
|
93
|
+
<h4>Daily Bookings</h4>
|
|
94
|
+
</div>
|
|
95
|
+
<div className={styles.bookingsFilters}>
|
|
96
|
+
<DailyBookingsFilter filterSelected={handleFilterSelected} />
|
|
97
|
+
</div>
|
|
98
|
+
<div className={styles.bookingsContent}>
|
|
99
|
+
<div className={styles.contentActions}>
|
|
100
|
+
<Button kind="primary" onClick={handleRefresh} disabled={loading}>
|
|
101
|
+
{loading ? <InlineLoading description="Fetching..." /> : 'Refresh'}
|
|
102
|
+
</Button>
|
|
103
|
+
</div>
|
|
104
|
+
<div className={styles.contentData}>
|
|
105
|
+
<Tabs>
|
|
106
|
+
<TabList contained>
|
|
107
|
+
<Tab onClick={() => handleSelectedTab(DailyBookingType.Appointments)}>Appointments</Tab>
|
|
108
|
+
<Tab onClick={() => handleSelectedTab(DailyBookingType.Visits)}>Visits</Tab>
|
|
109
|
+
<Tab onClick={() => handleSelectedTab(DailyBookingType.HasNotReturned)}>Has Not Returned</Tab>
|
|
110
|
+
</TabList>
|
|
111
|
+
<TabPanels>
|
|
112
|
+
<TabPanel>
|
|
113
|
+
{appointments && appointments.length > 0 ? (
|
|
114
|
+
<DailiyBookingsPatientList patientListData={appointments} />
|
|
115
|
+
) : (
|
|
116
|
+
<></>
|
|
117
|
+
)}
|
|
118
|
+
</TabPanel>
|
|
119
|
+
<TabPanel>
|
|
120
|
+
{visits && visits.length > 0 ? <DailiyBookingsPatientList patientListData={visits} /> : <></>}
|
|
121
|
+
</TabPanel>
|
|
122
|
+
<TabPanel>
|
|
123
|
+
{hasNotReturned && hasNotReturned.length > 0 ? (
|
|
124
|
+
<DailiyBookingsPatientList patientListData={hasNotReturned} />
|
|
125
|
+
) : (
|
|
126
|
+
<></>
|
|
127
|
+
)}
|
|
128
|
+
</TabPanel>
|
|
129
|
+
</TabPanels>
|
|
130
|
+
</Tabs>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</>
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export default DailyBookings;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
2
|
+
import { getEtlBaseUrl } from '../../shared/utils/get-base-url';
|
|
3
|
+
import {
|
|
4
|
+
type BookingFilter,
|
|
5
|
+
type BookingDto,
|
|
6
|
+
type DailyBookingsResult,
|
|
7
|
+
type DailyBookingsReponse,
|
|
8
|
+
type DailyBookingType,
|
|
9
|
+
} from '../types';
|
|
10
|
+
|
|
11
|
+
export async function getDailyBookings(
|
|
12
|
+
bookingFilter: BookingFilter,
|
|
13
|
+
bookingType: DailyBookingType,
|
|
14
|
+
): Promise<DailyBookingsResult[]> {
|
|
15
|
+
const etlBaseUrl = await getEtlBaseUrl();
|
|
16
|
+
const params: BookingDto = {
|
|
17
|
+
department: bookingFilter.department,
|
|
18
|
+
startDate: bookingFilter.startDate ?? new Date().toISOString().split('T')[0],
|
|
19
|
+
locationUuids: bookingFilter.locationUuids,
|
|
20
|
+
startIndex: '0',
|
|
21
|
+
limit: '1000',
|
|
22
|
+
};
|
|
23
|
+
const queryString = new URLSearchParams(params).toString();
|
|
24
|
+
const dailyAppUrl = `${etlBaseUrl}/${bookingType}/${bookingFilter.startDate}?&${queryString}`;
|
|
25
|
+
const resp = await openmrsFetch(dailyAppUrl);
|
|
26
|
+
const data: DailyBookingsReponse = await resp.json();
|
|
27
|
+
return data.result ?? [];
|
|
28
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { Button, DatePicker, DatePickerInput, Dropdown, type OnChangeData } from '@carbon/react';
|
|
3
|
+
import styles from './daily-bookings-filter.component.scss';
|
|
4
|
+
import { type BookingFilter } from '../../types';
|
|
5
|
+
import { useSession } from '@openmrs/esm-framework';
|
|
6
|
+
|
|
7
|
+
interface DailyBookingsFilterProps {
|
|
8
|
+
filterSelected: (filters: BookingFilter) => void;
|
|
9
|
+
}
|
|
10
|
+
const DailyBookingsFilter: React.FC<DailyBookingsFilterProps> = ({ filterSelected }) => {
|
|
11
|
+
const dateRef = useRef<string>('');
|
|
12
|
+
const departmentRef = useRef<string>();
|
|
13
|
+
const session = useSession();
|
|
14
|
+
const locationUuid = session.sessionLocation.uuid;
|
|
15
|
+
const handleDateChange = (dateSelected: Date[]) => {
|
|
16
|
+
dateRef.current = new Date(dateSelected[0]).toLocaleDateString('en-CA');
|
|
17
|
+
};
|
|
18
|
+
const handleDepartmentChange = (selectedDept: OnChangeData<{ text: string }>) => {
|
|
19
|
+
departmentRef.current = selectedDept.selectedItem.text;
|
|
20
|
+
};
|
|
21
|
+
const handeleGenerateFilters = () => {
|
|
22
|
+
const filters: BookingFilter = {
|
|
23
|
+
startDate: dateRef.current,
|
|
24
|
+
department: departmentRef.current,
|
|
25
|
+
locationUuids: locationUuid,
|
|
26
|
+
};
|
|
27
|
+
filterSelected(filters);
|
|
28
|
+
};
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
<div className={styles.filterLayout}>
|
|
32
|
+
<div className={styles.filterRow}>
|
|
33
|
+
<div className={styles.filterFormGroup}>
|
|
34
|
+
<DatePicker
|
|
35
|
+
datePickerType="single"
|
|
36
|
+
locale="en"
|
|
37
|
+
onChange={handleDateChange}
|
|
38
|
+
onClose={() => {}}
|
|
39
|
+
onOpen={() => {}}
|
|
40
|
+
>
|
|
41
|
+
<DatePickerInput id="date-picker-single" labelText="Date" placeholder="mm/dd/yyyy" />
|
|
42
|
+
</DatePicker>
|
|
43
|
+
</div>
|
|
44
|
+
<div className={styles.filterFormGroup}>
|
|
45
|
+
<Dropdown
|
|
46
|
+
id="department"
|
|
47
|
+
invalidText="invalid selection"
|
|
48
|
+
itemToString={(item) => item.text}
|
|
49
|
+
onChange={handleDepartmentChange}
|
|
50
|
+
items={[
|
|
51
|
+
{
|
|
52
|
+
text: 'HIV',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
text: 'CDM',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
text: 'ONCOLOGY',
|
|
59
|
+
},
|
|
60
|
+
]}
|
|
61
|
+
label="Select Department"
|
|
62
|
+
titleText="Department"
|
|
63
|
+
type="default"
|
|
64
|
+
warnText=""
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div className={styles.filterRow}>
|
|
69
|
+
<div className={styles.filterFormGroup}>
|
|
70
|
+
<Button kind="primary" onClick={handeleGenerateFilters}>
|
|
71
|
+
Generate
|
|
72
|
+
</Button>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export default DailyBookingsFilter;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@carbon/react';
|
|
3
|
+
import { type DailyBookingsResult } from '../../types';
|
|
4
|
+
|
|
5
|
+
interface DailiyBookingsPatientListProps {
|
|
6
|
+
patientListData: DailyBookingsResult[];
|
|
7
|
+
}
|
|
8
|
+
const DailiyBookingsPatientList: React.FC<DailiyBookingsPatientListProps> = ({ patientListData }) => {
|
|
9
|
+
if (!patientListData || patientListData.length === 0) {
|
|
10
|
+
return <>No Data</>;
|
|
11
|
+
}
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<Table>
|
|
15
|
+
<TableHead>
|
|
16
|
+
<TableRow>
|
|
17
|
+
<TableHeader>No</TableHeader>
|
|
18
|
+
<TableHeader>CCC Number</TableHeader>
|
|
19
|
+
<TableHeader>UPI Number</TableHeader>
|
|
20
|
+
<TableHeader>Program</TableHeader>
|
|
21
|
+
<TableHeader>RTC Date</TableHeader>
|
|
22
|
+
<TableHeader>Med Pickup Date</TableHeader>
|
|
23
|
+
<TableHeader>ARV Start Date</TableHeader>
|
|
24
|
+
<TableHeader>HIV Disclosure Status</TableHeader>
|
|
25
|
+
<TableHeader>Height</TableHeader>
|
|
26
|
+
<TableHeader>Weight</TableHeader>
|
|
27
|
+
<TableHeader>Stage</TableHeader>
|
|
28
|
+
<TableHeader>Patient Categorization</TableHeader>
|
|
29
|
+
<TableHeader>Service Delivery Model</TableHeader>
|
|
30
|
+
<TableHeader>DSD Model</TableHeader>
|
|
31
|
+
<TableHeader>CD4 Date</TableHeader>
|
|
32
|
+
<TableHeader>CD4 Results</TableHeader>
|
|
33
|
+
<TableHeader>Gender</TableHeader>
|
|
34
|
+
<TableHeader>Birthdate</TableHeader>
|
|
35
|
+
<TableHeader>Age</TableHeader>
|
|
36
|
+
<TableHeader>Patient Name</TableHeader>
|
|
37
|
+
<TableHeader>Identifiers</TableHeader>
|
|
38
|
+
<TableHeader>Phone Number</TableHeader>
|
|
39
|
+
<TableHeader>Latest RTC Date</TableHeader>
|
|
40
|
+
<TableHeader>Latest VL</TableHeader>
|
|
41
|
+
<TableHeader>VL Category</TableHeader>
|
|
42
|
+
<TableHeader>Latest VL Date</TableHeader>
|
|
43
|
+
<TableHeader>Last Appointment</TableHeader>
|
|
44
|
+
<TableHeader>Visit Type</TableHeader>
|
|
45
|
+
<TableHeader>Current Meds</TableHeader>
|
|
46
|
+
<TableHeader>Covid-19 Vaccination</TableHeader>
|
|
47
|
+
<TableHeader>TB Screening Date</TableHeader>
|
|
48
|
+
<TableHeader>TB Screening Result</TableHeader>
|
|
49
|
+
<TableHeader>Patient Category</TableHeader>
|
|
50
|
+
</TableRow>
|
|
51
|
+
</TableHead>
|
|
52
|
+
|
|
53
|
+
<TableBody>
|
|
54
|
+
{patientListData &&
|
|
55
|
+
patientListData.map((val, index) => (
|
|
56
|
+
<TableRow key={val.patient_uuid ?? index}>
|
|
57
|
+
<TableCell>{index + 1}</TableCell>
|
|
58
|
+
<TableCell>{val.ccc_number}</TableCell>
|
|
59
|
+
<TableCell>{val.upi_number}</TableCell>
|
|
60
|
+
<TableCell>{val.program}</TableCell>
|
|
61
|
+
<TableCell>{val.rtc_date}</TableCell>
|
|
62
|
+
<TableCell>{val.med_pick_up_date}</TableCell>
|
|
63
|
+
<TableCell>{val.arv_first_regimen_start_date}</TableCell>
|
|
64
|
+
<TableCell>{val.hiv_disclosure_status}</TableCell>
|
|
65
|
+
<TableCell>{val.height}</TableCell>
|
|
66
|
+
<TableCell>{val.weight}</TableCell>
|
|
67
|
+
<TableCell>{val.stage}</TableCell>
|
|
68
|
+
<TableCell>{val.patient_categorization}</TableCell>
|
|
69
|
+
<TableCell>{val.service_delivery_model}</TableCell>
|
|
70
|
+
<TableCell>{val.dsd_model}</TableCell>
|
|
71
|
+
<TableCell>{val.cd4_date}</TableCell>
|
|
72
|
+
<TableCell>{val.cd4_results}</TableCell>
|
|
73
|
+
<TableCell>{val.gender}</TableCell>
|
|
74
|
+
<TableCell>{val.birthdate}</TableCell>
|
|
75
|
+
<TableCell>{val.age}</TableCell>
|
|
76
|
+
<TableCell>{val.person_name}</TableCell>
|
|
77
|
+
<TableCell>{val.identifiers}</TableCell>
|
|
78
|
+
<TableCell>{val.phone_number}</TableCell>
|
|
79
|
+
<TableCell>{val.latest_rtc_date}</TableCell>
|
|
80
|
+
<TableCell>{val.latest_vl}</TableCell>
|
|
81
|
+
<TableCell>{val.vl_category}</TableCell>
|
|
82
|
+
<TableCell>{val.latest_vl_date}</TableCell>
|
|
83
|
+
<TableCell>{val.last_appointment}</TableCell>
|
|
84
|
+
<TableCell>{val.visit_type}</TableCell>
|
|
85
|
+
<TableCell>{val.cur_meds}</TableCell>
|
|
86
|
+
<TableCell>{val.covid_19_vaccination_status}</TableCell>
|
|
87
|
+
<TableCell>{val.tb_screening_date}</TableCell>
|
|
88
|
+
<TableCell>{val.tb_screening_result}</TableCell>
|
|
89
|
+
<TableCell>{val.patient_category}</TableCell>
|
|
90
|
+
</TableRow>
|
|
91
|
+
))}
|
|
92
|
+
</TableBody>
|
|
93
|
+
</Table>
|
|
94
|
+
</>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
export default DailiyBookingsPatientList;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export type BookingFilter = {
|
|
2
|
+
startDate: string;
|
|
3
|
+
department: string;
|
|
4
|
+
locationUuids: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type BookingDto = BookingFilter & {
|
|
8
|
+
startIndex: string;
|
|
9
|
+
limit: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type DailyBookingsResult = {
|
|
13
|
+
ccc_number: string;
|
|
14
|
+
ovcid_id: string;
|
|
15
|
+
upi_number: string;
|
|
16
|
+
program: string;
|
|
17
|
+
rtc_date: string;
|
|
18
|
+
med_pick_up_date: string;
|
|
19
|
+
arv_first_regimen_start_date: string;
|
|
20
|
+
hiv_disclosure_status: string;
|
|
21
|
+
height: number;
|
|
22
|
+
weight: number;
|
|
23
|
+
stage: number;
|
|
24
|
+
patient_categorization: string;
|
|
25
|
+
service_delivery_model: string;
|
|
26
|
+
dsd_model: string;
|
|
27
|
+
cd4_date: string;
|
|
28
|
+
cd4_results: number;
|
|
29
|
+
patient_uuid: string;
|
|
30
|
+
gender: string;
|
|
31
|
+
birthdate: string;
|
|
32
|
+
age: number;
|
|
33
|
+
person_name: string;
|
|
34
|
+
identifiers: string;
|
|
35
|
+
phone_number: string;
|
|
36
|
+
latest_rtc_date: string;
|
|
37
|
+
latest_vl: number;
|
|
38
|
+
vl_category: string;
|
|
39
|
+
latest_vl_date: string;
|
|
40
|
+
last_appointment: string;
|
|
41
|
+
visit_type: string;
|
|
42
|
+
cur_meds: string;
|
|
43
|
+
previous_vl: number;
|
|
44
|
+
previous_vl_date: string;
|
|
45
|
+
nearest_center: string;
|
|
46
|
+
covid_19_vaccination_status: string;
|
|
47
|
+
sms_consent_provided: string;
|
|
48
|
+
sms_receive_time: string;
|
|
49
|
+
sms_delivery_status: string;
|
|
50
|
+
tb_screening_date: string;
|
|
51
|
+
patient_category: string;
|
|
52
|
+
tb_screening_result: string;
|
|
53
|
+
cervical_screening_date: string;
|
|
54
|
+
cervical_screening_method: string;
|
|
55
|
+
cervical_screening_result: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type DailyBookingsReponse = {
|
|
59
|
+
schemas: any;
|
|
60
|
+
sqlQuery: string;
|
|
61
|
+
result: DailyBookingsResult[];
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export enum DailyBookingType {
|
|
65
|
+
Appointments = 'daily-appointments',
|
|
66
|
+
Visits = 'daily-visits',
|
|
67
|
+
HasNotReturned = 'daily-has-not-returned',
|
|
68
|
+
}
|
package/src/config-schema.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, validator } from '@openmrs/esm-framework';
|
|
2
2
|
|
|
3
3
|
export const configSchema = {
|
|
4
|
-
|
|
4
|
+
concepts: {
|
|
5
5
|
defaultPriorityConceptUuid: {
|
|
6
6
|
_type: Type.ConceptUuid,
|
|
7
7
|
_default: false,
|
|
@@ -77,6 +77,81 @@ export const configSchema = {
|
|
|
77
77
|
_default: '5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
78
78
|
},
|
|
79
79
|
},
|
|
80
|
+
subDomainUrl: {
|
|
81
|
+
_type: Type.String,
|
|
82
|
+
_description: 'Subdomain e.g training,staging',
|
|
83
|
+
_default: '',
|
|
84
|
+
},
|
|
85
|
+
etlBaseUrl: {
|
|
86
|
+
_type: Type.String,
|
|
87
|
+
_description: 'ETL Endpoint',
|
|
88
|
+
_default: '',
|
|
89
|
+
},
|
|
90
|
+
hieBaseUrl: {
|
|
91
|
+
_type: Type.String,
|
|
92
|
+
_description: 'HIE Endpoint',
|
|
93
|
+
_default: '',
|
|
94
|
+
},
|
|
95
|
+
claimsBaseUrl: {
|
|
96
|
+
_type: Type.String,
|
|
97
|
+
_description: '',
|
|
98
|
+
_default: '',
|
|
99
|
+
},
|
|
100
|
+
claimsKey: {
|
|
101
|
+
_type: Type.String,
|
|
102
|
+
_description: '',
|
|
103
|
+
_default: '',
|
|
104
|
+
},
|
|
105
|
+
registrationBillableServices: {
|
|
106
|
+
_type: Type.String,
|
|
107
|
+
_description: 'Billable services e.g consultation',
|
|
108
|
+
_default: '',
|
|
109
|
+
},
|
|
110
|
+
cashConsultationOrderTypeUuid: {
|
|
111
|
+
_type: Type.String,
|
|
112
|
+
_description: 'CASH Consultation Order type uuid',
|
|
113
|
+
_default: '',
|
|
114
|
+
},
|
|
115
|
+
shaConsultationOrderTypeUuid: {
|
|
116
|
+
_type: Type.String,
|
|
117
|
+
_description: 'SHA Consultation Order type uuid',
|
|
118
|
+
_default: '',
|
|
119
|
+
},
|
|
120
|
+
cashConsulationConceptUuid: {
|
|
121
|
+
_type: Type.String,
|
|
122
|
+
_description: 'Cash Consultation concept uuid',
|
|
123
|
+
_default: '',
|
|
124
|
+
},
|
|
125
|
+
shaConsulationConceptUuid: {
|
|
126
|
+
_type: Type.String,
|
|
127
|
+
_description: 'SHA Consultation concept uuid',
|
|
128
|
+
_default: '',
|
|
129
|
+
},
|
|
130
|
+
outPatientCareSettingUuid: {
|
|
131
|
+
_type: Type.String,
|
|
132
|
+
_description: 'Outpatient care settings uuid',
|
|
133
|
+
_default: '',
|
|
134
|
+
},
|
|
135
|
+
orderEncounterTypeUuid: {
|
|
136
|
+
_type: Type.String,
|
|
137
|
+
_description: 'Outpatient care settings uuid',
|
|
138
|
+
_default: '',
|
|
139
|
+
},
|
|
140
|
+
nonSHAPaymentModes: {
|
|
141
|
+
_type: Type.Array,
|
|
142
|
+
_description: 'NON SHA payment modes',
|
|
143
|
+
_default: []
|
|
144
|
+
},
|
|
145
|
+
registrationServicequeues: {
|
|
146
|
+
_type: Type.Array,
|
|
147
|
+
_description: 'Service Queues to display at send to triage',
|
|
148
|
+
_default: []
|
|
149
|
+
},
|
|
150
|
+
consultationBillableServiceNames: {
|
|
151
|
+
_type: Type.Array,
|
|
152
|
+
_description: 'Consultation billable service names',
|
|
153
|
+
_default: ["CONSULTATION", "KESSES CONSULTATION"]
|
|
154
|
+
}
|
|
80
155
|
};
|
|
81
156
|
|
|
82
157
|
export type Config = {
|
|
@@ -118,7 +193,22 @@ export interface ConfigObject {
|
|
|
118
193
|
showRecommendedVisitTypeTab: boolean;
|
|
119
194
|
visitQueueNumberAttributeUuid: string | null;
|
|
120
195
|
visitTypeResourceUrl: string;
|
|
196
|
+
subDomainUrl: string;
|
|
197
|
+
etlBaseUrl: string;
|
|
198
|
+
hieBaseUrl: string;
|
|
199
|
+
claimsBaseUrl: string;
|
|
200
|
+
claimsKey: string;
|
|
201
|
+
registrationBillableServices: Array<string>;
|
|
202
|
+
cashConsultationOrderTypeUuid: string;
|
|
203
|
+
cashConsulationConceptUuid: string;
|
|
204
|
+
shaConsultationOrderTypeUuid: string;
|
|
205
|
+
shaConsulationConceptUuid: string;
|
|
206
|
+
outPatientCareSettingUuid: string;
|
|
207
|
+
orderEncounterTypeUuid: string;
|
|
121
208
|
// vitals: VitalsConfigObject;
|
|
209
|
+
nonSHAPaymentModes: Array<string>;
|
|
210
|
+
registrationServicequeues: Array<string>;
|
|
211
|
+
consultationBillableServiceNames: Array<string>;
|
|
122
212
|
}
|
|
123
213
|
|
|
124
214
|
const queueEntryActions = ['move', 'call', 'edit', 'transition', 'signOff', 'remove', 'delete', 'undo'] as const;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
3
|
+
import { DashboardExtension, type DashboardExtensionProps, type IconId } from '@openmrs/esm-framework';
|
|
4
|
+
|
|
5
|
+
export const createDashboardLink = (config: Omit<DashboardExtensionProps, 'icon'> & { icon?: IconId }) => () => (
|
|
6
|
+
<BrowserRouter>
|
|
7
|
+
<DashboardExtension path={config.path} title={config.title} basePath={config.basePath} icon={config.icon} />
|
|
8
|
+
</BrowserRouter>
|
|
9
|
+
);
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
dashboardId: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Chart: React.FC<ChartProps> = ({ dashboardId }) => {
|
|
15
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
16
|
+
const session = useSession();
|
|
17
|
+
const locationUuid = session.sessionLocation.uuid;
|
|
18
|
+
const [subDomainUrl, setSubDomainUrl] = useState<string | null>(null);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const fetchSubDomainUrl = async () => {
|
|
21
|
+
const url = await getSubDomainUrl();
|
|
22
|
+
setSubDomainUrl(url);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
fetchSubDomainUrl();
|
|
26
|
+
}, []);
|
|
27
|
+
const container = document.getElementById('my-superset-container');
|
|
28
|
+
|
|
29
|
+
const firstChild = container?.children?.[0] as HTMLElement | undefined;
|
|
30
|
+
|
|
31
|
+
if (firstChild) {
|
|
32
|
+
firstChild.style.width = '100%';
|
|
33
|
+
firstChild.style.height = '100%';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
embedDashboard({
|
|
38
|
+
id: dashboardId,
|
|
39
|
+
supersetDomain: `${subDomainUrl}/superset`,
|
|
40
|
+
mountPoint: ref.current!,
|
|
41
|
+
fetchGuestToken: async () => await fetchGuestToken(locationUuid, dashboardId),
|
|
42
|
+
dashboardUiConfig: {
|
|
43
|
+
hideTitle: true,
|
|
44
|
+
filters: {
|
|
45
|
+
expanded: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}, [subDomainUrl]);
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
<div id="my-superset-container" className={styles.container} ref={ref}></div>
|
|
53
|
+
</>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
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;
|