@openmrs/esm-billing-app 1.0.2-pre.112 → 1.0.2-pre.1124
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/.eslintrc +16 -2
- package/README.md +54 -9
- package/__mocks__/bills.mock.ts +12 -0
- package/__mocks__/react-i18next.js +6 -5
- package/dist/1119.js +1 -1
- package/dist/1146.js +1 -2
- package/dist/1146.js.map +1 -1
- package/dist/1197.js +1 -1
- package/dist/1537.js +1 -0
- package/dist/1537.js.map +1 -0
- package/dist/1856.js +1 -0
- package/dist/1856.js.map +1 -0
- package/dist/2146.js +1 -1
- package/dist/2177.js +1 -1
- package/dist/2177.js.map +1 -1
- package/dist/2524.js +1 -0
- package/dist/2524.js.map +1 -0
- package/dist/2690.js +1 -1
- package/dist/3099.js +1 -1
- package/dist/3584.js +1 -1
- package/dist/3717.js +2 -0
- package/dist/3717.js.map +1 -0
- package/dist/4055.js +1 -1
- package/dist/4132.js +1 -1
- package/dist/4300.js +1 -1
- package/dist/4335.js +1 -1
- package/dist/439.js +1 -0
- package/dist/4618.js +1 -1
- package/dist/4652.js +1 -1
- package/dist/4724.js +1 -0
- package/dist/4724.js.map +1 -0
- package/dist/4739.js +1 -1
- package/dist/4739.js.map +1 -1
- package/dist/4944.js +1 -1
- package/dist/5173.js +1 -1
- package/dist/5241.js +1 -1
- package/dist/5442.js +1 -1
- package/dist/5661.js +1 -1
- package/dist/6022.js +1 -1
- package/dist/6468.js +1 -1
- package/dist/6540.js +1 -1
- package/dist/6540.js.map +1 -1
- package/dist/6589.js +1 -0
- package/dist/6679.js +1 -1
- package/dist/6840.js +1 -1
- package/dist/6859.js +1 -1
- package/dist/7097.js +1 -1
- package/dist/7159.js +1 -1
- package/dist/723.js +1 -1
- package/dist/7255.js +1 -1
- package/dist/7255.js.map +1 -1
- package/dist/7617.js +1 -1
- package/dist/795.js +1 -1
- package/dist/8163.js +1 -1
- package/dist/8349.js +1 -1
- package/dist/8371.js +1 -0
- package/dist/8572.js +1 -0
- package/dist/8572.js.map +1 -0
- package/dist/8618.js +1 -1
- package/dist/8708.js +2 -0
- package/dist/{6557.js.LICENSE.txt → 8708.js.LICENSE.txt} +22 -0
- package/dist/8708.js.map +1 -0
- package/dist/890.js +1 -1
- package/dist/9214.js +1 -1
- package/dist/9538.js +1 -1
- package/dist/9569.js +1 -1
- package/dist/961.js +1 -1
- package/dist/961.js.map +1 -1
- package/dist/986.js +1 -1
- package/dist/9879.js +1 -1
- package/dist/9895.js +1 -1
- package/dist/9900.js +1 -1
- package/dist/9913.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-billing-app.js +1 -1
- package/dist/openmrs-esm-billing-app.js.buildmanifest.json +321 -249
- package/dist/openmrs-esm-billing-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/e2e/README.md +19 -18
- package/e2e/commands/billing-operations.ts +96 -0
- package/e2e/commands/index.ts +3 -0
- package/e2e/commands/patient-operations.ts +82 -0
- package/e2e/commands/types.ts +73 -0
- package/e2e/core/test.ts +12 -1
- package/e2e/fixtures/api.ts +2 -3
- package/e2e/pages/billing-dashboard-page.ts +84 -0
- package/e2e/pages/billing-form-page.ts +114 -0
- package/e2e/pages/index.ts +4 -1
- package/e2e/pages/invoice-page.ts +113 -0
- package/e2e/pages/payment-page.ts +104 -0
- package/e2e/specs/billing-dashboard.spec.ts +203 -0
- package/e2e/specs/billing-patient-chart.spec.ts +738 -0
- package/e2e/support/github/Dockerfile +1 -1
- package/e2e/support/github/run-e2e-docker-env.sh +29 -32
- package/example.env +15 -1
- package/package.json +19 -16
- package/playwright.config.ts +4 -2
- package/src/bill-history/bill-history.component.tsx +15 -17
- package/src/bill-history/bill-history.scss +4 -94
- package/src/bill-history/bill-history.test.tsx +37 -77
- package/src/bill-item-actions/bill-item-actions.scss +21 -5
- package/src/bill-item-actions/edit-bill-item.modal.tsx +227 -0
- package/src/bill-item-actions/edit-bill-item.test.tsx +233 -40
- package/src/billable-services/bill-waiver/bill-selection.component.tsx +5 -5
- package/src/billable-services/bill-waiver/bill-waiver-form.component.tsx +37 -39
- package/src/billable-services/bill-waiver/patient-bills.component.tsx +7 -7
- package/src/billable-services/bill-waiver/utils.ts +13 -3
- package/src/billable-services/{create-edit/add-billable-service.scss → billable-service-form/billable-service-form.scss} +32 -64
- package/src/billable-services/billable-service-form/billable-service-form.test.tsx +1099 -0
- package/src/billable-services/billable-service-form/billable-service-form.workspace.tsx +516 -0
- package/src/billable-services/billable-service.resource.ts +71 -27
- package/src/billable-services/billable-services-home.component.tsx +13 -42
- package/src/billable-services/billable-services-left-panel-link.component.tsx +50 -0
- package/src/billable-services/billable-services-left-panel-menu.component.tsx +48 -0
- package/src/billable-services/billable-services-menu-item/item.component.tsx +5 -4
- package/src/billable-services/billable-services.component.tsx +156 -152
- package/src/billable-services/billable-services.scss +29 -0
- package/src/billable-services/billable-services.test.tsx +6 -49
- package/src/billable-services/cash-point/add-cash-point.modal.tsx +170 -0
- package/src/billable-services/cash-point/cash-point-configuration.component.tsx +19 -193
- package/src/billable-services/cash-point/cash-point-configuration.scss +1 -5
- package/src/billable-services/dashboard/dashboard.component.tsx +0 -2
- package/src/billable-services/payment-modes/delete-payment-mode.modal.tsx +77 -0
- package/src/billable-services/payment-modes/payment-mode-form.modal.tsx +131 -0
- package/src/billable-services/payment-modes/payment-modes-config.component.tsx +139 -0
- package/src/billable-services/{payyment-modes → payment-modes}/payment-modes-config.scss +5 -4
- package/src/billable-services-admin-card-link.component.test.tsx +2 -2
- package/src/billable-services-admin-card-link.component.tsx +1 -1
- package/src/billing-dashboard/billing-dashboard.scss +1 -1
- package/src/billing-form/billing-checkin-form.component.tsx +29 -29
- package/src/billing-form/billing-checkin-form.scss +0 -7
- package/src/billing-form/billing-checkin-form.test.tsx +100 -27
- package/src/billing-form/billing-form.component.tsx +226 -284
- package/src/billing-form/billing-form.scss +143 -0
- package/src/billing-form/visit-attributes/visit-attributes-form.component.tsx +47 -41
- package/src/billing-form/visit-attributes/visit-attributes-form.scss +16 -3
- package/src/billing.resource.test.ts +503 -0
- package/src/billing.resource.ts +68 -76
- package/src/bills-table/bills-table.component.tsx +17 -24
- package/src/bills-table/bills-table.test.tsx +98 -54
- package/src/config-schema.ts +84 -31
- package/src/dashboard.meta.ts +5 -3
- package/src/helpers/functions.ts +5 -4
- package/src/index.ts +75 -13
- package/src/invoice/invoice-table.component.tsx +36 -70
- package/src/invoice/invoice-table.scss +8 -5
- package/src/invoice/invoice-table.test.tsx +273 -62
- package/src/invoice/invoice.component.tsx +44 -38
- package/src/invoice/invoice.scss +11 -4
- package/src/invoice/invoice.test.tsx +324 -120
- package/src/invoice/payments/invoice-breakdown/invoice-breakdown.scss +9 -9
- package/src/invoice/payments/payment-form/payment-form.component.tsx +45 -36
- package/src/invoice/payments/payment-form/payment-form.scss +5 -6
- package/src/invoice/payments/payment-form/payment-form.test.tsx +217 -67
- package/src/invoice/payments/payment-history/payment-history.component.tsx +6 -4
- package/src/invoice/payments/payment-history/payment-history.test.tsx +9 -14
- package/src/invoice/payments/payments.component.tsx +56 -68
- package/src/invoice/payments/payments.scss +4 -3
- package/src/invoice/payments/payments.test.tsx +282 -0
- package/src/invoice/payments/utils.ts +15 -27
- package/src/invoice/printable-invoice/print-receipt.component.tsx +3 -3
- package/src/invoice/printable-invoice/print-receipt.test.tsx +14 -25
- package/src/invoice/printable-invoice/printable-footer.component.tsx +2 -2
- package/src/invoice/printable-invoice/printable-footer.test.tsx +4 -13
- package/src/invoice/printable-invoice/printable-invoice-header.component.tsx +20 -11
- package/src/invoice/printable-invoice/printable-invoice-header.test.tsx +95 -16
- package/src/invoice/printable-invoice/printable-invoice.component.tsx +21 -35
- package/src/left-panel-link.component.tsx +9 -8
- package/src/left-panel-link.test.tsx +1 -4
- package/src/metrics-cards/metrics-cards.component.tsx +16 -6
- package/src/metrics-cards/metrics-cards.scss +4 -0
- package/src/metrics-cards/metrics-cards.test.tsx +18 -5
- package/src/modal/require-payment-modal.test.tsx +27 -22
- package/src/modal/{require-payment-modal.component.tsx → require-payment.modal.tsx} +18 -19
- package/src/routes.json +44 -20
- package/src/types/index.ts +87 -24
- package/translations/am.json +140 -80
- package/translations/ar.json +141 -81
- package/translations/ar_SY.json +141 -81
- package/translations/bn.json +143 -83
- package/translations/cs.json +230 -0
- package/translations/de.json +141 -81
- package/translations/en.json +142 -81
- package/translations/en_US.json +141 -81
- package/translations/es.json +140 -80
- package/translations/es_MX.json +141 -81
- package/translations/fr.json +224 -164
- package/translations/he.json +140 -80
- package/translations/hi.json +141 -81
- package/translations/hi_IN.json +141 -81
- package/translations/id.json +141 -81
- package/translations/it.json +166 -106
- package/translations/ka.json +141 -81
- package/translations/km.json +140 -80
- package/translations/ku.json +141 -81
- package/translations/ky.json +141 -81
- package/translations/lg.json +141 -81
- package/translations/ne.json +141 -81
- package/translations/pl.json +141 -81
- package/translations/pt.json +141 -81
- package/translations/pt_BR.json +141 -81
- package/translations/qu.json +141 -81
- package/translations/ro_RO.json +225 -165
- package/translations/ru_RU.json +141 -81
- package/translations/si.json +141 -81
- package/translations/sq.json +230 -0
- package/translations/sw.json +141 -81
- package/translations/sw_KE.json +141 -81
- package/translations/tr.json +141 -81
- package/translations/tr_TR.json +141 -81
- package/translations/uk.json +141 -81
- package/translations/uz.json +141 -81
- package/translations/uz@Latn.json +141 -81
- package/translations/uz_UZ.json +141 -81
- package/translations/vi.json +141 -81
- package/translations/zh.json +141 -81
- package/translations/zh_CN.json +171 -111
- package/translations/zh_TW.json +230 -0
- package/dist/1146.js.LICENSE.txt +0 -21
- package/dist/2352.js +0 -1
- package/dist/2352.js.map +0 -1
- package/dist/246.js +0 -1
- package/dist/246.js.map +0 -1
- package/dist/4689.js +0 -2
- package/dist/4689.js.map +0 -1
- package/dist/6557.js +0 -2
- package/dist/6557.js.map +0 -1
- package/dist/8638.js +0 -1
- package/dist/8638.js.map +0 -1
- package/dist/9968.js +0 -1
- package/dist/9968.js.map +0 -1
- package/e2e/pages/home-page.ts +0 -9
- package/e2e/specs/sample-test.spec.ts +0 -11
- package/src/bill-item-actions/edit-bill-item.component.tsx +0 -221
- package/src/billable-services/create-edit/add-billable-service.component.tsx +0 -401
- package/src/billable-services/create-edit/add-billable-service.test.tsx +0 -154
- package/src/billable-services/dashboard/service-metrics.component.tsx +0 -41
- package/src/billable-services/payyment-modes/payment-modes-config.component.tsx +0 -280
- package/src/invoice/payments/payments.component.test.tsx +0 -121
- /package/dist/{4689.js.LICENSE.txt → 3717.js.LICENSE.txt} +0 -0
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
|
|
74
74
|
.grid {
|
|
75
75
|
margin: layout.$spacing-05;
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
gap: layout.$spacing-05;
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
.row {
|
|
@@ -85,3 +88,143 @@
|
|
|
85
88
|
.spacer {
|
|
86
89
|
margin-top: layout.$spacing-05;
|
|
87
90
|
}
|
|
91
|
+
|
|
92
|
+
.selectedItemsContainer {
|
|
93
|
+
margin-top: layout.$spacing-05;
|
|
94
|
+
|
|
95
|
+
h4 {
|
|
96
|
+
margin-bottom: layout.$spacing-05;
|
|
97
|
+
color: $text-02;
|
|
98
|
+
font-size: 1rem;
|
|
99
|
+
font-weight: 600;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.itemCard {
|
|
103
|
+
border: 1px solid $ui-03;
|
|
104
|
+
border-radius: layout.$spacing-02;
|
|
105
|
+
padding: layout.$spacing-05;
|
|
106
|
+
margin-bottom: layout.$spacing-05;
|
|
107
|
+
background-color: $ui-01;
|
|
108
|
+
|
|
109
|
+
.itemHeader {
|
|
110
|
+
display: flex;
|
|
111
|
+
justify-content: space-between;
|
|
112
|
+
align-items: center;
|
|
113
|
+
margin-bottom: layout.$spacing-05;
|
|
114
|
+
|
|
115
|
+
.itemName {
|
|
116
|
+
font-weight: 600;
|
|
117
|
+
font-size: 1rem;
|
|
118
|
+
color: $text-02;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.itemControls {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-wrap: wrap;
|
|
125
|
+
gap: layout.$spacing-05;
|
|
126
|
+
margin-top: layout.$spacing-03;
|
|
127
|
+
align-items: flex-end; .controlSection {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
min-width: 0;
|
|
131
|
+
|
|
132
|
+
&:first-child {
|
|
133
|
+
flex: 1 1 auto;
|
|
134
|
+
min-width: 250px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&:nth-child(2) {
|
|
138
|
+
flex: 0 0 140px;
|
|
139
|
+
width: 140px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&:last-child {
|
|
143
|
+
flex: 0 0 180px;
|
|
144
|
+
width: 180px;
|
|
145
|
+
margin-left: auto;
|
|
146
|
+
text-align: right;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
label {
|
|
150
|
+
font-size: 0.875rem;
|
|
151
|
+
font-weight: 500;
|
|
152
|
+
margin-bottom: layout.$spacing-03;
|
|
153
|
+
color: $text-02;
|
|
154
|
+
white-space: nowrap;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
text-overflow: ellipsis;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:global(.cds--list-box),
|
|
160
|
+
:global(.cds--number),
|
|
161
|
+
:global(.cds--combo-box),
|
|
162
|
+
:global(.cds--list-box__wrapper),
|
|
163
|
+
:global(.cds--list-box__field) {
|
|
164
|
+
width: 100% !important;
|
|
165
|
+
max-width: 100% !important;
|
|
166
|
+
min-width: 0 !important;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.priceDisplay,
|
|
170
|
+
.totalDisplay {
|
|
171
|
+
font-size: 0.875rem;
|
|
172
|
+
font-size: 0.875rem;
|
|
173
|
+
font-weight: 600;
|
|
174
|
+
color: $text-02;
|
|
175
|
+
padding: layout.$spacing-03 0;
|
|
176
|
+
word-break: break-word;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.grandTotal {
|
|
183
|
+
text-align: right;
|
|
184
|
+
padding: layout.$spacing-05;
|
|
185
|
+
border-top: 2px solid $interactive-01;
|
|
186
|
+
margin-top: layout.$spacing-05;
|
|
187
|
+
background-color: $ui-01;
|
|
188
|
+
font-size: 1.125rem;
|
|
189
|
+
font-weight: 600;
|
|
190
|
+
color: $text-02;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@media (max-width: 1056px) {
|
|
195
|
+
.selectedItemsContainer {
|
|
196
|
+
.itemCard {
|
|
197
|
+
.itemControls {
|
|
198
|
+
.controlSection {
|
|
199
|
+
&:nth-child(2) {
|
|
200
|
+
flex: 1 1 100%;
|
|
201
|
+
width: 100%;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@media (max-width: 768px) {
|
|
210
|
+
.selectedItemsContainer {
|
|
211
|
+
.itemCard {
|
|
212
|
+
padding: layout.$spacing-04;
|
|
213
|
+
|
|
214
|
+
.itemControls {
|
|
215
|
+
flex-direction: column;
|
|
216
|
+
gap: layout.$spacing-03;
|
|
217
|
+
|
|
218
|
+
.controlSection {
|
|
219
|
+
&:first-child,
|
|
220
|
+
&:nth-child(2),
|
|
221
|
+
&:last-child {
|
|
222
|
+
flex: 1 1 100%;
|
|
223
|
+
width: 100%;
|
|
224
|
+
max-width: 100%;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
4
4
|
import { Controller, useForm } from 'react-hook-form';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { ComboBox, InlineLoading, RadioButton, RadioButtonGroup, TextInput } from '@carbon/react';
|
|
6
|
+
import { ComboBox, InlineLoading, RadioButton, RadioButtonGroup, Stack, TextInput } from '@carbon/react';
|
|
7
7
|
import { useConfig } from '@openmrs/esm-framework';
|
|
8
8
|
import { usePaymentMethods } from '../billing-form.resource';
|
|
9
9
|
import styles from './visit-attributes-form.scss';
|
|
@@ -31,14 +31,14 @@ const visitAttributesFormSchema = z.object({
|
|
|
31
31
|
|
|
32
32
|
const VisitAttributesForm: React.FC<VisitAttributesFormProps> = ({ setAttributes, setPaymentMethod }) => {
|
|
33
33
|
const { t } = useTranslation();
|
|
34
|
-
const {
|
|
34
|
+
const { patientCategory, categoryConcepts, nonPayingPatientCategories } = useConfig();
|
|
35
35
|
const { control, getValues, watch } = useForm<VisitAttributesFormValue>({
|
|
36
36
|
mode: 'all',
|
|
37
37
|
defaultValues: {},
|
|
38
38
|
resolver: zodResolver(visitAttributesFormSchema),
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
const [paymentDetails, paymentMethods, insuranceSchema, policyNumber,
|
|
41
|
+
const [paymentDetails, paymentMethods, insuranceSchema, policyNumber, patientCategoryValue] = watch([
|
|
42
42
|
'paymentDetails',
|
|
43
43
|
'paymentMethods',
|
|
44
44
|
'insuranceScheme',
|
|
@@ -49,21 +49,29 @@ const VisitAttributesForm: React.FC<VisitAttributesFormProps> = ({ setAttributes
|
|
|
49
49
|
const { paymentModes, isLoading: isLoadingPaymentModes } = usePaymentMethods();
|
|
50
50
|
const patientCategoryOptions = useMemo(() => {
|
|
51
51
|
return Object.entries(nonPayingPatientCategories ?? {}).map(([key, uuid]) => ({
|
|
52
|
-
|
|
52
|
+
// t('childUnder5', 'Child under 5')
|
|
53
|
+
// t('student', 'Student')
|
|
54
|
+
text: t(key),
|
|
53
55
|
uuid,
|
|
54
56
|
}));
|
|
55
|
-
}, [nonPayingPatientCategories]);
|
|
57
|
+
}, [nonPayingPatientCategories, t]);
|
|
56
58
|
|
|
57
59
|
const createVisitAttributesPayload = useCallback(() => {
|
|
58
|
-
const {
|
|
60
|
+
const {
|
|
61
|
+
paymentDetails,
|
|
62
|
+
paymentMethods,
|
|
63
|
+
insuranceScheme,
|
|
64
|
+
policyNumber,
|
|
65
|
+
patientCategory: patientCategoryValue,
|
|
66
|
+
} = getValues();
|
|
59
67
|
setPaymentMethod?.(paymentMethods);
|
|
60
68
|
|
|
61
69
|
const formPayload = [
|
|
62
|
-
{ uuid:
|
|
63
|
-
{ uuid:
|
|
64
|
-
{ uuid:
|
|
65
|
-
{ uuid:
|
|
66
|
-
{ uuid:
|
|
70
|
+
{ uuid: patientCategory.paymentDetails, value: paymentDetails },
|
|
71
|
+
{ uuid: patientCategory.paymentMethods, value: paymentMethods },
|
|
72
|
+
{ uuid: patientCategory.insuranceScheme, value: insuranceScheme },
|
|
73
|
+
{ uuid: patientCategory.policyNumber, value: policyNumber },
|
|
74
|
+
{ uuid: patientCategory.patientCategory, value: patientCategoryValue },
|
|
67
75
|
];
|
|
68
76
|
|
|
69
77
|
const visitAttributesPayload = formPayload.filter(
|
|
@@ -75,11 +83,11 @@ const VisitAttributesForm: React.FC<VisitAttributesFormProps> = ({ setAttributes
|
|
|
75
83
|
}));
|
|
76
84
|
}, [
|
|
77
85
|
getValues,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
patientCategory.insuranceScheme,
|
|
87
|
+
patientCategory.patientCategory,
|
|
88
|
+
patientCategory.paymentDetails,
|
|
89
|
+
patientCategory.paymentMethods,
|
|
90
|
+
patientCategory.policyNumber,
|
|
83
91
|
setPaymentMethod,
|
|
84
92
|
]);
|
|
85
93
|
|
|
@@ -90,7 +98,7 @@ const VisitAttributesForm: React.FC<VisitAttributesFormProps> = ({ setAttributes
|
|
|
90
98
|
paymentMethods,
|
|
91
99
|
insuranceSchema,
|
|
92
100
|
policyNumber,
|
|
93
|
-
|
|
101
|
+
patientCategoryValue,
|
|
94
102
|
setAttributes,
|
|
95
103
|
createVisitAttributesPayload,
|
|
96
104
|
]);
|
|
@@ -100,59 +108,59 @@ const VisitAttributesForm: React.FC<VisitAttributesFormProps> = ({ setAttributes
|
|
|
100
108
|
<InlineLoading
|
|
101
109
|
status="active"
|
|
102
110
|
iconDescription={t('loadingDescription', 'Loading')}
|
|
103
|
-
description={t('loading', 'Loading data...'
|
|
111
|
+
description={t('loading', 'Loading data') + '...'}
|
|
104
112
|
/>
|
|
105
113
|
);
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
return (
|
|
109
|
-
<
|
|
110
|
-
<div className={styles.sectionTitle}>{t('paymentDetails', 'Payment Details')}</div>
|
|
117
|
+
<Stack className={styles.stack} gap={5}>
|
|
111
118
|
<Controller
|
|
112
119
|
name="paymentDetails"
|
|
113
120
|
control={control}
|
|
114
121
|
render={({ field }) => (
|
|
115
122
|
<RadioButtonGroup
|
|
123
|
+
className={styles.radioButtonGroup}
|
|
124
|
+
legendText={t('paymentDetails', 'Payment details')}
|
|
125
|
+
name="payment-details"
|
|
116
126
|
onChange={(selected) => field.onChange(selected)}
|
|
117
|
-
orientation="vertical"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
127
|
+
orientation="vertical">
|
|
128
|
+
<RadioButton labelText={t('paying', 'Paying')} value={categoryConcepts.payingDetails} id="radio-1" />
|
|
129
|
+
<RadioButton
|
|
130
|
+
labelText={t('nonPaying', 'Non paying')}
|
|
131
|
+
value={categoryConcepts.nonPayingDetails}
|
|
132
|
+
id="radio-2"
|
|
133
|
+
/>
|
|
122
134
|
</RadioButtonGroup>
|
|
123
135
|
)}
|
|
124
136
|
/>
|
|
125
|
-
|
|
126
|
-
{paymentDetails === catergoryConcepts.payingDetails && (
|
|
137
|
+
{paymentDetails === categoryConcepts.payingDetails && (
|
|
127
138
|
<Controller
|
|
128
139
|
control={control}
|
|
129
140
|
name="paymentMethods"
|
|
130
141
|
render={({ field }) => (
|
|
131
142
|
<ComboBox
|
|
132
|
-
className={styles.sectionField}
|
|
133
|
-
onChange={({ selectedItem }) => field.onChange(selectedItem?.uuid)}
|
|
134
143
|
id="paymentMethods"
|
|
135
144
|
items={paymentModes}
|
|
136
145
|
itemToString={(item) => (item ? item.name : '')}
|
|
137
|
-
|
|
146
|
+
onChange={({ selectedItem }) => field.onChange(selectedItem?.uuid)}
|
|
138
147
|
placeholder={t('selectPaymentMethod', 'Select payment method')}
|
|
148
|
+
titleText={t('paymentMethod', 'Payment method')}
|
|
139
149
|
/>
|
|
140
150
|
)}
|
|
141
151
|
/>
|
|
142
152
|
)}
|
|
143
|
-
|
|
144
|
-
{paymentMethods === catergoryConcepts.insuranceDetails && paymentDetails === catergoryConcepts.payingDetails && (
|
|
153
|
+
{paymentMethods === categoryConcepts.insuranceDetails && paymentDetails === categoryConcepts.payingDetails && (
|
|
145
154
|
<>
|
|
146
155
|
<Controller
|
|
147
156
|
control={control}
|
|
148
157
|
name="insuranceScheme"
|
|
149
158
|
render={({ field }) => (
|
|
150
159
|
<TextInput
|
|
151
|
-
className={styles.sectionField}
|
|
152
|
-
onChange={(e) => field.onChange(e.target.value)}
|
|
153
160
|
id="insurance-scheme"
|
|
154
|
-
type="text"
|
|
155
161
|
labelText={t('insuranceScheme', 'Insurance scheme')}
|
|
162
|
+
onChange={(e) => field.onChange(e.target.value)}
|
|
163
|
+
type="text"
|
|
156
164
|
/>
|
|
157
165
|
)}
|
|
158
166
|
/>
|
|
@@ -161,19 +169,17 @@ const VisitAttributesForm: React.FC<VisitAttributesFormProps> = ({ setAttributes
|
|
|
161
169
|
name="policyNumber"
|
|
162
170
|
render={({ field }) => (
|
|
163
171
|
<TextInput
|
|
164
|
-
className={styles.sectionField}
|
|
165
|
-
onChange={(e) => field.onChange(e.target.value)}
|
|
166
172
|
{...field}
|
|
167
173
|
id="policy-number"
|
|
168
|
-
type="text"
|
|
169
174
|
labelText={t('policyNumber', 'Policy number')}
|
|
175
|
+
onChange={(e) => field.onChange(e.target.value)}
|
|
176
|
+
type="text"
|
|
170
177
|
/>
|
|
171
178
|
)}
|
|
172
179
|
/>
|
|
173
180
|
</>
|
|
174
181
|
)}
|
|
175
|
-
|
|
176
|
-
{paymentDetails === catergoryConcepts.nonPayingDetails && (
|
|
182
|
+
{paymentDetails === categoryConcepts.nonPayingDetails && (
|
|
177
183
|
<Controller
|
|
178
184
|
control={control}
|
|
179
185
|
name="patientCategory"
|
|
@@ -190,7 +196,7 @@ const VisitAttributesForm: React.FC<VisitAttributesFormProps> = ({ setAttributes
|
|
|
190
196
|
)}
|
|
191
197
|
/>
|
|
192
198
|
)}
|
|
193
|
-
</
|
|
199
|
+
</Stack>
|
|
194
200
|
);
|
|
195
201
|
};
|
|
196
202
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
1
2
|
@use '@carbon/layout';
|
|
2
3
|
@use '@carbon/type';
|
|
3
|
-
@use '@carbon/colors';
|
|
4
4
|
|
|
5
5
|
.sectionContainer {
|
|
6
6
|
margin: 0 layout.$spacing-03;
|
|
@@ -11,12 +11,25 @@
|
|
|
11
11
|
color: colors.$gray-70;
|
|
12
12
|
margin: 0 0 layout.$spacing-03 0;
|
|
13
13
|
}
|
|
14
|
+
|
|
14
15
|
.visitAttributesContainer {
|
|
15
16
|
row-gap: layout.$spacing-03;
|
|
16
17
|
display: flex;
|
|
17
18
|
flex-direction: column;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
.
|
|
21
|
-
|
|
21
|
+
.radioButtonGroup {
|
|
22
|
+
:global(.cds--radio-button-group) {
|
|
23
|
+
:global(.cds--radio-button-wrapper) {
|
|
24
|
+
margin-bottom: layout.$spacing-03;
|
|
25
|
+
|
|
26
|
+
&:last-child {
|
|
27
|
+
margin-bottom: 0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.stack {
|
|
34
|
+
margin-bottom: layout.$spacing-05;
|
|
22
35
|
}
|