@openmrs/esm-billing-app 1.0.2-pre.749 → 1.0.2-pre.753
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/4300.js +1 -1
- package/dist/4739.js +1 -1
- package/dist/4739.js.map +1 -1
- package/dist/942.js +1 -1
- package/dist/942.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-billing-app.js.buildmanifest.json +12 -12
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/bill-item-actions/edit-bill-item.modal.tsx +0 -1
- package/src/bill-item-actions/edit-bill-item.test.tsx +0 -1
- package/src/billable-services/billable-service.resource.ts +13 -6
- package/src/billable-services/billable-services.component.tsx +47 -33
- package/src/billable-services/cash-point/cash-point-configuration.component.tsx +2 -1
- package/src/billable-services/create-edit/add-billable-service.component.tsx +336 -293
- package/src/billable-services/create-edit/add-billable-service.scss +3 -1
- package/src/billable-services/create-edit/add-billable-service.test.tsx +36 -35
- package/src/billable-services/create-edit/edit-billable-service.modal.tsx +6 -5
- package/src/billable-services/payment-modes/payment-modes-config.component.tsx +44 -44
- package/src/billable-services/payment-modes/payment-modes-config.scss +0 -3
- package/src/billing-form/billing-checkin-form.test.tsx +97 -22
- package/src/billing-form/billing-form.component.tsx +7 -4
- package/src/invoice/payments/payments.component.tsx +0 -1
- package/src/modal/require-payment-modal.test.tsx +2 -2
- package/src/types/index.ts +14 -6
- package/translations/en.json +15 -2
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
"initial": false,
|
|
72
72
|
"entry": false,
|
|
73
73
|
"recorded": false,
|
|
74
|
-
"size":
|
|
74
|
+
"size": 1169019,
|
|
75
75
|
"sizes": {
|
|
76
|
-
"javascript":
|
|
76
|
+
"javascript": 1168977,
|
|
77
77
|
"consume-shared": 42
|
|
78
78
|
},
|
|
79
79
|
"names": [],
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"auxiliaryFiles": [
|
|
88
88
|
"942.js.map"
|
|
89
89
|
],
|
|
90
|
-
"hash": "
|
|
90
|
+
"hash": "07d8b49d56e0d2ac",
|
|
91
91
|
"childrenByOrder": {}
|
|
92
92
|
},
|
|
93
93
|
{
|
|
@@ -544,9 +544,9 @@
|
|
|
544
544
|
"initial": false,
|
|
545
545
|
"entry": false,
|
|
546
546
|
"recorded": false,
|
|
547
|
-
"size":
|
|
547
|
+
"size": 7784,
|
|
548
548
|
"sizes": {
|
|
549
|
-
"javascript":
|
|
549
|
+
"javascript": 7784
|
|
550
550
|
},
|
|
551
551
|
"names": [],
|
|
552
552
|
"idHints": [],
|
|
@@ -558,7 +558,7 @@
|
|
|
558
558
|
"4300.js"
|
|
559
559
|
],
|
|
560
560
|
"auxiliaryFiles": [],
|
|
561
|
-
"hash": "
|
|
561
|
+
"hash": "0a3134f69ef42cdf",
|
|
562
562
|
"childrenByOrder": {}
|
|
563
563
|
},
|
|
564
564
|
{
|
|
@@ -659,9 +659,9 @@
|
|
|
659
659
|
"initial": false,
|
|
660
660
|
"entry": false,
|
|
661
661
|
"recorded": false,
|
|
662
|
-
"size":
|
|
662
|
+
"size": 37992,
|
|
663
663
|
"sizes": {
|
|
664
|
-
"javascript":
|
|
664
|
+
"javascript": 37992
|
|
665
665
|
},
|
|
666
666
|
"names": [],
|
|
667
667
|
"idHints": [],
|
|
@@ -675,7 +675,7 @@
|
|
|
675
675
|
"auxiliaryFiles": [
|
|
676
676
|
"4739.js.map"
|
|
677
677
|
],
|
|
678
|
-
"hash": "
|
|
678
|
+
"hash": "9eaad0c36391ca90",
|
|
679
679
|
"childrenByOrder": {}
|
|
680
680
|
},
|
|
681
681
|
{
|
|
@@ -1209,10 +1209,10 @@
|
|
|
1209
1209
|
"initial": true,
|
|
1210
1210
|
"entry": true,
|
|
1211
1211
|
"recorded": false,
|
|
1212
|
-
"size":
|
|
1212
|
+
"size": 5466849,
|
|
1213
1213
|
"sizes": {
|
|
1214
1214
|
"consume-shared": 210,
|
|
1215
|
-
"javascript":
|
|
1215
|
+
"javascript": 5444194,
|
|
1216
1216
|
"share-init": 336,
|
|
1217
1217
|
"runtime": 22109
|
|
1218
1218
|
},
|
|
@@ -1229,7 +1229,7 @@
|
|
|
1229
1229
|
"auxiliaryFiles": [
|
|
1230
1230
|
"main.js.map"
|
|
1231
1231
|
],
|
|
1232
|
-
"hash": "
|
|
1232
|
+
"hash": "20bbef786291d470",
|
|
1233
1233
|
"childrenByOrder": {}
|
|
1234
1234
|
},
|
|
1235
1235
|
{
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.24.0","fhir2":">=1.2"},"pages":[{"component":"billableServicesHome","route":"billable-services"}],"extensions":[{"component":"billingDashboardLink","name":"billing-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"billing","title":"billing","slot":"billing-dashboard-slot"},"featureFlag":"billing"},{"component":"root","name":"billing-dashboard-root","slot":"billing-dashboard-slot"},{"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 history"},"featureFlag":"billing"},{"name":"billable-services-app-menu-item","component":"billableServicesAppMenuItem","slot":"app-menu-item-slot","meta":{"name":"Billable Services"}},{"name":"billing-checkin-form","slot":"extra-visit-attribute-slot","component":"billingCheckInForm","featureFlag":"billing"},{"slot":"system-admin-page-card-link-slot","component":"billableServicesCardLink","name":"billable-services-admin-card-link"},{"name":"patient-banner-billing-tags","component":"visitAttributeTags","slot":"patient-banner-tags-slot","order":2},{"name":"billing-home-tiles-ext","slot":"billing-home-tiles-slot","component":"serviceMetrics"},{"name":"edit-bill-line-item-dialog","component":"editBillLineItemModal","online":true,"offline":true}],"modals":[{"name":"add-cash-point-modal","component":"addCashPointModal"},{"name":"add-payment-mode-modal","component":"addPaymentModeModal"},{"name":"delete-payment-mode-modal","component":"deletePaymentModeModal"},{"name":"edit-bill-item-modal","component":"editBillLineItemModal"},{"name":"edit-billable-service-modal","component":"editBillableServiceModal"},{"name":"require-billing-modal","component":"requirePaymentModal"}],"workspaces":[{"name":"billing-form-workspace","title":"billingForm","component":"billingFormWorkspace","type":"form"}],"featureFlags":[{"flagName":"billing","label":"Billing module","description":"This feature introduces navigation links on the patient chart and home page to allow accessing the billing module features"}],"version":"1.0.2-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.24.0","fhir2":">=1.2"},"pages":[{"component":"billableServicesHome","route":"billable-services"}],"extensions":[{"component":"billingDashboardLink","name":"billing-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"billing","title":"billing","slot":"billing-dashboard-slot"},"featureFlag":"billing"},{"component":"root","name":"billing-dashboard-root","slot":"billing-dashboard-slot"},{"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 history"},"featureFlag":"billing"},{"name":"billable-services-app-menu-item","component":"billableServicesAppMenuItem","slot":"app-menu-item-slot","meta":{"name":"Billable Services"}},{"name":"billing-checkin-form","slot":"extra-visit-attribute-slot","component":"billingCheckInForm","featureFlag":"billing"},{"slot":"system-admin-page-card-link-slot","component":"billableServicesCardLink","name":"billable-services-admin-card-link"},{"name":"patient-banner-billing-tags","component":"visitAttributeTags","slot":"patient-banner-tags-slot","order":2},{"name":"billing-home-tiles-ext","slot":"billing-home-tiles-slot","component":"serviceMetrics"},{"name":"edit-bill-line-item-dialog","component":"editBillLineItemModal","online":true,"offline":true}],"modals":[{"name":"add-cash-point-modal","component":"addCashPointModal"},{"name":"add-payment-mode-modal","component":"addPaymentModeModal"},{"name":"delete-payment-mode-modal","component":"deletePaymentModeModal"},{"name":"edit-bill-item-modal","component":"editBillLineItemModal"},{"name":"edit-billable-service-modal","component":"editBillableServiceModal"},{"name":"require-billing-modal","component":"requirePaymentModal"}],"workspaces":[{"name":"billing-form-workspace","title":"billingForm","component":"billingFormWorkspace","type":"form"}],"featureFlags":[{"flagName":"billing","label":"Billing module","description":"This feature introduces navigation links on the patient chart and home page to allow accessing the billing module features"}],"version":"1.0.2-pre.753"}
|
package/package.json
CHANGED
|
@@ -110,7 +110,6 @@ const EditBillLineItemModal: React.FC<EditBillLineItemModalProps> = ({ bill, clo
|
|
|
110
110
|
title: t('saveBill', 'Save Bill'),
|
|
111
111
|
subtitle: t('billProcessingSuccess', 'Bill processing has been successful'),
|
|
112
112
|
kind: 'success',
|
|
113
|
-
timeoutInMs: 3000,
|
|
114
113
|
});
|
|
115
114
|
closeModal();
|
|
116
115
|
} catch (error) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import useSWR from 'swr';
|
|
2
2
|
import { type OpenmrsResource, openmrsFetch, restBaseUrl, useOpenmrsFetchAll, useConfig } from '@openmrs/esm-framework';
|
|
3
|
-
import { type ServiceConcept } from '../types';
|
|
4
3
|
import { apiBasePath } from '../constants';
|
|
5
|
-
import { type BillableService } from '../types
|
|
4
|
+
import { type BillableService, type ServiceConcept } from '../types';
|
|
6
5
|
import type { BillingConfig } from '../config-schema';
|
|
7
6
|
|
|
8
7
|
type ResponseObject = {
|
|
@@ -29,10 +28,14 @@ export function useServiceTypes() {
|
|
|
29
28
|
|
|
30
29
|
const { data, error, isLoading } = useSWR<{ data }>(url, openmrsFetch);
|
|
31
30
|
|
|
31
|
+
const sortedServiceTypes = data?.data.setMembers
|
|
32
|
+
? [...data.data.setMembers].sort((a, b) => a.display.localeCompare(b.display))
|
|
33
|
+
: [];
|
|
34
|
+
|
|
32
35
|
return {
|
|
33
|
-
serviceTypes:
|
|
36
|
+
serviceTypes: sortedServiceTypes,
|
|
34
37
|
error,
|
|
35
|
-
isLoading,
|
|
38
|
+
isLoadingServiceTypes: isLoading,
|
|
36
39
|
};
|
|
37
40
|
}
|
|
38
41
|
|
|
@@ -41,10 +44,14 @@ export const usePaymentModes = () => {
|
|
|
41
44
|
|
|
42
45
|
const { data, error, isLoading } = useSWR<{ data: ResponseObject }>(url, openmrsFetch);
|
|
43
46
|
|
|
47
|
+
const sortedPaymentModes = data?.data.results
|
|
48
|
+
? [...data.data.results].sort((a, b) => a.name.localeCompare(b.name))
|
|
49
|
+
: [];
|
|
50
|
+
|
|
44
51
|
return {
|
|
45
|
-
paymentModes:
|
|
52
|
+
paymentModes: sortedPaymentModes,
|
|
46
53
|
error,
|
|
47
|
-
isLoading,
|
|
54
|
+
isLoadingPaymentModes: isLoading,
|
|
48
55
|
};
|
|
49
56
|
};
|
|
50
57
|
|
|
@@ -21,14 +21,15 @@ import {
|
|
|
21
21
|
} from '@carbon/react';
|
|
22
22
|
import { ArrowRight } from '@carbon/react/icons';
|
|
23
23
|
import {
|
|
24
|
-
useLayoutType,
|
|
25
|
-
isDesktop,
|
|
26
|
-
useConfig,
|
|
27
|
-
usePagination,
|
|
28
24
|
ErrorState,
|
|
25
|
+
getCoreTranslation,
|
|
26
|
+
isDesktop,
|
|
29
27
|
navigate,
|
|
30
28
|
showModal,
|
|
31
|
-
|
|
29
|
+
useConfig,
|
|
30
|
+
useLayoutType,
|
|
31
|
+
usePagination,
|
|
32
|
+
type LayoutType,
|
|
32
33
|
} from '@openmrs/esm-framework';
|
|
33
34
|
import { EmptyState } from '@openmrs/esm-patient-common-lib';
|
|
34
35
|
import { type BillableService } from '../types/index';
|
|
@@ -36,6 +37,14 @@ import { useBillableServices } from './billable-service.resource';
|
|
|
36
37
|
import type { BillingConfig } from '../config-schema';
|
|
37
38
|
import styles from './billable-services.scss';
|
|
38
39
|
|
|
40
|
+
interface FilterableTableHeaderProps {
|
|
41
|
+
layout: LayoutType;
|
|
42
|
+
handleSearch: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
43
|
+
isValidating: boolean;
|
|
44
|
+
responsiveSize: 'sm' | 'md' | 'lg';
|
|
45
|
+
t: (key: string, fallback: string) => string;
|
|
46
|
+
}
|
|
47
|
+
|
|
39
48
|
const BillableServices = () => {
|
|
40
49
|
const { t } = useTranslation();
|
|
41
50
|
const { billableServices, isLoading, isValidating, error, mutate } = useBillableServices();
|
|
@@ -67,10 +76,6 @@ const BillableServices = () => {
|
|
|
67
76
|
header: t('prices', 'Prices'),
|
|
68
77
|
key: 'prices',
|
|
69
78
|
},
|
|
70
|
-
{
|
|
71
|
-
header: getCoreTranslation('actions'),
|
|
72
|
-
key: 'actions',
|
|
73
|
-
},
|
|
74
79
|
];
|
|
75
80
|
|
|
76
81
|
const launchBillableServiceForm = useCallback(() => {
|
|
@@ -81,8 +86,9 @@ const BillableServices = () => {
|
|
|
81
86
|
const flatBillableServices = Array.isArray(billableServices) ? billableServices.flat() : billableServices;
|
|
82
87
|
|
|
83
88
|
if (flatBillableServices !== undefined && flatBillableServices.length > 0) {
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
const trimmedSearch = searchString.trim();
|
|
90
|
+
if (trimmedSearch) {
|
|
91
|
+
const search = trimmedSearch.toLowerCase();
|
|
86
92
|
return flatBillableServices.filter((service: BillableService) =>
|
|
87
93
|
Object.entries(service).some(([header, value]) => {
|
|
88
94
|
return header === 'uuid' ? false : `${value}`.toLowerCase().includes(search);
|
|
@@ -97,21 +103,16 @@ const BillableServices = () => {
|
|
|
97
103
|
const rowData = [];
|
|
98
104
|
|
|
99
105
|
if (results) {
|
|
100
|
-
results.forEach((service
|
|
106
|
+
results.forEach((service) => {
|
|
101
107
|
const s = {
|
|
102
|
-
id:
|
|
108
|
+
id: service.uuid,
|
|
103
109
|
uuid: service.uuid,
|
|
104
110
|
serviceName: service.name,
|
|
105
111
|
shortName: service.shortName,
|
|
106
112
|
serviceType: service?.serviceType?.display,
|
|
107
113
|
status: service.serviceStatus,
|
|
108
|
-
prices: '--',
|
|
114
|
+
prices: service.servicePrices.map((price) => `${price.name} (${price.price})`).join(', ') || '--',
|
|
109
115
|
};
|
|
110
|
-
let cost = '';
|
|
111
|
-
service.servicePrices.forEach((price) => {
|
|
112
|
-
cost += `${price.name} (${price.price}) `;
|
|
113
|
-
});
|
|
114
|
-
s.prices = cost;
|
|
115
116
|
rowData.push(s);
|
|
116
117
|
});
|
|
117
118
|
}
|
|
@@ -123,29 +124,33 @@ const BillableServices = () => {
|
|
|
123
124
|
},
|
|
124
125
|
[goTo, setSearchString],
|
|
125
126
|
);
|
|
127
|
+
|
|
126
128
|
const handleEditService = useCallback(
|
|
127
|
-
(service) => {
|
|
128
|
-
showModal('edit-billable-service-modal', {
|
|
129
|
-
|
|
129
|
+
(service: BillableService) => {
|
|
130
|
+
const dispose = showModal('edit-billable-service-modal', {
|
|
131
|
+
serviceToEdit: service,
|
|
130
132
|
onServiceUpdated: mutate,
|
|
133
|
+
closeModal: () => dispose(),
|
|
131
134
|
});
|
|
132
135
|
},
|
|
133
136
|
[mutate],
|
|
134
137
|
);
|
|
135
138
|
|
|
136
139
|
if (isLoading) {
|
|
137
|
-
return
|
|
140
|
+
return (
|
|
141
|
+
<InlineLoading status="active" iconDescription={getCoreTranslation('loading')} description="Loading data..." />
|
|
142
|
+
);
|
|
138
143
|
}
|
|
139
144
|
|
|
140
145
|
if (error) {
|
|
141
|
-
return <ErrorState headerTitle={t('billableService', 'Billable
|
|
146
|
+
return <ErrorState headerTitle={t('billableService', 'Billable service')} error={error} />;
|
|
142
147
|
}
|
|
143
148
|
|
|
144
149
|
if (billableServices.length === 0) {
|
|
145
150
|
return (
|
|
146
151
|
<EmptyState
|
|
147
152
|
displayText={t('billableServices__lower', 'billable services')}
|
|
148
|
-
headerTitle={t('billableService', 'Billable
|
|
153
|
+
headerTitle={t('billableService', 'Billable service')}
|
|
149
154
|
launchForm={launchBillableServiceForm}
|
|
150
155
|
/>
|
|
151
156
|
);
|
|
@@ -164,16 +169,24 @@ const BillableServices = () => {
|
|
|
164
169
|
isSortable
|
|
165
170
|
rows={rowData}
|
|
166
171
|
headers={headerData}
|
|
172
|
+
overflowMenuOnHover={isDesktop(layout)}
|
|
167
173
|
size={responsiveSize}
|
|
168
|
-
useZebraStyles={rowData?.length > 1
|
|
169
|
-
{({ rows, headers, getRowProps, getTableProps }) => (
|
|
174
|
+
useZebraStyles={rowData?.length > 1}>
|
|
175
|
+
{({ rows, headers, getHeaderProps, getRowProps, getTableProps }) => (
|
|
170
176
|
<TableContainer>
|
|
171
177
|
<Table {...getTableProps()} aria-label="service list">
|
|
172
178
|
<TableHead>
|
|
173
179
|
<TableRow>
|
|
174
180
|
{headers.map((header) => (
|
|
175
|
-
<TableHeader
|
|
181
|
+
<TableHeader
|
|
182
|
+
{...getHeaderProps({
|
|
183
|
+
header,
|
|
184
|
+
})}
|
|
185
|
+
key={header.key}>
|
|
186
|
+
{header.header}
|
|
187
|
+
</TableHeader>
|
|
176
188
|
))}
|
|
189
|
+
<TableHeader aria-label={getCoreTranslation('actions')} />
|
|
177
190
|
</TableRow>
|
|
178
191
|
</TableHead>
|
|
179
192
|
<TableBody>
|
|
@@ -187,10 +200,10 @@ const BillableServices = () => {
|
|
|
187
200
|
<TableCell key={cell.id}>{cell.value}</TableCell>
|
|
188
201
|
))}
|
|
189
202
|
<TableCell className="cds--table-column-menu">
|
|
190
|
-
<OverflowMenu size="
|
|
203
|
+
<OverflowMenu size="lg" flipped>
|
|
191
204
|
<OverflowMenuItem
|
|
192
205
|
className={styles.menuItem}
|
|
193
|
-
itemText={t('editBillableService', 'Edit
|
|
206
|
+
itemText={t('editBillableService', 'Edit billable service')}
|
|
194
207
|
onClick={() => handleEditService(results.find((service) => service.uuid === row.id))}
|
|
195
208
|
/>
|
|
196
209
|
</OverflowMenu>
|
|
@@ -216,8 +229,8 @@ const BillableServices = () => {
|
|
|
216
229
|
)}
|
|
217
230
|
{paginated && (
|
|
218
231
|
<Pagination
|
|
219
|
-
forwardText=
|
|
220
|
-
backwardText=
|
|
232
|
+
forwardText={t('nextPage', 'Next page')}
|
|
233
|
+
backwardText={t('previousPage', 'Previous page')}
|
|
221
234
|
page={currentPage}
|
|
222
235
|
pageSize={pageSize}
|
|
223
236
|
pageSizes={pageSizes}
|
|
@@ -238,7 +251,7 @@ const BillableServices = () => {
|
|
|
238
251
|
);
|
|
239
252
|
};
|
|
240
253
|
|
|
241
|
-
function FilterableTableHeader({ layout, handleSearch, isValidating, responsiveSize, t }) {
|
|
254
|
+
function FilterableTableHeader({ layout, handleSearch, isValidating, responsiveSize, t }: FilterableTableHeaderProps) {
|
|
242
255
|
return (
|
|
243
256
|
<>
|
|
244
257
|
<div className={styles.headerContainer}>
|
|
@@ -274,4 +287,5 @@ function FilterableTableHeader({ layout, handleSearch, isValidating, responsiveS
|
|
|
274
287
|
</>
|
|
275
288
|
);
|
|
276
289
|
}
|
|
290
|
+
|
|
277
291
|
export default BillableServices;
|
|
@@ -39,8 +39,9 @@ const CashPointConfiguration: React.FC = () => {
|
|
|
39
39
|
}, [fetchCashPoints]);
|
|
40
40
|
|
|
41
41
|
const handleAddCashPoint = () => {
|
|
42
|
-
showModal('add-cash-point-modal', {
|
|
42
|
+
const dispose = showModal('add-cash-point-modal', {
|
|
43
43
|
onCashPointAdded: fetchCashPoints,
|
|
44
|
+
closeModal: () => dispose(),
|
|
44
45
|
});
|
|
45
46
|
};
|
|
46
47
|
|