@ampath/esm-dha-workflow-app 4.0.0-next.13 → 4.0.0-next.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/1197.js +1 -0
- package/dist/1277.js +1 -0
- package/dist/1277.js.map +1 -0
- package/dist/1558.js +2 -0
- package/dist/{198.js.LICENSE.txt → 1558.js.LICENSE.txt} +0 -10
- package/dist/1558.js.map +1 -0
- package/dist/1729.js +1 -0
- package/dist/1729.js.map +1 -0
- package/dist/182.js +1 -0
- package/dist/182.js.map +1 -0
- package/dist/1826.js +1 -0
- package/dist/1826.js.map +1 -0
- package/dist/1833.js +1 -0
- package/dist/1833.js.map +1 -0
- package/dist/1856.js +1 -0
- package/dist/1856.js.map +1 -0
- package/dist/1925.js +1 -0
- package/dist/1925.js.map +1 -0
- package/dist/2021.js +1 -0
- package/dist/2021.js.map +1 -0
- package/dist/2054.js +1 -0
- package/dist/2054.js.map +1 -0
- package/dist/2177.js +2 -0
- package/dist/2177.js.LICENSE.txt +9 -0
- package/dist/2177.js.map +1 -0
- package/dist/2364.js +2 -0
- package/dist/{200.js.LICENSE.txt → 2364.js.LICENSE.txt} +15 -0
- package/dist/2364.js.map +1 -0
- package/dist/2566.js +1 -0
- package/dist/2566.js.map +1 -0
- package/dist/2801.js +1 -0
- package/dist/2801.js.map +1 -0
- package/dist/2975.js +1 -0
- package/dist/2975.js.map +1 -0
- package/dist/3041.js +1 -0
- package/dist/3041.js.map +1 -0
- package/dist/3099.js +1 -0
- package/dist/3184.js +2 -0
- package/dist/3184.js.map +1 -0
- package/dist/3485.js +1 -0
- package/dist/3485.js.map +1 -0
- package/dist/3654.js +1 -0
- package/dist/3654.js.map +1 -0
- package/dist/4055.js +1 -0
- package/dist/4205.js +1 -0
- package/dist/4205.js.map +1 -0
- package/dist/4225.js +1 -0
- package/dist/4225.js.map +1 -0
- package/dist/4300.js +1 -0
- package/dist/4335.js +1 -0
- package/dist/4353.js +1 -0
- package/dist/4353.js.map +1 -0
- package/dist/4517.js +1 -0
- package/dist/4517.js.map +1 -0
- package/dist/4652.js +1 -0
- package/dist/4674.js +1 -0
- package/dist/4674.js.map +1 -0
- package/dist/4947.js +1 -0
- package/dist/4947.js.map +1 -0
- package/dist/5015.js +1 -0
- package/dist/5015.js.map +1 -0
- package/dist/5422.js +1 -0
- package/dist/5422.js.map +1 -0
- package/dist/5428.js +1 -0
- package/dist/5428.js.map +1 -0
- package/dist/5752.js +1 -0
- package/dist/5752.js.map +1 -0
- package/dist/5851.js +1 -0
- package/dist/5851.js.map +1 -0
- package/dist/6264.js +1 -0
- package/dist/6264.js.map +1 -0
- package/dist/6540.js +2 -0
- package/dist/6540.js.map +1 -0
- package/dist/6606.js +1 -0
- package/dist/6606.js.map +1 -0
- package/dist/693.js +1 -0
- package/dist/693.js.map +1 -0
- package/dist/6991.js +1 -0
- package/dist/6991.js.map +1 -0
- package/dist/7199.js +1 -0
- package/dist/7199.js.map +1 -0
- package/dist/7255.js +1 -0
- package/dist/7255.js.map +1 -0
- package/dist/7258.js +1 -0
- package/dist/7258.js.map +1 -0
- package/dist/7420.js +1 -0
- package/dist/7420.js.map +1 -0
- package/dist/8114.js +1 -0
- package/dist/8114.js.map +1 -0
- package/dist/8339.js +1 -0
- package/dist/8339.js.map +1 -0
- package/dist/8865.js +1 -0
- package/dist/8865.js.map +1 -0
- package/dist/8895.js +1 -0
- package/dist/8895.js.map +1 -0
- package/dist/9037.js +1 -0
- package/dist/9037.js.map +1 -0
- package/dist/9091.js +1 -0
- package/dist/9091.js.map +1 -0
- package/dist/9093.js +1 -0
- package/dist/9093.js.map +1 -0
- package/dist/9117.js +1 -0
- package/dist/9117.js.map +1 -0
- package/dist/9721.js +1 -0
- package/dist/9721.js.map +1 -0
- package/dist/esm-dha-workflow-app.js +1 -0
- package/dist/esm-dha-workflow-app.js.buildmanifest.json +1546 -0
- package/dist/esm-dha-workflow-app.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +11 -4
- package/src/accounting/accounting.component.tsx +13 -0
- package/src/admissions/admission-request-list/admission-request-list.scss +0 -0
- package/src/admissions/admission-request-list/admission-request-list.tsx +134 -0
- package/src/admissions/admissions-dashboard.component.scss +15 -0
- package/src/admissions/admissions-dashboard.component.tsx +160 -0
- package/src/admissions/admissions.resource.ts +101 -0
- package/src/admissions/admitted-list/admitted-patients-list.tsx +141 -0
- package/src/admissions/constants/index.ts +33 -0
- package/src/admissions/discharged-list/discharged-list.scss +0 -0
- package/src/admissions/discharged-list/discharged-list.tsx +58 -0
- package/src/admissions/inpatient/admission-history/patient-admission-history.tsx +76 -0
- package/src/admissions/inpatient/admission-requests/patient-admission-requests.scss +19 -0
- package/src/admissions/inpatient/admission-requests/patient-admission-requests.tsx +72 -0
- package/src/admissions/inpatient/inpatient-admissions.component.scss +7 -0
- package/src/admissions/inpatient/inpatient-admissions.component.tsx +46 -0
- package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.scss +23 -0
- package/src/admissions/modal/admit-elsewhere/admit-elsewhere.modal.tsx +156 -0
- package/src/admissions/modal/admit-patient/admit-patient.modal.scss +0 -0
- package/src/admissions/modal/admit-patient/admit-patient.modal.tsx +109 -0
- package/src/admissions/modal/bed-swap/bed-swap.modal.scss +0 -0
- package/src/admissions/modal/bed-swap/bed-swap.modal.tsx +102 -0
- package/src/admissions/modal/cancel-admission-request/cancel-admission-request.scss +11 -0
- package/src/admissions/modal/cancel-admission-request/cancel-admission-request.tsx +105 -0
- package/src/admissions/modal/discharge/discharge-patient.modal.scss +13 -0
- package/src/admissions/modal/discharge/discharge-patient.modal.tsx +84 -0
- package/src/admissions/types/index.ts +192 -0
- package/src/appointments/appointments.component.tsx +13 -0
- package/src/billing/api/billing.api.ts +95 -0
- package/src/billing/billing-root.tsx +20 -0
- package/src/billing/dashboard/billingDashboard.component.scss +0 -0
- package/src/billing/dashboard/billingDashboard.component.tsx +25 -0
- package/src/billing/extensions/visit-billing/visit-billing.extension.scss +0 -0
- package/src/billing/extensions/visit-billing/visit-billing.extension.tsx +409 -0
- package/src/billing/invoice/bill.resource.ts +47 -0
- package/src/billing/invoice/invoice-header/header-card/header-card.scss +17 -0
- package/src/billing/invoice/invoice-header/header-card/header-card.tsx +21 -0
- package/src/billing/invoice/invoice.scss +113 -0
- package/src/billing/invoice/invoice.tsx +1371 -0
- package/src/billing/invoice/line-items/line-items.scss +0 -0
- package/src/billing/invoice/line-items/line-items.tsx +120 -0
- package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.scss +23 -0
- package/src/billing/invoice/modal/delete-bill-item/delete-bill-item.modal.tsx +114 -0
- package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.scss +0 -0
- package/src/billing/invoice/modal/edit-bill-item/edit-bill-item.modal.tsx +122 -0
- package/src/billing/invoice/payment-details/payment-details.scss +0 -0
- package/src/billing/invoice/payment-details/payment-details.tsx +43 -0
- package/src/billing/invoice/print-invoice/print-receipt.component.tsx +44 -0
- package/src/billing/invoice/print-invoice/print-receipt.scss +14 -0
- package/src/billing/types/index.ts +84 -0
- package/src/billing/utils/index.ts +17 -0
- package/src/billing/widgets/billingTotalsRow.component.scss +0 -0
- package/src/billing/widgets/billingTotalsRow.component.tsx +712 -0
- package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.resource.ts +85 -0
- package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.scss +58 -0
- package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.workspace.tsx +330 -0
- package/src/billing/workspaces/create-order-bill-form-workspace/schema.ts +11 -0
- package/src/bookings/bookings.component.scss +7 -0
- package/src/bookings/bookings.component.tsx +31 -0
- package/src/bookings/daily/daily-bookings.component.scss +38 -0
- package/src/bookings/daily/daily-bookings.component.tsx +138 -0
- package/src/bookings/daily/daily-bookings.resource.ts +28 -0
- package/src/bookings/daily/filters/daily-bookings-filter.component.scss +15 -0
- package/src/bookings/daily/filters/daily-bookings-filter.component.tsx +80 -0
- package/src/bookings/daily/patient-list/daily-bookings-patient-list.component.tsx +97 -0
- package/src/bookings/types/index.ts +68 -0
- package/src/config-schema.ts +186 -32
- package/src/createDashboardLink.tsx +9 -0
- package/src/dashboard/charts/chart.component.scss +13 -0
- package/src/dashboard/charts/chart.component.tsx +54 -0
- package/src/dashboard/dashboard.component.scss +7 -0
- package/src/dashboard/dashboard.component.tsx +51 -0
- package/src/dashboard/overview/overview.component.scss +147 -0
- package/src/dashboard/overview/overview.component.tsx +115 -0
- package/src/dashboard/patient-list/patient-list.component.tsx +41 -0
- package/src/dashboard-meta/accounting-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/admissions-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/billing-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/bookings-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/consultation-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/dha-workflow-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/inpatient-admissions.meta.ts +6 -0
- package/src/dashboard-meta/mch-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/pharmacy-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/queue-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/registers-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/registry-dashboard.meta.ts +6 -0
- package/src/dashboard-meta/service-queue-admin.meta.ts +6 -0
- package/src/dashboard-meta/triage-dashboard.meta.ts +6 -0
- package/src/hooks/useActions.ts +165 -0
- package/src/index.ts +113 -1
- package/src/laboratory/laboratory.component.tsx +13 -0
- package/src/left-panel/left-panel.component.tsx +0 -2
- package/src/mch/mch-queues.component.scss +7 -0
- package/src/mch/mch-queues.component.tsx +32 -0
- package/src/mch/queues/consultation/mch-consultation.tsx +18 -0
- package/src/mch/queues/triage/mch-triage.tsx +15 -0
- package/src/modals/sign-off-modal.scss +7 -0
- package/src/modals/sign-off-modal.tsx +52 -0
- package/src/mortuary/mortuary.component.tsx +13 -0
- package/src/pharmacy/pharmacy.component.tsx +13 -0
- package/src/registers/registers.component.tsx +8 -0
- package/src/registry/eligibility/eliigibility-tags/eligibility-tags.scss +6 -0
- package/src/registry/eligibility/eliigibility-tags/eligibility-tags.tsx +137 -0
- package/src/registry/eligibility/modal/eligibility-details.modal.scss +38 -0
- package/src/registry/eligibility/modal/eligibility-details.modal.tsx +131 -0
- package/src/registry/modal/client-details-modal/client-details-modal.tsx +9 -26
- package/src/registry/modal/otp-verification-modal/otp-verification-modal.scss +31 -1
- package/src/registry/modal/otp-verification-modal/otp-verification-modal.tsx +145 -58
- package/src/registry/modal/send-to-triage/send-to-triage.modal.scss +16 -1
- package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +681 -97
- package/src/registry/payment-details/payment-options/payment-options.scss +13 -0
- package/src/registry/payment-details/payment-options/payment-options.tsx +61 -14
- package/src/registry/registry.component.scss +18 -1
- package/src/registry/registry.component.tsx +242 -111
- package/src/registry/registry.resource.ts +8 -5
- package/src/registry/types/index.ts +179 -1
- package/src/registry/utils/error-handler.ts +33 -0
- package/src/registry/utils/format-dependant-display-data.ts +8 -0
- package/src/registry/utils/hie-client-adapter.ts +312 -0
- package/src/registry/utils/mask-data.ts +11 -0
- package/src/resources/dashboard.resource.ts +20 -0
- package/src/resources/hie-amrs-automatic-registration.service.ts +16 -0
- package/src/resources/identifier-types.ts +29 -0
- package/src/resources/patient-resource.ts +62 -0
- package/src/resources/queue.resource.ts +23 -0
- package/src/resources/superset.resource.ts +20 -0
- package/src/resources/visit.resource.ts +19 -1
- package/src/root.component.tsx +32 -6
- package/src/routes.json +215 -7
- package/src/service-queues/action-button.component.tsx +34 -0
- package/src/service-queues/action-overflow-menu-item.component.tsx +34 -0
- package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.scss +31 -0
- package/src/service-queues/admin/queue/modal/create-queue/create-queue.modal.tsx +142 -0
- package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.scss +0 -0
- package/src/service-queues/admin/queue/modal/edit-queue/edit-queue.modal.tsx +150 -0
- package/src/service-queues/admin/queue/queue-list/queue-list.scss +33 -0
- package/src/service-queues/admin/queue/queue-list/queue-list.tsx +113 -0
- package/src/service-queues/admin/queue-entry/queue-entry-list.component.scss +6 -0
- package/src/service-queues/admin/queue-entry/queue-entry-list.component.tsx +137 -0
- package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.scss +31 -0
- package/src/service-queues/admin/queue-room/modal/create-queue-room/create-queue-room.modal.tsx +137 -0
- package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.scss +0 -0
- package/src/service-queues/admin/queue-room/modal/edit-queue-room/edit-queue-room.modal.tsx +146 -0
- package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.scss +22 -0
- package/src/service-queues/admin/queue-room/queue-room-list/queue-room-list.tsx +120 -0
- package/src/service-queues/admin/service-queue-admin-dashboard.component.scss +6 -0
- package/src/service-queues/admin/service-queue-admin-dashboard.component.tsx +34 -0
- package/src/service-queues/consultation/consultation.component.scss +7 -0
- package/src/service-queues/consultation/consultation.component.tsx +15 -0
- package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.scss +30 -0
- package/src/service-queues/extensions/service-queue-patient-banner/service-queue-patient-banner.tsx +108 -0
- package/src/service-queues/metrics/metrics-cards/attended-patients.extension.tsx +38 -0
- package/src/service-queues/metrics/metrics-cards/metrics-card.component.tsx +86 -0
- package/src/service-queues/metrics/metrics-cards/metrics-card.scss +106 -0
- package/src/service-queues/metrics/metrics-cards/waiting-patients.extension.tsx +34 -0
- package/src/service-queues/metrics/metrics-container.component.tsx +23 -0
- package/src/service-queues/metrics/metrics-container.scss +36 -0
- package/src/service-queues/metrics/metrics.resource.ts +65 -0
- package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.scss +26 -0
- package/src/service-queues/modals/daily-report-patient-list/daily-report-patient-list.tsx +108 -0
- package/src/service-queues/modals/move/move-patient.component.scss +35 -0
- package/src/service-queues/modals/move/move-patient.component.tsx +152 -0
- package/src/service-queues/modals/serve/serve-patient.comppnent.scss +0 -0
- package/src/service-queues/modals/serve/serve-patient.comppnent.tsx +80 -0
- package/src/service-queues/modals/sign-off/sign-off.modal.scss +0 -0
- package/src/service-queues/modals/sign-off/sign-off.modal.tsx +79 -0
- package/src/service-queues/modals/transition/transition-patient.component.scss +0 -0
- package/src/service-queues/modals/transition/transition-patient.component.tsx +122 -0
- package/src/service-queues/queue-list/check-in.service.ts +26 -0
- package/src/service-queues/queue-list/queue-list.component.scss +36 -0
- package/src/service-queues/queue-list/queue-list.component.tsx +249 -0
- package/src/service-queues/queue-room.component.tsx +39 -0
- package/src/service-queues/room/room.component.tsx +58 -0
- package/src/service-queues/service-queue/service-queue.component.scss +14 -0
- package/src/service-queues/service-queue/service-queue.component.tsx +399 -0
- package/src/service-queues/service-queue/stats/stat-details/stat-details.component.scss +12 -0
- package/src/service-queues/service-queue/stats/stat-details/stat-details.component.tsx +63 -0
- package/src/service-queues/service-queue.scss +27 -0
- package/src/service-queues/service-queue.tsx +37 -0
- package/src/service-queues/service-queues.resource.ts +361 -0
- package/src/service-queues/service.resource.ts +28 -0
- package/src/shared/constants/civil-status.ts +29 -0
- package/src/shared/constants/concepts.ts +15 -0
- package/src/shared/constants/index.ts +1 -2
- package/src/shared/constants/patient-category.ts +6 -0
- package/src/shared/constants/person-attributes.ts +33 -0
- package/src/shared/constants/visit-types.ts +7 -0
- package/src/shared/services/billing.resource.ts +38 -0
- package/src/shared/services/client-payment-mode.resource.ts +27 -0
- package/src/shared/services/client-payment.resource.ts +17 -0
- package/src/shared/services/eligibility.resource.ts +19 -0
- package/src/shared/services/encounters.resource.ts +27 -0
- package/src/shared/services/location.resource.ts +9 -0
- package/src/shared/types/index.ts +152 -0
- package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.scss +42 -0
- package/src/shared/ui/aggregate-stat-card/aggregate-stat-card.tsx +42 -0
- package/src/shared/ui/confirm-modal/confirm.modal.scss +18 -0
- package/src/shared/ui/confirm-modal/confirm.modal.tsx +38 -0
- package/src/shared/ui/otp-input/otp-input.component.scss +14 -0
- package/src/shared/ui/otp-input/otp-input.component.tsx +90 -0
- package/src/shared/ui/stat-card/stat-card.component.scss +10 -0
- package/src/shared/ui/stat-card/stat-card.component.tsx +26 -0
- package/src/shared/ui/timer/timer.component.scss +5 -0
- package/src/shared/ui/timer/timer.component.tsx +40 -0
- package/src/shared/utils/get-base-url.ts +27 -0
- package/src/shared/utils/get-tag-type.ts +66 -0
- package/src/side-nav-menu/nav-link-config.ts +6 -4
- package/src/triage/metrics/attended-patients.extension.tsx +42 -0
- package/src/triage/metrics/metrics.scss +36 -0
- package/src/triage/metrics/triage-metrics.component.tsx +21 -0
- package/src/triage/metrics/waiting-patients.extension.tsx +39 -0
- package/src/triage/room/room.scss +29 -0
- package/src/triage/triage.component.tsx +15 -0
- package/src/triage/triage.resource.ts +19 -0
- package/src/triage/types.ts +16 -0
- package/src/types/types.ts +180 -0
- package/dist/16.js +0 -1
- package/dist/16.js.map +0 -1
- package/dist/184.js +0 -2
- package/dist/184.js.map +0 -1
- package/dist/197.js +0 -1
- package/dist/198.js +0 -2
- package/dist/198.js.map +0 -1
- package/dist/200.js +0 -2
- package/dist/200.js.map +0 -1
- package/dist/255.js +0 -1
- package/dist/255.js.map +0 -1
- package/dist/300.js +0 -1
- package/dist/335.js +0 -1
- package/dist/353.js +0 -1
- package/dist/353.js.map +0 -1
- package/dist/420.js +0 -1
- package/dist/420.js.map +0 -1
- package/dist/540.js +0 -2
- package/dist/540.js.map +0 -1
- package/dist/55.js +0 -1
- package/dist/652.js +0 -1
- package/dist/860.js +0 -1
- package/dist/860.js.map +0 -1
- package/dist/91.js +0 -1
- package/dist/91.js.map +0 -1
- package/dist/93.js +0 -1
- package/dist/93.js.map +0 -1
- package/dist/99.js +0 -1
- package/dist/openmrs-esm-home-app.js +0 -1
- package/dist/openmrs-esm-home-app.js.buildmanifest.json +0 -626
- package/dist/openmrs-esm-home-app.js.map +0 -1
- package/src/consultation/consultation.tsx +0 -7
- /package/dist/{184.js.LICENSE.txt → 3184.js.LICENSE.txt} +0 -0
- /package/dist/{540.js.LICENSE.txt → 6540.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Location, type Patient } from '@openmrs/esm-framework';
|
|
1
|
+
import { type Location, type Patient } from '@openmrs/esm-framework';
|
|
2
2
|
|
|
3
3
|
export type IdentifierType = 'National ID' | 'Alien ID' | 'Passport' | 'Mandate Number' | 'Refugee ID';
|
|
4
4
|
|
|
@@ -10,6 +10,18 @@ export const IDENTIFIER_TYPES: IdentifierType[] = [
|
|
|
10
10
|
'Refugee ID',
|
|
11
11
|
];
|
|
12
12
|
|
|
13
|
+
export enum OtpStatus {
|
|
14
|
+
Draft = 'DRAFT',
|
|
15
|
+
Sent = 'SENT',
|
|
16
|
+
Verified = 'VERIFIED',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export enum OtpOptions {
|
|
20
|
+
Skip = 'SKIP',
|
|
21
|
+
NoOverride = 'NO OVERRIDE',
|
|
22
|
+
Override = 'OVERRIDE',
|
|
23
|
+
}
|
|
24
|
+
|
|
13
25
|
export interface ValidateCustomOtpResponse {
|
|
14
26
|
message: string;
|
|
15
27
|
isValid?: boolean;
|
|
@@ -65,6 +77,8 @@ export enum HieIdentificationType {
|
|
|
65
77
|
MandateNumber = 'Mandate Number',
|
|
66
78
|
Cr = 'id',
|
|
67
79
|
TemporaryDependantID = 'Temporary Dependant ID',
|
|
80
|
+
BirthCertificate = 'Birth Certificate',
|
|
81
|
+
BirthNotification = 'Birth Notification',
|
|
68
82
|
}
|
|
69
83
|
|
|
70
84
|
export interface HieIdentifications {
|
|
@@ -220,4 +234,168 @@ export type CreateVisitDto = {
|
|
|
220
234
|
startDatetime: null | string;
|
|
221
235
|
stopDatetime: null | string;
|
|
222
236
|
patient: string;
|
|
237
|
+
attributes?: VisitAttribute[];
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export type VisitAttribute = {
|
|
241
|
+
attributeType: string;
|
|
242
|
+
value: string;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export type EndVisitDto = {
|
|
246
|
+
stopDatetime: string;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export interface GlobalError {
|
|
250
|
+
code: string;
|
|
251
|
+
message: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface AmrsErrorResponse {
|
|
255
|
+
message: string;
|
|
256
|
+
error: {
|
|
257
|
+
error: {
|
|
258
|
+
message: string;
|
|
259
|
+
code: string;
|
|
260
|
+
globalErrors?: GlobalError[];
|
|
261
|
+
fieldErrors?: any;
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface CreatePersonDto {
|
|
267
|
+
gender?: string;
|
|
268
|
+
birthdate?: string;
|
|
269
|
+
dead?: boolean;
|
|
270
|
+
deathDate?: string;
|
|
271
|
+
names?: {
|
|
272
|
+
givenName?: string;
|
|
273
|
+
middleName?: string;
|
|
274
|
+
familyName?: string;
|
|
275
|
+
}[];
|
|
276
|
+
addresses?: {
|
|
277
|
+
country?: string;
|
|
278
|
+
address1?: string;
|
|
279
|
+
address2?: string;
|
|
280
|
+
address4?: string;
|
|
281
|
+
address7?: string;
|
|
282
|
+
address10?: string;
|
|
283
|
+
countyDistrict?: string;
|
|
284
|
+
stateProvince?: string;
|
|
285
|
+
cityVillage?: string;
|
|
286
|
+
longitude?: string;
|
|
287
|
+
latitude?: string;
|
|
288
|
+
}[];
|
|
289
|
+
attributes?: {
|
|
290
|
+
value: string | number;
|
|
291
|
+
attributeType: string;
|
|
292
|
+
}[];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export type CreatePatientDto = {
|
|
296
|
+
person: CreatePersonDto;
|
|
297
|
+
identifiers?: any;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
export type QueueEntryResult = {
|
|
301
|
+
name: string;
|
|
302
|
+
queue_entry_id: number;
|
|
303
|
+
priority_comment: string;
|
|
304
|
+
wait_time_in_min: number;
|
|
305
|
+
queue_entry_uuid: string;
|
|
306
|
+
service_uuid: string;
|
|
307
|
+
location_id: number;
|
|
308
|
+
location: string;
|
|
309
|
+
service: number;
|
|
310
|
+
queue_id: number;
|
|
311
|
+
queue_room: string;
|
|
312
|
+
priority: string;
|
|
313
|
+
patient_id: number;
|
|
314
|
+
visit_id: number;
|
|
315
|
+
patient_uuid: string;
|
|
316
|
+
family_name: string;
|
|
317
|
+
given_name: string;
|
|
318
|
+
middle_name: string;
|
|
319
|
+
status: string;
|
|
320
|
+
visit_uuid: string;
|
|
321
|
+
queue_coming_from: string;
|
|
322
|
+
bill_status: string;
|
|
323
|
+
bill_item_payment_status: string;
|
|
324
|
+
price_name: string;
|
|
325
|
+
cash_unpaid_client: string;
|
|
326
|
+
hide_in_queue: number;
|
|
327
|
+
identifiers: string;
|
|
328
|
+
phone_number: string;
|
|
329
|
+
age: number;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
export enum PaymentDetail {
|
|
333
|
+
Paying = 'Paying',
|
|
334
|
+
NonPaying = 'Non-Paying',
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export type EligibilityFilterDto = {
|
|
338
|
+
requestIdType: string;
|
|
339
|
+
requestIdNumber: string;
|
|
340
|
+
locationUuid: string;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
export type HieClientEligibility = {
|
|
344
|
+
requestIdType: number;
|
|
345
|
+
requestIdNumber: string;
|
|
346
|
+
memberCrNumber: string;
|
|
347
|
+
fullName: string;
|
|
348
|
+
schemes: Scheme[];
|
|
349
|
+
statusDesc: string;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
export type Scheme = {
|
|
353
|
+
schemeName: string;
|
|
354
|
+
memberType: 'BENEFICIARY' | string;
|
|
355
|
+
coverageType: 'SHIF' | string;
|
|
356
|
+
policy: Policy;
|
|
357
|
+
coverage: Coverage;
|
|
358
|
+
principalContributor: PrincipalContributor;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
export type Policy = {
|
|
362
|
+
startDate: string;
|
|
363
|
+
endDate: string;
|
|
364
|
+
number: string;
|
|
223
365
|
};
|
|
366
|
+
|
|
367
|
+
export type Coverage = {
|
|
368
|
+
startDate: string;
|
|
369
|
+
endDate: string;
|
|
370
|
+
message: string;
|
|
371
|
+
reason: string;
|
|
372
|
+
possibleSolution: string | null;
|
|
373
|
+
status: string;
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
export type PrincipalContributor = {
|
|
377
|
+
idNumber: string;
|
|
378
|
+
name: string;
|
|
379
|
+
crNumber: string;
|
|
380
|
+
relationship: string;
|
|
381
|
+
employmentType: string;
|
|
382
|
+
employerDetails: EmployerDetails;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
export type EmployerDetails = {
|
|
386
|
+
name: string;
|
|
387
|
+
jobGroup: string;
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
export enum RequestIdTypes {
|
|
391
|
+
BirthCertificate = 2,
|
|
392
|
+
CrId = 3,
|
|
393
|
+
NationalId = 4,
|
|
394
|
+
Refugee = 5,
|
|
395
|
+
TemporaryId = 6,
|
|
396
|
+
TempDependantId = 7,
|
|
397
|
+
MandateNo = 8,
|
|
398
|
+
Passport = 9,
|
|
399
|
+
BirthCertificate2 = 10,
|
|
400
|
+
HouseholdNumber = 11,
|
|
401
|
+
}
|
|
@@ -1,4 +1,37 @@
|
|
|
1
|
+
import { type AmrsErrorResponse } from '../types';
|
|
2
|
+
|
|
1
3
|
export function generateErrorMessage(error: any): string[] {
|
|
2
4
|
const errors: string[] = [];
|
|
3
5
|
return errors;
|
|
4
6
|
}
|
|
7
|
+
|
|
8
|
+
export function getErrorMessages(error: AmrsErrorResponse) {
|
|
9
|
+
const errors = [];
|
|
10
|
+
if (error && error.error) {
|
|
11
|
+
if (error.error.error) {
|
|
12
|
+
const globalErrors = error.error.error.globalErrors || null;
|
|
13
|
+
if (globalErrors) {
|
|
14
|
+
for (const err of globalErrors) {
|
|
15
|
+
errors.push(err.message);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
} else if (error.error) {
|
|
19
|
+
if (error.error['globalErrors']) {
|
|
20
|
+
const globalErrors = error.error['globalErrors'] || null;
|
|
21
|
+
if (globalErrors) {
|
|
22
|
+
for (const err of globalErrors) {
|
|
23
|
+
errors.push(err.message);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
} else if (error.error['message']) {
|
|
27
|
+
errors.push(error.error['message']);
|
|
28
|
+
}
|
|
29
|
+
} else {
|
|
30
|
+
errors.push(
|
|
31
|
+
error.error.error.message ||
|
|
32
|
+
'An error occurred while creating the patient. Please try again or contact support',
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return errors;
|
|
37
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type HieClient } from '../types';
|
|
2
|
+
import { maskExceptFirstAndLast } from './mask-data';
|
|
3
|
+
|
|
4
|
+
export function formatDependantDisplayData(dependant: HieClient, relationship: string): string {
|
|
5
|
+
const stringData = `${dependant.first_name} ${maskExceptFirstAndLast(dependant.middle_name)} (${dependant.gender}) (DOB: ${dependant.date_of_birth}) (${relationship}) (CR: ${dependant.id})`;
|
|
6
|
+
|
|
7
|
+
return stringData;
|
|
8
|
+
}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { IdentifierTypesUuids } from '../../resources/identifier-types';
|
|
2
|
+
import { CivilStatusUids } from '../../shared/constants/civil-status';
|
|
3
|
+
import { PersonAttributeTypeUuids } from '../../shared/constants/person-attributes';
|
|
4
|
+
import {
|
|
5
|
+
type AlternateContact,
|
|
6
|
+
type CreatePersonDto,
|
|
7
|
+
type HieClient,
|
|
8
|
+
type HieIdentifications,
|
|
9
|
+
HieIdentificationType,
|
|
10
|
+
} from '../types';
|
|
11
|
+
|
|
12
|
+
const clientDatailsFields = [
|
|
13
|
+
'id',
|
|
14
|
+
'other_identifications',
|
|
15
|
+
'first_name',
|
|
16
|
+
'middle_name',
|
|
17
|
+
'last_name',
|
|
18
|
+
'gender',
|
|
19
|
+
'date_of_birth',
|
|
20
|
+
'is_alive',
|
|
21
|
+
'deceased_datetime',
|
|
22
|
+
'phone',
|
|
23
|
+
'email',
|
|
24
|
+
'civil_status',
|
|
25
|
+
'place_of_birth',
|
|
26
|
+
'citizenship',
|
|
27
|
+
'country',
|
|
28
|
+
'county',
|
|
29
|
+
'sub_county',
|
|
30
|
+
'ward',
|
|
31
|
+
'village_estate',
|
|
32
|
+
'longitude',
|
|
33
|
+
'latitude',
|
|
34
|
+
'identification_type',
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const nameFields = ['first_name', 'middle_name', 'last_name'];
|
|
38
|
+
const otherPersonFields = ['gender', 'date_of_birth', 'is_alive', 'deceased_datetime'];
|
|
39
|
+
const attributeFields = ['phone', 'email', 'civil_status', 'place_of_birth', 'citizenship'];
|
|
40
|
+
const addressFields = ['country', 'county', 'sub_county', 'ward', 'village_estate', 'longitude', 'latitude'];
|
|
41
|
+
const otherFields = ['gender', 'date_of_birth'];
|
|
42
|
+
const identifierFields = [
|
|
43
|
+
HieIdentificationType.Cr,
|
|
44
|
+
HieIdentificationType.SHANumber,
|
|
45
|
+
HieIdentificationType.HouseholdNumber,
|
|
46
|
+
HieIdentificationType.RefugeeID,
|
|
47
|
+
HieIdentificationType.MandateNumber,
|
|
48
|
+
HieIdentificationType.AlienID,
|
|
49
|
+
HieIdentificationType.NationalID,
|
|
50
|
+
HieIdentificationType.TemporaryDependantID,
|
|
51
|
+
];
|
|
52
|
+
const hieAmrsSyncFields = [
|
|
53
|
+
...identifierFields,
|
|
54
|
+
...nameFields,
|
|
55
|
+
...otherPersonFields,
|
|
56
|
+
...attributeFields,
|
|
57
|
+
...addressFields,
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
export function generateHieClientDetails(hieClient: HieClient) {
|
|
61
|
+
let data = {};
|
|
62
|
+
Object.keys(hieClient)
|
|
63
|
+
.filter((key) => {
|
|
64
|
+
return clientDatailsFields.includes(key);
|
|
65
|
+
})
|
|
66
|
+
.forEach((key) => {
|
|
67
|
+
if (key === 'other_identifications') {
|
|
68
|
+
const otherIds = generateOtherIdentifications(hieClient[key]);
|
|
69
|
+
data = {
|
|
70
|
+
...data,
|
|
71
|
+
...otherIds,
|
|
72
|
+
};
|
|
73
|
+
} else if (key === 'identification_type') {
|
|
74
|
+
data[hieClient['identification_type']] = hieClient.identification_number;
|
|
75
|
+
} else {
|
|
76
|
+
const value = hieClient[key];
|
|
77
|
+
data[key] = value;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return data;
|
|
81
|
+
}
|
|
82
|
+
function generateOtherIdentifications(hieIdentifications: HieIdentifications[]) {
|
|
83
|
+
const other = {};
|
|
84
|
+
hieIdentifications.forEach((id) => {
|
|
85
|
+
other[id.identification_type] = id.identification_number;
|
|
86
|
+
});
|
|
87
|
+
return other;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function generateAmrsPersonPayload(hieClient: HieClient): CreatePersonDto {
|
|
91
|
+
const createPersonPayload: CreatePersonDto = {};
|
|
92
|
+
const namesAttribute = {};
|
|
93
|
+
const addresses = {};
|
|
94
|
+
let attributes = [];
|
|
95
|
+
hieAmrsSyncFields.forEach((d) => {
|
|
96
|
+
if (d === 'first_name') {
|
|
97
|
+
namesAttribute['givenName'] = hieClient.first_name;
|
|
98
|
+
}
|
|
99
|
+
if (d === 'middle_name') {
|
|
100
|
+
namesAttribute['middleName'] = hieClient.middle_name;
|
|
101
|
+
}
|
|
102
|
+
if (d === 'last_name') {
|
|
103
|
+
namesAttribute['familyName'] = hieClient.last_name;
|
|
104
|
+
}
|
|
105
|
+
if (d === 'gender') {
|
|
106
|
+
createPersonPayload['gender'] = hieClient.gender === 'Male' ? 'M' : 'F';
|
|
107
|
+
}
|
|
108
|
+
if (d === 'date_of_birth') {
|
|
109
|
+
createPersonPayload['birthdate'] = hieClient.date_of_birth;
|
|
110
|
+
createPersonPayload['birthdateEstimated'] = false;
|
|
111
|
+
}
|
|
112
|
+
if (d === 'is_alive') {
|
|
113
|
+
createPersonPayload['dead'] = hieClient.is_alive === 0 ? true : false;
|
|
114
|
+
}
|
|
115
|
+
if (d === 'deceased_datetime') {
|
|
116
|
+
if (hieClient.deceased_datetime.length > 0) {
|
|
117
|
+
createPersonPayload['deathDate'] = hieClient.deceased_datetime;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (d === 'country' && hieClient.country.length > 0) {
|
|
121
|
+
addresses['country'] = hieClient.country;
|
|
122
|
+
addresses['address1'] = hieClient.country;
|
|
123
|
+
}
|
|
124
|
+
if (d === 'place_of_birth' && hieClient.place_of_birth.length > 0) {
|
|
125
|
+
addresses['address10'] = hieClient.place_of_birth;
|
|
126
|
+
}
|
|
127
|
+
if (d === 'county' && hieClient.county.length > 0) {
|
|
128
|
+
addresses['countyDistrict'] = hieClient.county;
|
|
129
|
+
}
|
|
130
|
+
if (d === 'sub_county' && hieClient.sub_county.length > 0) {
|
|
131
|
+
addresses['address2'] = hieClient.sub_county;
|
|
132
|
+
addresses['stateProvince'] = hieClient.sub_county;
|
|
133
|
+
}
|
|
134
|
+
if (d === 'ward' && hieClient.sub_county.length > 0) {
|
|
135
|
+
addresses['address7'] = hieClient.sub_county;
|
|
136
|
+
addresses['address4'] = hieClient.sub_county;
|
|
137
|
+
}
|
|
138
|
+
if (d === 'village_estate' && hieClient.village_estate.length > 0) {
|
|
139
|
+
addresses['cityVillage'] = hieClient.village_estate;
|
|
140
|
+
}
|
|
141
|
+
if (d === 'longitude' && hieClient.longitude.length > 0) {
|
|
142
|
+
addresses['longitude'] = hieClient.longitude;
|
|
143
|
+
}
|
|
144
|
+
if (d === 'latitude' && hieClient.latitude.length > 0) {
|
|
145
|
+
addresses['latitude'] = hieClient.latitude;
|
|
146
|
+
}
|
|
147
|
+
if (d === 'place_of_birth' && hieClient.place_of_birth.length > 0) {
|
|
148
|
+
attributes.push({
|
|
149
|
+
value: hieClient.place_of_birth,
|
|
150
|
+
attributeType: PersonAttributeTypeUuids.PLACE_OF_BIRTH_UUID,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
if (d === 'phone' && hieClient.phone.length > 0) {
|
|
154
|
+
attributes.push({
|
|
155
|
+
value: hieClient.phone,
|
|
156
|
+
attributeType: PersonAttributeTypeUuids.CONTACT_PHONE_NUMBER_UUID,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (d === 'email' && hieClient.email.length > 0) {
|
|
160
|
+
attributes.push({
|
|
161
|
+
value: hieClient.email,
|
|
162
|
+
attributeType: PersonAttributeTypeUuids.CONTACT_EMAIL_ADDRESS_UUID,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
if (d === 'civil_status' && hieClient.civil_status.length > 0) {
|
|
166
|
+
attributes.push({
|
|
167
|
+
value: getAmrsConceptUuidFromField(hieClient.civil_status),
|
|
168
|
+
attributeType: PersonAttributeTypeUuids.CIVIL_STATUS_UUID,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
if (d === 'id' && hieClient.id) {
|
|
172
|
+
attributes.push({
|
|
173
|
+
value: hieClient.id,
|
|
174
|
+
attributeType: PersonAttributeTypeUuids.CLIENT_REGISTRY_ID_UUID,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
if (d === 'citizenship' && hieClient.citizenship) {
|
|
178
|
+
attributes.push({
|
|
179
|
+
value: hieClient.citizenship,
|
|
180
|
+
attributeType: PersonAttributeTypeUuids.CITIZENSHIP_UUID,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
// Add next of kin details
|
|
185
|
+
const nextOfKinAndAlternativeAttributes = generateNextOfKinAndAlternateContactDetails(hieClient.alternative_contacts);
|
|
186
|
+
attributes = [...attributes, ...nextOfKinAndAlternativeAttributes];
|
|
187
|
+
if (Object.keys(namesAttribute).length > 0) {
|
|
188
|
+
createPersonPayload['names'] = [namesAttribute];
|
|
189
|
+
}
|
|
190
|
+
if (Object.keys(addresses).length > 0) {
|
|
191
|
+
createPersonPayload['addresses'] = [addresses];
|
|
192
|
+
}
|
|
193
|
+
if (attributes.length > 0) {
|
|
194
|
+
createPersonPayload['attributes'] = attributes;
|
|
195
|
+
}
|
|
196
|
+
return createPersonPayload;
|
|
197
|
+
}
|
|
198
|
+
function generateNextOfKinAndAlternateContactDetails(alternativeContacts: AlternateContact[]) {
|
|
199
|
+
const attributes = [];
|
|
200
|
+
const alterNativeClientContact = alternativeContacts.find((a) => {
|
|
201
|
+
return a.relationship === 'Alternative Phone Number';
|
|
202
|
+
});
|
|
203
|
+
const nextOfKinContact = alternativeContacts.find((a) => {
|
|
204
|
+
return a.remarks === 'Next Of Kin';
|
|
205
|
+
});
|
|
206
|
+
if (alterNativeClientContact) {
|
|
207
|
+
if (alterNativeClientContact.contact_type === 'Phone') {
|
|
208
|
+
attributes.push({
|
|
209
|
+
value: alterNativeClientContact.contact_id,
|
|
210
|
+
attributeType: PersonAttributeTypeUuids.ALTERNATIVE_CONTACT_PHONE_NUMBER_UUID,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (nextOfKinContact) {
|
|
215
|
+
if (nextOfKinContact.contact_type === 'Phone') {
|
|
216
|
+
attributes.push({
|
|
217
|
+
value: nextOfKinContact.contact_id,
|
|
218
|
+
attributeType: PersonAttributeTypeUuids.NEXT_OF_KIN_CONTACT_PHONE_NUMBER_UUID,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
attributes.push({
|
|
222
|
+
value: nextOfKinContact.relationship,
|
|
223
|
+
attributeType: PersonAttributeTypeUuids.NEXT_OF_KIN_RELATIONSHIP_UUID,
|
|
224
|
+
});
|
|
225
|
+
attributes.push({
|
|
226
|
+
value: nextOfKinContact.contact_name,
|
|
227
|
+
attributeType: PersonAttributeTypeUuids.NEXT_OF_KIN_NAME_UUID,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
return attributes;
|
|
231
|
+
}
|
|
232
|
+
function getAmrsConceptUuidFromField(fieldName: string): string {
|
|
233
|
+
let conceptUuid = '';
|
|
234
|
+
switch (fieldName) {
|
|
235
|
+
case 'Divorced':
|
|
236
|
+
conceptUuid = CivilStatusUids.DIVORCED_UUID;
|
|
237
|
+
break;
|
|
238
|
+
case 'Married':
|
|
239
|
+
conceptUuid = CivilStatusUids.MARRIED_UUID;
|
|
240
|
+
break;
|
|
241
|
+
case 'Single':
|
|
242
|
+
conceptUuid = CivilStatusUids.SINGLE_UUID;
|
|
243
|
+
break;
|
|
244
|
+
default:
|
|
245
|
+
conceptUuid = CivilStatusUids.NOT_APPLICABLE_UUID;
|
|
246
|
+
}
|
|
247
|
+
return conceptUuid;
|
|
248
|
+
}
|
|
249
|
+
export function generateAmrsCreatePatientIdentifiersPayload(hieClient: HieClient, identifierLocation: string) {
|
|
250
|
+
const identifiers = [];
|
|
251
|
+
// add CR number
|
|
252
|
+
identifiers.push({
|
|
253
|
+
identifierType: getAmrsIdentifierTypeUuid(HieIdentificationType.Cr),
|
|
254
|
+
identifier: hieClient.id,
|
|
255
|
+
location: identifierLocation,
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
// add main identifier
|
|
259
|
+
identifiers.push({
|
|
260
|
+
identifierType: getAmrsIdentifierTypeUuid(hieClient.identification_type),
|
|
261
|
+
identifier: hieClient.identification_number,
|
|
262
|
+
location: identifierLocation,
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
// add other idenfications
|
|
266
|
+
hieClient.other_identifications.forEach((id) => {
|
|
267
|
+
identifiers.push({
|
|
268
|
+
identifierType: getAmrsIdentifierTypeUuid(id.identification_type),
|
|
269
|
+
identifier: id.identification_number,
|
|
270
|
+
location: identifierLocation,
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
return identifiers;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export function getAmrsIdentifierTypeUuid(hieIdentifierName: string) {
|
|
278
|
+
let idTypeUuid;
|
|
279
|
+
switch (hieIdentifierName) {
|
|
280
|
+
case HieIdentificationType.NationalID:
|
|
281
|
+
idTypeUuid = IdentifierTypesUuids.NATIONAL_ID_UUID;
|
|
282
|
+
break;
|
|
283
|
+
case HieIdentificationType.HouseholdNumber:
|
|
284
|
+
idTypeUuid = IdentifierTypesUuids.HOUSE_HOLD_NUMBER_UUID;
|
|
285
|
+
break;
|
|
286
|
+
case HieIdentificationType.AlienID:
|
|
287
|
+
idTypeUuid = IdentifierTypesUuids.ALIEN_ID_UUID;
|
|
288
|
+
break;
|
|
289
|
+
case HieIdentificationType.SHANumber:
|
|
290
|
+
idTypeUuid = IdentifierTypesUuids.SHA_UUID;
|
|
291
|
+
break;
|
|
292
|
+
case HieIdentificationType.MandateNumber:
|
|
293
|
+
idTypeUuid = IdentifierTypesUuids.MANDATE_NUMBER_UUID;
|
|
294
|
+
break;
|
|
295
|
+
case HieIdentificationType.RefugeeID:
|
|
296
|
+
idTypeUuid = IdentifierTypesUuids.REFUGEE_ID_UUID;
|
|
297
|
+
break;
|
|
298
|
+
case HieIdentificationType.Cr:
|
|
299
|
+
idTypeUuid = IdentifierTypesUuids.CLIENT_REGISTRY_NO_UUID;
|
|
300
|
+
break;
|
|
301
|
+
case HieIdentificationType.BirthCertificate:
|
|
302
|
+
idTypeUuid = IdentifierTypesUuids.BIRTH_CERTIFICATE_NUMBER_UUID;
|
|
303
|
+
break;
|
|
304
|
+
case HieIdentificationType.TemporaryDependantID:
|
|
305
|
+
idTypeUuid = IdentifierTypesUuids.TEMPORARY_DEPENDANT_ID_UUID;
|
|
306
|
+
break;
|
|
307
|
+
case HieIdentificationType.BirthNotification:
|
|
308
|
+
idTypeUuid = IdentifierTypesUuids.BIRTH_NOTIFICATION_UUID;
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
return idTypeUuid;
|
|
312
|
+
}
|
|
@@ -19,3 +19,14 @@ export const maskExceptFirstAndLast = (value: string): string => {
|
|
|
19
19
|
const maskedValue = arrValue.join('');
|
|
20
20
|
return maskedValue;
|
|
21
21
|
};
|
|
22
|
+
|
|
23
|
+
export const maskAllButFirstAndLastThree = (value: string): string => {
|
|
24
|
+
let arrValue = value.split('');
|
|
25
|
+
for (let i = 0; i < value.length; i++) {
|
|
26
|
+
if (i > 3 && i < value.length - 3) {
|
|
27
|
+
arrValue[i] = '*';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const maskedValue = arrValue.join('');
|
|
31
|
+
return maskedValue;
|
|
32
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
2
|
+
import { getEtlBaseUrl } from '../shared/utils/get-base-url';
|
|
3
|
+
|
|
4
|
+
export async function getDashBoardSummary(locationUuid: string): Promise<any> {
|
|
5
|
+
const etlBaseUrl = await getEtlBaseUrl();
|
|
6
|
+
const dashboardSummaryUrl = `${etlBaseUrl}/dashboard-summary`;
|
|
7
|
+
const params = {
|
|
8
|
+
locationUuid: locationUuid,
|
|
9
|
+
};
|
|
10
|
+
const queryString = new URLSearchParams(params).toString();
|
|
11
|
+
const response = await openmrsFetch(`${dashboardSummaryUrl}?${queryString}`);
|
|
12
|
+
|
|
13
|
+
if (!response.ok) {
|
|
14
|
+
const errorText = await response.text();
|
|
15
|
+
throw new Error(`Failed to fetch dashboard summary: ${response.status} - ${errorText}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const data = await response.json();
|
|
19
|
+
return data.data;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Patient } from '@openmrs/esm-framework';
|
|
2
|
+
import { type HieClient } from '../registry/types';
|
|
3
|
+
import { generateAmrsPersonPayload } from '../registry/utils/hie-client-adapter';
|
|
4
|
+
import { createPatient, generatePatientIdentifiers } from './patient-resource';
|
|
5
|
+
|
|
6
|
+
export async function registerHieClientInAmrs(client: HieClient, identifierLocation: string): Promise<Patient> {
|
|
7
|
+
const createPersonPayload = generateAmrsPersonPayload(client);
|
|
8
|
+
const identifiers = await generatePatientIdentifiers(identifierLocation, client);
|
|
9
|
+
const resp = await createPatient({
|
|
10
|
+
person: createPersonPayload,
|
|
11
|
+
identifiers: identifiers,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const res = await resp.json();
|
|
15
|
+
return res;
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const HOUSE_HOLD_NUMBER_UUID = 'bb74b20e-dcee-4f59-bdf1-2dffc3abf106';
|
|
2
|
+
const SHA_UUID = 'cf5362b2-8049-4442-b3c6-36f870e320cb';
|
|
3
|
+
const CLIENT_REGISTRY_NO_UUID = 'e88dc246-3614-4ee3-8141-1f2a83054e72';
|
|
4
|
+
const NATIONAL_ID_UUID = '58a47054-1359-11df-a1f1-0026b9348838';
|
|
5
|
+
const PROVIDER_NATIONAL_ID_UUID = '4550df92-c684-4597-8ab8-d6b10eabdcfb';
|
|
6
|
+
const REFUGEE_ID_UUID = '465e81af-8d69-47e9-9127-53a94adc75fb';
|
|
7
|
+
const MANDATE_NUMBER_UUID = 'aae2d097-20ba-43ca-9b71-fd8296068f39';
|
|
8
|
+
const ALIEN_ID_UUID = '12f5b147-3403-4a73-913d-7ded9ffec094';
|
|
9
|
+
const TEMPORARY_DEPENDANT_ID_UUID = 'a3d34214-93e8-4faf-bf4d-0272eee079eb';
|
|
10
|
+
const AMRS_UNIVERSAL_ID_UUID = '58a4732e-1359-11df-a1f1-0026b9348838';
|
|
11
|
+
const UPI_NUMBER_UUID = 'cba702b9-4664-4b43-83f1-9ab473cbd64d';
|
|
12
|
+
const BIRTH_CERTIFICATE_NUMBER_UUID = '7924e13b-131a-4da8-8efa-e294184a1b0d';
|
|
13
|
+
const BIRTH_NOTIFICATION_UUID = '10a4349d-dd1b-4b0c-bd35-a00a22394266';
|
|
14
|
+
|
|
15
|
+
export const IdentifierTypesUuids = {
|
|
16
|
+
HOUSE_HOLD_NUMBER_UUID,
|
|
17
|
+
SHA_UUID,
|
|
18
|
+
CLIENT_REGISTRY_NO_UUID,
|
|
19
|
+
NATIONAL_ID_UUID,
|
|
20
|
+
PROVIDER_NATIONAL_ID_UUID,
|
|
21
|
+
REFUGEE_ID_UUID,
|
|
22
|
+
MANDATE_NUMBER_UUID,
|
|
23
|
+
ALIEN_ID_UUID,
|
|
24
|
+
TEMPORARY_DEPENDANT_ID_UUID,
|
|
25
|
+
AMRS_UNIVERSAL_ID_UUID,
|
|
26
|
+
UPI_NUMBER_UUID,
|
|
27
|
+
BIRTH_CERTIFICATE_NUMBER_UUID,
|
|
28
|
+
BIRTH_NOTIFICATION_UUID,
|
|
29
|
+
};
|