@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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import { type HieClient, type CreatePatientDto, HieIdentificationType } from '../registry/types';
|
|
3
|
+
import { IdentifierTypesUuids } from './identifier-types';
|
|
4
|
+
import { getAmrsIdentifierTypeUuid } from '../registry/utils/hie-client-adapter';
|
|
5
|
+
import { getSubDomainUrl } from '../shared/utils/get-base-url';
|
|
6
|
+
|
|
7
|
+
export async function createPatient(payload: CreatePatientDto) {
|
|
8
|
+
return await openmrsFetch(`${restBaseUrl}/patient`, {
|
|
9
|
+
method: 'POST',
|
|
10
|
+
headers: {
|
|
11
|
+
'Content-Type': 'application/json',
|
|
12
|
+
},
|
|
13
|
+
body: payload,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const generatePatientIdentifiers = async (identifierLocation: string, client: HieClient) => {
|
|
18
|
+
const amrsUniverSalId = await generateAmrsUniversalIdentifier();
|
|
19
|
+
const identifiers = generateAmrsCreatePatientIdentifiersPayload(client, identifierLocation);
|
|
20
|
+
identifiers.push({
|
|
21
|
+
identifierType: IdentifierTypesUuids.AMRS_UNIVERSAL_ID_UUID,
|
|
22
|
+
identifier: amrsUniverSalId,
|
|
23
|
+
location: identifierLocation,
|
|
24
|
+
preferred: true,
|
|
25
|
+
});
|
|
26
|
+
return identifiers;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function generateAmrsCreatePatientIdentifiersPayload(hieClient: HieClient, identifierLocation: string) {
|
|
30
|
+
const identifiers = [];
|
|
31
|
+
// add CR number
|
|
32
|
+
identifiers.push({
|
|
33
|
+
identifierType: getAmrsIdentifierTypeUuid(HieIdentificationType.Cr),
|
|
34
|
+
identifier: hieClient.id,
|
|
35
|
+
location: identifierLocation,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// add main identifier
|
|
39
|
+
identifiers.push({
|
|
40
|
+
identifierType: getAmrsIdentifierTypeUuid(hieClient.identification_type),
|
|
41
|
+
identifier: hieClient.identification_number,
|
|
42
|
+
location: identifierLocation,
|
|
43
|
+
});
|
|
44
|
+
return identifiers;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export async function generateAmrsUniversalIdentifier() {
|
|
48
|
+
const subDomainUrl = await getSubDomainUrl();
|
|
49
|
+
const abortController = new AbortController();
|
|
50
|
+
const resp = await openmrsFetch(`${subDomainUrl}/amrs-id-generator/generateidentifier`, {
|
|
51
|
+
headers: {
|
|
52
|
+
'Content-Type': 'application/json',
|
|
53
|
+
},
|
|
54
|
+
method: 'POST',
|
|
55
|
+
body: {
|
|
56
|
+
user: 1,
|
|
57
|
+
},
|
|
58
|
+
signal: abortController.signal,
|
|
59
|
+
});
|
|
60
|
+
const data = await resp.json();
|
|
61
|
+
return data['identifier'] ?? '';
|
|
62
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
2
|
import { type QueueEntryDto, type ServiceQueueApiResponse } from '../registry/types';
|
|
3
|
+
import { getLocationByUuid } from '../shared/services/location.resource';
|
|
3
4
|
|
|
4
5
|
export async function fetchServiceQueuesByLocationUuid<T>(locationUuid: string): Promise<ServiceQueueApiResponse> {
|
|
5
6
|
const url = `${restBaseUrl}/queue`;
|
|
@@ -35,3 +36,25 @@ export async function createQueueEntry(createQueueEntryDto: QueueEntryDto) {
|
|
|
35
36
|
|
|
36
37
|
return response.json();
|
|
37
38
|
}
|
|
39
|
+
|
|
40
|
+
export async function getFacilityServiceQueues(locationUuid: string) {
|
|
41
|
+
const currentLocation = await getLocationByUuid(locationUuid);
|
|
42
|
+
if (!currentLocation) return;
|
|
43
|
+
const parentLocation = currentLocation.parentLocation;
|
|
44
|
+
//get child locations
|
|
45
|
+
if (!parentLocation) return;
|
|
46
|
+
const parentLocationDetail = await getLocationByUuid(parentLocation.uuid);
|
|
47
|
+
const childLocations = parentLocationDetail.childLocations ?? [];
|
|
48
|
+
const childLocationUuids =
|
|
49
|
+
childLocations.map((c) => {
|
|
50
|
+
return c.uuid;
|
|
51
|
+
}) ?? [];
|
|
52
|
+
let sqs = [];
|
|
53
|
+
if (childLocationUuids.length > 0) {
|
|
54
|
+
for (let i = 0; i < childLocationUuids.length; i++) {
|
|
55
|
+
const s = await fetchServiceQueuesByLocationUuid(childLocationUuids[i]);
|
|
56
|
+
sqs = [...sqs, ...s.results];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return sqs;
|
|
60
|
+
}
|
|
@@ -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 fetchGuestToken(locationUuid: string): Promise<string> {
|
|
5
|
+
const etlBaseUrl = await getEtlBaseUrl();
|
|
6
|
+
const supersetTokenUrl = `${etlBaseUrl}/superset-token`;
|
|
7
|
+
const params = {
|
|
8
|
+
locationUuid: locationUuid,
|
|
9
|
+
};
|
|
10
|
+
const queryString = new URLSearchParams(params).toString();
|
|
11
|
+
const response = await openmrsFetch(`${supersetTokenUrl}?${queryString}`);
|
|
12
|
+
|
|
13
|
+
if (!response.ok) {
|
|
14
|
+
const errorText = await response.text();
|
|
15
|
+
throw new Error(`Failed to fetch guest token: ${response.status} - ${errorText}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const data = await response.json();
|
|
19
|
+
return data.access_token;
|
|
20
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
-
import { type CreateVisitDto } from '../registry/types';
|
|
2
|
+
import { type EndVisitDto, type CreateVisitDto } from '../registry/types';
|
|
3
3
|
|
|
4
4
|
export async function createVisit(createVisitDto: CreateVisitDto) {
|
|
5
5
|
const url = `${restBaseUrl}/visit`;
|
|
@@ -18,3 +18,21 @@ export async function createVisit(createVisitDto: CreateVisitDto) {
|
|
|
18
18
|
|
|
19
19
|
return response.json();
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
export async function endVisit(visitUuid: string, endVisitDto: EndVisitDto) {
|
|
23
|
+
const url = `${restBaseUrl}/visit/${visitUuid}`;
|
|
24
|
+
const response = await openmrsFetch(url, {
|
|
25
|
+
method: 'POST',
|
|
26
|
+
headers: {
|
|
27
|
+
'content-type': 'application/json',
|
|
28
|
+
},
|
|
29
|
+
body: JSON.stringify(endVisitDto),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (!response.ok) {
|
|
33
|
+
const errorText = await response.text();
|
|
34
|
+
throw new Error(`Request failed with ${response.status}: ${errorText}`);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return response.json();
|
|
38
|
+
}
|
package/src/root.component.tsx
CHANGED
|
@@ -1,22 +1,48 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from './root.scss';
|
|
3
|
-
import { WorkspaceContainer } from '@openmrs/esm-framework';
|
|
3
|
+
import { useLeftNav, WorkspaceContainer } from '@openmrs/esm-framework';
|
|
4
4
|
import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
|
5
5
|
import RegistryComponent from './registry/registry.component';
|
|
6
6
|
import LeftPanel from './left-panel/left-panel.component';
|
|
7
|
-
import
|
|
7
|
+
import Triage from './triage/triage.component';
|
|
8
|
+
import LaboratoryComponent from './laboratory/laboratory.component';
|
|
9
|
+
import AppointmentsComponent from './appointments/appointments.component';
|
|
10
|
+
import PharmacyComponent from './pharmacy/pharmacy.component';
|
|
11
|
+
import Consultation from './service-queues/consultation/consultation.component';
|
|
12
|
+
import Dashboard from './dashboard/dashboard.component';
|
|
13
|
+
import AccountingComponent from './accounting/accounting.component';
|
|
14
|
+
import DailyBookings from './bookings/daily/daily-bookings.component';
|
|
15
|
+
import MchTriage from './mch/queues/triage/mch-triage';
|
|
16
|
+
import MchConsultation from './mch/queues/consultation/mch-consultation';
|
|
17
|
+
import Mortuary from './mortuary/mortuary.component';
|
|
18
|
+
import ServiceQueueAdminDashboard from './service-queues/admin/service-queue-admin-dashboard.component';
|
|
19
|
+
import AdmissionsDashboard from './admissions/admissions-dashboard.component';
|
|
8
20
|
|
|
9
21
|
const Root: React.FC = () => {
|
|
22
|
+
const spaBasePath = window.spaBase;
|
|
23
|
+
useLeftNav({
|
|
24
|
+
name: 'dha-workflow-slot',
|
|
25
|
+
basePath: spaBasePath,
|
|
26
|
+
mode: 'normal',
|
|
27
|
+
});
|
|
10
28
|
return (
|
|
11
|
-
<BrowserRouter basename={`${window.spaBase}/
|
|
29
|
+
<BrowserRouter basename={`${window.spaBase}/dha-workflow`}>
|
|
12
30
|
<LeftPanel />
|
|
13
31
|
<main className={styles.container}>
|
|
14
32
|
<Routes>
|
|
15
|
-
<Route path="" element={<
|
|
33
|
+
<Route path="dashboard" element={<Dashboard />} />
|
|
16
34
|
<Route path="registry" element={<RegistryComponent />} />
|
|
17
|
-
<Route path="triage" element={<Consultation />} />
|
|
18
35
|
<Route path="consultation" element={<Consultation />} />
|
|
19
|
-
<Route path="
|
|
36
|
+
<Route path="triage" element={<Triage />} />
|
|
37
|
+
<Route path="laboratory" element={<LaboratoryComponent />} />
|
|
38
|
+
<Route path="pharmacy" element={<PharmacyComponent />} />
|
|
39
|
+
<Route path="appointments" element={<AppointmentsComponent />} />
|
|
40
|
+
<Route path="bookings/daily" element={<DailyBookings />} />
|
|
41
|
+
<Route path="mch/triage" element={<MchTriage />} />
|
|
42
|
+
<Route path="mch/consultation" element={<MchConsultation />} />
|
|
43
|
+
<Route path="mortuary" element={<Mortuary />} />
|
|
44
|
+
<Route path="service-queue-admin" element={<ServiceQueueAdminDashboard />} />
|
|
45
|
+
<Route path="admissions-dashboard" element={<AdmissionsDashboard />} />
|
|
20
46
|
</Routes>
|
|
21
47
|
</main>
|
|
22
48
|
<WorkspaceContainer contextKey="home" />
|
package/src/routes.json
CHANGED
|
@@ -4,25 +4,250 @@
|
|
|
4
4
|
"pages": [
|
|
5
5
|
{
|
|
6
6
|
"component": "root",
|
|
7
|
-
"route": "
|
|
7
|
+
"route": "dha-workflow",
|
|
8
8
|
"online": true,
|
|
9
9
|
"offline": true
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
12
|
"extensions": [
|
|
13
13
|
{
|
|
14
|
-
"component": "
|
|
15
|
-
"name": "workflow-
|
|
14
|
+
"component": "navLinks",
|
|
15
|
+
"name": "side-nav-workflow-links",
|
|
16
|
+
"slot": "dha-workflow-slot",
|
|
17
|
+
"online": true,
|
|
18
|
+
"offline": true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "dha-workflow-dashboard-link",
|
|
22
|
+
"component": "dhaWorkflowDashboardLink",
|
|
23
|
+
"slot": "homepage-dashboard-slot",
|
|
24
|
+
"meta": {
|
|
25
|
+
"name": "dashboard",
|
|
26
|
+
"slot": "dha-workflow-dashboard-slot",
|
|
27
|
+
"title": "Dashboard"
|
|
28
|
+
},
|
|
29
|
+
"online": true,
|
|
30
|
+
"offline": true,
|
|
31
|
+
"order": 0
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"component": "dhaWorkflowDashboard",
|
|
35
|
+
"name": "dashboardExt",
|
|
36
|
+
"slot": "dha-workflow-dashboard-slot"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "registry-dashboard-link",
|
|
40
|
+
"component": "registryDashboardLink",
|
|
41
|
+
"slot": "homepage-dashboard-slot",
|
|
42
|
+
"meta": {
|
|
43
|
+
"name": "registry",
|
|
44
|
+
"slot": "client-registry-dashboard-slot",
|
|
45
|
+
"title": "Registry"
|
|
46
|
+
},
|
|
47
|
+
"online": true,
|
|
48
|
+
"offline": true,
|
|
49
|
+
"order": 1
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"component": "registryExtension",
|
|
53
|
+
"name": "registry",
|
|
54
|
+
"slot": "client-registry-dashboard-slot"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "triage-dashboard-link",
|
|
58
|
+
"component": "triageDashboardLink",
|
|
59
|
+
"slot": "homepage-dashboard-slot",
|
|
60
|
+
"meta": {
|
|
61
|
+
"name": "triage",
|
|
62
|
+
"slot": "triage-queue-dashboard-slot",
|
|
63
|
+
"title": "Triage"
|
|
64
|
+
},
|
|
65
|
+
"online": true,
|
|
66
|
+
"offline": false
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"component": "triageQueueExtension",
|
|
70
|
+
"name": "triage",
|
|
71
|
+
"slot": "triage-queue-dashboard-slot"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "consultation-dashboard-link",
|
|
75
|
+
"component": "consultationDashboardLink",
|
|
76
|
+
"slot": "homepage-dashboard-slot",
|
|
77
|
+
"meta": {
|
|
78
|
+
"name": "consultation",
|
|
79
|
+
"slot": "consultation-dashboard-slot",
|
|
80
|
+
"title": "Consultation"
|
|
81
|
+
},
|
|
82
|
+
"online": true,
|
|
83
|
+
"offline": false
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"component": "consultationQueue",
|
|
87
|
+
"name": "consultation",
|
|
88
|
+
"slot": "consultation-dashboard-slot"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "mnch-dashboard-link",
|
|
92
|
+
"component": "mnchQueueDashboardLink",
|
|
93
|
+
"slot": "homepage-dashboard-slot",
|
|
94
|
+
"meta": {
|
|
95
|
+
"name": "mnch",
|
|
96
|
+
"slot": "mnch-dashboard-slot",
|
|
97
|
+
"title": "MNCH"
|
|
98
|
+
},
|
|
99
|
+
"online": true,
|
|
100
|
+
"offline": true
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"component": "mnchQueueDashboard",
|
|
104
|
+
"name": "mnch",
|
|
105
|
+
"slot": "mnch-dashboard-slot"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "pharmacy-dashboard-link",
|
|
109
|
+
"component": "pharmacyDashboardLink",
|
|
110
|
+
"slot": "homepage-dashboard-slot",
|
|
111
|
+
"meta": {
|
|
112
|
+
"name": "dispensing",
|
|
113
|
+
"slot": "dispensing-dashboard-slot",
|
|
114
|
+
"title": "Pharmacy"
|
|
115
|
+
},
|
|
116
|
+
"online": true,
|
|
117
|
+
"offline": true
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "registers-dashboard-link",
|
|
121
|
+
"component": "registersDashboardLink",
|
|
122
|
+
"slot": "homepage-dashboard-slot",
|
|
123
|
+
"meta": {
|
|
124
|
+
"name": "registers",
|
|
125
|
+
"slot": "registers-dashboard-slot",
|
|
126
|
+
"title": "Registers"
|
|
127
|
+
},
|
|
128
|
+
"online": true,
|
|
129
|
+
"offline": false
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"component": "registers",
|
|
133
|
+
"name": "registers",
|
|
134
|
+
"slot": "registers-dashboard-slot"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "bookings-dashboard-link",
|
|
138
|
+
"component": "bookingsDashboardLink",
|
|
139
|
+
"slot": "homepage-dashboard-slot",
|
|
140
|
+
"meta": {
|
|
141
|
+
"name": "bookings",
|
|
142
|
+
"slot": "bookings-dashboard-slot",
|
|
143
|
+
"title": "Bookings"
|
|
144
|
+
},
|
|
145
|
+
"online": true,
|
|
146
|
+
"offline": true
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"component": "bookings",
|
|
150
|
+
"name": "bookings",
|
|
151
|
+
"slot": "bookings-dashboard-slot"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "service-queue-admin-dashboard-link",
|
|
155
|
+
"component": "serviceQueuesAdminLink",
|
|
16
156
|
"slot": "app-menu-slot",
|
|
157
|
+
"meta": {
|
|
158
|
+
"name": "service-queue-admin",
|
|
159
|
+
"slot": "service-queue-admin-dashboard-slot",
|
|
160
|
+
"title": "Service Queue Admin"
|
|
161
|
+
},
|
|
17
162
|
"online": true,
|
|
18
163
|
"offline": true
|
|
19
164
|
},
|
|
20
165
|
{
|
|
21
|
-
"component": "
|
|
22
|
-
"name": "
|
|
23
|
-
"slot": "
|
|
166
|
+
"component": "serviceQueueAdmin",
|
|
167
|
+
"name": "service-queue-admin",
|
|
168
|
+
"slot": "service-queue-admin-dashboard-slot"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "admissions-dashboard-link",
|
|
172
|
+
"component": "admissionsDashboardLink",
|
|
173
|
+
"slot": "homepage-dashboard-slot",
|
|
174
|
+
"meta": {
|
|
175
|
+
"name": "admissions-dashboard",
|
|
176
|
+
"slot": "admissions-dashboard-slot",
|
|
177
|
+
"title": "Admissions Dashboard"
|
|
178
|
+
},
|
|
24
179
|
"online": true,
|
|
25
180
|
"offline": true
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"component": "admissionsDashboard",
|
|
184
|
+
"name": "admissions-dashboard",
|
|
185
|
+
"slot": "admissions-dashboard-slot"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"component": "serviceQueueBannerComponent",
|
|
189
|
+
"name": "service-queue-banne",
|
|
190
|
+
"slot": "patient-banner-tags-slot"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "admissions-summary-dashboard",
|
|
194
|
+
"slot": "patient-chart-dashboard-slot",
|
|
195
|
+
"component": "patientChartAdmissionsLink",
|
|
196
|
+
"meta": {
|
|
197
|
+
"slot": "patient-chart-admissions-summary-dashboard-slot",
|
|
198
|
+
"path": "Admissions",
|
|
199
|
+
"layoutMode": "anchored"
|
|
200
|
+
},
|
|
201
|
+
"online": true,
|
|
202
|
+
"offline": true
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "admission-details",
|
|
206
|
+
"slot": "patient-chart-admissions-summary-dashboard-slot",
|
|
207
|
+
"component": "patientAdmissionSummary",
|
|
208
|
+
"order": 1,
|
|
209
|
+
"meta": {
|
|
210
|
+
"title": "Admissions",
|
|
211
|
+
"view": "admissions"
|
|
212
|
+
},
|
|
213
|
+
"online": true,
|
|
214
|
+
"offline": true
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"name": "ampath-billing-dashboard-link",
|
|
218
|
+
"component": "billingDashboardLink",
|
|
219
|
+
"slot": "homepage-dashboard-slot",
|
|
220
|
+
"meta": {
|
|
221
|
+
"name": "billing",
|
|
222
|
+
"slot": "ampath-billing-dashboard-slot",
|
|
223
|
+
"title": "Accounting"
|
|
224
|
+
},
|
|
225
|
+
"online": true,
|
|
226
|
+
"offline": true
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"component": "billingRoot",
|
|
230
|
+
"name": "billing",
|
|
231
|
+
"slot": "ampath-billing-dashboard-slot"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "ampath-billing-checkin-form",
|
|
235
|
+
"slot": "extra-visit-attribute-slot",
|
|
236
|
+
"component": "visitBillingForm"
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"workspaces": [
|
|
240
|
+
{
|
|
241
|
+
"name": "create-order-bill-form-workspace",
|
|
242
|
+
"component": "createOrderBillFormWorkspace",
|
|
243
|
+
"title": "Create order Bill",
|
|
244
|
+
"type": "other-form"
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
"modals": [
|
|
248
|
+
{
|
|
249
|
+
"name": "sign-off-queue-entry-modal",
|
|
250
|
+
"component": "signOffModal"
|
|
26
251
|
}
|
|
27
252
|
]
|
|
28
|
-
}
|
|
253
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Button } from "@carbon/react";
|
|
2
|
+
import { useLayoutType, isDesktop } from "@openmrs/esm-framework";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { useActionPropsByKey } from "../hooks/useActions";
|
|
6
|
+
import { type QueueEntryAction } from "../config-schema";
|
|
7
|
+
import { type QueueEntry } from "../types/types";
|
|
8
|
+
|
|
9
|
+
export function ActionButton({ actionKey, queueEntry }: { actionKey: QueueEntryAction; queueEntry: QueueEntry }) {
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
const layout = useLayoutType();
|
|
12
|
+
const actionPropsByKey = useActionPropsByKey();
|
|
13
|
+
|
|
14
|
+
const actionProps = actionPropsByKey[actionKey];
|
|
15
|
+
if (!actionProps) {
|
|
16
|
+
console.error(`Service queue table configuration uses unknown action in 'action.buttons': ${actionKey}`);
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (actionProps.showIf && !actionProps.showIf(queueEntry)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Button
|
|
26
|
+
key={actionKey}
|
|
27
|
+
kind="ghost"
|
|
28
|
+
aria-label={t(actionProps.label, actionProps.text)}
|
|
29
|
+
onClick={() => actionProps.onClick(queueEntry)}
|
|
30
|
+
size={isDesktop(layout) ? 'sm' : 'lg'}>
|
|
31
|
+
{t(actionProps.label, actionProps.text)}
|
|
32
|
+
</Button>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { OverflowMenuItem } from "@carbon/react";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { type QueueEntryAction } from "../config-schema";
|
|
5
|
+
import { useActionPropsByKey } from "../hooks/useActions";
|
|
6
|
+
import { type QueueEntry } from "../types/types";
|
|
7
|
+
import styles from './service-queue.scss';
|
|
8
|
+
|
|
9
|
+
export function ActionOverflowMenuItem({ actionKey, queueEntry }: { actionKey: QueueEntryAction; queueEntry: QueueEntry }) {
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
const actionPropsByKey = useActionPropsByKey();
|
|
12
|
+
|
|
13
|
+
const actionProps = actionPropsByKey[actionKey];
|
|
14
|
+
if (!actionProps) {
|
|
15
|
+
console.error(`Service queue table configuration uses unknown action in 'action.overflowMenu': ${actionKey}`);
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (actionProps.showIf && !actionProps.showIf(queueEntry)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<OverflowMenuItem
|
|
25
|
+
key={actionKey}
|
|
26
|
+
className={styles.menuItem}
|
|
27
|
+
aria-label={t(actionProps.label, actionProps.text)}
|
|
28
|
+
hasDivider
|
|
29
|
+
isDelete={actionProps.isDelete}
|
|
30
|
+
onClick={() => actionProps.onClick(queueEntry)}
|
|
31
|
+
itemText={t(actionProps.label, actionProps.text)}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.createQueueModalLayout{
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
row-gap: 10px;
|
|
6
|
+
padding: 15px 15px;
|
|
7
|
+
.sectionHeader{
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
row-gap: 15px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
padding-bottom: 15px;
|
|
13
|
+
}
|
|
14
|
+
.createQueueModalContentSection{
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
width: 100%;
|
|
18
|
+
row-gap: 10px;
|
|
19
|
+
}
|
|
20
|
+
.createQueueModalFormRow{
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
width: 100%;
|
|
24
|
+
column-gap: 10px;
|
|
25
|
+
}
|
|
26
|
+
.createQueueModalFormControl{
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
}
|