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