@kenyaemr/esm-billing-app 5.4.1-pre.2102 → 5.4.1-pre.2107

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/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":"manage-claim-request-modal","component":"manageClaimRequestModal"},{"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.2102"}
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":"manage-claim-request-modal","component":"manageClaimRequestModal"},{"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.2107"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-billing-app",
3
- "version": "5.4.1-pre.2102",
3
+ "version": "5.4.1-pre.2107",
4
4
  "description": "Billing app for KenyaEMR",
5
5
  "browser": "dist/kenyaemr-esm-billing-app.js",
6
6
  "main": "src/index.ts",
@@ -70,6 +70,7 @@ const PackageInterventions: React.FC<PackageInterventionsProps> = ({ categories,
70
70
  render={({ field }) => (
71
71
  <MultiSelect
72
72
  ref={field.ref}
73
+ disabled={!categories || categories.length === 0}
73
74
  invalid={form.formState.errors[field.name]?.message}
74
75
  invalidText={form.formState.errors[field.name]?.message}
75
76
  id="interventions"
@@ -92,6 +92,9 @@ const ClaimsTable: React.FC<TableProps> = ({ title, emptyStateText, emptyStateHe
92
92
  const layout = useLayoutType();
93
93
  const size = layout === 'tablet' ? 'lg' : 'md';
94
94
  const filteredClaimIds = filteredClaims.map((claim) => claim.responseUUID);
95
+ const responseUUIDs = filteredClaimIds
96
+ .map((claimId) => claims.find((c) => c.responseUUID === claimId)?.responseUUID)
97
+ .filter((uuid) => uuid);
95
98
 
96
99
  const getHeaders = (): Header[] => {
97
100
  let baseHeaders = [
@@ -208,7 +211,7 @@ const ClaimsTable: React.FC<TableProps> = ({ title, emptyStateText, emptyStateHe
208
211
  filters={filters}
209
212
  onFilterChanged={setFilters}
210
213
  statusOptions={status}
211
- filteredClaimIds={filteredClaimIds}
214
+ filteredClaimIds={responseUUIDs}
212
215
  />
213
216
  </div>
214
217
  <DataTable rows={results} headers={headers} isSortable useZebraStyles>
@@ -79,54 +79,95 @@ interface Intervention {
79
79
  benefit: number;
80
80
  }
81
81
 
82
+ /**
83
+ * Hook to fetch and filter interventions based on provided filters
84
+ * @param filters Object containing filtering criteria
85
+ * @returns Object with loading state, filtered interventions, all interventions, and any errors
86
+ */
82
87
  export const useInterventions = (filters: InterventionsFilter) => {
83
88
  const { error: facilityLevelError, isLoading: isLoadingFacilityLevel, level } = useFacilityLevel();
89
+
90
+ // Build URL parameters for the API call
84
91
  const urlParams = new URLSearchParams({
85
- ...filters,
92
+ ...(filters || {}),
86
93
  synchronize: 'false',
87
94
  });
95
+
88
96
  const url = `${restBaseUrl}/kenyaemr/sha-interventions?${urlParams.toString()}`;
89
97
  const { isLoading, error, data } = useSWR<FetchResponse<{ results: Array<Intervention> }>>(url, openmrsFetch);
90
- const mapper = ({ benefitCode, name, parentBenefitCode }: Intervention): any => ({
98
+
99
+ // Mapper function to transform intervention data
100
+ const mapper = ({ benefitCode, name, parentBenefitCode }: Intervention): SHAIntervention => ({
91
101
  interventionCode: benefitCode,
92
102
  interventionName: name,
93
103
  interventionPackage: parentBenefitCode,
104
+ ...({} as any),
94
105
  });
95
106
 
107
+ // Filter and map interventions
96
108
  const interventions = useMemo(() => {
97
- const packageCodes = filters.package_code?.split(',') || [];
98
- return data?.data?.results
99
- ?.filter((d) => {
100
- // 1. Filter by package code (only if defined)
101
- if (packageCodes.length > 0 && !packageCodes.includes(d.parentBenefitCode)) {
102
- return false;
103
- }
104
-
105
- // 2. Filter by applicable gender (only if defined)
106
- if (
107
- filters.applicable_gender &&
108
- d.applicableGender &&
109
- !['ALL', filters.applicable_gender].includes(d.applicableGender)
110
- ) {
111
- return false;
112
- }
113
-
114
- if (level && d.levelsApplicable && !d.levelsApplicable.some((l) => level.includes(l))) {
115
- return false;
116
- }
117
-
118
- return true; // Keep item if it passes all filters
119
- })
120
- ?.map(mapper);
121
- }, [data, filters, level]); // Ensure proper memoization
109
+ if (!data?.data?.results) {
110
+ return [];
111
+ }
112
+
113
+ const packageCodes = filters.package_code?.split(',').filter(Boolean) || [];
114
+
115
+ // Filter based on criteria
116
+ const filteredResults = data.data.results.filter((intervention) => {
117
+ // Filter by package code (only if defined)
118
+ if (packageCodes.length > 0 && !packageCodes.includes(intervention.parentBenefitCode)) {
119
+ return false;
120
+ }
121
+
122
+ // Filter by applicable gender (only if defined)
123
+ if (
124
+ filters.applicable_gender &&
125
+ intervention.applicableGender &&
126
+ !['ALL', filters.applicable_gender].includes(intervention.applicableGender)
127
+ ) {
128
+ return false;
129
+ }
130
+
131
+ // Filter by facility level
132
+ if (level && intervention.levelsApplicable && !intervention.levelsApplicable.some((l) => level.includes(l))) {
133
+ return false;
134
+ }
135
+
136
+ return true; // Keep item if it passes all filters
137
+ });
138
+
139
+ // Map to the required format and ensure uniqueness by interventionCode
140
+ const mappedInterventions = filteredResults.map(mapper);
141
+
142
+ // Remove duplicates based on interventionCode
143
+ const uniqueInterventions = Array.from(
144
+ new Map(mappedInterventions.map((item) => [item.interventionCode, item])),
145
+ ).map(([, value]) => value);
146
+
147
+ return uniqueInterventions;
148
+ }, [data, filters, level]);
149
+
150
+ // Map all interventions without filtering
122
151
  const allInterventions = useMemo(() => {
123
- return (data?.data?.results ?? []).map(mapper);
152
+ if (!data?.data?.results) {
153
+ return [];
154
+ }
155
+
156
+ // Map to the required format and ensure uniqueness
157
+ const mappedInterventions = data.data.results.map(mapper);
158
+
159
+ // Remove duplicates based on interventionCode
160
+ const uniqueInterventions = Array.from(
161
+ new Map(mappedInterventions.map((item) => [item.interventionCode, item])),
162
+ ).map(([, value]) => value);
163
+
164
+ return uniqueInterventions;
124
165
  }, [data]);
125
166
 
126
167
  return {
127
168
  isLoading: isLoading || isLoadingFacilityLevel,
128
- interventions: (interventions ?? []) as Array<SHAIntervention>,
129
- allInterventions: (allInterventions ?? []) as Array<SHAIntervention>,
169
+ interventions: interventions as Array<SHAIntervention>,
170
+ allInterventions: allInterventions as Array<SHAIntervention>,
130
171
  error: error || facilityLevelError,
131
172
  };
132
173
  };
@@ -14,6 +14,7 @@
14
14
  "amount": "Amount",
15
15
  "anErrorOccurred": "An Error Occurred",
16
16
  "anErrorOccurredCreatingPaymentPoint": "An error occurred creating payment point",
17
+ "approved": "Approved",
17
18
  "approvedTotal": "Approved Total",
18
19
  "attributeDescription": "Attribute description",
19
20
  "attributeFormat": "Attribute format",
@@ -95,10 +96,6 @@
95
96
  "editSchema": "Edit Schema",
96
97
  "editServiceChargeItem": "Edit Service Charge Item",
97
98
  "eligibleBenefits": "Eligible benefits",
98
- "emptyClaimsHeader": "No Claims",
99
- "emptyClaimsState": "There are no claims to display",
100
- "emptyPreauthHeader": "No Preauths",
101
- "emptyPreauthState": "There are no preauth to display",
102
99
  "endDate": "End date",
103
100
  "endVisitAndClaim": "End visit and Process claims",
104
101
  "enterAmount": "Enter amount",
@@ -215,7 +212,6 @@
215
212
  "Phone Number": "Phone Number",
216
213
  "pleaseSelectItems": "Please select line items to raise a claim",
217
214
  "policyNumber": "Policy number",
218
- "preathsRequests": "Preauth Requests",
219
215
  "preauthRequest": "Preauth requests",
220
216
  "preAuthRequests": "Pre-auth requests",
221
217
  "preAuthRequets": "Pre-Auth Requests",
@@ -292,6 +288,7 @@
292
288
  "type": "Type",
293
289
  "unitPrice": "Unit price",
294
290
  "updateRegistration": "Update registration",
291
+ "updateStatus": "Update status",
295
292
  "valuated": "Valuated",
296
293
  "verifyingBillStatus": "Verifying bill status...",
297
294
  "visitEnded": "Visit ended",