@kenyaemr/esm-billing-app 5.4.1-pre.2061 → 5.4.1-pre.2063
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 +82 -82
- package/dist/717.js +1 -1
- package/dist/717.js.map +1 -1
- package/dist/kenyaemr-esm-billing-app.js.buildmanifest.json +6 -6
- 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/hooks/useInterventions.ts +84 -68
- package/src/hooks/usePackages.ts +5 -5
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":[{"component":"billingDashboardLink","name":"billing-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"billing","title":"billing","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-link-slot"},{"component":"paymentHistoryLink","name":"payment-history-link","slot":"billing-dashboard-link-slot"},{"component":"paymentPointsLink","name":"payment-points-link","slot":"billing-dashboard-link-slot"},{"component":"paymentModesLink","name":"payment-modes-link","slot":"billing-dashboard-link-slot"},{"component":"billManagerLink","name":"bill-manager-link","slot":"billing-dashboard-link-slot"},{"component":"chargeableItemsLink","name":"chargeable-items-link","slot":"billing-dashboard-link-slot"},{"component":"billableExemptionsLink","name":"billable-exemptions-link","slot":"billing-dashboard-link-slot"},{"component":"claimsManagementSideNavGroup","name":"claims-management-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"claims-management","title":"Claims management Overview","slot":"case-management-slot"},"featureFlag":"healthInformationExchange"},{"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":"bill-deposit-workspace","component":"billDepositWorkspace","title":"Bill Deposit Workspace","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":"retry-claim-request-modal","component":"retryClaimRequestModal"},{"name":"paid-bill-receipt-print-preview-modal","component":"paidBillReceiptPrintPreviewModal"},{"name":"clock-in-modal","component":"clockIn"},{"name":"create-bill-item-modal","component":"createBillItemModal"}],"version":"5.4.1-pre.
|
|
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":{"name":"billing","title":"billing","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-link-slot"},{"component":"paymentHistoryLink","name":"payment-history-link","slot":"billing-dashboard-link-slot"},{"component":"paymentPointsLink","name":"payment-points-link","slot":"billing-dashboard-link-slot"},{"component":"paymentModesLink","name":"payment-modes-link","slot":"billing-dashboard-link-slot"},{"component":"billManagerLink","name":"bill-manager-link","slot":"billing-dashboard-link-slot"},{"component":"chargeableItemsLink","name":"chargeable-items-link","slot":"billing-dashboard-link-slot"},{"component":"billableExemptionsLink","name":"billable-exemptions-link","slot":"billing-dashboard-link-slot"},{"component":"claimsManagementSideNavGroup","name":"claims-management-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"claims-management","title":"Claims management Overview","slot":"case-management-slot"},"featureFlag":"healthInformationExchange"},{"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":"bill-deposit-workspace","component":"billDepositWorkspace","title":"Bill Deposit Workspace","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":"retry-claim-request-modal","component":"retryClaimRequestModal"},{"name":"paid-bill-receipt-print-preview-modal","component":"paidBillReceiptPrintPreviewModal"},{"name":"clock-in-modal","component":"clockIn"},{"name":"create-bill-item-modal","component":"createBillItemModal"}],"version":"5.4.1-pre.2063"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { FetchResponse, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import { useMemo } from 'react';
|
|
2
3
|
import useSWR from 'swr';
|
|
3
|
-
import { SHAIntervention } from '../types';
|
|
4
4
|
import useFacilityLevel from './useFacilityLevel';
|
|
5
|
-
import { useMemo } from 'react';
|
|
6
5
|
|
|
7
6
|
export type InterventionsFilter = {
|
|
8
7
|
package_code?: string;
|
|
@@ -10,102 +9,119 @@ export type InterventionsFilter = {
|
|
|
10
9
|
applicable_gender?: 'MALE' | 'FEMALE';
|
|
11
10
|
};
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
interface Intervention {
|
|
13
|
+
id: number;
|
|
14
|
+
isMultisession: boolean;
|
|
15
|
+
fund: string;
|
|
16
|
+
supportedScheme: string;
|
|
17
|
+
parentBenefitName: string;
|
|
18
|
+
parentBenefitCode: string;
|
|
19
|
+
benefitCode: string;
|
|
20
|
+
benefitName: string;
|
|
21
|
+
guid: string;
|
|
22
|
+
created: string;
|
|
23
|
+
updated: string;
|
|
24
|
+
replicated: string;
|
|
25
|
+
owner: number;
|
|
26
|
+
needsPreauth: boolean;
|
|
27
|
+
levelsApplicable: string[];
|
|
28
|
+
paymentMechanism: string;
|
|
29
|
+
coverageLevel: string;
|
|
30
|
+
annualQuantityLimit: number;
|
|
31
|
+
annualQuantityLimitChoice: string;
|
|
32
|
+
annualQuantityLimitType: string;
|
|
33
|
+
overallTariff: string;
|
|
34
|
+
overallTariffHasLimit: boolean;
|
|
35
|
+
annualLimitValue: string;
|
|
36
|
+
usageFrequencyLimit: string;
|
|
37
|
+
usageFrequencyType: string;
|
|
14
38
|
status: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
needsManualPreauthApproval: boolean;
|
|
40
|
+
needsDoctorAuthorization: boolean;
|
|
41
|
+
numberOfDoctorsRequired: string;
|
|
42
|
+
needsMemberAuthorization: boolean;
|
|
43
|
+
accessPoint: string;
|
|
44
|
+
name: string;
|
|
45
|
+
code: string;
|
|
46
|
+
active: boolean;
|
|
47
|
+
activeForUhc: boolean;
|
|
48
|
+
diagnosisBlock: string[];
|
|
49
|
+
diagnosisList: string[];
|
|
50
|
+
applicableGender: string;
|
|
51
|
+
applicableFacilityOwnership: string;
|
|
52
|
+
upperAgeLimit: string;
|
|
53
|
+
lowerAgeLimit: string;
|
|
54
|
+
investigationTariff: string;
|
|
55
|
+
investigationTariffHasLimit: boolean;
|
|
56
|
+
managementTariff: string;
|
|
57
|
+
managementTariffHasLimit: boolean;
|
|
58
|
+
isIntraMetro: boolean;
|
|
59
|
+
tariffPerAdditionalKilometer: string;
|
|
60
|
+
needApprovalBeforeClaimSubmission: boolean;
|
|
61
|
+
needsProtocols: boolean;
|
|
62
|
+
level_2_tariff: string;
|
|
63
|
+
level_3_tariff: string;
|
|
64
|
+
level_4_tariff: string;
|
|
65
|
+
level_5_tariff: string;
|
|
66
|
+
level_6_tariff: string;
|
|
67
|
+
protocolUsed: string;
|
|
68
|
+
tariffLimitPerIndividual: string;
|
|
69
|
+
complexity: string;
|
|
70
|
+
comment: string;
|
|
71
|
+
retiredOn: string;
|
|
72
|
+
requiresSurgicalPreauth: boolean;
|
|
73
|
+
requiresRenalPreauth: boolean;
|
|
74
|
+
requiresOncologyPreauth: boolean;
|
|
75
|
+
requiresRadiologyPreauth: boolean;
|
|
76
|
+
requiresOpticalPreauth: boolean;
|
|
77
|
+
applicableSchemes: string[];
|
|
78
|
+
benefit: number;
|
|
79
|
+
}
|
|
43
80
|
|
|
81
|
+
export const useInterventions = (filters: InterventionsFilter) => {
|
|
44
82
|
const { error: facilityLevelError, isLoading: isLoadingFacilityLevel, level } = useFacilityLevel();
|
|
45
83
|
const urlParams = new URLSearchParams({
|
|
46
84
|
...filters,
|
|
47
85
|
synchronize: 'false',
|
|
48
86
|
});
|
|
49
87
|
const url = `${restBaseUrl}/kenyaemr/sha-interventions?${urlParams.toString()}`;
|
|
50
|
-
const { isLoading, error, data } = useSWR<FetchResponse<
|
|
88
|
+
const { isLoading, error, data } = useSWR<FetchResponse<{ results: Array<Intervention> }>>(url, openmrsFetch);
|
|
89
|
+
const mapper = ({ benefitCode, benefitName, parentBenefitCode }: Intervention): any => ({
|
|
90
|
+
interventionCode: benefitCode,
|
|
91
|
+
interventionName: benefitName,
|
|
92
|
+
interventionPackage: parentBenefitCode,
|
|
93
|
+
});
|
|
94
|
+
|
|
51
95
|
const interventions = useMemo(() => {
|
|
52
96
|
const packageCodes = filters.package_code?.split(',') || [];
|
|
53
|
-
return data?.data?.
|
|
97
|
+
return data?.data?.results
|
|
54
98
|
?.filter((d) => {
|
|
55
99
|
// 1. Filter by package code (only if defined)
|
|
56
|
-
if (packageCodes.length > 0 && !packageCodes.includes(d.
|
|
100
|
+
if (packageCodes.length > 0 && !packageCodes.includes(d.parentBenefitCode)) {
|
|
57
101
|
return false;
|
|
58
102
|
}
|
|
59
103
|
|
|
60
104
|
// 2. Filter by applicable gender (only if defined)
|
|
61
105
|
if (
|
|
62
106
|
filters.applicable_gender &&
|
|
63
|
-
d.
|
|
64
|
-
|
|
65
|
-
(r) =>
|
|
66
|
-
r.ruleCode === 'applicable_gender' &&
|
|
67
|
-
r.value && // Ensure value exists
|
|
68
|
-
!['ALL', filters.applicable_gender].includes(r.value),
|
|
69
|
-
),
|
|
70
|
-
)
|
|
107
|
+
d.applicableGender &&
|
|
108
|
+
!['ALL', filters.applicable_gender].includes(d.applicableGender)
|
|
71
109
|
) {
|
|
72
110
|
return false;
|
|
73
111
|
}
|
|
74
112
|
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
-
level &&
|
|
78
|
-
d.insuranceSchemes?.some((s) =>
|
|
79
|
-
s.rules?.some(
|
|
80
|
-
(r) =>
|
|
81
|
-
r.ruleCode === 'levels_applicable' &&
|
|
82
|
-
r.value && // Ensure value exists
|
|
83
|
-
!String(r.value).includes(level), // Convert to string to avoid array issues
|
|
84
|
-
),
|
|
85
|
-
)
|
|
86
|
-
) {
|
|
113
|
+
if (level && d.levelsApplicable && !d.levelsApplicable.some((l) => level.includes(l))) {
|
|
87
114
|
return false;
|
|
88
115
|
}
|
|
89
116
|
|
|
90
117
|
return true; // Keep item if it passes all filters
|
|
91
118
|
})
|
|
92
|
-
?.map(
|
|
93
|
-
interventionCode,
|
|
94
|
-
subCategoryBenefitsPackage: interventionSubPackage,
|
|
95
|
-
interventionName,
|
|
96
|
-
interventionPackage,
|
|
97
|
-
})) as SHAIntervention[];
|
|
119
|
+
?.map(mapper);
|
|
98
120
|
}, [data, filters, level]); // Ensure proper memoization
|
|
99
121
|
const allInterventions = useMemo(() => {
|
|
100
|
-
return (data?.data?.
|
|
101
|
-
({ interventionCode, interventionName, interventionPackage, interventionSubPackage }) => ({
|
|
102
|
-
interventionCode,
|
|
103
|
-
subCategoryBenefitsPackage: interventionSubPackage,
|
|
104
|
-
interventionName,
|
|
105
|
-
interventionPackage,
|
|
106
|
-
}),
|
|
107
|
-
) as SHAIntervention[];
|
|
122
|
+
return (data?.data?.results ?? []).map(mapper);
|
|
108
123
|
}, [data]);
|
|
124
|
+
|
|
109
125
|
return {
|
|
110
126
|
isLoading: isLoading || isLoadingFacilityLevel,
|
|
111
127
|
interventions: interventions ?? [],
|
package/src/hooks/usePackages.ts
CHANGED
|
@@ -10,17 +10,17 @@ const usePackages = () => {
|
|
|
10
10
|
const url = `${restBaseUrl}/kenyaemr/sha-benefits-package?synchronize=false`;
|
|
11
11
|
|
|
12
12
|
const { data, isLoading, error } = useSWR<
|
|
13
|
-
FetchResponse<{
|
|
13
|
+
FetchResponse<{ result: Array<{ benefitCode: string; benefitName: string; description?: string }> }>
|
|
14
14
|
>(url, openmrsFetch);
|
|
15
15
|
|
|
16
16
|
return {
|
|
17
17
|
isLoading,
|
|
18
|
-
packages: (data?.data.
|
|
18
|
+
packages: (data?.data.result ?? []).map(
|
|
19
19
|
(category) =>
|
|
20
20
|
({
|
|
21
|
-
uuid: `${category.
|
|
22
|
-
packageCode: category.
|
|
23
|
-
packageName: category.
|
|
21
|
+
uuid: `${category.benefitCode}`,
|
|
22
|
+
packageCode: category.benefitCode,
|
|
23
|
+
packageName: category.benefitName,
|
|
24
24
|
} as Package),
|
|
25
25
|
),
|
|
26
26
|
error,
|