@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,168 @@
|
|
|
1
|
+
import useSWR from "swr";
|
|
2
|
+
import { ServiceType, type BenefitUtilization, type InterventionResults, type ClaimResult, type Intervention, VisitType, type ClientSubBenefit } from "./index";
|
|
3
|
+
import { fetchUrl, getUrl, useHie } from "./utils";
|
|
4
|
+
import { openmrsFetch } from "@openmrs/esm-framework";
|
|
5
|
+
|
|
6
|
+
export const useClientSubBenefits = (clientRegistryId: string) => {
|
|
7
|
+
const { hieBaseUrl, locationUuid } = useHie();
|
|
8
|
+
const url = clientRegistryId ? `${hieBaseUrl}/sub-benefits?patient_id=${clientRegistryId}&locationUuid=${locationUuid}` : null;
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
data,
|
|
12
|
+
error,
|
|
13
|
+
isLoading
|
|
14
|
+
} = useSWR<{ data: Array<ClientSubBenefit> }>(url, openmrsFetch);
|
|
15
|
+
|
|
16
|
+
const results = data?.data;
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
clientSubBenefits: results,
|
|
20
|
+
error,
|
|
21
|
+
isLoadingClientSubBenefits: isLoading
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const useInterventions = (clientRegistryId: string, subBenefitCode: string) => {
|
|
26
|
+
const { hieBaseUrl, locationUuid } = useHie();
|
|
27
|
+
const url = clientRegistryId && subBenefitCode ? `${hieBaseUrl}/interventions?patient_id=${clientRegistryId}&locationUuid=${locationUuid}&sub_benefit_code=${subBenefitCode}` : null;
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
data,
|
|
31
|
+
error,
|
|
32
|
+
isLoading
|
|
33
|
+
} = useSWR<{ data: Array<Intervention> }>(url, openmrsFetch);
|
|
34
|
+
|
|
35
|
+
const results = data?.data;
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
interventions: results,
|
|
39
|
+
error,
|
|
40
|
+
isLoadingInterventions: isLoading
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const useBenefitUtilizations = (clientRegistryId: string, interventionCode: string, isCapitation: boolean) => {
|
|
45
|
+
const { hieBaseUrl, locationUuid } = useHie();
|
|
46
|
+
const url = clientRegistryId && interventionCode && !isCapitation ? `${hieBaseUrl}/benefits-utilization?patient_id=${clientRegistryId}&locationUuid=${locationUuid}&intervention_code=${interventionCode}` : null;
|
|
47
|
+
|
|
48
|
+
const {
|
|
49
|
+
data,
|
|
50
|
+
error,
|
|
51
|
+
isLoading
|
|
52
|
+
} = useSWR<{ data: Array<BenefitUtilization> }>(url, openmrsFetch);
|
|
53
|
+
|
|
54
|
+
const results = data?.data;
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
benefitUtilizations: results,
|
|
58
|
+
error,
|
|
59
|
+
isLoadingBenefitUtilization: isLoading
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export async function createClaimsVisit(interventionCode: string, crIdentifier: string, serviceType: ServiceType, { auth_guid, otp }: { auth_guid?: string, otp?: string } = {}) {
|
|
64
|
+
const endPoint = `/claims/visit`;
|
|
65
|
+
const url = getUrl() + endPoint;
|
|
66
|
+
|
|
67
|
+
let payload = {
|
|
68
|
+
intervention_codes: [interventionCode],
|
|
69
|
+
patient_id: crIdentifier,
|
|
70
|
+
service_type: serviceType // Type of service Options: CAPITATION, OUTPATIENT, INPATIENT, EMERGENCY
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (otp) {
|
|
74
|
+
payload["otp"] = otp;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (auth_guid) {
|
|
78
|
+
payload["auth_guid"] = auth_guid;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return await fetchUrl<ClaimResult>(url, { method: "POST", payload });
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Preauths
|
|
85
|
+
export async function createPreauth() {
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const generatePreauthFormData = (payload: any, intervention: Intervention, consentToken: string) => {
|
|
90
|
+
const formData = new FormData();
|
|
91
|
+
|
|
92
|
+
// fileInput.files[0]
|
|
93
|
+
|
|
94
|
+
formData.append("consent_token", consentToken);
|
|
95
|
+
formData.append("intervention_code", intervention.code);
|
|
96
|
+
formData.append("service_start", payload.service_start);
|
|
97
|
+
formData.append("service_end", payload.service_end);
|
|
98
|
+
formData.append("items", JSON.stringify(payload.items));//items -> [{"unit_price": "500.00"}]
|
|
99
|
+
formData.append("diagnoses", JSON.stringify(payload.diagnoses));// diagnoses -> [{"consent_token": "{{consent_token}}","icd_code": "ca07.0"}]
|
|
100
|
+
formData.append("doctors", JSON.stringify(payload.doctors)); //doctors -> [{"identification_number": "{{practitioner_id_number}}","identification_type":"{{practitioner_id_type}}", "regulation_body": "KMPDC", "intervention_code": "{{intervention_code}}", "is_primary":true}]
|
|
101
|
+
formData.append("attachments", JSON.stringify(payload.attachments)); //attachments -> {"document_title": "Lab Results", "document_type": "LAB_TESTS","file_field_name": "attachments_0_file_blob"}
|
|
102
|
+
formData.append("provider_notification_email", payload.provider_notification_email);
|
|
103
|
+
|
|
104
|
+
if (intervention.requiresRadiologyPreauth) {
|
|
105
|
+
formData.append("clinical_indications", payload.clinical_indications);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (intervention.requiresOncologyPreauth) {
|
|
109
|
+
formData.append("carcinoma_staging", payload.carcinoma_staging);
|
|
110
|
+
formData.append("comorbidity", payload.comorbidity);
|
|
111
|
+
formData.append("metastases", JSON.stringify(payload.metastases));
|
|
112
|
+
formData.append("treatment_setting", JSON.stringify(payload.treatment_setting));
|
|
113
|
+
formData.append("number_of_sessions_required", String(payload.number_of_sessions_required));
|
|
114
|
+
formData.append("cost_per_session", String(payload.cost_per_session));
|
|
115
|
+
formData.append("is_co_insured", String(payload.is_co_insured));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (intervention.requiresOpticalPreauth) {
|
|
119
|
+
formData.append("necessity_of_service", payload.necessity_of_service);
|
|
120
|
+
formData.append("lens_prescription", payload.lens_prescription);
|
|
121
|
+
formData.append("lens_amount", String(payload.lens_amount));
|
|
122
|
+
formData.append("eye_examination_amount", String(payload.eye_examination_amount));
|
|
123
|
+
formData.append("frame_amount", String(payload.frame_amount));
|
|
124
|
+
formData.append("new_or_replacement", payload.new_or_replacement);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (intervention.requiresRenalPreauth) {
|
|
128
|
+
formData.append("number_of_sessions_required", String(payload.number_of_sessions_required));
|
|
129
|
+
formData.append("cost_per_session", String(payload.cost_per_session));
|
|
130
|
+
formData.append("frequency_of_sessions", payload.frequency_of_sessions);
|
|
131
|
+
formData.append("clinical_indications", payload.clinical_indications);
|
|
132
|
+
formData.append("start_date", payload.start_date);
|
|
133
|
+
formData.append("is_co_insured", String(payload.is_co_insured));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (intervention.requiresSurgicalPreauth) {
|
|
137
|
+
formData.append("chief_complaint", payload.chief_complaint);
|
|
138
|
+
formData.append("vital_signs", payload.vital_signs);
|
|
139
|
+
formData.append("history_of_present_illness", payload.history_of_present_illness);
|
|
140
|
+
formData.append("physical_examination", payload.physical_examination);
|
|
141
|
+
formData.append("investigation_report_details", payload.investigation_report_details);
|
|
142
|
+
formData.append("type_of_anaesthesia", payload.type_of_anaesthesia);
|
|
143
|
+
formData.append("surgery_date", payload.surgery_date);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Dynamic Attachments
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
return formData;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const getServiceType = (selectedIntervention: Intervention, visitType?: VisitType): ServiceType => {
|
|
153
|
+
const paymentMechanism = selectedIntervention.paymentMechanism;
|
|
154
|
+
if (paymentMechanism.toUpperCase() === "CAPITATION") {
|
|
155
|
+
return "CAPITATION";
|
|
156
|
+
}
|
|
157
|
+
if (visitType === "OUTPATIENT") {
|
|
158
|
+
return "OUTPATIENT";
|
|
159
|
+
}
|
|
160
|
+
if (visitType === "INPATIENT") {
|
|
161
|
+
return "INPATIENT";
|
|
162
|
+
}
|
|
163
|
+
return "EMERGENCY";
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export const fetchConsentToken = async () => {
|
|
167
|
+
return "";
|
|
168
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
export interface ClientSubBenefit {
|
|
2
|
+
id: number;
|
|
3
|
+
code: string;
|
|
4
|
+
name: string;
|
|
5
|
+
accessPoint: string;
|
|
6
|
+
fund: string;
|
|
7
|
+
parentBenefit: string;
|
|
8
|
+
parentBenefitCode: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ClientSubBenefitResults {
|
|
12
|
+
results: ClientSubBenefit[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Intervention {
|
|
16
|
+
id: number;
|
|
17
|
+
accessPoint: string;
|
|
18
|
+
name: string;
|
|
19
|
+
code: string;
|
|
20
|
+
paymentMechanism: string;
|
|
21
|
+
needsPreauth: boolean;
|
|
22
|
+
needsManualPreauthApproval: boolean;
|
|
23
|
+
overallTariff: string;
|
|
24
|
+
kephLevelTarriff: string;
|
|
25
|
+
fund: string;
|
|
26
|
+
fallBackOverallTariff: string;
|
|
27
|
+
tariffPerAdditionalKilometer: string;
|
|
28
|
+
level2Tariff: string;
|
|
29
|
+
level3Tariff: string;
|
|
30
|
+
level4Tariff: string;
|
|
31
|
+
level5Tariff: string;
|
|
32
|
+
level6Tariff: string;
|
|
33
|
+
requiresSurgicalPreauth: boolean;
|
|
34
|
+
requiresRenalPreauth: boolean;
|
|
35
|
+
requiresOncologyPreauth: boolean;
|
|
36
|
+
requiresRadiologyPreauth: boolean;
|
|
37
|
+
requiresOpticalPreauth: boolean;
|
|
38
|
+
applicableSchemes: string[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface InterventionResults {
|
|
42
|
+
results: Intervention[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface FundUtilizationLimit {
|
|
46
|
+
fundType: string;
|
|
47
|
+
utilisedAmount: string;
|
|
48
|
+
maxAmount: string;
|
|
49
|
+
availableAmount: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface IntermediatePeriodUsage {
|
|
53
|
+
individualUtilisedDuringPeriod: number;
|
|
54
|
+
individualMaxDuringPeriod: number;
|
|
55
|
+
period: string;
|
|
56
|
+
lastUsageDate: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface ComputationalDetail {
|
|
60
|
+
individualLimitAvailableCount: number;
|
|
61
|
+
householdLimitAvailableCount: number;
|
|
62
|
+
coverageStartDate: string;
|
|
63
|
+
coverageEndDate: string;
|
|
64
|
+
limitAvailableAmount: string;
|
|
65
|
+
nextAvailableDate: string;
|
|
66
|
+
eligibility: boolean;
|
|
67
|
+
intermediatePeriodUsage: IntermediatePeriodUsage;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface BenefitUtilization {
|
|
71
|
+
crId: string;
|
|
72
|
+
code: string;
|
|
73
|
+
limitScope: string;
|
|
74
|
+
nextAvailability: string;
|
|
75
|
+
utilizationDays: number;
|
|
76
|
+
individualMaxLimit: number;
|
|
77
|
+
householdMaxLimit: number;
|
|
78
|
+
individualUtilisedLimit: number;
|
|
79
|
+
householdUtilisedLimit: number;
|
|
80
|
+
fundUtilizationLimit: FundUtilizationLimit[];
|
|
81
|
+
computationalDetail: ComputationalDetail;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type ServiceType = "CAPITATION" | "OUTPATIENT" | "INPATIENT" | "EMERGENCY";
|
|
85
|
+
|
|
86
|
+
export type PreauthType = "NORMAL" | "SURGICAL" | "ONCOLOGY" | "RENAL" | "IMAGING" | "OPTICAL";
|
|
87
|
+
|
|
88
|
+
export type VisitType = "INPATIENT" | "OUTPATIENT";
|
|
89
|
+
|
|
90
|
+
// Claim visit
|
|
91
|
+
interface ClaimIntervention {
|
|
92
|
+
id: string;
|
|
93
|
+
intervention_code: string;
|
|
94
|
+
intervention_name: string;
|
|
95
|
+
intervention_payment_mechanism: string;
|
|
96
|
+
keph_level_tarrif: string;
|
|
97
|
+
accrued_per_diem_amount: string;
|
|
98
|
+
accrued_per_diem_days: number;
|
|
99
|
+
workflow_state: string;
|
|
100
|
+
preauth_exist: boolean;
|
|
101
|
+
is_switched_intervention: boolean;
|
|
102
|
+
supported_scheme: string;
|
|
103
|
+
switched_lines_retained: boolean;
|
|
104
|
+
sub_benefit_code: string;
|
|
105
|
+
active_for_uhc: boolean;
|
|
106
|
+
intervention_fund: string;
|
|
107
|
+
requires_surgical_preauth: boolean;
|
|
108
|
+
requires_renal_preauth: boolean;
|
|
109
|
+
requires_oncology_preauth: boolean;
|
|
110
|
+
requires_radiology_preauth: boolean;
|
|
111
|
+
requires_optical_preauth: boolean;
|
|
112
|
+
optional_document_type: string | null;
|
|
113
|
+
required_preauth_document_types: string[] | null;
|
|
114
|
+
optional_preauth_document_types: string[] | null;
|
|
115
|
+
applicable_document_types: string[];
|
|
116
|
+
needs_preauth: boolean;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface InvoiceLine {
|
|
120
|
+
[key: string]: unknown;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface InvoiceDoctor {
|
|
124
|
+
[key: string]: unknown;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface InvoiceFlag {
|
|
128
|
+
[key: string]: unknown;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface ClaimInvoice {
|
|
132
|
+
id: string;
|
|
133
|
+
invoice_number: string;
|
|
134
|
+
invoice_date: string;
|
|
135
|
+
dispatch_status: string;
|
|
136
|
+
workflow_state: string;
|
|
137
|
+
created_by_name: string;
|
|
138
|
+
patient_name: string;
|
|
139
|
+
patient_number: string;
|
|
140
|
+
provider_name: string;
|
|
141
|
+
scheme_code: string;
|
|
142
|
+
scheme_name: string;
|
|
143
|
+
service_type: ServiceType;
|
|
144
|
+
total_inv_amount: string;
|
|
145
|
+
total_inv_net_amount: string;
|
|
146
|
+
total_inv_copay: string;
|
|
147
|
+
total_inv_discount: string;
|
|
148
|
+
lines: InvoiceLine[];
|
|
149
|
+
doctors: InvoiceDoctor[];
|
|
150
|
+
invoice_flags: InvoiceFlag[];
|
|
151
|
+
visit_start: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
interface ClaimDiagnosis {
|
|
155
|
+
[key: string]: unknown;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface ClaimResult {
|
|
159
|
+
id: string;
|
|
160
|
+
payer_code: string;
|
|
161
|
+
payer_name: string;
|
|
162
|
+
payer_slade_code: string;
|
|
163
|
+
provider_slade_code: string;
|
|
164
|
+
provider_name: string;
|
|
165
|
+
patient_name: string;
|
|
166
|
+
patient_number: string;
|
|
167
|
+
member_number: string;
|
|
168
|
+
member_number_has_token: boolean;
|
|
169
|
+
service_type: ServiceType;
|
|
170
|
+
scheme_code: string;
|
|
171
|
+
scheme_name: string;
|
|
172
|
+
currency: string;
|
|
173
|
+
visit_number: string;
|
|
174
|
+
visit_start: string;
|
|
175
|
+
authorization_code: string;
|
|
176
|
+
authorization_guid: string;
|
|
177
|
+
beneficiary_id: number;
|
|
178
|
+
beneficiary_guid: string;
|
|
179
|
+
beneficiary_is_fuzzy_matched: boolean;
|
|
180
|
+
workflow_state: string;
|
|
181
|
+
is_charge_master_mapped: boolean;
|
|
182
|
+
is_resubmitted: boolean;
|
|
183
|
+
is_negative: boolean;
|
|
184
|
+
is_zero: boolean;
|
|
185
|
+
has_reviewed_claim: boolean;
|
|
186
|
+
initial_intervention: string;
|
|
187
|
+
interventions: ClaimIntervention[];
|
|
188
|
+
invoices: ClaimInvoice[];
|
|
189
|
+
claim_attachments_count: number;
|
|
190
|
+
claim_auth_status: string;
|
|
191
|
+
claim_diagnoses: ClaimDiagnosis[];
|
|
192
|
+
diagnoses_count: number;
|
|
193
|
+
invoice_attachments_count: number;
|
|
194
|
+
invoice_id: string;
|
|
195
|
+
invoice_number: string;
|
|
196
|
+
number_of_invoices: number;
|
|
197
|
+
total_claim_amount: string;
|
|
198
|
+
total_claim_copay: string;
|
|
199
|
+
total_claim_discount: string;
|
|
200
|
+
total_claim_net_amount: string;
|
|
201
|
+
total_claim_splits: string;
|
|
202
|
+
retry_count: number;
|
|
203
|
+
created_by_name: string;
|
|
204
|
+
updated_by_name: string;
|
|
205
|
+
notes: string;
|
|
206
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { fetchUrl, getUrl } from "./utils";
|
|
2
|
+
|
|
3
|
+
export async function addIntervention(consentToken: string, interventionCode: string) {
|
|
4
|
+
const endPoint = `/claims/interventions`;
|
|
5
|
+
const url = getUrl() + endPoint;
|
|
6
|
+
|
|
7
|
+
const payload = {
|
|
8
|
+
consent_token: consentToken,
|
|
9
|
+
intervention_code: interventionCode
|
|
10
|
+
}
|
|
11
|
+
return await fetchUrl<any>(url, { method: "POST", payload });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export async function switchIntervention(consentToken: string, existingInterventionCode: string, newInterventionCode: string) {
|
|
15
|
+
const endPoint = `/claims/interventions/switch`;
|
|
16
|
+
const url = getUrl() + endPoint;
|
|
17
|
+
|
|
18
|
+
const payload = {
|
|
19
|
+
consent_token: consentToken,
|
|
20
|
+
existing_intervention_code: existingInterventionCode,
|
|
21
|
+
new_intervention_code: newInterventionCode,
|
|
22
|
+
retain_bill_items: false,
|
|
23
|
+
bill_from: "", // Date from - Optional depending on whether retain_bill_items is true
|
|
24
|
+
bill_to: ""// Date to - Optional depending on whether retain_bill_items is true
|
|
25
|
+
}
|
|
26
|
+
return await fetchUrl<any>(url, { method: "POST", payload });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function restoreIntervention(consentToken: string, interventionCode: string) {
|
|
30
|
+
const endPoint = `/claims/interventions/restore`;
|
|
31
|
+
const url = getUrl() + endPoint;
|
|
32
|
+
|
|
33
|
+
const payload = {
|
|
34
|
+
consent_token: consentToken,
|
|
35
|
+
intervention_code: interventionCode
|
|
36
|
+
}
|
|
37
|
+
return await fetchUrl<any>(url, { method: "POST", payload });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export async function retireIntervention(consentToken: string, interventionCode: string) {
|
|
41
|
+
const endPoint = `/claims/interventions/retire`;
|
|
42
|
+
const url = getUrl() + endPoint;
|
|
43
|
+
|
|
44
|
+
const payload = {
|
|
45
|
+
consent_token: consentToken,
|
|
46
|
+
intervention_code: interventionCode
|
|
47
|
+
}
|
|
48
|
+
return await fetchUrl<any>(url, { method: "POST", payload });
|
|
49
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useConfig, useSession } from "@openmrs/esm-framework";
|
|
2
|
+
|
|
3
|
+
export const getUrl = () => {
|
|
4
|
+
const baseUrl = "https://ilm-dev.dha.go.ke/uat-middleware";
|
|
5
|
+
const version = "/api/v1"
|
|
6
|
+
return `${baseUrl}${version}`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export async function fetchUrl<T>(url: string, { method = "GET", headers, payload, isFormData = false }: { method?: string, headers?: Record<string, any>, payload?: unknown, isFormData?: boolean } = {}): Promise<T> {
|
|
10
|
+
// Temporarily
|
|
11
|
+
const authToken = "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJRRzhsY1ZKeG5jS0pCY1hveWVNbmRZWWRaNHdSV2lXY1lBWVppLWlCalBNIn0.eyJleHAiOjE3ODA1Njk5ODMsImlhdCI6MTc4MDU2NjM4MywianRpIjoidHJydGNjOjQ4MmIzNmQ5LTA5MTgtOTI4Ni1kMGIzLTAzYjBhYzE5MWY1OCIsImlzcyI6Imh0dHBzOi8vYWNjb3VudHMtdWF0LmRoYS5nby5rZS9yZWFsbXMvaGllIiwiYXVkIjoiYWNjb3VudCIsInN1YiI6IjQ1YTIyYjIzLTUxZTEtNDIwNi05NzcyLTdlYWM0MzA2NjM3MyIsInR5cCI6IkJlYXJlciIsImF6cCI6ImFtcnMiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbIi8qIl0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJkZWZhdWx0LXJvbGVzLWhpZSJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJ2aWV3LWFwcGxpY2F0aW9ucyIsInZpZXctY29uc2VudCIsInZpZXctZ3JvdXBzIiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJkZWxldGUtYWNjb3VudCIsIm1hbmFnZS1jb25zZW50Iiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJlbWFpbCB0ZW5hbnQgcHJvZmlsZSBwaG9uZSIsInRlbmFudF9pZCI6ImFtcnMiLCJ0ZW5hbnRfbmFtZSI6ImFtcnMiLCJjbGllbnRIb3N0IjoiMTAuMC4zLjQ4IiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJmYWNpbGl0eV9pZF90eXBlIjoiZnItY29kZSIsImZhY2lsaXR5X2lkIjoiRklELTI3LTExNjAwNy03IiwidGVuYW50X3R5cGUiOiJvcmdhbmlzYXRpb24iLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtYW1ycyIsImNsaWVudEFkZHJlc3MiOiIxMC4wLjMuNDgiLCJjbGllbnRfaWQiOiJhbXJzIn0.JXb07V9Qdx0yvnbT6_8bAhqXbDHRtK8XaW2C6Hm04mAZbuTkjB5By9rIrAbeSX6hbiMfZOwrNdWT9Jz473QX6kTde6GxAkjguFNpQ51UrM1g5NUb9IAqSqQsHlYuSSpmK254jMNYocJNEzry9W1gzjs0Q5TPkppF6xASHtyDq6gb1TpYeYzKEwvzvO9nq0VA6ZHRLQ87ZDEvqmxPcOVvHIhZaiNLMZ_UviDmaz2zMuXuioCJftQMMIxzpLP4XFzlkPt7jVdLqhsymAr6NxpNS9KI2irTiMqpS9jRnqU07h1Fsl38ss37boQJAo0rosLrmJBWcYMG0WSNcU9wZFEpRw";
|
|
12
|
+
// const myHeaders = new Headers();
|
|
13
|
+
// myHeaders.append("Content-Type", "multipart/form-data");
|
|
14
|
+
|
|
15
|
+
headers = {
|
|
16
|
+
...headers,
|
|
17
|
+
Authorization: `Bearer ${authToken}`,
|
|
18
|
+
'X-Facility-Id': 'FID-27-114387-5',
|
|
19
|
+
'X-Facility-Id-Type': 'fr-code'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (isFormData) {
|
|
23
|
+
headers["Content-Type"] = "multipart/form-data";
|
|
24
|
+
headers["Accept"] = "application/json";
|
|
25
|
+
} else {
|
|
26
|
+
headers["Content-Type"] = "application/json";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let request = {
|
|
30
|
+
method: method,
|
|
31
|
+
headers: { ...headers },
|
|
32
|
+
...{ method },
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (method === "POST" && payload) {
|
|
36
|
+
request["body"] = isFormData ? payload : JSON.stringify(payload)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const response = await fetch(url, request);
|
|
40
|
+
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
const errorText = await response.text();
|
|
43
|
+
throw new Error(`Request failed with ${response.status}: ${errorText}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return response.json() as Promise<T>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const useHie = () => {
|
|
50
|
+
const { hieBaseUrl } = useConfig({
|
|
51
|
+
externalModuleName: '@ampath/esm-dha-workflow-app',
|
|
52
|
+
});
|
|
53
|
+
const { sessionLocation } = useSession();
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
hieBaseUrl,
|
|
57
|
+
locationUuid: sessionLocation?.uuid
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { Type, validator } from '@openmrs/esm-framework';
|
|
2
|
+
|
|
3
|
+
export const configSchema = {
|
|
4
|
+
concepts: {
|
|
5
|
+
defaultPriorityConceptUuid: {
|
|
6
|
+
_type: Type.ConceptUuid,
|
|
7
|
+
_default: false,
|
|
8
|
+
_description: 'The UUID of the default priority for the queues eg Not urgent.',
|
|
9
|
+
},
|
|
10
|
+
defaultStatusConceptUuid: {
|
|
11
|
+
_type: Type.ConceptUuid,
|
|
12
|
+
_default: '51ae5e4d-b72b-4912-bf31-a17efb690aeb',
|
|
13
|
+
_description: 'The UUID of the default status for the queues eg Waiting.',
|
|
14
|
+
},
|
|
15
|
+
defaultTransitionStatus: {
|
|
16
|
+
_type: Type.ConceptUuid,
|
|
17
|
+
_default: 'ca7494ae-437f-4fd0-8aae-b88b9a2ba47d',
|
|
18
|
+
_description: 'The UUID of the default status for attending a service in the queues eg In Service.',
|
|
19
|
+
},
|
|
20
|
+
systolicBloodPressureUuid: {
|
|
21
|
+
_type: Type.ConceptUuid,
|
|
22
|
+
_default: '5085AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
23
|
+
},
|
|
24
|
+
diastolicBloodPressureUuid: {
|
|
25
|
+
_type: Type.ConceptUuid,
|
|
26
|
+
_default: '5086AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
27
|
+
},
|
|
28
|
+
emergencyPriorityConceptUuid: {
|
|
29
|
+
_type: Type.ConceptUuid,
|
|
30
|
+
_default: false,
|
|
31
|
+
_description: 'The UUID of the priority with the highest sort weight for the queues eg Emergency.',
|
|
32
|
+
},
|
|
33
|
+
generalPatientNoteConceptUuid: {
|
|
34
|
+
_type: Type.ConceptUuid,
|
|
35
|
+
_default: '162169AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
36
|
+
_description:
|
|
37
|
+
'The UUID of the free text note field intended to capture unstructured description of the patient encounter',
|
|
38
|
+
},
|
|
39
|
+
heightUuid: {
|
|
40
|
+
_type: Type.ConceptUuid,
|
|
41
|
+
_default: '5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
42
|
+
},
|
|
43
|
+
historicalObsConceptUuid: {
|
|
44
|
+
_type: Type.Array,
|
|
45
|
+
_default: ['161643AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'],
|
|
46
|
+
_description: 'The Uuids of the obs that are displayed on the previous visit modal',
|
|
47
|
+
_elements: {
|
|
48
|
+
_type: Type.ConceptUuid,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
oxygenSaturationUuid: {
|
|
52
|
+
_type: Type.ConceptUuid,
|
|
53
|
+
_default: '5092AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
54
|
+
},
|
|
55
|
+
pulseUuid: {
|
|
56
|
+
_type: Type.ConceptUuid,
|
|
57
|
+
_default: '5087AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
58
|
+
},
|
|
59
|
+
problemListConceptUuid: {
|
|
60
|
+
_type: Type.ConceptUuid,
|
|
61
|
+
_default: '1284AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
62
|
+
},
|
|
63
|
+
respiratoryRateUuid: {
|
|
64
|
+
_type: Type.ConceptUuid,
|
|
65
|
+
_default: '5242AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
66
|
+
},
|
|
67
|
+
temperatureUuid: {
|
|
68
|
+
_type: Type.ConceptUuid,
|
|
69
|
+
_default: '5088AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
70
|
+
},
|
|
71
|
+
visitDiagnosesConceptUuid: {
|
|
72
|
+
_type: Type.ConceptUuid,
|
|
73
|
+
_default: '159947AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
74
|
+
},
|
|
75
|
+
weightUuid: {
|
|
76
|
+
_type: Type.ConceptUuid,
|
|
77
|
+
_default: '5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
78
|
+
},
|
|
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
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export type Config = {
|
|
158
|
+
casualGreeting: boolean;
|
|
159
|
+
whoToGreet: Array<string>;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export interface ConfigObject {
|
|
163
|
+
// priorityConfigs: Array<PriorityConfig>;
|
|
164
|
+
appointmentStatuses: Array<string>;
|
|
165
|
+
// biometrics: BiometricsConfigObject;
|
|
166
|
+
concepts: {
|
|
167
|
+
defaultPriorityConceptUuid: string;
|
|
168
|
+
defaultStatusConceptUuid: string;
|
|
169
|
+
defaultTransitionStatus: string;
|
|
170
|
+
diastolicBloodPressureUuid: string;
|
|
171
|
+
emergencyPriorityConceptUuid: string;
|
|
172
|
+
generalPatientNoteConceptUuid: string;
|
|
173
|
+
heightUuid: string;
|
|
174
|
+
historicalObsConceptUuid: Array<string>;
|
|
175
|
+
oxygenSaturationUuid: string;
|
|
176
|
+
pulseUuid: string;
|
|
177
|
+
problemListConceptUuid: string;
|
|
178
|
+
respiratoryRateUuid: string;
|
|
179
|
+
systolicBloodPressureUuid: string;
|
|
180
|
+
temperatureUuid: string;
|
|
181
|
+
visitDiagnosesConceptUuid: string;
|
|
182
|
+
weightUuid: string;
|
|
183
|
+
};
|
|
184
|
+
defaultInitialServiceQueue: string;
|
|
185
|
+
contactAttributeType: string;
|
|
186
|
+
customPatientChartUrl: string;
|
|
187
|
+
defaultIdentifierTypes: Array<string>;
|
|
188
|
+
dashboardTitle: {
|
|
189
|
+
key: string;
|
|
190
|
+
value: string;
|
|
191
|
+
};
|
|
192
|
+
// queueTables: TablesConfig;
|
|
193
|
+
showRecommendedVisitTypeTab: boolean;
|
|
194
|
+
visitQueueNumberAttributeUuid: string | null;
|
|
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;
|
|
208
|
+
// vitals: VitalsConfigObject;
|
|
209
|
+
nonSHAPaymentModes: Array<string>;
|
|
210
|
+
registrationServicequeues: Array<string>;
|
|
211
|
+
consultationBillableServiceNames: Array<string>;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const queueEntryActions = ['move', 'call', 'edit', 'transition', 'signOff', 'remove', 'delete', 'undo'] as const;
|
|
215
|
+
export type QueueEntryAction = (typeof queueEntryActions)[number];
|