@kenyaemr/esm-billing-app 5.4.1-pre.1935 → 5.4.1-pre.1936
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 +68 -68
- package/dist/{202.js → 308.js} +1 -1
- package/dist/308.js.map +1 -0
- package/dist/kenyaemr-esm-billing-app.js +1 -1
- package/dist/kenyaemr-esm-billing-app.js.buildmanifest.json +28 -28
- 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/benefits-package/benefits-package.resources.tsx +1 -1
- package/src/benefits-package/forms/benefit-pre-auth-form.workspace.tsx +8 -52
- package/src/benefits-package/forms/{package-interventions.component.tsx → interventions-form.component.tsx} +25 -13
- package/src/benefits-package/forms/packages-and-interventions-form.component.tsx +72 -0
- package/src/billing-form/billing-checkin-form.component.tsx +6 -1
- package/src/billing-form/check-in-form.utils.tsx +2 -0
- package/src/billing-form/visit-attributes/visit-attributes-form.component.tsx +13 -3
- package/src/claims/dashboard/form/claims-form.component.tsx +28 -59
- package/src/claims/dashboard/form/claims-form.resource.ts +18 -2
- package/src/config-schema.ts +6 -0
- package/src/constants.ts +1 -0
- package/src/hooks/useInterventions.ts +19 -21
- package/src/types/index.ts +1 -0
- package/dist/202.js.map +0 -1
package/src/config-schema.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface BillingConfig {
|
|
|
8
8
|
policyNumber: string;
|
|
9
9
|
exemptionCategory: string;
|
|
10
10
|
billPaymentStatus: string;
|
|
11
|
+
shaBenefitPackagesAndInterventions: string;
|
|
11
12
|
};
|
|
12
13
|
insurancePaymentMethod: string;
|
|
13
14
|
inPatientVisitTypeUuid: string;
|
|
@@ -96,6 +97,11 @@ export const configSchema: ConfigSchema = {
|
|
|
96
97
|
_description: 'The bill payment status visit attribute uuid',
|
|
97
98
|
_default: '919b51c9-8e2e-468f-8354-181bf3e55786',
|
|
98
99
|
},
|
|
100
|
+
shaBenefitPackagesAndInterventions: {
|
|
101
|
+
_type: Type.String,
|
|
102
|
+
_description: 'JSON String of SHA Benefit Packages and Interventions for this visit',
|
|
103
|
+
_default: '338725fa-3790-4679-98b9-be623214ee29',
|
|
104
|
+
},
|
|
99
105
|
},
|
|
100
106
|
insurancePaymentMethod: {
|
|
101
107
|
_type: Type.String,
|
package/src/constants.ts
CHANGED
|
@@ -10,20 +10,6 @@ export type InterventionsFilter = {
|
|
|
10
10
|
applicable_gender?: 'MALE' | 'FEMALE';
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const toQueryParams = (q: Record<string, any>) => {
|
|
14
|
-
return (
|
|
15
|
-
'?' +
|
|
16
|
-
Object.entries(q)
|
|
17
|
-
.reduce((prev, [key, val]) => {
|
|
18
|
-
if (val !== undefined && val !== null) {
|
|
19
|
-
return [...prev, `${key}=${val}`];
|
|
20
|
-
}
|
|
21
|
-
return prev;
|
|
22
|
-
}, [])
|
|
23
|
-
.join('&')
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
13
|
type Data = {
|
|
28
14
|
status: string;
|
|
29
15
|
data: Array<{
|
|
@@ -56,17 +42,18 @@ export const useInterventions = (filters: InterventionsFilter) => {
|
|
|
56
42
|
};
|
|
57
43
|
|
|
58
44
|
const { error: facilityLevelError, isLoading: isLoadingFacilityLevel, level } = useFacilityLevel();
|
|
59
|
-
|
|
60
|
-
const url = `${restBaseUrl}/kenyaemr/sha-interventions${toQueryParams({
|
|
45
|
+
const urlParams = new URLSearchParams({
|
|
61
46
|
...filters,
|
|
62
|
-
synchronize: false,
|
|
63
|
-
})
|
|
47
|
+
synchronize: 'false',
|
|
48
|
+
});
|
|
49
|
+
const url = `${restBaseUrl}/kenyaemr/sha-interventions?${urlParams.toString()}`;
|
|
64
50
|
const { isLoading, error, data } = useSWR<FetchResponse<Data>>(url, openmrsFetch);
|
|
65
51
|
const interventions = useMemo(() => {
|
|
52
|
+
const packageCodes = filters.package_code?.split(',') || [];
|
|
66
53
|
return data?.data?.data
|
|
67
54
|
?.filter((d) => {
|
|
68
55
|
// 1. Filter by package code (only if defined)
|
|
69
|
-
if (
|
|
56
|
+
if (packageCodes.length > 0 && !packageCodes.includes(d.interventionPackage)) {
|
|
70
57
|
return false;
|
|
71
58
|
}
|
|
72
59
|
|
|
@@ -106,12 +93,23 @@ export const useInterventions = (filters: InterventionsFilter) => {
|
|
|
106
93
|
interventionCode,
|
|
107
94
|
subCategoryBenefitsPackage: interventionSubPackage,
|
|
108
95
|
interventionName,
|
|
96
|
+
interventionPackage,
|
|
109
97
|
})) as SHAIntervention[];
|
|
110
98
|
}, [data, filters, level]); // Ensure proper memoization
|
|
111
|
-
|
|
99
|
+
const allInterventions = useMemo(() => {
|
|
100
|
+
return (data?.data?.data ?? []).map(
|
|
101
|
+
({ interventionCode, interventionName, interventionPackage, interventionSubPackage }) => ({
|
|
102
|
+
interventionCode,
|
|
103
|
+
subCategoryBenefitsPackage: interventionSubPackage,
|
|
104
|
+
interventionName,
|
|
105
|
+
interventionPackage,
|
|
106
|
+
}),
|
|
107
|
+
) as SHAIntervention[];
|
|
108
|
+
}, [data]);
|
|
112
109
|
return {
|
|
113
110
|
isLoading: isLoading || isLoadingFacilityLevel,
|
|
114
|
-
interventions,
|
|
111
|
+
interventions: interventions ?? [],
|
|
112
|
+
allInterventions,
|
|
115
113
|
error: error || facilityLevelError,
|
|
116
114
|
};
|
|
117
115
|
};
|
package/src/types/index.ts
CHANGED