@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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import styles from './payment-options.scss';
|
|
3
|
+
import { Button, ComboBox } from '@carbon/react';
|
|
4
|
+
import { fetchPaymentModes } from '../../../shared/services/billing.resource';
|
|
5
|
+
import { type PaymentMode } from '../../../shared/types';
|
|
6
|
+
import { showSnackbar } from '@openmrs/esm-framework';
|
|
7
|
+
interface PaymentOptionsComponentProps {
|
|
8
|
+
onSelectPaymentMethod: (paymentMode: PaymentMode) => void;
|
|
9
|
+
}
|
|
10
|
+
const PaymentOptionsComponent: React.FC<PaymentOptionsComponentProps> = ({ onSelectPaymentMethod }) => {
|
|
11
|
+
const [paymentModes, setPaymentModes] = useState<PaymentMode[]>([]);
|
|
12
|
+
const paymentOptions = useMemo(() => generatePaymentTypeOptions(), [paymentModes]);
|
|
13
|
+
const [selectedPaymentMethod, setSelectedPaymentMethod] = useState<PaymentMode>();
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
getPaymentMethods();
|
|
16
|
+
}, []);
|
|
17
|
+
async function getPaymentMethods() {
|
|
18
|
+
const methods = await fetchPaymentModes();
|
|
19
|
+
setPaymentModes(methods);
|
|
20
|
+
}
|
|
21
|
+
function generatePaymentTypeOptions() {
|
|
22
|
+
return paymentModes.map((p: PaymentMode) => {
|
|
23
|
+
return {
|
|
24
|
+
id: p.uuid,
|
|
25
|
+
text: p.name,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const handleSelectedPatientOption = (selectedPaymentOption: { selectedItem: { id: string; text: string } }) => {
|
|
30
|
+
const selectedMethod = paymentModes.find((p) => {
|
|
31
|
+
return p.uuid === selectedPaymentOption.selectedItem.id;
|
|
32
|
+
});
|
|
33
|
+
if (selectedMethod) {
|
|
34
|
+
setSelectedPaymentMethod(selectedMethod);
|
|
35
|
+
} else {
|
|
36
|
+
showSnackbar({
|
|
37
|
+
kind: 'error',
|
|
38
|
+
title: 'Missing Payment method',
|
|
39
|
+
subtitle: 'Please select a payment method',
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const handleSavePaymentMethod = () => {
|
|
44
|
+
onSelectPaymentMethod(selectedPaymentMethod);
|
|
45
|
+
};
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<div className={styles.paymentOptionLayout}>
|
|
49
|
+
<div className={styles.formRow}>
|
|
50
|
+
<ComboBox
|
|
51
|
+
onChange={handleSelectedPatientOption}
|
|
52
|
+
id="payment-method-combobox"
|
|
53
|
+
items={paymentOptions}
|
|
54
|
+
itemToString={(item) => (item ? item.text : '')}
|
|
55
|
+
titleText="Select a Payment Method"
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
<div className={styles.formRow}>
|
|
59
|
+
<Button kind="primary" onClick={handleSavePaymentMethod}>
|
|
60
|
+
Save
|
|
61
|
+
</Button>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default PaymentOptionsComponent;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
.registryLayout{
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
width: 100%;
|
|
5
|
+
row-gap: 10px;
|
|
6
|
+
padding: 2% 2%;
|
|
7
|
+
}
|
|
8
|
+
.mainContent{
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
.registryHeader{
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
row-gap: 10px;
|
|
17
|
+
width: 100%;
|
|
18
|
+
}
|
|
19
|
+
.registryContent{
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
.formRow{
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
width: 100%;
|
|
28
|
+
column-gap: 5px;
|
|
29
|
+
margin-top: 10px;
|
|
30
|
+
}
|
|
31
|
+
.formControl{
|
|
32
|
+
width: 30%;
|
|
33
|
+
}
|
|
34
|
+
.hieData{
|
|
35
|
+
margin-top: 15px;
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
width: 80%;
|
|
39
|
+
row-gap: 10px;
|
|
40
|
+
}
|
|
41
|
+
.btnContainer{
|
|
42
|
+
padding: 5px 5px;
|
|
43
|
+
}
|
|
44
|
+
.selectionHeader{
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
width: 100%;
|
|
48
|
+
row-gap: 5px;
|
|
49
|
+
}
|
|
50
|
+
.patientSelect{
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: row;
|
|
53
|
+
width: 100%;
|
|
54
|
+
column-gap: 5px;
|
|
55
|
+
}
|
|
56
|
+
.patientSelectRadio{
|
|
57
|
+
width: 70%;
|
|
58
|
+
}
|
|
59
|
+
.patientConfirmSelection{
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
width: 30%;
|
|
63
|
+
column-gap: 5px;
|
|
64
|
+
}
|
|
65
|
+
.formBtn{
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: row;
|
|
68
|
+
column-gap: 5px;
|
|
69
|
+
}
|
|
70
|
+
.registrySearchBtn{
|
|
71
|
+
height: 30px;
|
|
72
|
+
}
|
|
73
|
+
.principalDependantSection{
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
width: 100%;
|
|
77
|
+
margin-top: 15px;
|
|
78
|
+
}
|
|
79
|
+
.dependantCard{
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: row;
|
|
82
|
+
width: 30%;
|
|
83
|
+
}
|
|
84
|
+
.dependantDetails{
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
width: 100%;
|
|
88
|
+
row-gap: 10px;
|
|
89
|
+
}
|
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Dropdown,
|
|
4
|
+
InlineLoading,
|
|
5
|
+
RadioButton,
|
|
6
|
+
RadioButtonGroup,
|
|
7
|
+
Table,
|
|
8
|
+
TableBody,
|
|
9
|
+
TableCell,
|
|
10
|
+
TableHead,
|
|
11
|
+
TableHeader,
|
|
12
|
+
TableRow,
|
|
13
|
+
TextInput,
|
|
14
|
+
} from '@carbon/react';
|
|
15
|
+
import React, { useState } from 'react';
|
|
16
|
+
import styles from './registry.component.scss';
|
|
17
|
+
import { type ClientRegistrySearchRequest, type HieClient, IDENTIFIER_TYPES, type IdentifierType, type RequestCustomOtpDto } from './types';
|
|
18
|
+
import { fetchClientRegistryData } from './registry.resource';
|
|
19
|
+
import { type Patient, showSnackbar, useSession } from '@openmrs/esm-framework';
|
|
20
|
+
import OtpVerificationModal from './modal/otp-verification-modal/otp-verification-modal';
|
|
21
|
+
import { maskExceptFirstAndLast, maskValue } from './utils/mask-data';
|
|
22
|
+
import ClientDetailsModal from './modal/client-details-modal/client-details-modal';
|
|
23
|
+
import { searchPatientByCrNumber } from '../resources/patient-search.resource';
|
|
24
|
+
import SendToTriageModal from './modal/send-to-triage/send-to-triage.modal';
|
|
25
|
+
import { formatDependantDisplayData } from './utils/format-dependant-display-data';
|
|
26
|
+
import { registerHieClientInAmrs } from '../resources/hie-amrs-automatic-registration.service';
|
|
27
|
+
import { getErrorMessages } from './utils/error-handler';
|
|
28
|
+
import EligibilityTags from './eligibility/eliigibility-tags/eligibility-tags';
|
|
29
|
+
import { IdentifierTypesUuids } from '../resources/identifier-types';
|
|
30
|
+
import { formatPhoneNumberForOTP } from './utils/phone-number-formatter';
|
|
31
|
+
|
|
32
|
+
interface RegistryComponentProps {}
|
|
33
|
+
const RegistryComponent: React.FC<RegistryComponentProps> = () => {
|
|
34
|
+
const [identifierType, setIdentifierType] = useState<IdentifierType>('National ID');
|
|
35
|
+
const [identifierValue, setIdentifierValue] = useState('');
|
|
36
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
37
|
+
const [principal, setPrincipal] = useState<HieClient>();
|
|
38
|
+
const [selectedDependant, setSelectedDependant] = useState<HieClient>();
|
|
39
|
+
const [amrsPatients, setAmrsPatients] = useState<Patient[]>([]);
|
|
40
|
+
const [selectedPatient, setSelectedPatient] = useState<string>('principal');
|
|
41
|
+
const [displayOtpModal, setDisplayOtpModal] = useState<boolean>(false);
|
|
42
|
+
const [displayClientDetailsModal, setDisplayClientDetailsModal] = useState<boolean>(false);
|
|
43
|
+
const [displaytriageModal, setDisplaytriageModal] = useState<boolean>(false);
|
|
44
|
+
const [requestCustomOtpDto, setRequestCustomOtpDto] = useState<RequestCustomOtpDto>();
|
|
45
|
+
const session = useSession();
|
|
46
|
+
const locationUuid = session.sessionLocation.uuid;
|
|
47
|
+
|
|
48
|
+
const handleSearchPatient = async () => {
|
|
49
|
+
setLoading(true);
|
|
50
|
+
try {
|
|
51
|
+
const searchClientPayload = getSearchClientDto();
|
|
52
|
+
|
|
53
|
+
if (!isValidSeatchClientPayload(searchClientPayload)) return false;
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
const result = await fetchClientRegistryData(searchClientPayload);
|
|
57
|
+
const patients = Array.isArray(result) ? result : [];
|
|
58
|
+
|
|
59
|
+
if (patients.length === 0) {
|
|
60
|
+
handleCancel();
|
|
61
|
+
throw new Error('No matching patient found in Client Registry.');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const patient = patients[0];
|
|
65
|
+
setPrincipal(patient);
|
|
66
|
+
showAlert('success', 'Client Data Loaded', 'Patient fetched successfully');
|
|
67
|
+
} catch (err: any) {
|
|
68
|
+
const errorMessage = err.message || 'Failed to fetch client data';
|
|
69
|
+
handleCancel();
|
|
70
|
+
showAlert('error', 'Fetch Failed', errorMessage);
|
|
71
|
+
} finally {
|
|
72
|
+
setLoading(false);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const getSearchClientDto = (): ClientRegistrySearchRequest =>{
|
|
77
|
+
return {
|
|
78
|
+
identificationNumber: identifierValue,
|
|
79
|
+
identificationType: identifierType,
|
|
80
|
+
locationUuid,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const isValidSeatchClientPayload = (payload: ClientRegistrySearchRequest): boolean => {
|
|
85
|
+
if (!payload.identificationNumber) {
|
|
86
|
+
showAlert('error', 'Please enter a valid identification number', '');
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
if (!payload.identificationType) {
|
|
90
|
+
showAlert('error', 'Please enter a valid identification type', '');
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
if (!payload.locationUuid) {
|
|
94
|
+
showAlert('error', 'No default location selected', '');
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
return true;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const generateCustomSmsPayload = (): RequestCustomOtpDto =>{
|
|
101
|
+
return {
|
|
102
|
+
identificationNumber: identifierValue,
|
|
103
|
+
identificationType: identifierType,
|
|
104
|
+
locationUuid,
|
|
105
|
+
phoneNumber: principal?.phone ? formatPhoneNumberForOTP(principal.phone ?? '') : ''
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const isValidCustomSmsPayload = (payload: RequestCustomOtpDto): boolean => {
|
|
110
|
+
if (!payload.identificationNumber) {
|
|
111
|
+
showAlert('error', 'Please enter a valid identification number', '');
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
if (!payload.identificationType) {
|
|
115
|
+
showAlert('error', 'Please enter a valid identification type', '');
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
if (!payload.locationUuid) {
|
|
119
|
+
showAlert('error', 'No default location selected', '');
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
if(!payload.phoneNumber){
|
|
123
|
+
showAlert('error', 'No phone number selected', '');
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
};
|
|
128
|
+
const showAlert = (alertType: 'error' | 'success', title: string, subtitle: string) => {
|
|
129
|
+
showSnackbar({
|
|
130
|
+
kind: alertType,
|
|
131
|
+
title: title,
|
|
132
|
+
subtitle: subtitle,
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
const handleSelectedPatient = (sp: string) => {
|
|
136
|
+
setSelectedPatient(sp);
|
|
137
|
+
};
|
|
138
|
+
const handleOtpVerification = () => {
|
|
139
|
+
const smsPayload = generateCustomSmsPayload();
|
|
140
|
+
if(isValidCustomSmsPayload(smsPayload )) {
|
|
141
|
+
setRequestCustomOtpDto(smsPayload);
|
|
142
|
+
setDisplayOtpModal(true);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
};
|
|
146
|
+
const handleModelClose = () => {
|
|
147
|
+
setDisplayOtpModal(false);
|
|
148
|
+
};
|
|
149
|
+
const onClientDetailsModalClose = () => {
|
|
150
|
+
setDisplayClientDetailsModal(false);
|
|
151
|
+
};
|
|
152
|
+
const handleClientDetailsSubmit = () => {
|
|
153
|
+
return;
|
|
154
|
+
};
|
|
155
|
+
const handleEmergencyRegistration = () => {
|
|
156
|
+
window.location.href = `${window.spaBase}/patient-registration`;
|
|
157
|
+
};
|
|
158
|
+
const handleManualRegistration = () => {
|
|
159
|
+
setDisplaytriageModal(false);
|
|
160
|
+
handleEmergencyRegistration();
|
|
161
|
+
};
|
|
162
|
+
const handleSendClientToTriage = async (crId: string) => {
|
|
163
|
+
onClientDetailsModalClose();
|
|
164
|
+
const resp = await searchPatientByCrNumber(crId);
|
|
165
|
+
if (resp.totalCount > 0) {
|
|
166
|
+
showAlert(
|
|
167
|
+
'success',
|
|
168
|
+
`${resp.totalCount} ${resp.totalCount > 0 ? 'Patients' : 'Patient'} found in the system with ${crId}`,
|
|
169
|
+
'',
|
|
170
|
+
);
|
|
171
|
+
const validPatients = validateAmrsPatient(crId, resp.results ?? []);
|
|
172
|
+
setAmrsPatients(validPatients);
|
|
173
|
+
setDisplaytriageModal(true);
|
|
174
|
+
} else {
|
|
175
|
+
showAlert('error', 'Patient not found in the system', '');
|
|
176
|
+
setAmrsPatients([]);
|
|
177
|
+
setDisplaytriageModal(true);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
const validateAmrsPatient = (crNo: string, patients: Patient[]) => {
|
|
181
|
+
return patients.filter((p) => {
|
|
182
|
+
return p.identifiers.some((id) => {
|
|
183
|
+
return id.identifier === crNo && id.identifierType.uuid === IdentifierTypesUuids.CLIENT_REGISTRY_NO_UUID;
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
const onSendToTriageModalClose = (modalCloseResp?: { success: boolean }) => {
|
|
188
|
+
setDisplaytriageModal(false);
|
|
189
|
+
if (modalCloseResp && modalCloseResp.success) {
|
|
190
|
+
window.location.href = `${window.spaBase}/home/triage`;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
const handleSendToTriageModalSubmit = () => {};
|
|
194
|
+
const getPatient = (): HieClient => {
|
|
195
|
+
if (selectedPatient === 'principal') {
|
|
196
|
+
return principal;
|
|
197
|
+
} else if (selectedPatient === 'dependants') {
|
|
198
|
+
return selectedDependant;
|
|
199
|
+
} else {
|
|
200
|
+
return principal;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
const handleSelectedDependant = (dependantId: string) => {
|
|
204
|
+
const dependants = principal.dependants;
|
|
205
|
+
if (dependants.length > 0) {
|
|
206
|
+
const dependant = dependants.find((d) => {
|
|
207
|
+
return d.result[0].id === dependantId;
|
|
208
|
+
});
|
|
209
|
+
if (dependant) {
|
|
210
|
+
setSelectedDependant(dependant.result[0] as unknown as HieClient);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const createAmrsPatient = async () => {
|
|
215
|
+
const patient = getPatient();
|
|
216
|
+
if (!patient) {
|
|
217
|
+
showAlert('error', 'Principal or dependant not selected', '');
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
try {
|
|
221
|
+
const resp = await registerHieClientInAmrs(patient, locationUuid);
|
|
222
|
+
if (resp) {
|
|
223
|
+
showAlert('success', 'Patient created succesfully', '');
|
|
224
|
+
setAmrsPatients([resp]);
|
|
225
|
+
}
|
|
226
|
+
} catch (e) {
|
|
227
|
+
const errorResp = e['responseBody'] ?? e.message;
|
|
228
|
+
showAlert('error', 'Error Creating Patient', '');
|
|
229
|
+
const errors = getErrorMessages(errorResp);
|
|
230
|
+
if (errors && errors.length > 0) {
|
|
231
|
+
for (let error of errors) {
|
|
232
|
+
showAlert('error', error, '');
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
const handleCancel = () => {
|
|
238
|
+
setPrincipal(null);
|
|
239
|
+
setSelectedDependant(null);
|
|
240
|
+
setAmrsPatients([]);
|
|
241
|
+
setSelectedPatient(null);
|
|
242
|
+
setIdentifierValue('');
|
|
243
|
+
setIdentifierType('National ID');
|
|
244
|
+
setDisplayClientDetailsModal(false);
|
|
245
|
+
setDisplayOtpModal(false);
|
|
246
|
+
setDisplaytriageModal(false);
|
|
247
|
+
setSelectedPatient('principal');
|
|
248
|
+
};
|
|
249
|
+
const handleOtpSuccessfullVerification = () => {
|
|
250
|
+
setDisplayOtpModal(false);
|
|
251
|
+
setDisplayClientDetailsModal(true);
|
|
252
|
+
};
|
|
253
|
+
const registerOnAfyaYangu = () => {
|
|
254
|
+
window.open('https://afyayangu.go.ke/', '_blank');
|
|
255
|
+
};
|
|
256
|
+
return (
|
|
257
|
+
<>
|
|
258
|
+
<div className={styles.registryLayout}>
|
|
259
|
+
<div className={styles.mainContent}>
|
|
260
|
+
<div className={styles.registryHeader}>
|
|
261
|
+
<h4>Client Registry</h4>
|
|
262
|
+
<p>Please enter identification number to begin</p>
|
|
263
|
+
</div>
|
|
264
|
+
<div className={styles.registryContent}>
|
|
265
|
+
<div className={styles.formRow}>
|
|
266
|
+
<div className={styles.formControl}>
|
|
267
|
+
<Dropdown
|
|
268
|
+
id="identifier-type-dropdown"
|
|
269
|
+
label="Identifier Type"
|
|
270
|
+
titleText="Select Identifier Type"
|
|
271
|
+
items={IDENTIFIER_TYPES}
|
|
272
|
+
selectedItem={identifierType}
|
|
273
|
+
onChange={({ selectedItem }) => setIdentifierType(selectedItem as IdentifierType)}
|
|
274
|
+
/>
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
<div className={styles.formControl}>
|
|
278
|
+
<TextInput
|
|
279
|
+
id="identifier-value"
|
|
280
|
+
labelText={`${identifierType} Value`}
|
|
281
|
+
value={identifierValue}
|
|
282
|
+
onChange={(e) => setIdentifierValue(e.target.value)}
|
|
283
|
+
placeholder={`Enter ${identifierType.toLowerCase()} value`}
|
|
284
|
+
/>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
<div className={styles.formRow}>
|
|
288
|
+
<div className={styles.formControl}>
|
|
289
|
+
<div className={styles.formBtn}>
|
|
290
|
+
<Button
|
|
291
|
+
className={styles.registrySearchBtn}
|
|
292
|
+
kind="primary"
|
|
293
|
+
onClick={handleSearchPatient}
|
|
294
|
+
disabled={loading}
|
|
295
|
+
>
|
|
296
|
+
{loading ? <InlineLoading description="Searching..." /> : 'Search'}
|
|
297
|
+
</Button>
|
|
298
|
+
<Button className={styles.registrySearchBtn} kind="secondary" onClick={handleEmergencyRegistration}>
|
|
299
|
+
Emergency Registration
|
|
300
|
+
</Button>
|
|
301
|
+
{!principal ? (
|
|
302
|
+
<Button className={styles.registrySearchBtn} kind="tertiary" onClick={registerOnAfyaYangu}>
|
|
303
|
+
Register on Afya Yangu
|
|
304
|
+
</Button>
|
|
305
|
+
) : (
|
|
306
|
+
<></>
|
|
307
|
+
)}
|
|
308
|
+
</div>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
{principal ? (
|
|
312
|
+
<div className={styles.formRow}>
|
|
313
|
+
<div className={styles.hieData}>
|
|
314
|
+
<div className={styles.selectionHeader}>
|
|
315
|
+
<h5>Please select one patient and request patient to share the OTP sent</h5>
|
|
316
|
+
</div>
|
|
317
|
+
<div className={styles.patientSelect}>
|
|
318
|
+
<div className={styles.patientSelectRadio}>
|
|
319
|
+
<RadioButtonGroup
|
|
320
|
+
defaultSelected="principal"
|
|
321
|
+
legendText="Patient"
|
|
322
|
+
onChange={(v) => handleSelectedPatient(v as string)}
|
|
323
|
+
name="radio-button-default-group"
|
|
324
|
+
>
|
|
325
|
+
<RadioButton id="principal" labelText="Principal" value="principal" />
|
|
326
|
+
<RadioButton id="dependants" labelText="Dependants" value="dependants" />
|
|
327
|
+
</RadioButtonGroup>
|
|
328
|
+
</div>
|
|
329
|
+
<div className={styles.patientConfirmSelection}>
|
|
330
|
+
<div className={styles.btnContainer}>
|
|
331
|
+
<Button kind="primary" onClick={handleOtpVerification}>
|
|
332
|
+
{' '}
|
|
333
|
+
Confirm
|
|
334
|
+
</Button>
|
|
335
|
+
</div>
|
|
336
|
+
<div className={styles.btnContainer}>
|
|
337
|
+
<Button kind="secondary" onClick={handleCancel}>
|
|
338
|
+
Cancel
|
|
339
|
+
</Button>
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
<div className={styles.principalDependantSection}>
|
|
344
|
+
{selectedPatient === 'principal' ? (
|
|
345
|
+
<>
|
|
346
|
+
<Table>
|
|
347
|
+
<TableHead>
|
|
348
|
+
<TableRow>
|
|
349
|
+
<TableHeader>Name</TableHeader>
|
|
350
|
+
<TableHeader>CR</TableHeader>
|
|
351
|
+
<TableHeader>Phone No</TableHeader>
|
|
352
|
+
<TableHeader>ID No</TableHeader>
|
|
353
|
+
<TableHeader>Eligibility Status</TableHeader>
|
|
354
|
+
</TableRow>
|
|
355
|
+
</TableHead>
|
|
356
|
+
<TableBody>
|
|
357
|
+
<TableRow>
|
|
358
|
+
<TableCell>
|
|
359
|
+
{principal.first_name} {maskExceptFirstAndLast(principal.middle_name)}{' '}
|
|
360
|
+
{maskExceptFirstAndLast(principal.last_name)}
|
|
361
|
+
</TableCell>
|
|
362
|
+
<TableCell>{maskValue(principal.id)}</TableCell>
|
|
363
|
+
<TableCell>{maskValue(principal.phone)}</TableCell>
|
|
364
|
+
<TableCell>{maskValue(principal.identification_number)}</TableCell>
|
|
365
|
+
<TableCell>
|
|
366
|
+
<EligibilityTags crId={principal.id} locationUuid={locationUuid} />
|
|
367
|
+
</TableCell>
|
|
368
|
+
</TableRow>
|
|
369
|
+
</TableBody>
|
|
370
|
+
</Table>
|
|
371
|
+
</>
|
|
372
|
+
) : (
|
|
373
|
+
<></>
|
|
374
|
+
)}
|
|
375
|
+
{selectedPatient === 'dependants' ? (
|
|
376
|
+
<>
|
|
377
|
+
<div className={styles.dependantDetails}>
|
|
378
|
+
<div>
|
|
379
|
+
<RadioButtonGroup
|
|
380
|
+
defaultSelected=""
|
|
381
|
+
helperText=""
|
|
382
|
+
invalidText=""
|
|
383
|
+
legendText=""
|
|
384
|
+
name="dependant-group"
|
|
385
|
+
onChange={(dependantId) => handleSelectedDependant(dependantId as string)}
|
|
386
|
+
>
|
|
387
|
+
{principal.dependants.map((d) => {
|
|
388
|
+
const dependant = d.result[0];
|
|
389
|
+
const relationship = d.relationship;
|
|
390
|
+
return (
|
|
391
|
+
<RadioButton
|
|
392
|
+
id={dependant.id}
|
|
393
|
+
labelText={formatDependantDisplayData(dependant, relationship)}
|
|
394
|
+
value={dependant.id}
|
|
395
|
+
/>
|
|
396
|
+
);
|
|
397
|
+
})}
|
|
398
|
+
</RadioButtonGroup>
|
|
399
|
+
</div>
|
|
400
|
+
<div>
|
|
401
|
+
{selectedDependant ? (
|
|
402
|
+
<>
|
|
403
|
+
<Table>
|
|
404
|
+
<TableHead>
|
|
405
|
+
<TableRow>
|
|
406
|
+
<TableHeader>Name</TableHeader>
|
|
407
|
+
<TableHeader>CR</TableHeader>
|
|
408
|
+
<TableHeader>Eligibility Status</TableHeader>
|
|
409
|
+
</TableRow>
|
|
410
|
+
</TableHead>
|
|
411
|
+
<TableBody>
|
|
412
|
+
<TableRow>
|
|
413
|
+
<TableCell>
|
|
414
|
+
{selectedDependant.first_name}{' '}
|
|
415
|
+
{maskExceptFirstAndLast(selectedDependant.middle_name)}{' '}
|
|
416
|
+
{maskExceptFirstAndLast(selectedDependant.last_name)}
|
|
417
|
+
</TableCell>
|
|
418
|
+
<TableCell>{maskValue(selectedDependant.id)}</TableCell>
|
|
419
|
+
<TableCell>
|
|
420
|
+
<EligibilityTags crId={selectedDependant.id} locationUuid={locationUuid} />
|
|
421
|
+
</TableCell>
|
|
422
|
+
</TableRow>
|
|
423
|
+
</TableBody>
|
|
424
|
+
</Table>
|
|
425
|
+
</>
|
|
426
|
+
) : (
|
|
427
|
+
<></>
|
|
428
|
+
)}
|
|
429
|
+
</div>
|
|
430
|
+
</div>
|
|
431
|
+
</>
|
|
432
|
+
) : (
|
|
433
|
+
<></>
|
|
434
|
+
)}
|
|
435
|
+
|
|
436
|
+
{displayOtpModal && requestCustomOtpDto ? (
|
|
437
|
+
<OtpVerificationModal
|
|
438
|
+
requestCustomOtpDto={requestCustomOtpDto}
|
|
439
|
+
phoneNumber={formatPhoneNumberForOTP(principal.phone)}
|
|
440
|
+
open={displayOtpModal}
|
|
441
|
+
onModalClose={handleModelClose}
|
|
442
|
+
onOtpSuccessfullVerification={handleOtpSuccessfullVerification}
|
|
443
|
+
/>
|
|
444
|
+
) : (
|
|
445
|
+
<></>
|
|
446
|
+
)}
|
|
447
|
+
|
|
448
|
+
{principal && displayClientDetailsModal ? (
|
|
449
|
+
<>
|
|
450
|
+
<ClientDetailsModal
|
|
451
|
+
client={getPatient()}
|
|
452
|
+
open={displayClientDetailsModal}
|
|
453
|
+
onModalClose={onClientDetailsModalClose}
|
|
454
|
+
onSubmit={handleClientDetailsSubmit}
|
|
455
|
+
onSendClientToTriage={handleSendClientToTriage}
|
|
456
|
+
/>{' '}
|
|
457
|
+
</>
|
|
458
|
+
) : (
|
|
459
|
+
<></>
|
|
460
|
+
)}
|
|
461
|
+
|
|
462
|
+
{principal && displaytriageModal ? (
|
|
463
|
+
<>
|
|
464
|
+
<SendToTriageModal
|
|
465
|
+
client={getPatient()}
|
|
466
|
+
patients={amrsPatients}
|
|
467
|
+
open={displaytriageModal}
|
|
468
|
+
onModalClose={onSendToTriageModalClose}
|
|
469
|
+
onSubmit={handleSendToTriageModalSubmit}
|
|
470
|
+
onCreateAmrsPatient={createAmrsPatient}
|
|
471
|
+
onManualRegistration={handleManualRegistration}
|
|
472
|
+
/>
|
|
473
|
+
</>
|
|
474
|
+
) : (
|
|
475
|
+
<></>
|
|
476
|
+
)}
|
|
477
|
+
</div>
|
|
478
|
+
</div>
|
|
479
|
+
</div>
|
|
480
|
+
) : (
|
|
481
|
+
<></>
|
|
482
|
+
)}
|
|
483
|
+
</div>
|
|
484
|
+
</div>
|
|
485
|
+
</div>
|
|
486
|
+
</>
|
|
487
|
+
);
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
export default RegistryComponent;
|