@ampath/esm-dha-workflow-app 4.0.0-claim-workflows.159
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/.editorconfig +12 -0
- package/.eslintignore +2 -0
- package/.eslintrc +57 -0
- package/.husky/pre-commit +7 -0
- package/.husky/pre-push +6 -0
- package/.prettierignore +14 -0
- package/.turbo.json +18 -0
- package/.yarn/plugins/@yarnpkg/plugin-outdated.cjs +35 -0
- package/LICENSE +401 -0
- package/README.md +37 -0
- package/__mocks__/react-i18next.js +50 -0
- 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.LICENSE.txt +14 -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.LICENSE.txt +9 -0
- package/dist/2177.js.map +1 -0
- package/dist/2333.js +1 -0
- package/dist/2333.js.map +1 -0
- package/dist/2801.js +1 -0
- package/dist/2801.js.map +1 -0
- package/dist/282.js +2 -0
- package/dist/282.js.LICENSE.txt +32 -0
- package/dist/282.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.LICENSE.txt +14 -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.LICENSE.txt +9 -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/8321.js +1 -0
- package/dist/8321.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/8778.js +1 -0
- package/dist/8778.js.map +1 -0
- package/dist/8803.js +2 -0
- package/dist/8803.js.LICENSE.txt +54 -0
- package/dist/8803.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/961.js +2 -0
- package/dist/961.js.LICENSE.txt +19 -0
- package/dist/961.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 +1594 -0
- package/dist/esm-dha-workflow-app.js.map +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -0
- package/dist/routes.json +1 -0
- package/e2e/README.md +115 -0
- package/e2e/core/global-setup.ts +32 -0
- package/e2e/core/index.ts +1 -0
- package/e2e/core/test.ts +20 -0
- package/e2e/fixtures/api.ts +26 -0
- package/e2e/fixtures/index.ts +1 -0
- package/e2e/pages/index.ts +1 -0
- package/e2e/pages/root-page.ts +32 -0
- package/e2e/specs/template-app.spec.ts +23 -0
- package/e2e/support/github/Dockerfile +34 -0
- package/e2e/support/github/docker-compose.yml +24 -0
- package/e2e/support/github/run-e2e-docker-env.sh +37 -0
- package/example.env +6 -0
- package/jest.config.js +33 -0
- package/package.json +117 -0
- package/playwright.config.ts +32 -0
- package/prettier.config.js +8 -0
- 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 +357 -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/claims/claims.component.tsx +142 -0
- package/src/claims/claims.resource.ts +168 -0
- package/src/claims/index.ts +206 -0
- package/src/claims/interventions.resource.ts +49 -0
- package/src/claims/utils.ts +59 -0
- package/src/config-schema.ts +215 -0
- 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/declarations.d.ts +5 -0
- package/src/hooks/useActions.ts +165 -0
- package/src/index.ts +161 -0
- package/src/laboratory/laboratory.component.tsx +13 -0
- package/src/left-panel/left-panel.component.tsx +20 -0
- package/src/left-panel/left-panel.scss +42 -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/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/client-details/client-details.tsx +40 -0
- package/src/registry/eligibility/eligibility-details/eligibility-details.scss +38 -0
- package/src/registry/eligibility/eligibility-details/eligibility-details.tsx +101 -0
- package/src/registry/eligibility/eliigibility-tags/eligibility-tags.scss +6 -0
- package/src/registry/eligibility/eliigibility-tags/eligibility-tags.tsx +120 -0
- package/src/registry/eligibility/modal/eligibility-details.modal.scss +0 -0
- package/src/registry/eligibility/modal/eligibility-details.modal.tsx +45 -0
- package/src/registry/modal/client-details-modal/client-details-modal.scss +28 -0
- package/src/registry/modal/client-details-modal/client-details-modal.tsx +119 -0
- package/src/registry/modal/otp-verification-modal/otp-verification-modal.scss +43 -0
- package/src/registry/modal/otp-verification-modal/otp-verification-modal.tsx +280 -0
- package/src/registry/modal/send-to-triage/send-to-triage.modal.scss +39 -0
- package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +921 -0
- package/src/registry/payment-details/payment-options/payment-options.scss +13 -0
- package/src/registry/payment-details/payment-options/payment-options.tsx +68 -0
- package/src/registry/registry.component.scss +89 -0
- package/src/registry/registry.component.tsx +490 -0
- package/src/registry/registry.resource.ts +62 -0
- package/src/registry/types/index.ts +401 -0
- package/src/registry/utils/error-handler.ts +37 -0
- package/src/registry/utils/format-dependant-display-data.ts +8 -0
- package/src/registry/utils/hie-adapter.ts +56 -0
- package/src/registry/utils/hie-client-adapter.ts +312 -0
- package/src/registry/utils/mask-data.ts +32 -0
- package/src/registry/utils/phone-number-formatter.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/patient-search.resource.ts +22 -0
- package/src/resources/queue.resource.ts +60 -0
- package/src/resources/superset.resource.ts +21 -0
- package/src/resources/visit.resource.ts +38 -0
- package/src/root.component.tsx +48 -0
- package/src/root.scss +11 -0
- package/src/root.test.tsx +51 -0
- package/src/routes.json +292 -0
- 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 +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/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 +110 -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 +56 -0
- package/src/service-queues/queue-list/queue-list.component.tsx +311 -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 +387 -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 +35 -0
- package/src/shared/constants/index.ts +1 -0
- package/src/shared/constants/patient-category.ts +6 -0
- package/src/shared/constants/patient-type.ts +10 -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 +20 -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 +153 -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/side-menu.scss +38 -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 +78 -0
- package/src/side-nav-menu/nav-links.tsx +42 -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/src/widgets/workflow-registry-link.extension.tsx +12 -0
- package/tools/i18next-parser.config.js +89 -0
- package/tools/setup-tests.ts +1 -0
- package/tools/update-openmrs-deps.mjs +43 -0
- package/translations/am.json +24 -0
- package/translations/en.json +24 -0
- package/translations/es.json +24 -0
- package/translations/fr.json +24 -0
- package/translations/he.json +24 -0
- package/translations/km.json +24 -0
- package/tsconfig.json +24 -0
- package/webpack.config.js +1 -0
package/src/root.scss
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the root test for this page. It simply checks that the page
|
|
3
|
+
* renders. If the components of your page are highly interdependent,
|
|
4
|
+
* (e.g., if the `Root` component had state that communicated
|
|
5
|
+
* information between `Greeter` and `PatientGetter`) then you might
|
|
6
|
+
* want to do most of your testing here. If those components are
|
|
7
|
+
* instead quite independent (as is the case in this example), then
|
|
8
|
+
* it would make more sense to test those components independently.
|
|
9
|
+
*
|
|
10
|
+
* The key thing to remember, always, is: write tests that behave like
|
|
11
|
+
* users. They should *look* for elements by their visual
|
|
12
|
+
* characteristics, *interact* with them, and (mostly) *assert* based
|
|
13
|
+
* on things that would be visually apparent to a user.
|
|
14
|
+
*
|
|
15
|
+
* To learn more about how we do testing, see the following resources:
|
|
16
|
+
* https://o3-docs.vercel.app/docs/frontend-modules/testing
|
|
17
|
+
* https://kentcdodds.com/blog/how-to-know-what-to-test
|
|
18
|
+
* https://kentcdodds.com/blog/testing-implementation-details
|
|
19
|
+
* https://kentcdodds.com/blog/common-mistakes-with-react-testing-library
|
|
20
|
+
*
|
|
21
|
+
* Kent C. Dodds is the inventor of `@testing-library`:
|
|
22
|
+
* https://testing-library.com/docs/guiding-principles
|
|
23
|
+
*/
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import { render, screen } from '@testing-library/react';
|
|
26
|
+
import { useConfig } from '@openmrs/esm-framework';
|
|
27
|
+
import { Config } from './config-schema';
|
|
28
|
+
import Root from './root.component';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* This is an idiomatic way of dealing with mocked files. Note that
|
|
32
|
+
* `useConfig` is already mocked; the Jest moduleNameMapper (see the
|
|
33
|
+
* Jest config) has mapped the `@openmrs/esm-framework` import to a
|
|
34
|
+
* mock file. This line just tells TypeScript that the object is, in
|
|
35
|
+
* fact, a mock, and so will have methods like `mockReturnValue`.
|
|
36
|
+
*/
|
|
37
|
+
const mockUseConfig = jest.mocked(useConfig<Config>);
|
|
38
|
+
|
|
39
|
+
it('renders a landing page for the Home app', () => {
|
|
40
|
+
const config: Config = { casualGreeting: false, whoToGreet: ['World'] };
|
|
41
|
+
mockUseConfig.mockReturnValue(config);
|
|
42
|
+
|
|
43
|
+
render(<Root />);
|
|
44
|
+
|
|
45
|
+
expect(screen.getByRole('heading', { name: /welcome to the o3 home app/i })).toBeInTheDocument();
|
|
46
|
+
expect(screen.getByRole('heading', { name: /configuration system/i })).toBeInTheDocument();
|
|
47
|
+
expect(screen.getByRole('heading', { name: /extension system/i })).toBeInTheDocument();
|
|
48
|
+
expect(screen.getByRole('heading', { name: /data fetching/i })).toBeInTheDocument();
|
|
49
|
+
expect(screen.getByRole('heading', { name: /resources/i })).toBeInTheDocument();
|
|
50
|
+
expect(screen.getByRole('button', { name: /get a patient named 'test'/i })).toBeInTheDocument();
|
|
51
|
+
});
|
package/src/routes.json
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.openmrs.org/routes.schema.json",
|
|
3
|
+
"backendDependencies": {},
|
|
4
|
+
"pages": [
|
|
5
|
+
{
|
|
6
|
+
"component": "root",
|
|
7
|
+
"route": "dha-workflow",
|
|
8
|
+
"online": true,
|
|
9
|
+
"offline": true
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"extensions": [
|
|
13
|
+
{
|
|
14
|
+
"component": "navLinks",
|
|
15
|
+
"name": "side-nav-workflow-links",
|
|
16
|
+
"slot": "dha-workflow-slot",
|
|
17
|
+
"online": true,
|
|
18
|
+
"offline": true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "dha-workflow-dashboard-link",
|
|
22
|
+
"component": "dhaWorkflowDashboardLink",
|
|
23
|
+
"slot": "homepage-dashboard-slot",
|
|
24
|
+
"meta": {
|
|
25
|
+
"name": "dashboard",
|
|
26
|
+
"slot": "dha-workflow-dashboard-slot",
|
|
27
|
+
"title": "Dashboard"
|
|
28
|
+
},
|
|
29
|
+
"online": true,
|
|
30
|
+
"offline": true,
|
|
31
|
+
"order": 0
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"component": "dhaWorkflowDashboard",
|
|
35
|
+
"name": "dashboardExt",
|
|
36
|
+
"slot": "dha-workflow-dashboard-slot"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "registry-dashboard-link",
|
|
40
|
+
"component": "registryDashboardLink",
|
|
41
|
+
"slot": "homepage-dashboard-slot",
|
|
42
|
+
"privileges": [
|
|
43
|
+
"O3 View Client Registry Dashboard"
|
|
44
|
+
],
|
|
45
|
+
"meta": {
|
|
46
|
+
"name": "registry",
|
|
47
|
+
"slot": "client-registry-dashboard-slot",
|
|
48
|
+
"title": "Registry"
|
|
49
|
+
},
|
|
50
|
+
"online": true,
|
|
51
|
+
"offline": true,
|
|
52
|
+
"order": 1
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"component": "registryExtension",
|
|
56
|
+
"name": "registry",
|
|
57
|
+
"slot": "client-registry-dashboard-slot",
|
|
58
|
+
"privileges": [
|
|
59
|
+
"O3 View Client Registry Dashboard"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "triage-dashboard-link",
|
|
64
|
+
"component": "triageDashboardLink",
|
|
65
|
+
"slot": "homepage-dashboard-slot",
|
|
66
|
+
"privileges": [
|
|
67
|
+
"O3 View Triage Dashboard"
|
|
68
|
+
],
|
|
69
|
+
"meta": {
|
|
70
|
+
"name": "triage",
|
|
71
|
+
"slot": "triage-queue-dashboard-slot",
|
|
72
|
+
"title": "Triage"
|
|
73
|
+
},
|
|
74
|
+
"online": true,
|
|
75
|
+
"offline": false
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"component": "triageQueueExtension",
|
|
79
|
+
"name": "triage",
|
|
80
|
+
"slot": "triage-queue-dashboard-slot",
|
|
81
|
+
"privileges": [
|
|
82
|
+
"O3 View Triage Dashboard"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "consultation-dashboard-link",
|
|
87
|
+
"component": "consultationDashboardLink",
|
|
88
|
+
"slot": "homepage-dashboard-slot",
|
|
89
|
+
"privileges": [
|
|
90
|
+
"O3 View Consultation Dashboard"
|
|
91
|
+
],
|
|
92
|
+
"meta": {
|
|
93
|
+
"name": "consultation",
|
|
94
|
+
"slot": "consultation-dashboard-slot",
|
|
95
|
+
"title": "Consultation"
|
|
96
|
+
},
|
|
97
|
+
"online": true,
|
|
98
|
+
"offline": false
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"component": "consultationQueue",
|
|
102
|
+
"name": "consultation",
|
|
103
|
+
"slot": "consultation-dashboard-slot",
|
|
104
|
+
"privileges": [
|
|
105
|
+
"O3 View Consultation Dashboard"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "mnch-dashboard-link",
|
|
110
|
+
"component": "mnchQueueDashboardLink",
|
|
111
|
+
"slot": "homepage-dashboard-slot",
|
|
112
|
+
"privileges": [
|
|
113
|
+
"O3 View MNCH Dashboard"
|
|
114
|
+
],
|
|
115
|
+
"meta": {
|
|
116
|
+
"name": "mnch",
|
|
117
|
+
"slot": "mnch-dashboard-slot",
|
|
118
|
+
"title": "MNCH"
|
|
119
|
+
},
|
|
120
|
+
"online": true,
|
|
121
|
+
"offline": true
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"component": "MNCHRoot",
|
|
125
|
+
"name": "mnch",
|
|
126
|
+
"slot": "mnch-dashboard-slot",
|
|
127
|
+
"privileges": [
|
|
128
|
+
"O3 View MNCH Dashboard"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "pharmacy-dashboard-link",
|
|
133
|
+
"component": "pharmacyDashboardLink",
|
|
134
|
+
"slot": "homepage-dashboard-slot",
|
|
135
|
+
"privileges": [
|
|
136
|
+
"O3 View Pharmacy Dashboard"
|
|
137
|
+
],
|
|
138
|
+
"meta": {
|
|
139
|
+
"name": "dispensing",
|
|
140
|
+
"slot": "dispensing-dashboard-slot",
|
|
141
|
+
"title": "Pharmacy"
|
|
142
|
+
},
|
|
143
|
+
"online": true,
|
|
144
|
+
"offline": true
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "bookings-dashboard-link",
|
|
148
|
+
"component": "bookingsDashboardLink",
|
|
149
|
+
"slot": "homepage-dashboard-slot",
|
|
150
|
+
"privileges": [
|
|
151
|
+
"O3 View Bookings Dashboard"
|
|
152
|
+
],
|
|
153
|
+
"meta": {
|
|
154
|
+
"name": "bookings",
|
|
155
|
+
"slot": "bookings-dashboard-slot",
|
|
156
|
+
"title": "Bookings"
|
|
157
|
+
},
|
|
158
|
+
"online": true,
|
|
159
|
+
"offline": true
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"component": "bookings",
|
|
163
|
+
"name": "bookings",
|
|
164
|
+
"slot": "bookings-dashboard-slot",
|
|
165
|
+
"privileges": [
|
|
166
|
+
"O3 View Bookings Dashboard"
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"name": "service-queue-admin-dashboard-link",
|
|
171
|
+
"component": "serviceQueuesAdminLink",
|
|
172
|
+
"privileges": [
|
|
173
|
+
"O3 View Service Queue Admin Panel"
|
|
174
|
+
],
|
|
175
|
+
"slot": "app-menu-slot",
|
|
176
|
+
"meta": {
|
|
177
|
+
"name": "service-queue-admin",
|
|
178
|
+
"slot": "service-queue-admin-dashboard-slot",
|
|
179
|
+
"title": "Service Queue Admin"
|
|
180
|
+
},
|
|
181
|
+
"online": true,
|
|
182
|
+
"offline": true
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"component": "serviceQueueAdmin",
|
|
186
|
+
"name": "service-queue-admin",
|
|
187
|
+
"slot": "service-queue-admin-dashboard-slot",
|
|
188
|
+
"privileges": [
|
|
189
|
+
"O3 View Service Queue Admin Panel"
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "admissions-dashboard-link",
|
|
194
|
+
"component": "admissionsDashboardLink",
|
|
195
|
+
"slot": "homepage-dashboard-slot",
|
|
196
|
+
"privileges": [
|
|
197
|
+
"O3 View Admissions Dashboard"
|
|
198
|
+
],
|
|
199
|
+
"meta": {
|
|
200
|
+
"name": "admissions-dashboard",
|
|
201
|
+
"slot": "admissions-dashboard-slot",
|
|
202
|
+
"title": "Admissions Dashboard"
|
|
203
|
+
},
|
|
204
|
+
"online": true,
|
|
205
|
+
"offline": true
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"component": "admissionsDashboard",
|
|
209
|
+
"name": "admissions-dashboard",
|
|
210
|
+
"slot": "admissions-dashboard-slot",
|
|
211
|
+
"privileges": [
|
|
212
|
+
"O3 View Admissions Dashboard"
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"component": "serviceQueueBannerComponent",
|
|
217
|
+
"name": "service-queue-banne",
|
|
218
|
+
"slot": "patient-banner-tags-slot"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "admissions-summary-dashboard",
|
|
222
|
+
"slot": "patient-chart-dashboard-slot",
|
|
223
|
+
"component": "patientChartAdmissionsLink",
|
|
224
|
+
"meta": {
|
|
225
|
+
"slot": "patient-chart-admissions-summary-dashboard-slot",
|
|
226
|
+
"path": "Admissions",
|
|
227
|
+
"layoutMode": "anchored"
|
|
228
|
+
},
|
|
229
|
+
"online": true,
|
|
230
|
+
"offline": true
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"name": "admission-details",
|
|
234
|
+
"slot": "patient-chart-admissions-summary-dashboard-slot",
|
|
235
|
+
"component": "patientAdmissionSummary",
|
|
236
|
+
"order": 1,
|
|
237
|
+
"meta": {
|
|
238
|
+
"title": "Admissions",
|
|
239
|
+
"view": "admissions"
|
|
240
|
+
},
|
|
241
|
+
"online": true,
|
|
242
|
+
"offline": true
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"name": "ampath-billing-dashboard-link",
|
|
246
|
+
"component": "billingDashboardLink",
|
|
247
|
+
"slot": "homepage-dashboard-slot",
|
|
248
|
+
"privileges": [
|
|
249
|
+
"O3 View Accounting Dashboard"
|
|
250
|
+
],
|
|
251
|
+
"meta": {
|
|
252
|
+
"name": "billing",
|
|
253
|
+
"slot": "ampath-billing-dashboard-slot",
|
|
254
|
+
"title": "Accounting"
|
|
255
|
+
},
|
|
256
|
+
"online": true,
|
|
257
|
+
"offline": true
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"component": "billingRoot",
|
|
261
|
+
"name": "billing",
|
|
262
|
+
"slot": "ampath-billing-dashboard-slot",
|
|
263
|
+
"privileges": [
|
|
264
|
+
"O3 View Accounting Dashboard"
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "ampath-billing-checkin-form",
|
|
269
|
+
"slot": "extra-visit-attribute-slot",
|
|
270
|
+
"component": "visitBillingForm"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "claims",
|
|
274
|
+
"slot": "billing-claims-slot",
|
|
275
|
+
"component": "claims"
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"workspaces": [
|
|
279
|
+
{
|
|
280
|
+
"name": "create-order-bill-form-workspace",
|
|
281
|
+
"component": "createOrderBillFormWorkspace",
|
|
282
|
+
"title": "Create order Bill",
|
|
283
|
+
"type": "other-form"
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
"modals": [
|
|
287
|
+
{
|
|
288
|
+
"name": "sign-off-queue-entry-modal",
|
|
289
|
+
"component": "signOffModal"
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Button } from "@carbon/react";
|
|
2
|
+
import { useLayoutType, isDesktop } from "@openmrs/esm-framework";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { useActionPropsByKey } from "../hooks/useActions";
|
|
6
|
+
import { type QueueEntryAction } from "../config-schema";
|
|
7
|
+
import { type QueueEntry } from "../types/types";
|
|
8
|
+
|
|
9
|
+
export function ActionButton({ actionKey, queueEntry }: { actionKey: QueueEntryAction; queueEntry: QueueEntry }) {
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
const layout = useLayoutType();
|
|
12
|
+
const actionPropsByKey = useActionPropsByKey();
|
|
13
|
+
|
|
14
|
+
const actionProps = actionPropsByKey[actionKey];
|
|
15
|
+
if (!actionProps) {
|
|
16
|
+
console.error(`Service queue table configuration uses unknown action in 'action.buttons': ${actionKey}`);
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (actionProps.showIf && !actionProps.showIf(queueEntry)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Button
|
|
26
|
+
key={actionKey}
|
|
27
|
+
kind="ghost"
|
|
28
|
+
aria-label={t(actionProps.label, actionProps.text)}
|
|
29
|
+
onClick={() => actionProps.onClick(queueEntry)}
|
|
30
|
+
size={isDesktop(layout) ? 'sm' : 'lg'}>
|
|
31
|
+
{t(actionProps.label, actionProps.text)}
|
|
32
|
+
</Button>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { OverflowMenuItem } from "@carbon/react";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { type QueueEntryAction } from "../config-schema";
|
|
5
|
+
import { useActionPropsByKey } from "../hooks/useActions";
|
|
6
|
+
import { type QueueEntry } from "../types/types";
|
|
7
|
+
import styles from './service-queue.scss';
|
|
8
|
+
|
|
9
|
+
export function ActionOverflowMenuItem({ actionKey, queueEntry }: { actionKey: QueueEntryAction; queueEntry: QueueEntry }) {
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
const actionPropsByKey = useActionPropsByKey();
|
|
12
|
+
|
|
13
|
+
const actionProps = actionPropsByKey[actionKey];
|
|
14
|
+
if (!actionProps) {
|
|
15
|
+
console.error(`Service queue table configuration uses unknown action in 'action.overflowMenu': ${actionKey}`);
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (actionProps.showIf && !actionProps.showIf(queueEntry)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<OverflowMenuItem
|
|
25
|
+
key={actionKey}
|
|
26
|
+
className={styles.menuItem}
|
|
27
|
+
aria-label={t(actionProps.label, actionProps.text)}
|
|
28
|
+
hasDivider
|
|
29
|
+
isDelete={actionProps.isDelete}
|
|
30
|
+
onClick={() => actionProps.onClick(queueEntry)}
|
|
31
|
+
itemText={t(actionProps.label, actionProps.text)}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.createQueueModalLayout{
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
row-gap: 10px;
|
|
6
|
+
padding: 15px 15px;
|
|
7
|
+
.sectionHeader{
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
row-gap: 15px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
padding-bottom: 15px;
|
|
13
|
+
}
|
|
14
|
+
.createQueueModalContentSection{
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
width: 100%;
|
|
18
|
+
row-gap: 10px;
|
|
19
|
+
}
|
|
20
|
+
.createQueueModalFormRow{
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
width: 100%;
|
|
24
|
+
column-gap: 10px;
|
|
25
|
+
}
|
|
26
|
+
.createQueueModalFormControl{
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { Modal, ModalBody, SelectItem, Select, TextInput, Button } from '@carbon/react';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import styles from './create-queue.modal.scss';
|
|
4
|
+
import { useSession, showSnackbar } from '@openmrs/esm-framework';
|
|
5
|
+
import { QUEUE_SERVICE_UUIDS } from '../../../../../shared/constants/concepts';
|
|
6
|
+
import { type CreateQueueDto } from '../../../../../types/types';
|
|
7
|
+
import { createQueue } from '../../../../service-queues.resource';
|
|
8
|
+
interface CreateQueueModalProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
onModalClose: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const CreateQueueModal: React.FC<CreateQueueModalProps> = ({ open, onModalClose }) => {
|
|
14
|
+
const session = useSession();
|
|
15
|
+
const location = session.sessionLocation;
|
|
16
|
+
const [queueName, setQueueName] = useState<string>();
|
|
17
|
+
const [description, setDescription] = useState<string>();
|
|
18
|
+
const [queueService, setQueueService] = useState<string>();
|
|
19
|
+
const handleQueueName = (queueName: string) => {
|
|
20
|
+
setQueueName(queueName);
|
|
21
|
+
};
|
|
22
|
+
const handleQueueDescription = (queueDescription: string) => {
|
|
23
|
+
setDescription(queueDescription);
|
|
24
|
+
};
|
|
25
|
+
const handleQueueService = (queueServiceUuid: string) => {
|
|
26
|
+
setQueueService(queueServiceUuid);
|
|
27
|
+
};
|
|
28
|
+
const handleCreateQueue = async () => {
|
|
29
|
+
const payload = generateCreateQueuePayload();
|
|
30
|
+
if (isValidateCreateQueueDto(payload)) {
|
|
31
|
+
const resp = await createQueue(payload);
|
|
32
|
+
if (resp) {
|
|
33
|
+
showAlert('Queue created successfully!', 'success');
|
|
34
|
+
onModalClose();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const generateCreateQueuePayload = (): CreateQueueDto => {
|
|
39
|
+
return {
|
|
40
|
+
name: queueName,
|
|
41
|
+
description: description,
|
|
42
|
+
service: {
|
|
43
|
+
uuid: queueService,
|
|
44
|
+
},
|
|
45
|
+
location: {
|
|
46
|
+
uuid: location.uuid,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const isValidateCreateQueueDto = (payload: CreateQueueDto): boolean => {
|
|
51
|
+
if (!payload.name) {
|
|
52
|
+
showAlert('Please add the queue name', 'error');
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
if (!payload.description) {
|
|
56
|
+
showAlert('Please add the queue description', 'error');
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
if (!payload.service) {
|
|
60
|
+
showAlert('Please add the queue service', 'error');
|
|
61
|
+
return false;
|
|
62
|
+
} else {
|
|
63
|
+
if (!payload.service.uuid) {
|
|
64
|
+
showAlert('Please select as service', 'error');
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
};
|
|
70
|
+
const showAlert = (message: string, alertType: 'success' | 'error') => {
|
|
71
|
+
showSnackbar({
|
|
72
|
+
kind: alertType,
|
|
73
|
+
title: 'Queue Deleted',
|
|
74
|
+
subtitle: message,
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
return (
|
|
78
|
+
<>
|
|
79
|
+
<Modal
|
|
80
|
+
open={open}
|
|
81
|
+
size="md"
|
|
82
|
+
onSecondarySubmit={() => onModalClose()}
|
|
83
|
+
onRequestClose={() => onModalClose()}
|
|
84
|
+
onRequestSubmit={handleCreateQueue}
|
|
85
|
+
primaryButtonText="Create Queue"
|
|
86
|
+
secondaryButtonText="Cancel"
|
|
87
|
+
>
|
|
88
|
+
<ModalBody>
|
|
89
|
+
<div className={styles.createQueueModalLayout}>
|
|
90
|
+
<div className={styles.sectionHeader}>
|
|
91
|
+
<h4 className={styles.sectionTitle}>Create Service Queue</h4>
|
|
92
|
+
</div>
|
|
93
|
+
<div className={styles.createQueueModalContentSection}>
|
|
94
|
+
<div className={styles.createQueueModalFormRow}>
|
|
95
|
+
<div className={styles.createQueueModalFormControl}>
|
|
96
|
+
<TextInput
|
|
97
|
+
id="queue-name"
|
|
98
|
+
labelText="Queue Name"
|
|
99
|
+
onChange={(e) => handleQueueName(e.target.value)}
|
|
100
|
+
type="text"
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
<div className={styles.createQueueModalFormRow}>
|
|
105
|
+
<div className={styles.createQueueModalFormControl}>
|
|
106
|
+
<TextInput
|
|
107
|
+
id="description"
|
|
108
|
+
labelText="Description"
|
|
109
|
+
onChange={(e) => handleQueueDescription(e.target.value)}
|
|
110
|
+
type="text"
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
<div className={styles.createQueueModalFormRow}>
|
|
115
|
+
<div className={styles.createQueueModalFormControl}>
|
|
116
|
+
<Select id="service" labelText="Service" onChange={(e) => handleQueueService(e.target.value)}>
|
|
117
|
+
<SelectItem value="" text="Select Service" />
|
|
118
|
+
<SelectItem value={QUEUE_SERVICE_UUIDS.TRIAGE_SERVICE_UUID} text="Triage Service" />
|
|
119
|
+
<SelectItem
|
|
120
|
+
value={QUEUE_SERVICE_UUIDS.CLINICAL_CONSULTATION_SERVICE_UUID}
|
|
121
|
+
text="Clinical Consultation Service"
|
|
122
|
+
/>
|
|
123
|
+
<SelectItem
|
|
124
|
+
value={QUEUE_SERVICE_UUIDS.MCH_TRIAGE_SERVICE_UUID}
|
|
125
|
+
text="Maternal Child Health Triage Service"
|
|
126
|
+
/>
|
|
127
|
+
<SelectItem
|
|
128
|
+
value={QUEUE_SERVICE_UUIDS.MCH_CLINICAL_CONSULTATION_SERVICE_UUID}
|
|
129
|
+
text="Maternal Child Health Consultation Service"
|
|
130
|
+
/>
|
|
131
|
+
<SelectItem value={QUEUE_SERVICE_UUIDS.MATERNITY_TRIAGE_SERVICE_UUID} text="Maternity Triage" />
|
|
132
|
+
</Select>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</ModalBody>
|
|
138
|
+
</Modal>
|
|
139
|
+
</>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export default CreateQueueModal;
|
|
File without changes
|