@kenyaemr/esm-billing-app 5.4.2-pre.2152 → 5.4.2-pre.2159
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/.turbo/turbo-build.log +74 -74
- package/dist/574.js +1 -1
- package/dist/919.js +1 -1
- package/dist/919.js.map +1 -1
- package/dist/933.js +1 -1
- package/dist/933.js.map +1 -1
- package/dist/kenyaemr-esm-billing-app.js.buildmanifest.json +11 -11
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -28
- package/src/invoice/invoice.component.tsx +24 -2
- package/src/invoice/invoice.resource.ts +31 -1
- package/src/routes.json +9 -32
- package/src/types/index.ts +12 -0
- package/translations/en.json +2 -0
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemr":"^19.0.0"},"pages":[{"component":"billableServicesHome","route":"billable-services"},{"component":"requirePaymentModal","routeRegex":"^patient/.+/chart","online":true,"offline":false}],"extensions":[{"
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemr":"^19.0.0"},"pages":[{"component":"billableServicesHome","route":"billable-services"},{"component":"requirePaymentModal","routeRegex":"^patient/.+/chart","online":true,"offline":false}],"extensions":[{"component":"billingDashboardLink","name":"billing-dashboard-link","slot":"homepage-dashboard-slot","meta":{"slot":"billing-dashboard-slot"}},{"component":"benefitsPackageDashboardLink","name":"benefits-package-dashboard-link","slot":"patient-chart-dashboard-slot","meta":{"name":"benefits-package","slot":"patient-chart-benefits-dashboard-slot","path":"insurance-benefits","columns":1,"columnSpan":1},"featureFlag":"healthInformationExchange"},{"component":"benefitsPackage","name":"benefits-package","slot":"patient-chart-benefits-dashboard-slot"},{"component":"root","name":"billing-dashboard-root","slot":"billing-dashboard-slot"},{"component":"benefitsEligibilyRequestForm","name":"benefits-eligibility-request-form"},{"component":"benefitsPreAuthForm","name":"benefits-pre-auth-form"},{"name":"billing-patient-summary","component":"billingPatientSummary","slot":"patient-chart-billing-dashboard-slot","order":10,"meta":{"columnSpan":4}},{"name":"billing-summary-dashboard-link","component":"billingSummaryDashboardLink","slot":"patient-chart-dashboard-slot","order":11,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-billing-dashboard-slot","path":"Billing","layoutMode":"anchored"}},{"name":"billing-check-in-form","slot":"extra-visit-attribute-slot","component":"billingCheckInForm"},{"name":"require-billing-modal","component":"requirePaymentModal"},{"name":"patient-banner-billing-tags","component":"visitAttributeTags","slot":"patient-banner-tags-slot","order":2},{"name":"initiate-payment-modal","component":"initiatePaymentDialog"},{"name":"delete-billableservice-modal","component":"deleteBillableServiceModal"},{"name":"refund-bill-modal","component":"refundBillModal"},{"name":"delete-bill-modal","component":"deleteBillModal"},{"name":"lab-order-billable-item","component":"labOrder","slot":"top-of-lab-order-form-slot"},{"name":"procedure-order-billable-item","component":"procedureOrder","slot":"top-of-procedure-order-form-slot"},{"name":"imaging-order-billable-item","component":"imagingOrder","slot":"top-of-imaging-order-form-slot"},{"name":"price-info-order","component":"priceInfoOrder"},{"name":"drug-order-billable-item","component":"drugOrder","slot":"medication-info-slot"},{"name":"order-action-button","component":"orderActionButton","slots":["prescription-action-button-slot","imaging-orders-action","procedure-orders-action","tests-ordered-actions-slot"],"order":0},{"component":"billingOverviewLink","name":"billing-overview-link","order":0,"slot":"billing-dashboard-group-nav-slot"},{"component":"billDepositDashboardLink","name":"bill-deposit-dashboard-link","slot":"billing-dashboard-group-nav-slot"},{"component":"paymentHistoryLink","name":"payment-history-link","slot":"billing-dashboard-group-nav-slot"},{"component":"paymentPointsLink","name":"payment-points-link","slot":"billing-dashboard-group-nav-slot"},{"component":"paymentModesLink","name":"payment-modes-link","slot":"billing-dashboard-group-nav-slot"},{"component":"billManagerLink","name":"bill-manager-link","slot":"billing-dashboard-group-nav-slot"},{"component":"chargeableItemsLink","name":"chargeable-items-link","slot":"billing-dashboard-group-nav-slot"},{"component":"billableExemptionsLink","name":"billable-exemptions-link","slot":"billing-dashboard-group-nav-slot"},{"component":"claimsManagementOverviewDashboardLink","name":"claims-management-overview-link","order":0,"slot":"claims-management-dashboard-link-slot"},{"component":"preAuthRequestsDashboardLink","name":"preauthrequest-overview-link","slot":"claims-management-dashboard-link-slot"},{"component":"claimsOverview","name":"claims-overview-dashboard-link","slot":"claims-management-overview-slot"},{"component":"waiveBillActionButton","name":"waive-bill-action-button","slot":"bill-actions-slot"},{"component":"deleteBillActionButton","name":"delete-bill-action-button","slot":"bill-actions-slot"},{"component":"refundLineItem","name":"refund-line-item","slot":"bill-actions-overflow-menu-slot"},{"name":"edit-line-item","component":"editLineItem","slot":"bill-actions-overflow-menu-slot"},{"name":"cancel-line-item","component":"cancelLineItem","slot":"bill-actions-overflow-menu-slot"}],"workspaces":[{"name":"create-bill-workspace","component":"createBillWorkspace","title":"Create Bill Workspace","type":"other-form"},{"name":"waive-bill-form","component":"waiveBillForm","title":"Waive Bill Form","type":"other-form"},{"name":"edit-bill-form","component":"editBillForm","title":"Edit Bill Form","type":"other-form"},{"name":"billable-service-form","component":"addServiceForm","title":"Create Charge Item Form","type":"other-form"},{"name":"commodity-form","component":"addCommodityForm","title":"Create Charge Item Form","type":"other-form"},{"name":"billing-form","component":"billingForm","title":"Billing Form","type":"other-form","width":"extra-wide"},{"name":"payment-mode-workspace","component":"paymentModeWorkspace","title":"Payment Mode Workspace","type":"other-form"},{"name":"cancel-bill-workspace","component":"cancelBillWorkspace","title":"Cancel Bill Workspace","type":"other-form"},{"name":"add-deposit-workspace","component":"addDepositWorkspace","title":"Add Deposit","type":"other-form"},{"name":"deposit-transaction-workspace","component":"depositTransactionWorkspace","title":"Deposit Transaction","type":"other-form"}],"modals":[{"name":"create-payment-point","component":"createPaymentPoint"},{"name":"clock-out-modal","component":"clockOut"},{"name":"bulk-import-billable-services-modal","component":"bulkImportBillableServicesModal"},{"name":"delete-payment-mode-modal","component":"deletePaymentModeModal"},{"name":"manage-claim-request-modal","component":"manageClaimRequestModal"},{"name":"paid-bill-receipt-print-preview-modal","component":"paidBillReceiptPrintPreviewModal"},{"name":"clock-in-modal","component":"clockIn"},{"name":"create-bill-item-modal","component":"createBillItemModal"},{"name":"delete-deposit-modal","component":"deleteDepositModal"},{"name":"reverse-transaction-modal","component":"reverseTransactionModal"}],"version":"5.4.2-pre.2159"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -83,15 +83,6 @@ export const billingSummaryDashboardLink = getSyncLifecycle(
|
|
|
83
83
|
options,
|
|
84
84
|
);
|
|
85
85
|
|
|
86
|
-
export const billingDashboardLink = getSyncLifecycle(
|
|
87
|
-
createDashboardGroup({
|
|
88
|
-
title: 'Billing',
|
|
89
|
-
slotName: 'billing-dashboard-link-slot',
|
|
90
|
-
isExpanded: false,
|
|
91
|
-
}),
|
|
92
|
-
options,
|
|
93
|
-
);
|
|
94
|
-
|
|
95
86
|
// Navigation Links
|
|
96
87
|
export const billingOverviewLink = getSyncLifecycle(
|
|
97
88
|
createLeftPanelLink({
|
|
@@ -149,25 +140,6 @@ export const chargeableItemsLink = getSyncLifecycle(
|
|
|
149
140
|
options,
|
|
150
141
|
);
|
|
151
142
|
|
|
152
|
-
export const billingModuleNavGroup = getSyncLifecycle(
|
|
153
|
-
createDashboardGroup({
|
|
154
|
-
title: 'Billing',
|
|
155
|
-
slotName: 'billing-dashboard-link-slot',
|
|
156
|
-
isExpanded: false,
|
|
157
|
-
}),
|
|
158
|
-
options,
|
|
159
|
-
);
|
|
160
|
-
|
|
161
|
-
// Claims Management Links
|
|
162
|
-
export const claimsManagementSideNavGroup = getSyncLifecycle(
|
|
163
|
-
createDashboardGroup({
|
|
164
|
-
title: 'Claims Management',
|
|
165
|
-
slotName: 'claims-management-dashboard-link-slot',
|
|
166
|
-
isExpanded: false,
|
|
167
|
-
}),
|
|
168
|
-
options,
|
|
169
|
-
);
|
|
170
|
-
|
|
171
143
|
export const claimsManagementOverviewDashboardLink = getSyncLifecycle(
|
|
172
144
|
createLeftPanelLink({
|
|
173
145
|
name: 'claims-overview',
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
setCurrentVisit,
|
|
9
9
|
showModal,
|
|
10
10
|
showSnackbar,
|
|
11
|
+
showToast,
|
|
11
12
|
updateVisit,
|
|
12
13
|
useFeatureFlag,
|
|
13
14
|
usePatient,
|
|
@@ -24,7 +25,7 @@ import { convertToCurrency } from '../helpers';
|
|
|
24
25
|
import { usePaymentsReconciler } from '../hooks/use-payments-reconciler';
|
|
25
26
|
import { LineItem } from '../types';
|
|
26
27
|
import InvoiceTable from './invoice-table.component';
|
|
27
|
-
import { removeQueuedPatient, useVisitQueueEntry } from './invoice.resource';
|
|
28
|
+
import { removeQueuedPatient, useShaFacilityStatus, useVisitQueueEntry } from './invoice.resource';
|
|
28
29
|
import styles from './invoice.scss';
|
|
29
30
|
import Payments from './payments/payments.component';
|
|
30
31
|
import ReceiptPrintButton from './print-bill-receipt/receipt-print-button.component';
|
|
@@ -38,6 +39,7 @@ interface InvoiceDetailsProps {
|
|
|
38
39
|
const Invoice: React.FC = () => {
|
|
39
40
|
const { t } = useTranslation();
|
|
40
41
|
const { data: facilityInfo } = useDefaultFacility();
|
|
42
|
+
const { shaFacilityStatus } = useShaFacilityStatus();
|
|
41
43
|
const { billUuid, patientUuid } = useParams();
|
|
42
44
|
const [isPrinting, setIsPrinting] = useState(false);
|
|
43
45
|
const { patient, isLoading: isLoadingPatient, error: patientError } = usePatient(patientUuid);
|
|
@@ -57,9 +59,15 @@ const Invoice: React.FC = () => {
|
|
|
57
59
|
const [selectedLineItems, setSelectedLineItems] = useState([]);
|
|
58
60
|
const componentRef = useRef<HTMLDivElement>(null);
|
|
59
61
|
const isProcessClaimsFormEnabled = useFeatureFlag('healthInformationExchange');
|
|
62
|
+
|
|
63
|
+
const isShaFacilityStatusValid =
|
|
64
|
+
shaFacilityStatus &&
|
|
65
|
+
shaFacilityStatus.shaFacilityId &&
|
|
66
|
+
shaFacilityStatus.operationalStatus &&
|
|
67
|
+
shaFacilityStatus?.registrationNumber;
|
|
68
|
+
|
|
60
69
|
const handleSelectItem = (lineItems: Array<LineItem>) => {
|
|
61
70
|
const paidLineItems = bill?.lineItems?.filter((item) => item.paymentStatus === 'PAID') ?? [];
|
|
62
|
-
// remove duplicates
|
|
63
71
|
const uniqueLineItems = [...new Set([...lineItems, ...paidLineItems])];
|
|
64
72
|
setSelectedLineItems(uniqueLineItems);
|
|
65
73
|
};
|
|
@@ -165,6 +173,19 @@ const Invoice: React.FC = () => {
|
|
|
165
173
|
};
|
|
166
174
|
|
|
167
175
|
const handleViewClaims = async () => {
|
|
176
|
+
if (!isShaFacilityStatusValid) {
|
|
177
|
+
showToast({
|
|
178
|
+
critical: true,
|
|
179
|
+
kind: 'warning',
|
|
180
|
+
title: t('shaFacilityLicenseNumberRequired', 'Facility license number Required'),
|
|
181
|
+
description: t(
|
|
182
|
+
'shaFacilityLicenseNumbernRequiredDescription',
|
|
183
|
+
'Facility license number is required to process claims. Please update facility license number details.',
|
|
184
|
+
),
|
|
185
|
+
});
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
|
|
168
189
|
if (currentVisit) {
|
|
169
190
|
await handleEndVisit();
|
|
170
191
|
navigate({ to: `${spaBasePath}/billing/patient/${patientUuid}/${billUuid}/claims` });
|
|
@@ -204,6 +225,7 @@ const Invoice: React.FC = () => {
|
|
|
204
225
|
tooltipPosition="left">
|
|
205
226
|
{t('mpesaPayment', 'MPESA Payment')}
|
|
206
227
|
</Button>
|
|
228
|
+
|
|
207
229
|
{isProcessClaimsFormEnabled && isInsurancePayment(bill?.payments) && (
|
|
208
230
|
<Button
|
|
209
231
|
onClick={handleViewClaims}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Concept,
|
|
3
|
+
FetchResponse,
|
|
4
|
+
openmrsFetch,
|
|
5
|
+
restBaseUrl,
|
|
6
|
+
toDateObjectStrict,
|
|
7
|
+
toOmrsIsoString,
|
|
8
|
+
useSession,
|
|
9
|
+
Visit,
|
|
10
|
+
} from '@openmrs/esm-framework';
|
|
2
11
|
import useSWR from 'swr';
|
|
12
|
+
import { type ShaFacilityStatusResponse } from '../types';
|
|
3
13
|
|
|
4
14
|
export interface VisitQueueEntry {
|
|
5
15
|
queueEntry: VisitQueueEntry;
|
|
@@ -79,3 +89,23 @@ export function removeQueuedPatient(
|
|
|
79
89
|
signal: abortController.signal,
|
|
80
90
|
});
|
|
81
91
|
}
|
|
92
|
+
|
|
93
|
+
export const useShaFacilityStatus = () => {
|
|
94
|
+
const { authenticated } = useSession();
|
|
95
|
+
|
|
96
|
+
const url = `${restBaseUrl}/kenyaemr/sha-facility-status?synchronize=true`;
|
|
97
|
+
|
|
98
|
+
const { data, isLoading, error, mutate } = useSWR<FetchResponse<ShaFacilityStatusResponse>>(
|
|
99
|
+
authenticated ? url : null,
|
|
100
|
+
openmrsFetch,
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const shaFacilityStatus = data?.data;
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
shaFacilityStatus,
|
|
107
|
+
isLoading,
|
|
108
|
+
error,
|
|
109
|
+
mutate,
|
|
110
|
+
};
|
|
111
|
+
};
|
package/src/routes.json
CHANGED
|
@@ -16,23 +16,11 @@
|
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
18
|
"extensions": [
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
"name": "billing-module-nav-group-link",
|
|
22
|
-
"component": "billingModuleNavGroup",
|
|
23
|
-
"meta": {
|
|
24
|
-
"name": "billing",
|
|
25
|
-
"title": "Billing",
|
|
26
|
-
"slot": "billing-dashboard-slot"
|
|
27
|
-
},
|
|
28
|
-
"slot": "homepage-dashboard-slot"
|
|
29
|
-
},
|
|
30
19
|
{
|
|
31
20
|
"component": "billingDashboardLink",
|
|
32
21
|
"name": "billing-dashboard-link",
|
|
33
22
|
"slot": "homepage-dashboard-slot",
|
|
34
23
|
"meta": {
|
|
35
|
-
|
|
36
24
|
"slot": "billing-dashboard-slot"
|
|
37
25
|
}
|
|
38
26
|
},
|
|
@@ -159,53 +147,42 @@
|
|
|
159
147
|
"component": "billingOverviewLink",
|
|
160
148
|
"name": "billing-overview-link",
|
|
161
149
|
"order": 0,
|
|
162
|
-
"slot": "billing-dashboard-
|
|
150
|
+
"slot": "billing-dashboard-group-nav-slot"
|
|
163
151
|
},
|
|
164
152
|
{
|
|
165
153
|
"component": "billDepositDashboardLink",
|
|
166
154
|
"name": "bill-deposit-dashboard-link",
|
|
167
|
-
"
|
|
155
|
+
"slot": "billing-dashboard-group-nav-slot"
|
|
168
156
|
},
|
|
169
157
|
{
|
|
170
158
|
"component": "paymentHistoryLink",
|
|
171
159
|
"name": "payment-history-link",
|
|
172
|
-
"slot": "billing-dashboard-
|
|
160
|
+
"slot": "billing-dashboard-group-nav-slot"
|
|
173
161
|
},
|
|
174
162
|
{
|
|
175
163
|
"component": "paymentPointsLink",
|
|
176
164
|
"name": "payment-points-link",
|
|
177
|
-
"slot": "billing-dashboard-
|
|
165
|
+
"slot": "billing-dashboard-group-nav-slot"
|
|
178
166
|
},
|
|
179
167
|
{
|
|
180
168
|
"component": "paymentModesLink",
|
|
181
169
|
"name": "payment-modes-link",
|
|
182
|
-
"slot": "billing-dashboard-
|
|
170
|
+
"slot": "billing-dashboard-group-nav-slot"
|
|
183
171
|
},
|
|
184
172
|
{
|
|
185
173
|
"component": "billManagerLink",
|
|
186
174
|
"name": "bill-manager-link",
|
|
187
|
-
"slot": "billing-dashboard-
|
|
175
|
+
"slot": "billing-dashboard-group-nav-slot"
|
|
188
176
|
},
|
|
189
177
|
{
|
|
190
178
|
"component": "chargeableItemsLink",
|
|
191
179
|
"name": "chargeable-items-link",
|
|
192
|
-
"slot": "billing-dashboard-
|
|
180
|
+
"slot": "billing-dashboard-group-nav-slot"
|
|
193
181
|
},
|
|
194
182
|
{
|
|
195
183
|
"component": "billableExemptionsLink",
|
|
196
184
|
"name": "billable-exemptions-link",
|
|
197
|
-
"slot": "billing-dashboard-
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
"component": "claimsManagementSideNavGroup",
|
|
201
|
-
"name": "claims-management-dashboard-link",
|
|
202
|
-
"slot": "homepage-dashboard-slot",
|
|
203
|
-
"meta": {
|
|
204
|
-
"name": "claims-management",
|
|
205
|
-
"title": "Claims management Overview",
|
|
206
|
-
"slot": "case-management-slot"
|
|
207
|
-
},
|
|
208
|
-
"featureFlag": "healthInformationExchange"
|
|
185
|
+
"slot": "billing-dashboard-group-nav-slot"
|
|
209
186
|
},
|
|
210
187
|
{
|
|
211
188
|
"component": "claimsManagementOverviewDashboardLink",
|
|
@@ -306,7 +283,7 @@
|
|
|
306
283
|
"type": "other-form"
|
|
307
284
|
},
|
|
308
285
|
{
|
|
309
|
-
"name":"deposit-transaction-workspace",
|
|
286
|
+
"name": "deposit-transaction-workspace",
|
|
310
287
|
"component": "depositTransactionWorkspace",
|
|
311
288
|
"title": "Deposit Transaction",
|
|
312
289
|
"type": "other-form"
|
package/src/types/index.ts
CHANGED
|
@@ -614,3 +614,15 @@ export interface ProgressTracker {
|
|
|
614
614
|
success?: number;
|
|
615
615
|
failed?: number;
|
|
616
616
|
}
|
|
617
|
+
export interface ShaFacilityStatusResponse {
|
|
618
|
+
operationalStatus: string;
|
|
619
|
+
approved: string;
|
|
620
|
+
kephLevel: string;
|
|
621
|
+
shaFacilityId: string;
|
|
622
|
+
shaFacilityExpiryDate: string;
|
|
623
|
+
registrationNumber: string;
|
|
624
|
+
mflCode: string;
|
|
625
|
+
shaFacilityLicenseNumber: string;
|
|
626
|
+
facilityRegistryCode: string;
|
|
627
|
+
source: string;
|
|
628
|
+
}
|
package/translations/en.json
CHANGED
|
@@ -274,6 +274,8 @@
|
|
|
274
274
|
"serviceConcept": "Service Concept",
|
|
275
275
|
"serviceType": "Service Type",
|
|
276
276
|
"shaBenefits": "SHA benefits",
|
|
277
|
+
"shaFacilityRegistrationRequired": "Facility registration number Required",
|
|
278
|
+
"shaFacilityRegistrationRequiredDescription": "Facility registration number is required to process claims. Please update facility registration number details.",
|
|
277
279
|
"shaNo": "SHA NUMBER: ",
|
|
278
280
|
"SHIF": "Social Health Insurance Fund",
|
|
279
281
|
"shortName": "Short Name",
|