@kenyaemr/esm-billing-app 5.4.1-pre.1710 → 5.4.1-pre.1729
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 +58 -79
- package/dist/{10.js → 11.js} +1 -1
- package/dist/11.js.map +1 -0
- package/dist/114.js +2 -0
- package/dist/114.js.map +1 -0
- package/dist/300.js +1 -1
- package/dist/495.js +1 -2
- package/dist/495.js.map +1 -1
- package/dist/876.js +8 -1
- package/dist/876.js.map +1 -1
- package/dist/kenyaemr-esm-billing-app.js +1 -1
- package/dist/kenyaemr-esm-billing-app.js.buildmanifest.json +268 -268
- package/dist/kenyaemr-esm-billing-app.js.map +1 -1
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/benefits-package/benefits-package.mock.ts +3 -3
- package/src/benefits-package/forms/benefit-pre-auth-form.workspace.tsx +5 -4
- package/src/benefits-package/forms/{package-intervensions.component.tsx → package-interventions.component.tsx} +30 -10
- package/src/claims/dashboard/form/claims-form.component.tsx +4 -4
- package/src/claims/metrics/metrics.component.tsx +2 -2
- package/src/config-schema.ts +1 -1
- package/src/hooks/use-pre-auth-requests.ts +13 -1
- package/src/hooks/useInterventions.ts +27 -5
- package/src/root.component.tsx +0 -2
- package/src/types/index.ts +1 -1
- package/translations/en.json +3 -18
- package/dist/10.js.map +0 -1
- package/dist/13.js +0 -8
- package/dist/13.js.map +0 -1
- package/src/claims/pre-auth/form/pre-auth-form.component.tsx +0 -364
- package/src/claims/pre-auth/form/pre-auth-form.resource.ts +0 -20
- package/src/claims/pre-auth/form/pre-auth-form.scss +0 -141
- package/src/claims/pre-auth/form/pre-auth-mock-data.ts +0 -44
- package/src/claims/pre-auth/hook/pre-auth.mock.ts +0 -40
- package/src/claims/pre-auth/pre-auth-dashboard.component.tsx +0 -79
- package/src/claims/pre-auth/pre-auth-dashboard.scss +0 -42
- package/src/claims/pre-auth/table/pre-auth-table.component.tsx +0 -234
- package/src/claims/pre-auth/table/pre-auth-table.scss +0 -111
- /package/dist/{495.js.LICENSE.txt → 114.js.LICENSE.txt} +0 -0
- /package/dist/{13.js.LICENSE.txt → 876.js.LICENSE.txt} +0 -0
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import {
|
|
4
|
-
Column,
|
|
5
|
-
TextArea,
|
|
6
|
-
Form,
|
|
7
|
-
Layer,
|
|
8
|
-
Stack,
|
|
9
|
-
TextInput,
|
|
10
|
-
Row,
|
|
11
|
-
Button,
|
|
12
|
-
ButtonSet,
|
|
13
|
-
MultiSelect,
|
|
14
|
-
Tag,
|
|
15
|
-
InlineLoading,
|
|
16
|
-
} from '@carbon/react';
|
|
17
|
-
import { navigate, showSnackbar } from '@openmrs/esm-framework';
|
|
18
|
-
import { useSystemSetting } from '../../../hooks/getMflCode';
|
|
19
|
-
import { useParams } from 'react-router-dom';
|
|
20
|
-
import { useForm, Controller } from 'react-hook-form';
|
|
21
|
-
import { z } from 'zod';
|
|
22
|
-
import { zodResolver } from '@hookform/resolvers/zod';
|
|
23
|
-
import { useVisit } from '../../dashboard/form/claims-form.resource';
|
|
24
|
-
import styles from './pre-auth-form.scss';
|
|
25
|
-
import { LineItem, MappedBill } from '../../../types';
|
|
26
|
-
import { useInterventions, usePackages } from './pre-auth-form.resource';
|
|
27
|
-
import { Service } from '../../../../../esm-lab-manifest-app/src/metrics/lab-manifest-metrics.component';
|
|
28
|
-
|
|
29
|
-
type PreAuthFormProps = {
|
|
30
|
-
bill: MappedBill;
|
|
31
|
-
selectedLineItems: LineItem[];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const PreAuthFormSchema = z.object({
|
|
35
|
-
claimCode: z.string().nonempty({ message: 'Claim code is required' }),
|
|
36
|
-
guaranteeId: z.string().nonempty({ message: 'Guarantee Id is required' }),
|
|
37
|
-
preAuthJustification: z.string().nonempty({ message: 'Claim justification is required' }),
|
|
38
|
-
diagnoses: z
|
|
39
|
-
.array(
|
|
40
|
-
z.object({
|
|
41
|
-
id: z.string(),
|
|
42
|
-
text: z.string(),
|
|
43
|
-
}),
|
|
44
|
-
)
|
|
45
|
-
.nonempty({ message: 'At least one diagnosis is required' }),
|
|
46
|
-
visitType: z.string().nonempty({ message: 'Visit type is required' }),
|
|
47
|
-
facility: z.string().nonempty({ message: 'Facility is required' }),
|
|
48
|
-
packages: z.array(z.string()).nonempty({ message: 'At least one package is required' }),
|
|
49
|
-
interventions: z.array(z.string()).nonempty({ message: 'At least one intervention is required' }),
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const PreAuthForm: React.FC<PreAuthFormProps> = ({ bill, selectedLineItems }) => {
|
|
53
|
-
const { t } = useTranslation();
|
|
54
|
-
const { mflCodeValue } = useSystemSetting('facility.mflcode');
|
|
55
|
-
const { patientUuid, billUuid } = useParams();
|
|
56
|
-
const { visits: recentVisit } = useVisit(patientUuid);
|
|
57
|
-
const { interventions } = useInterventions();
|
|
58
|
-
const { packages } = usePackages();
|
|
59
|
-
|
|
60
|
-
const [loading, setLoading] = useState(false);
|
|
61
|
-
|
|
62
|
-
const handleNavigateToBillingOptions = () =>
|
|
63
|
-
navigate({
|
|
64
|
-
to: window.getOpenmrsSpaBase() + `home/billing/patient/${patientUuid}/${billUuid}`,
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
const diagnoses = useMemo(() => {
|
|
68
|
-
return (
|
|
69
|
-
recentVisit?.encounters?.flatMap(
|
|
70
|
-
(encounter) =>
|
|
71
|
-
encounter.diagnoses.map((diagnosis) => ({
|
|
72
|
-
id: diagnosis.diagnosis.coded.uuid,
|
|
73
|
-
text: diagnosis.display,
|
|
74
|
-
certainty: diagnosis.certainty,
|
|
75
|
-
})) || [],
|
|
76
|
-
) || []
|
|
77
|
-
);
|
|
78
|
-
}, [recentVisit]);
|
|
79
|
-
|
|
80
|
-
const confirmedDiagnoses = useMemo(() => {
|
|
81
|
-
return diagnoses.filter((diagnosis) => diagnosis.certainty === 'CONFIRMED');
|
|
82
|
-
}, [diagnoses]);
|
|
83
|
-
|
|
84
|
-
const {
|
|
85
|
-
control,
|
|
86
|
-
handleSubmit,
|
|
87
|
-
formState: { errors, isValid },
|
|
88
|
-
setValue,
|
|
89
|
-
reset,
|
|
90
|
-
} = useForm({
|
|
91
|
-
mode: 'all',
|
|
92
|
-
resolver: zodResolver(PreAuthFormSchema),
|
|
93
|
-
defaultValues: {
|
|
94
|
-
claimCode: '',
|
|
95
|
-
guaranteeId: '',
|
|
96
|
-
preAuthJustification: '',
|
|
97
|
-
diagnoses: [],
|
|
98
|
-
visitType: '',
|
|
99
|
-
facility: '',
|
|
100
|
-
packages: [],
|
|
101
|
-
interventions: [],
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
const onSubmit = async (data) => {
|
|
106
|
-
setLoading(true);
|
|
107
|
-
try {
|
|
108
|
-
showSnackbar({
|
|
109
|
-
kind: 'success',
|
|
110
|
-
title: t('requestPreAuth', 'Pre Authorization'),
|
|
111
|
-
subtitle: t('sendClaim', 'Pre authorization request sent successfully'),
|
|
112
|
-
timeoutInMs: 3000,
|
|
113
|
-
isLowContrast: true,
|
|
114
|
-
});
|
|
115
|
-
reset();
|
|
116
|
-
setTimeout(() => {
|
|
117
|
-
navigate({
|
|
118
|
-
to: window.getOpenmrsSpaBase() + `home/billing/`,
|
|
119
|
-
});
|
|
120
|
-
}, 2000);
|
|
121
|
-
} catch (err) {
|
|
122
|
-
console.error(err);
|
|
123
|
-
showSnackbar({
|
|
124
|
-
kind: 'error',
|
|
125
|
-
title: t('requestPreAuthError', 'Pre Authorization Error'),
|
|
126
|
-
subtitle: t('sendClaimError', 'Pre authorization request failed, please try later'),
|
|
127
|
-
timeoutInMs: 2500,
|
|
128
|
-
isLowContrast: true,
|
|
129
|
-
});
|
|
130
|
-
} finally {
|
|
131
|
-
setLoading(false);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
useEffect(() => {
|
|
136
|
-
reset({
|
|
137
|
-
diagnoses: confirmedDiagnoses,
|
|
138
|
-
visitType: recentVisit?.visitType?.display || '',
|
|
139
|
-
facility: `${recentVisit?.location?.display || ''} - ${mflCodeValue || ''}`,
|
|
140
|
-
claimCode: '',
|
|
141
|
-
guaranteeId: '',
|
|
142
|
-
preAuthJustification: '',
|
|
143
|
-
packages: [],
|
|
144
|
-
interventions: [],
|
|
145
|
-
});
|
|
146
|
-
}, [confirmedDiagnoses, recentVisit, mflCodeValue, reset]);
|
|
147
|
-
|
|
148
|
-
return (
|
|
149
|
-
<Form className={styles.form} onSubmit={handleSubmit(onSubmit)}>
|
|
150
|
-
<Stack gap={4} className={styles.grid}>
|
|
151
|
-
<span className={styles.preAuthFormTitle}>{t('formTitle', 'Fill in the form details')}</span>
|
|
152
|
-
<Column>
|
|
153
|
-
<Layer className={styles.input}>
|
|
154
|
-
<Controller
|
|
155
|
-
control={control}
|
|
156
|
-
name="preAuthJustification"
|
|
157
|
-
render={({ field }) => (
|
|
158
|
-
<TextArea
|
|
159
|
-
{...field}
|
|
160
|
-
labelText={t('preAuthJustification', 'Pre-Auth Justification')}
|
|
161
|
-
rows={3}
|
|
162
|
-
placeholder="Claim Justification"
|
|
163
|
-
id="preAuthJustification"
|
|
164
|
-
invalid={!!errors.preAuthJustification}
|
|
165
|
-
invalidText={errors.preAuthJustification?.message}
|
|
166
|
-
/>
|
|
167
|
-
)}
|
|
168
|
-
/>
|
|
169
|
-
</Layer>
|
|
170
|
-
</Column>
|
|
171
|
-
<Row className={styles.formPreAuthRow}>
|
|
172
|
-
<Column className={styles.formPreAuthColumn}>
|
|
173
|
-
<Layer className={styles.input}>
|
|
174
|
-
<Controller
|
|
175
|
-
control={control}
|
|
176
|
-
name="visitType"
|
|
177
|
-
render={({ field }) => (
|
|
178
|
-
<TextInput
|
|
179
|
-
{...field}
|
|
180
|
-
id="visittype"
|
|
181
|
-
labelText={t('visittype', 'Visit Type')}
|
|
182
|
-
readOnly
|
|
183
|
-
value={field.value}
|
|
184
|
-
/>
|
|
185
|
-
)}
|
|
186
|
-
/>
|
|
187
|
-
</Layer>
|
|
188
|
-
</Column>
|
|
189
|
-
<Column className={styles.formPreAuthColumn}>
|
|
190
|
-
<Layer className={styles.input}>
|
|
191
|
-
<Controller
|
|
192
|
-
control={control}
|
|
193
|
-
name="facility"
|
|
194
|
-
render={({ field }) => (
|
|
195
|
-
<TextInput
|
|
196
|
-
{...field}
|
|
197
|
-
id="facility"
|
|
198
|
-
labelText={t('facility', 'Facility')}
|
|
199
|
-
readOnly
|
|
200
|
-
value={field.value}
|
|
201
|
-
/>
|
|
202
|
-
)}
|
|
203
|
-
/>
|
|
204
|
-
</Layer>
|
|
205
|
-
</Column>
|
|
206
|
-
</Row>
|
|
207
|
-
<Row className={styles.formPreAuthRow}>
|
|
208
|
-
<Column className={styles.formPreAuthColumn}>
|
|
209
|
-
<Layer className={styles.input}>
|
|
210
|
-
<Controller
|
|
211
|
-
control={control}
|
|
212
|
-
name="guaranteeId"
|
|
213
|
-
render={({ field }) => (
|
|
214
|
-
<TextInput
|
|
215
|
-
{...field}
|
|
216
|
-
id="guaranteeId"
|
|
217
|
-
placeholder="Guarantee Id"
|
|
218
|
-
labelText={t('guaranteeId', 'Guarantee Id')}
|
|
219
|
-
invalid={!!errors.guaranteeId}
|
|
220
|
-
invalidText={errors.guaranteeId?.message}
|
|
221
|
-
/>
|
|
222
|
-
)}
|
|
223
|
-
/>
|
|
224
|
-
</Layer>
|
|
225
|
-
</Column>
|
|
226
|
-
<Column className={styles.formPreAuthColumn}>
|
|
227
|
-
<Layer className={styles.input}>
|
|
228
|
-
<Controller
|
|
229
|
-
control={control}
|
|
230
|
-
name="claimCode"
|
|
231
|
-
render={({ field }) => (
|
|
232
|
-
<TextInput
|
|
233
|
-
{...field}
|
|
234
|
-
id="claimcode"
|
|
235
|
-
placeholder="Claim Code"
|
|
236
|
-
labelText={t('claimcode', 'Claim Code')}
|
|
237
|
-
invalid={!!errors.claimCode}
|
|
238
|
-
invalidText={errors.claimCode?.message}
|
|
239
|
-
/>
|
|
240
|
-
)}
|
|
241
|
-
/>
|
|
242
|
-
</Layer>
|
|
243
|
-
</Column>
|
|
244
|
-
</Row>
|
|
245
|
-
<Column>
|
|
246
|
-
<Layer className={styles.input}>
|
|
247
|
-
<Controller
|
|
248
|
-
control={control}
|
|
249
|
-
name="packages"
|
|
250
|
-
render={({ field }) => (
|
|
251
|
-
<>
|
|
252
|
-
<>
|
|
253
|
-
<div>
|
|
254
|
-
{field.value.map((item, index) => (
|
|
255
|
-
<Tag key={index} type="high-contrast">
|
|
256
|
-
{item}
|
|
257
|
-
</Tag>
|
|
258
|
-
))}
|
|
259
|
-
</div>
|
|
260
|
-
</>
|
|
261
|
-
<MultiSelect
|
|
262
|
-
{...field}
|
|
263
|
-
items={packages}
|
|
264
|
-
titleText={t('packages', 'Packages')}
|
|
265
|
-
itemToString={(item) => (item ? item.shaPackageName : '')}
|
|
266
|
-
label={field.value.length === 0 ? t('packagesOptions', 'Choose packages') : ''}
|
|
267
|
-
id="packages"
|
|
268
|
-
invalid={!!errors.packages}
|
|
269
|
-
invalidText={errors.packages?.message}
|
|
270
|
-
placeholder="Select Packages"
|
|
271
|
-
onChange={({ selectedItems }) => {
|
|
272
|
-
field.onChange(selectedItems.map((item) => item.shaPackageCode));
|
|
273
|
-
}}
|
|
274
|
-
/>
|
|
275
|
-
</>
|
|
276
|
-
)}
|
|
277
|
-
/>
|
|
278
|
-
</Layer>
|
|
279
|
-
</Column>
|
|
280
|
-
<Column>
|
|
281
|
-
<Layer className={styles.input}>
|
|
282
|
-
<Controller
|
|
283
|
-
control={control}
|
|
284
|
-
name="interventions"
|
|
285
|
-
render={({ field }) => (
|
|
286
|
-
<>
|
|
287
|
-
<div>
|
|
288
|
-
{field.value.map((item, index) => {
|
|
289
|
-
const intervention = interventions.find((interv) => interv.shaInterventionCode === item);
|
|
290
|
-
return (
|
|
291
|
-
<Tag key={index} type="high-contrast">
|
|
292
|
-
{intervention ? intervention.shaInterventionName : ''}
|
|
293
|
-
</Tag>
|
|
294
|
-
);
|
|
295
|
-
})}
|
|
296
|
-
</div>
|
|
297
|
-
<MultiSelect
|
|
298
|
-
{...field}
|
|
299
|
-
items={interventions}
|
|
300
|
-
titleText={t('interventions', 'Interventions')}
|
|
301
|
-
itemToString={(item) => (item ? item.shaInterventionName : '')}
|
|
302
|
-
label={field.value.length === 0 ? t('interventionsOption', 'Choose interventions') : ''}
|
|
303
|
-
id="interventions"
|
|
304
|
-
invalid={!!errors.interventions}
|
|
305
|
-
invalidText={errors.interventions?.message}
|
|
306
|
-
placeholder="Select Interventions"
|
|
307
|
-
onChange={({ selectedItems }) => {
|
|
308
|
-
field.onChange(selectedItems.map((item) => item.shaInterventionCode));
|
|
309
|
-
}}
|
|
310
|
-
/>
|
|
311
|
-
</>
|
|
312
|
-
)}
|
|
313
|
-
/>
|
|
314
|
-
</Layer>
|
|
315
|
-
</Column>
|
|
316
|
-
<Column>
|
|
317
|
-
<Layer className={styles.input}>
|
|
318
|
-
<Controller
|
|
319
|
-
control={control}
|
|
320
|
-
name="diagnoses"
|
|
321
|
-
render={({ field }) => (
|
|
322
|
-
<>
|
|
323
|
-
<div>
|
|
324
|
-
{field.value.map((item, index) => (
|
|
325
|
-
<Tag key={index} type="high-contrast">
|
|
326
|
-
{item.text}
|
|
327
|
-
</Tag>
|
|
328
|
-
))}
|
|
329
|
-
</div>
|
|
330
|
-
<MultiSelect
|
|
331
|
-
{...field}
|
|
332
|
-
id="diagnoses"
|
|
333
|
-
titleText={t('diagnoses', 'Diagnoses')}
|
|
334
|
-
items={diagnoses}
|
|
335
|
-
itemToString={(item) => (item ? item.text : '')}
|
|
336
|
-
selectionFeedback="top-after-reopen"
|
|
337
|
-
label={field.value.length === 0 ? t('chooseDiagnosis', 'Choose diagnosis') : ''}
|
|
338
|
-
selectedItems={field.value}
|
|
339
|
-
onChange={({ selectedItems }) => field.onChange(selectedItems)}
|
|
340
|
-
/>
|
|
341
|
-
</>
|
|
342
|
-
)}
|
|
343
|
-
/>
|
|
344
|
-
</Layer>
|
|
345
|
-
</Column>
|
|
346
|
-
|
|
347
|
-
<ButtonSet className={styles.buttonSet}>
|
|
348
|
-
<Button className={styles.button} kind="secondary" onClick={handleNavigateToBillingOptions}>
|
|
349
|
-
{t('discard', 'Discard')}
|
|
350
|
-
</Button>
|
|
351
|
-
<Button className={styles.button} kind="primary" type="submit" disabled={!isValid || loading}>
|
|
352
|
-
{loading ? (
|
|
353
|
-
<InlineLoading description={t('processing', 'Processing...')} />
|
|
354
|
-
) : (
|
|
355
|
-
t('preAuthRequest', 'Pre-Auth Request')
|
|
356
|
-
)}
|
|
357
|
-
</Button>
|
|
358
|
-
</ButtonSet>
|
|
359
|
-
</Stack>
|
|
360
|
-
</Form>
|
|
361
|
-
);
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
export default PreAuthForm;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { mockInterventions, mockPackages } from './pre-auth-mock-data';
|
|
3
|
-
|
|
4
|
-
export const useInterventions = () => {
|
|
5
|
-
const interventions = useMemo(() => mockInterventions, []);
|
|
6
|
-
return {
|
|
7
|
-
isLoading: false,
|
|
8
|
-
interventions: interventions,
|
|
9
|
-
error: undefined,
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const usePackages = () => {
|
|
14
|
-
const packages = useMemo(() => mockPackages, []);
|
|
15
|
-
return {
|
|
16
|
-
isLoading: false,
|
|
17
|
-
packages: packages,
|
|
18
|
-
error: undefined,
|
|
19
|
-
};
|
|
20
|
-
};
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
@use '@carbon/layout';
|
|
2
|
-
@use '@carbon/type';
|
|
3
|
-
@use '@carbon/colors';
|
|
4
|
-
|
|
5
|
-
.heading {
|
|
6
|
-
@include type.type-style('heading-compact-01');
|
|
7
|
-
margin: layout.$spacing-05 0 layout.$spacing-05;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.warningContainer {
|
|
11
|
-
background-color: colors.$red-50;
|
|
12
|
-
padding: layout.$spacing-04;
|
|
13
|
-
margin: layout.$spacing-03 0 layout.$spacing-03;
|
|
14
|
-
display: flex;
|
|
15
|
-
justify-content: space-between;
|
|
16
|
-
.warning {
|
|
17
|
-
@include type.type-style('heading-compact-01');
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.form {
|
|
22
|
-
width: 100%;
|
|
23
|
-
margin: layout.$spacing-09 layout.$spacing-05 0;
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
justify-content: space-between;
|
|
27
|
-
background-color: white;
|
|
28
|
-
|
|
29
|
-
:global(.omrs-breakpoint-lt-desktop) {
|
|
30
|
-
width: 50%;
|
|
31
|
-
padding: layout.$spacing-06 layout.$spacing-05;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.preAuthFormTitle {
|
|
35
|
-
@include type.type-style('heading-02');
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
justify-content: space-between;
|
|
39
|
-
margin: layout.$spacing-05 0 1rem;
|
|
40
|
-
row-gap: layout.$spacing-06;
|
|
41
|
-
position: relative;
|
|
42
|
-
|
|
43
|
-
&::after {
|
|
44
|
-
content: '';
|
|
45
|
-
display: block;
|
|
46
|
-
width: layout.$spacing-07;
|
|
47
|
-
border-bottom: 0.375rem solid var(--brand-03);
|
|
48
|
-
position: absolute;
|
|
49
|
-
bottom: -0.75rem;
|
|
50
|
-
left: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
& > span {
|
|
54
|
-
@include type.type-style('body-01');
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.buttonSet {
|
|
59
|
-
padding: 0;
|
|
60
|
-
margin-top: layout.$spacing-03;
|
|
61
|
-
display: flex;
|
|
62
|
-
justify-content: flex-end;
|
|
63
|
-
gap: layout.$spacing-05;
|
|
64
|
-
margin-bottom: layout.$spacing-07;
|
|
65
|
-
|
|
66
|
-
:global(.omrs-breakpoint-lt-desktop) {
|
|
67
|
-
justify-content: center;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
:global(.omrs-breakpoint-lt-desktop) {
|
|
72
|
-
width: 768px;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.grid {
|
|
77
|
-
margin: 0 layout.$spacing-05;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.input {
|
|
81
|
-
margin-top: layout.$spacing-05;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.button {
|
|
85
|
-
height: layout.$spacing-08;
|
|
86
|
-
display: flex;
|
|
87
|
-
align-content: flex-start;
|
|
88
|
-
align-items: baseline;
|
|
89
|
-
min-width: 20%;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.buttonSet {
|
|
93
|
-
padding: 0;
|
|
94
|
-
margin-top: layout.$spacing-05;
|
|
95
|
-
display: flex;
|
|
96
|
-
justify-content: flex-end;
|
|
97
|
-
gap: layout.$spacing-05;
|
|
98
|
-
margin-bottom: layout.$spacing-07;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.preAuthFormTitle {
|
|
102
|
-
@include type.type-style('heading-02');
|
|
103
|
-
display: flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
justify-content: space-between;
|
|
106
|
-
margin: layout.$spacing-05 0 layout.$spacing-03;
|
|
107
|
-
row-gap: layout.$spacing-06;
|
|
108
|
-
position: relative;
|
|
109
|
-
|
|
110
|
-
&::after {
|
|
111
|
-
content: '';
|
|
112
|
-
display: block;
|
|
113
|
-
width: layout.$spacing-07;
|
|
114
|
-
border-bottom: 0.375rem solid var(--brand-03);
|
|
115
|
-
position: absolute;
|
|
116
|
-
bottom: -0.75rem;
|
|
117
|
-
left: 0;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
& > span {
|
|
121
|
-
@include type.type-style('body-01');
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
:global(.omrs-breakpoint-lt-desktop) {
|
|
126
|
-
.buttonSet {
|
|
127
|
-
padding: layout.$spacing-06 layout.$spacing-05;
|
|
128
|
-
justify-content: flex-end;
|
|
129
|
-
gap: layout.$spacing-05;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.formPreAuthRow {
|
|
134
|
-
display: flex;
|
|
135
|
-
flex-wrap: nowrap;
|
|
136
|
-
gap: layout.$spacing-05;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.formPreAuthColumn {
|
|
140
|
-
flex: 1 1 0%;
|
|
141
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { SHAPackage, Benefits, Intervention } from '../../../types';
|
|
2
|
-
|
|
3
|
-
export const benefits: Benefits[] = [
|
|
4
|
-
{
|
|
5
|
-
shaPackageCode: 'SHA-001',
|
|
6
|
-
shaPackageName: 'Eye Care',
|
|
7
|
-
shaInterventionCode: 'SHA-001-01',
|
|
8
|
-
shaInterventionName: 'Intervention 1',
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
shaPackageCode: 'SHA-002',
|
|
12
|
-
shaPackageName: 'Malaria',
|
|
13
|
-
shaInterventionCode: 'SHA-002-01',
|
|
14
|
-
shaInterventionName: 'Intervention 2',
|
|
15
|
-
},
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
export const mockPackages: SHAPackage[] = [
|
|
19
|
-
{
|
|
20
|
-
uuid: 'SHA-PKG-001',
|
|
21
|
-
shaPackageCode: 'SHA-001',
|
|
22
|
-
shaPackageName: 'Eye Care',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
uuid: 'SHA-PKG-002',
|
|
26
|
-
shaPackageCode: 'SHA-002',
|
|
27
|
-
shaPackageName: 'Dental Care',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
uuid: 'SHA-PKG-003',
|
|
31
|
-
shaPackageCode: 'SHA-003',
|
|
32
|
-
shaPackageName: 'Surgical',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
uuid: 'SHA-PKG-004',
|
|
36
|
-
shaPackageCode: 'SHA-004',
|
|
37
|
-
shaPackageName: 'Haemo-oncology',
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
export const mockInterventions: Intervention[] = benefits.map(({ shaInterventionCode, shaInterventionName }) => ({
|
|
42
|
-
shaInterventionCode,
|
|
43
|
-
shaInterventionName,
|
|
44
|
-
}));
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export interface Package {
|
|
2
|
-
uuid: string;
|
|
3
|
-
packageCode: string;
|
|
4
|
-
packageName: string;
|
|
5
|
-
packageAccessPoint: 'OP' | 'IP' | 'Both';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface SHAintervention {
|
|
9
|
-
interventionCode: string;
|
|
10
|
-
interventionName?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const packages = [
|
|
14
|
-
{
|
|
15
|
-
packageCode: 'SHA-001',
|
|
16
|
-
packageName: 'Eye Care',
|
|
17
|
-
packageAccessPoint: 'OPD',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
packageCode: 'SHA-002',
|
|
21
|
-
packageName: 'Dental Care',
|
|
22
|
-
packageAccessPoint: 'IPD',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
packageCode: 'SHA-003',
|
|
26
|
-
packageName: 'Surgical',
|
|
27
|
-
packageAccessPoint: 'OPD',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
packageCode: 'SHA-004',
|
|
31
|
-
packageName: 'Haemo-oncology',
|
|
32
|
-
packageAccessPoint: 'OP',
|
|
33
|
-
},
|
|
34
|
-
] as Array<Package>;
|
|
35
|
-
|
|
36
|
-
export const interventions: SHAintervention[] = [
|
|
37
|
-
{ interventionCode: 'SHA-001-01', interventionName: 'Intervention 1' },
|
|
38
|
-
{ interventionCode: 'SHA-001-02', interventionName: 'Intervention 2' },
|
|
39
|
-
{ interventionCode: 'SHA-001-03', interventionName: 'Intervention 3' },
|
|
40
|
-
];
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useParams } from 'react-router-dom';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { usePatient, ErrorState, ExtensionSlot, navigate } from '@openmrs/esm-framework';
|
|
5
|
-
import { InlineLoading, Button } from '@carbon/react';
|
|
6
|
-
import { useBill } from '../../billing.resource';
|
|
7
|
-
import { CardHeader } from '@openmrs/esm-patient-common-lib';
|
|
8
|
-
import { PreviousOutline } from '@carbon/react/icons';
|
|
9
|
-
import { spaBasePath } from '../../constants';
|
|
10
|
-
import { LineItem } from '../../types';
|
|
11
|
-
import styles from './pre-auth-dashboard.scss';
|
|
12
|
-
import PreAuthTable from './table/pre-auth-table.component';
|
|
13
|
-
import PreAuthForm from './form/pre-auth-form.component';
|
|
14
|
-
|
|
15
|
-
const PreAuthRequestDashboard: React.FC = () => {
|
|
16
|
-
const { billUuid, patientUuid } = useParams();
|
|
17
|
-
const { t } = useTranslation();
|
|
18
|
-
const { patient, isLoading: isLoadingPatient } = usePatient(patientUuid);
|
|
19
|
-
const { bill, isLoading: isLoadingBill, error } = useBill(billUuid);
|
|
20
|
-
const preAuthTitle = t('makePreauthRequest', 'Make Pre-auth Request');
|
|
21
|
-
|
|
22
|
-
const [selectedLineItems, setSelectedLineItems] = useState<LineItem[]>([]);
|
|
23
|
-
|
|
24
|
-
const handleSelectItem = (selectedItems: LineItem[]) => {
|
|
25
|
-
setSelectedLineItems(selectedItems);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
if (isLoadingPatient && isLoadingBill) {
|
|
29
|
-
return (
|
|
30
|
-
<div className={styles.preAuthContainer}>
|
|
31
|
-
<InlineLoading
|
|
32
|
-
className={styles.loader}
|
|
33
|
-
status="active"
|
|
34
|
-
iconDescription="Loading"
|
|
35
|
-
description="Loading patient header..."
|
|
36
|
-
/>
|
|
37
|
-
</div>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (error) {
|
|
42
|
-
return (
|
|
43
|
-
<div className={styles.preAuthContainer}>
|
|
44
|
-
<ErrorState headerTitle={t('preAuthRequestError', 'Pre-authorization request error page')} error={error} />
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div className={styles.preAuthContainer}>
|
|
51
|
-
{patient && (
|
|
52
|
-
<ExtensionSlot
|
|
53
|
-
name="patient-header-slot"
|
|
54
|
-
state={{ patientUuid: patient.id, patient }}
|
|
55
|
-
className={styles.preAuthContainer}
|
|
56
|
-
/>
|
|
57
|
-
)}
|
|
58
|
-
<CardHeader title={preAuthTitle}>
|
|
59
|
-
<Button
|
|
60
|
-
kind="secondary"
|
|
61
|
-
size="sm"
|
|
62
|
-
className={styles.backButton}
|
|
63
|
-
onClick={() => navigate({ to: `${spaBasePath}/billing/patient/${patientUuid}/${billUuid}` })}
|
|
64
|
-
renderIcon={PreviousOutline}
|
|
65
|
-
iconDescription="back">
|
|
66
|
-
{t('backButton', 'Back')}
|
|
67
|
-
</Button>{' '}
|
|
68
|
-
</CardHeader>
|
|
69
|
-
<div className={styles.preAuthMainContainer}>
|
|
70
|
-
<div className={styles.content}>
|
|
71
|
-
<PreAuthTable bill={bill} isLoadingBill={isLoadingBill} onSelectItem={handleSelectItem} />
|
|
72
|
-
<PreAuthForm bill={bill} selectedLineItems={selectedLineItems} />
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export default PreAuthRequestDashboard;
|