@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
package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.resource.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { openmrsFetch, OpenmrsResource, restBaseUrl } from "@openmrs/esm-framework";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import useSWR from 'swr';
|
|
4
|
+
import { getHieBaseUrl } from "../../../shared/utils/get-base-url";
|
|
5
|
+
import { postJson } from "../../../registry/registry.resource";
|
|
6
|
+
import dayjs from "dayjs";
|
|
7
|
+
|
|
8
|
+
export const useBillableItems = (serviceTypeUuid: string = "") => {
|
|
9
|
+
const url = `${restBaseUrl}/billing/billableService?v=custom:(uuid,name,shortName,serviceStatus,serviceType:(uuid,display),servicePrices:(uuid,name,price,paymentMode),concept:(uuid))`;
|
|
10
|
+
const { data, isLoading, error } = useSWR<{ data: { results: Array<OpenmrsResource> } }>(url, openmrsFetch);
|
|
11
|
+
const [searchTerm, setSearchTerm] = useState('');
|
|
12
|
+
let filteredItems =
|
|
13
|
+
data?.data?.results?.filter((item) => item.name.toLowerCase().includes(searchTerm.toLowerCase())) ?? [];
|
|
14
|
+
|
|
15
|
+
if (serviceTypeUuid) {
|
|
16
|
+
filteredItems = filteredItems?.filter(item => item?.serviceType?.uuid === serviceTypeUuid);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
lineItems: filteredItems,
|
|
21
|
+
isLoading,
|
|
22
|
+
error,
|
|
23
|
+
searchTerm,
|
|
24
|
+
setSearchTerm,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const usePatientBills = (patientUuid: string, billStatus: string = 'PENDING') => {
|
|
29
|
+
const url = `${restBaseUrl}/billing/bill?patientUuid=${patientUuid}&status=${billStatus}&v=custom:(uuid,lineItems,dateCreated)`;
|
|
30
|
+
|
|
31
|
+
const {
|
|
32
|
+
data,
|
|
33
|
+
error,
|
|
34
|
+
isLoading,
|
|
35
|
+
isValidating,
|
|
36
|
+
mutate: mutated,
|
|
37
|
+
} = useSWR<{ data: { results: Array<OpenmrsResource> } }>(url, openmrsFetch, {
|
|
38
|
+
errorRetryCount: 2,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const results = data?.data?.results ?? [];
|
|
42
|
+
|
|
43
|
+
const today = dayjs().startOf('day');
|
|
44
|
+
|
|
45
|
+
const currentDayBills = results.filter((bill) => {
|
|
46
|
+
const billDate = dayjs(bill?.dateCreated).startOf('day');
|
|
47
|
+
return billDate.isSame(today);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
currentDayBills,
|
|
52
|
+
error,
|
|
53
|
+
isLoading,
|
|
54
|
+
isValidating,
|
|
55
|
+
mutated,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const useCashPoint = () => {
|
|
60
|
+
const url = `/ws/rest/v1/billing/cashPoint`;
|
|
61
|
+
const { data, isLoading, error } = useSWR<{ data: { results: Array<OpenmrsResource> } }>(url, openmrsFetch);
|
|
62
|
+
|
|
63
|
+
return { isLoading, error, cashPoints: data?.data?.results ?? [] };
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const createPatientBill = (payload) => {
|
|
67
|
+
const postUrl = `${restBaseUrl}/billing/bill`;
|
|
68
|
+
return openmrsFetch<{ uuid: string, lineItems: Array<{ lineItemOrder: number; uuid: string }> }>(postUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: payload });
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const updatePatientBill = (billUuid: string, payload) => {
|
|
72
|
+
const postUrl = `${restBaseUrl}/billing/bill/${billUuid}`;
|
|
73
|
+
return openmrsFetch<{ uuid: string, lineItems: Array<{ lineItemOrder: number; uuid: string }> }>(postUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: payload });
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const removePatientBill = (uuid) => {
|
|
77
|
+
const purgeUrl = `${restBaseUrl}/billing/bill/${uuid}?purge=true`;
|
|
78
|
+
return openmrsFetch<{ uuid: string }>(purgeUrl, { method: 'DELETE' });
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const createOrderBillInHie = async (payload) => {
|
|
82
|
+
const hieBaseUrl = await getHieBaseUrl();
|
|
83
|
+
const url = `${hieBaseUrl}/bill-order`;
|
|
84
|
+
return postJson<{ bill_uuid: string }>(url, payload);
|
|
85
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
4
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
|
+
|
|
6
|
+
.form {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
height: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.formContainer {
|
|
14
|
+
margin: layout.$spacing-05;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: layout.$spacing-05;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.tablet {
|
|
21
|
+
padding: layout.$spacing-06 layout.$spacing-05;
|
|
22
|
+
background-color: colors.$white;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.desktop {
|
|
26
|
+
padding: layout.$spacing-01 layout.$spacing-05;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.buttonContainer {
|
|
30
|
+
max-width: 50%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.inlineLoading {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: layout.$spacing-03;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.service {
|
|
40
|
+
padding: layout.$spacing-05 layout.$spacing-04;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.conceptsList {
|
|
44
|
+
background-color: $ui-02;
|
|
45
|
+
max-height: 14rem;
|
|
46
|
+
overflow-y: auto;
|
|
47
|
+
border: 1px solid $ui-03;
|
|
48
|
+
|
|
49
|
+
li:hover {
|
|
50
|
+
background-color: $ui-03;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.errorMessage {
|
|
55
|
+
@include type.type-style('label-02');
|
|
56
|
+
color: $danger;
|
|
57
|
+
margin-bottom: layout.$spacing-05;
|
|
58
|
+
}
|
package/src/billing/workspaces/create-order-bill-form-workspace/create-order-bill-form.workspace.tsx
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { Order } from "@openmrs/esm-patient-common-lib";
|
|
2
|
+
import { useMemo, useRef, useState } from "react";
|
|
3
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
4
|
+
import { Controller, useForm, useWatch } from "react-hook-form";
|
|
5
|
+
import { validationSchema, type CreateOrderBillFormSchema } from "./schema";
|
|
6
|
+
import { FetchResponse, OpenmrsResource, ResponsiveWrapper, showSnackbar, useDebounce, useLayoutType } from "@openmrs/esm-framework";
|
|
7
|
+
import { useTranslation } from "react-i18next";
|
|
8
|
+
import { Column, FilterableMultiSelect, Select, SelectItem, Form, FormGroup, Stack, TextInput, InlineNotification, ButtonSet, Button, InlineLoading, Search, Layer, Tile, FormLabel } from "@carbon/react";
|
|
9
|
+
import styles from './create-order-bill-form.scss';
|
|
10
|
+
import React from "react";
|
|
11
|
+
import classNames from 'classnames';
|
|
12
|
+
import { createOrderBillInHie, createPatientBill, removePatientBill, updatePatientBill, useBillableItems, useCashPoint, usePatientBills } from "./create-order-bill-form.resource";
|
|
13
|
+
import { generateUpdateBillLineItems } from "../../utils";
|
|
14
|
+
|
|
15
|
+
interface CreateOrderBillFormProps {
|
|
16
|
+
closeWorkspace: () => void;
|
|
17
|
+
quantity: number;
|
|
18
|
+
order: Order,
|
|
19
|
+
mutated: () => void;
|
|
20
|
+
serviceTypeUuid: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const CreateOrderBillForm: React.FC<CreateOrderBillFormProps> = ({
|
|
24
|
+
closeWorkspace, quantity, order, mutated, serviceTypeUuid
|
|
25
|
+
}) => {
|
|
26
|
+
const { t } = useTranslation();
|
|
27
|
+
const isTablet = useLayoutType() === 'tablet';
|
|
28
|
+
const { lineItems, isLoading: isLoadingLineItems } = useBillableItems(); //useBillableItems(serviceTypeUuid);
|
|
29
|
+
const { currentDayBills } = usePatientBills(order?.patient?.uuid);
|
|
30
|
+
const { cashPoints } = useCashPoint();
|
|
31
|
+
const cashPointUuid = cashPoints?.[0]?.uuid ?? '';
|
|
32
|
+
const conceptUuid = order?.concept?.uuid;
|
|
33
|
+
const [searchTerm, setSearchTerm] = useState('');
|
|
34
|
+
const debouncedSearchTerm = useDebounce(searchTerm.trim());
|
|
35
|
+
const searchInputRef = useRef(null);
|
|
36
|
+
const searchResults = useMemo(() => {
|
|
37
|
+
if (debouncedSearchTerm) {
|
|
38
|
+
const filteredItems = lineItems.filter(item => item?.name.toLowerCase()?.includes(debouncedSearchTerm.toLowerCase()));
|
|
39
|
+
return filteredItems;
|
|
40
|
+
}
|
|
41
|
+
return [];
|
|
42
|
+
}, [debouncedSearchTerm])
|
|
43
|
+
|
|
44
|
+
const {
|
|
45
|
+
control,
|
|
46
|
+
watch,
|
|
47
|
+
handleSubmit,
|
|
48
|
+
setValue,
|
|
49
|
+
formState: { errors, isDirty, isSubmitting },
|
|
50
|
+
} = useForm<CreateOrderBillFormSchema>({
|
|
51
|
+
resolver: zodResolver(validationSchema),
|
|
52
|
+
defaultValues: {
|
|
53
|
+
quantity: quantity ?? 1
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const initialPriceName = useMemo(() => {
|
|
58
|
+
let priceName = "";
|
|
59
|
+
if (currentDayBills && currentDayBills.length) {
|
|
60
|
+
const bill = currentDayBills[0];
|
|
61
|
+
priceName = bill?.lineItems?.find(i => i?.billableService?.toUpperCase() === "CONSULTATION")?.priceName;
|
|
62
|
+
}
|
|
63
|
+
return priceName;
|
|
64
|
+
}, [currentDayBills]);
|
|
65
|
+
|
|
66
|
+
const selectedBillableItem = useWatch({ control, name: 'billableItem' });
|
|
67
|
+
const billableItem = useMemo(() => {
|
|
68
|
+
if (selectedBillableItem) {
|
|
69
|
+
let filteredItems = lineItems.filter(item => item?.uuid === selectedBillableItem);
|
|
70
|
+
return filteredItems;
|
|
71
|
+
}
|
|
72
|
+
return [];
|
|
73
|
+
}, [selectedBillableItem, initialPriceName]);
|
|
74
|
+
|
|
75
|
+
const initialUnitPriceUuid = useMemo(() => {
|
|
76
|
+
if (billableItem && billableItem.length && initialPriceName) {
|
|
77
|
+
const servicePrices = billableItem[0]?.servicePrices ?? [];
|
|
78
|
+
const serviceUuid = billableItem[0]?.uuid ?? "";
|
|
79
|
+
|
|
80
|
+
const initialServicePriceUuid = servicePrices?.find(sP => sP?.paymentMode?.name?.toUpperCase() === initialPriceName.toUpperCase())?.uuid;
|
|
81
|
+
const value = serviceUuid + "#" + initialServicePriceUuid;
|
|
82
|
+
setValue("unitPrice", value);
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}, [billableItem, initialPriceName])
|
|
87
|
+
|
|
88
|
+
const onSubmit = async (data) => {
|
|
89
|
+
try {
|
|
90
|
+
if (isSubmitting) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const unitPriceTxt = data?.unitPrice;
|
|
95
|
+
const serviceUuid = unitPriceTxt?.split("#")[0];
|
|
96
|
+
const servicePriceUuid = unitPriceTxt?.split("#")[1];
|
|
97
|
+
const lineItemOrder = order?.orderNumber?.split("-")[1] ?? null;
|
|
98
|
+
|
|
99
|
+
const billableItems = lineItems
|
|
100
|
+
.filter((item) => item.uuid === serviceUuid)
|
|
101
|
+
.map((item, index) => {
|
|
102
|
+
const price = item.servicePrices?.find(service => service.uuid === servicePriceUuid)?.price || 0;
|
|
103
|
+
const paymentStatus = price == 0 ? "PAID" : "PENDING";
|
|
104
|
+
return {
|
|
105
|
+
billableService: item.uuid,
|
|
106
|
+
quantity: data.quantity,
|
|
107
|
+
item: conceptUuid,
|
|
108
|
+
price: price,
|
|
109
|
+
priceName: item.servicePrices?.find(service => service.uuid === servicePriceUuid)?.name || 'Default',
|
|
110
|
+
priceUuid: servicePriceUuid || '',
|
|
111
|
+
lineItemOrder: Number(lineItemOrder) ?? index,
|
|
112
|
+
paymentStatus: paymentStatus,
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
let billPayload = {};
|
|
116
|
+
|
|
117
|
+
let response: FetchResponse<{ uuid: string, lineItems: Array<{ lineItemOrder: number; uuid: string }> }> | undefined;
|
|
118
|
+
|
|
119
|
+
if (currentDayBills && currentDayBills.length) {
|
|
120
|
+
const bill = currentDayBills[0];
|
|
121
|
+
const billUuid = bill?.uuid;
|
|
122
|
+
const initialLineItems = generateUpdateBillLineItems(bill, lineItems);
|
|
123
|
+
const lineItemsPayload = [...initialLineItems, ...billableItems];
|
|
124
|
+
billPayload = {
|
|
125
|
+
lineItems: lineItemsPayload
|
|
126
|
+
}
|
|
127
|
+
response = await updatePatientBill(billUuid, billPayload);
|
|
128
|
+
} else {
|
|
129
|
+
billPayload = {
|
|
130
|
+
lineItems: billableItems,
|
|
131
|
+
cashPoint: cashPointUuid,
|
|
132
|
+
patient: order?.patient?.uuid,
|
|
133
|
+
status: 'PENDING',
|
|
134
|
+
payments: []
|
|
135
|
+
};
|
|
136
|
+
response = await createPatientBill(billPayload);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const billUuidResp = response?.data?.uuid;
|
|
140
|
+
const lineItemUuid = response?.data?.lineItems?.find(v => v?.lineItemOrder === Number(lineItemOrder))?.uuid;
|
|
141
|
+
|
|
142
|
+
if (billUuidResp) {
|
|
143
|
+
const hiePayload = {
|
|
144
|
+
bill_uuid: billUuidResp,
|
|
145
|
+
order_no: order?.orderNumber,
|
|
146
|
+
line_item_uuid: lineItemUuid
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
try {
|
|
150
|
+
await createOrderBillInHie(hiePayload);
|
|
151
|
+
} catch (error) {
|
|
152
|
+
await removePatientBill(billUuidResp);
|
|
153
|
+
throw error;
|
|
154
|
+
}
|
|
155
|
+
} else {
|
|
156
|
+
throw new Error("Bill uuid not found!");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
showSnackbar({
|
|
160
|
+
title: t('billSuccess', 'Bill created'),
|
|
161
|
+
subtitle: t('billSuccessMessage', "Patient's bill has been created successfully"),
|
|
162
|
+
kind: 'success',
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
mutated();
|
|
166
|
+
closeWorkspace();
|
|
167
|
+
} catch (error) {
|
|
168
|
+
showSnackbar({
|
|
169
|
+
title: t('error', 'Error'),
|
|
170
|
+
subtitle: error?.message || t('unknownError', 'An unknown error occurred'),
|
|
171
|
+
kind: 'error',
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<Form onSubmit={handleSubmit(onSubmit)} className={styles.form}>
|
|
178
|
+
<div className={styles.formContainer}>
|
|
179
|
+
<Stack gap={3}>
|
|
180
|
+
<InlineNotification
|
|
181
|
+
kind="info"
|
|
182
|
+
title={`${order?.orderNumber} - ${order?.display}`}
|
|
183
|
+
lowContrast
|
|
184
|
+
/>
|
|
185
|
+
|
|
186
|
+
<ResponsiveWrapper>
|
|
187
|
+
<FormGroup legendText="">
|
|
188
|
+
<Column>
|
|
189
|
+
<Controller
|
|
190
|
+
name="quantity"
|
|
191
|
+
control={control}
|
|
192
|
+
render={({ field }) => (
|
|
193
|
+
<TextInput
|
|
194
|
+
{...field}
|
|
195
|
+
id="quantity"
|
|
196
|
+
labelText={t('quantity', 'Quantity *')}
|
|
197
|
+
placeholder={t('enterQuantity', 'Enter quantity')}
|
|
198
|
+
invalid={!!errors.quantity}
|
|
199
|
+
invalidText={errors.quantity?.message}
|
|
200
|
+
/>
|
|
201
|
+
)}
|
|
202
|
+
/>
|
|
203
|
+
</Column>
|
|
204
|
+
</FormGroup>
|
|
205
|
+
</ResponsiveWrapper>
|
|
206
|
+
|
|
207
|
+
<ResponsiveWrapper>
|
|
208
|
+
<Controller
|
|
209
|
+
name="billableItem"
|
|
210
|
+
control={control}
|
|
211
|
+
render={({ field }) => (
|
|
212
|
+
<>
|
|
213
|
+
<FormLabel className={styles.conceptLabel}>{t('billableItem', 'Billable item')}</FormLabel>
|
|
214
|
+
<Search
|
|
215
|
+
id="billableItemSearch"
|
|
216
|
+
labelText={t('billableItem', 'Billable item')}
|
|
217
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSearchTerm(e.target.value)}
|
|
218
|
+
onClear={() => {
|
|
219
|
+
setSearchTerm('');
|
|
220
|
+
field.onChange('');
|
|
221
|
+
}}
|
|
222
|
+
placeholder={t('searchBillableItem', 'Search billable item')}
|
|
223
|
+
ref={searchInputRef}
|
|
224
|
+
value={lineItems.find(v => v.uuid === selectedBillableItem)?.name || searchTerm}
|
|
225
|
+
/>
|
|
226
|
+
|
|
227
|
+
{(() => {
|
|
228
|
+
if (!debouncedSearchTerm || selectedBillableItem) {
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
if (searchResults && searchResults.length) {
|
|
232
|
+
|
|
233
|
+
return (
|
|
234
|
+
<ul className={styles.conceptsList}>
|
|
235
|
+
{searchResults?.map((item) => (
|
|
236
|
+
<li
|
|
237
|
+
className={styles.service}
|
|
238
|
+
key={item?.uuid}
|
|
239
|
+
onClick={() => {
|
|
240
|
+
field.onChange(item?.uuid);
|
|
241
|
+
setSearchTerm('');
|
|
242
|
+
}}
|
|
243
|
+
role="menuitem">
|
|
244
|
+
{item?.name}
|
|
245
|
+
</li>
|
|
246
|
+
))}
|
|
247
|
+
</ul>
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
return (
|
|
251
|
+
<Layer>
|
|
252
|
+
<Tile className={styles.emptyResults}>
|
|
253
|
+
<span>
|
|
254
|
+
{t('noResultsFor', 'No results for {{searchTerm}}', { searchTerm: debouncedSearchTerm })}
|
|
255
|
+
</span>
|
|
256
|
+
</Tile>
|
|
257
|
+
</Layer>
|
|
258
|
+
);
|
|
259
|
+
})()}
|
|
260
|
+
</>
|
|
261
|
+
)}
|
|
262
|
+
/>
|
|
263
|
+
</ResponsiveWrapper>
|
|
264
|
+
|
|
265
|
+
<Column>
|
|
266
|
+
<Controller
|
|
267
|
+
control={control}
|
|
268
|
+
name="unitPrice"
|
|
269
|
+
render={({ field }) => {
|
|
270
|
+
const servicePrices = billableItem[0]?.servicePrices ?? [];
|
|
271
|
+
const serviceUuid = billableItem[0]?.uuid ?? "";
|
|
272
|
+
|
|
273
|
+
return (
|
|
274
|
+
<>
|
|
275
|
+
{billableItem && billableItem.length ?
|
|
276
|
+
(servicePrices.length > 0 ? (
|
|
277
|
+
<Select id="unitPrice" labelText={t('selectServicePrice', 'Select service price *')} invalid={!!errors.unitPrice}
|
|
278
|
+
invalidText={errors.unitPrice?.message}
|
|
279
|
+
onChange={(e) => {
|
|
280
|
+
field.onChange(e.target.value);
|
|
281
|
+
}}
|
|
282
|
+
defaultValue={initialUnitPriceUuid ?? null}
|
|
283
|
+
>
|
|
284
|
+
<SelectItem value="" text="Select service price" />
|
|
285
|
+
{
|
|
286
|
+
servicePrices.map((service) => {
|
|
287
|
+
const value = serviceUuid + "#" + service?.uuid;
|
|
288
|
+
const text = `${service?.name} - ${service?.price}`;
|
|
289
|
+
return (
|
|
290
|
+
<SelectItem value={value} text={text} />
|
|
291
|
+
)
|
|
292
|
+
})
|
|
293
|
+
}
|
|
294
|
+
</Select>
|
|
295
|
+
) : (
|
|
296
|
+
<InlineNotification
|
|
297
|
+
kind="warning"
|
|
298
|
+
title={t(
|
|
299
|
+
'noServicesAvailable',
|
|
300
|
+
'No service price has been configured for this order.',
|
|
301
|
+
)}
|
|
302
|
+
lowContrast
|
|
303
|
+
/>
|
|
304
|
+
)) : null
|
|
305
|
+
}
|
|
306
|
+
</>
|
|
307
|
+
);
|
|
308
|
+
}}
|
|
309
|
+
/>
|
|
310
|
+
</Column>
|
|
311
|
+
</Stack>
|
|
312
|
+
</div>
|
|
313
|
+
|
|
314
|
+
<ButtonSet className={classNames(styles.buttonSet, { [styles.tablet]: isTablet })}>
|
|
315
|
+
<Button kind="secondary" onClick={closeWorkspace}>
|
|
316
|
+
{t('cancel', 'Cancel')}
|
|
317
|
+
</Button>
|
|
318
|
+
<Button kind="primary" type="submit" disabled={isSubmitting || !isDirty}>
|
|
319
|
+
{isSubmitting ? (
|
|
320
|
+
<InlineLoading description={t('submitting', 'Submitting...')} />
|
|
321
|
+
) : (
|
|
322
|
+
t('saveAndClose', 'Save & close')
|
|
323
|
+
)}
|
|
324
|
+
</Button>
|
|
325
|
+
</ButtonSet>
|
|
326
|
+
</Form>
|
|
327
|
+
)
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export default CreateOrderBillForm;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const validationSchema = z.object({
|
|
4
|
+
unitPrice: z.string({ required_error: "Unit price is required" }),
|
|
5
|
+
quantity: z.number({ required_error: "Quantity is required" }),
|
|
6
|
+
billableItem: z.string().optional()
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { validationSchema };
|
|
10
|
+
|
|
11
|
+
export type CreateOrderBillFormSchema = z.infer<typeof validationSchema>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Checkbox, Layer, Tab, TabList, TabPanel, TabPanels, Tabs } from '@carbon/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import DailyBookings from './daily/daily-bookings.component';
|
|
4
|
+
import styles from './bookings.component.scss';
|
|
5
|
+
const Bookings: React.FC = () => {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<div className={styles.bookingsLayout}>
|
|
9
|
+
<div className={styles.bookingsHeader}>
|
|
10
|
+
<h4>Bookings</h4>
|
|
11
|
+
</div>
|
|
12
|
+
<div className={styles.bookingsContent}>
|
|
13
|
+
<Tabs>
|
|
14
|
+
<TabList contained>
|
|
15
|
+
<Tab>Daily</Tab>
|
|
16
|
+
<Tab>Monthly</Tab>
|
|
17
|
+
</TabList>
|
|
18
|
+
<TabPanels>
|
|
19
|
+
<TabPanel>
|
|
20
|
+
<DailyBookings />
|
|
21
|
+
</TabPanel>
|
|
22
|
+
<TabPanel></TabPanel>
|
|
23
|
+
</TabPanels>
|
|
24
|
+
</Tabs>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default Bookings;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.bookingsLayout{
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
padding: 15px 15px;
|
|
5
|
+
row-gap: 5px;
|
|
6
|
+
}
|
|
7
|
+
.bookingsHeader{
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: row;
|
|
10
|
+
column-gap: 5px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
.bookingsFilters{
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
width: 100%;
|
|
17
|
+
border: 1px double lightgray;
|
|
18
|
+
padding-top: 10px;
|
|
19
|
+
padding-bottom: 10px;
|
|
20
|
+
padding-left: 15px;
|
|
21
|
+
padding-right: 15px;
|
|
22
|
+
margin-left: 5px;
|
|
23
|
+
margin-right: 5px;
|
|
24
|
+
margin-bottom: 10px;
|
|
25
|
+
}
|
|
26
|
+
.bookingsContent{
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
width: 100%;
|
|
30
|
+
row-gap: 15px;
|
|
31
|
+
}
|
|
32
|
+
.contentActions{
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: row;
|
|
35
|
+
width: 100%;
|
|
36
|
+
justify-content: flex-end;
|
|
37
|
+
column-gap: 5px;
|
|
38
|
+
}
|