@kenyaemr/esm-billing-app 5.4.1-pre.1978 → 5.4.1-pre.1983

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":"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.1978"}
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.1983"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-billing-app",
3
- "version": "5.4.1-pre.1978",
3
+ "version": "5.4.1-pre.1983",
4
4
  "description": "Billing app for KenyaEMR",
5
5
  "browser": "dist/kenyaemr-esm-billing-app.js",
6
6
  "main": "src/index.ts",
@@ -4,6 +4,7 @@ import { ClaimsPreAuthFilter } from '../../../types';
4
4
  import { ClaimsManagementHeader } from '../header/claims-header.component';
5
5
  import ClaimsFilterHeader from '../header/filter-header.component';
6
6
  import PreAuthTable from '../table/pre-auth-table.component';
7
+ import PreauthTableTemporary from '../table/preauth-table.tmp.component';
7
8
 
8
9
  const ClaimsManagementPreAuthRequest = () => {
9
10
  const { t } = useTranslation();
@@ -26,8 +27,8 @@ const ClaimsManagementPreAuthRequest = () => {
26
27
  return (
27
28
  <div className="omrs-main-content">
28
29
  <ClaimsManagementHeader title={t('preAuthRequets', 'Pre-Auth Requests')} />
29
- <ClaimsFilterHeader filters={filters} onFilterChanged={setFilters} statusOptions={status} />
30
- <PreAuthTable filters={filters} />
30
+ {/* <ClaimsFilterHeader filters={filters} onFilterChanged={setFilters} statusOptions={status} /> */}
31
+ <PreauthTableTemporary />
31
32
  </div>
32
33
  );
33
34
  };
@@ -0,0 +1,207 @@
1
+ import {
2
+ DataTable,
3
+ DataTableSkeleton,
4
+ OverflowMenu,
5
+ OverflowMenuItem,
6
+ Pagination,
7
+ Table,
8
+ TableBody,
9
+ TableCell,
10
+ TableContainer,
11
+ TableHead,
12
+ TableHeader,
13
+ TableRow,
14
+ Tag,
15
+ } from '@carbon/react';
16
+ import { formatDate, isDesktop, parseDate, showModal, useLayoutType, usePagination } from '@openmrs/esm-framework';
17
+ import { CardHeader, EmptyState, usePaginationInfo } from '@openmrs/esm-patient-common-lib';
18
+ import React, { useMemo, useState } from 'react';
19
+ import { useTranslation } from 'react-i18next';
20
+ import { ClaimsPreAuthFilter } from '../../../types';
21
+ import ClaimsFilterHeader from '../header/filter-header.component';
22
+ import styles from './claims-list-table.scss';
23
+ import { useFacilityClaims } from './use-facility-claims';
24
+
25
+ const PreauthTableTemporary: React.FC = () => {
26
+ const { claims, isLoading } = useFacilityClaims();
27
+ const { t } = useTranslation();
28
+ const [filters, setFilters] = useState<ClaimsPreAuthFilter>({
29
+ status: 'all',
30
+ });
31
+ const status = useMemo(
32
+ () => [
33
+ { value: 'all', label: t('all', 'All') },
34
+ { value: 'ENTERED', label: t('entered', 'Entered') },
35
+ { value: 'ERRORED', label: t('errored', 'Errored') },
36
+ { value: 'REJECTED', label: t('rejected', 'Rejected') },
37
+ { value: 'CHECKED', label: t('checked', 'Checked') },
38
+ { value: 'VALUATED', label: t('valuated', 'Valuated') },
39
+ ],
40
+ [t],
41
+ );
42
+ const [pageSize, setPageSize] = useState(5);
43
+ const filterClaims = (claim) => {
44
+ const status = filters?.status;
45
+ const search = filters?.search?.toLowerCase();
46
+ const fromDate = filters?.fromDate ? new Date(filters.fromDate) : null;
47
+ const toDate = filters?.toDate ? new Date(filters.toDate) : null;
48
+
49
+ const patientName = claim.patientName?.toLowerCase();
50
+ const providerName = claim.providerName?.toLowerCase();
51
+ const timeStamp = new Date(claim.dateFrom);
52
+ const preauthStatus = claim.status;
53
+
54
+ // Check status (allow 'all' to bypass the filter)
55
+ const statusMatch = status === 'all' || preauthStatus === status;
56
+
57
+ // Check search filter (patient name or provider name contains the search term)
58
+ const searchMatch = !search || patientName?.includes(search) || providerName?.includes(search);
59
+
60
+ // Check date range filter (timestamp is between fromDate and toDate if provided)
61
+ const dateMatch = (!fromDate || timeStamp >= fromDate) && (!toDate || timeStamp <= toDate);
62
+
63
+ // Return true if all conditions match
64
+ return statusMatch && searchMatch && dateMatch;
65
+ };
66
+
67
+ const filteredClaims = claims.filter(filterClaims);
68
+ const { paginated, goTo, results, currentPage } = usePagination(filteredClaims, pageSize);
69
+ const { pageSizes } = usePaginationInfo(pageSize, claims.length, currentPage, results.length);
70
+ const responsiveSize = isDesktop(useLayoutType()) ? 'sm' : 'lg';
71
+ const layout = useLayoutType();
72
+ const size = layout === 'tablet' ? 'lg' : 'md';
73
+
74
+ const headers = [
75
+ { key: 'status', header: t('status', 'Status') },
76
+ { key: 'providerName', header: t('provider', 'Provider') },
77
+ { key: 'patientName', header: t('patient', 'Patient') },
78
+ { key: 'claimedTotal', header: t('claimedAmount', 'Claimed Amount') },
79
+ { key: 'approvedTotal', header: t('approvedTotal', 'Approved Total') },
80
+ { key: 'dateFrom', header: t('dateCreated', 'Date Created') },
81
+ { key: 'action', header: t('action', 'Action') },
82
+ ];
83
+
84
+ if (isLoading) {
85
+ return (
86
+ <div className={styles.dataTableSkeleton}>
87
+ <DataTableSkeleton
88
+ headers={headers}
89
+ showToolbar={false}
90
+ showHeader={false}
91
+ columnCount={Object.keys(headers).length}
92
+ zebra
93
+ rowCount={pageSize}
94
+ />
95
+ </div>
96
+ );
97
+ }
98
+
99
+ if (claims.length === 0) {
100
+ return (
101
+ <div className={styles.claimsTable}>
102
+ <EmptyState
103
+ displayText={t('emptyPreauthState', 'There are no preauth to display')}
104
+ headerTitle={t('emptyPreauthHeader', 'No Preauths')}
105
+ />
106
+ </div>
107
+ );
108
+ }
109
+
110
+ const handleRetry = (claimId: string) => {
111
+ const dispose = showModal('retry-claim-request-modal', {
112
+ closeModal: () => dispose(),
113
+ claimId,
114
+ });
115
+ };
116
+
117
+ return (
118
+ <div className={styles.dataTableSkeleton}>
119
+ <div className={styles.tableHeader}>
120
+ <CardHeader title={t('preathsRequests', 'Preauth Requests')}>{''}</CardHeader>
121
+ <ClaimsFilterHeader filters={filters} onFilterChanged={setFilters} statusOptions={status} />
122
+ </div>
123
+ <DataTable rows={results} headers={headers} isSortable useZebraStyles>
124
+ {({ rows, headers, getHeaderProps, getRowProps, getTableProps }) => (
125
+ <TableContainer className={styles.claimsTable}>
126
+ <Table {...getTableProps()} aria-label="sample table">
127
+ <TableHead>
128
+ <TableRow>
129
+ {headers.map((header) => (
130
+ <TableHeader
131
+ key={header.key}
132
+ {...getHeaderProps({
133
+ header,
134
+ })}>
135
+ {header.header}
136
+ </TableHeader>
137
+ ))}
138
+ </TableRow>
139
+ </TableHead>
140
+ <TableBody>
141
+ {rows.map((row) => {
142
+ const rowStatus = row.cells.find((cell) => cell.info.header === 'status')?.value;
143
+ return (
144
+ <TableRow
145
+ {...getRowProps({
146
+ row,
147
+ })}>
148
+ {row.cells.map((cell) => (
149
+ <TableCell key={cell.id}>
150
+ {cell.info.header === 'status' ? (
151
+ <ClaimStatus cell={cell} row={row} />
152
+ ) : cell.info.header === 'action' && ['ENTERED', 'ERRORED'].includes(rowStatus) ? (
153
+ <OverflowMenu size={size} flipped>
154
+ <OverflowMenuItem
155
+ itemText={t('retryRequest', 'Retry request')}
156
+ onClick={() => handleRetry(row.id)}
157
+ />
158
+ </OverflowMenu>
159
+ ) : cell.info.header === 'dateFrom' ? (
160
+ formatDate(parseDate(cell.value))
161
+ ) : (
162
+ cell.value
163
+ )}
164
+ </TableCell>
165
+ ))}
166
+ </TableRow>
167
+ );
168
+ })}
169
+ </TableBody>
170
+ </Table>
171
+ {paginated && !isLoading && (
172
+ <Pagination
173
+ forwardText=""
174
+ backwardText=""
175
+ page={currentPage}
176
+ pageSize={pageSize}
177
+ pageSizes={pageSizes}
178
+ totalItems={filteredClaims.length}
179
+ size={responsiveSize}
180
+ onChange={({ page: newPage, pageSize }) => {
181
+ if (newPage !== currentPage) {
182
+ goTo(newPage);
183
+ }
184
+ setPageSize(pageSize);
185
+ }}
186
+ />
187
+ )}
188
+ </TableContainer>
189
+ )}
190
+ </DataTable>
191
+ </div>
192
+ );
193
+ };
194
+
195
+ export default PreauthTableTemporary;
196
+
197
+ const ClaimStatus = ({ cell, row }: { cell: { value: string }; row: any }) => {
198
+ const { claims } = useFacilityClaims();
199
+
200
+ const claim = claims.find((claim) => claim.id === row.id);
201
+ return (
202
+ <div className={styles.claimStatus}>
203
+ <p>{cell.value}</p>
204
+ {claim.externalId && <Tag type="blue">{claim.externalId}</Tag>}
205
+ </div>
206
+ );
207
+ };
@@ -350,7 +350,7 @@ const ClaimsForm: React.FC<ClaimsFormProps> = ({ bill, selectedLineItems }) => {
350
350
  <Button className={styles.button} kind="secondary" onClick={handleNavigateToBillingOptions}>
351
351
  {t('discardClaim', 'Discard Claim')}
352
352
  </Button>
353
- <Button className={styles.button} kind="primary" type="submit" disabled={!isValid || loading}>
353
+ <Button className={styles.button} kind="primary" type="submit" disabled={loading}>
354
354
  {loading ? (
355
355
  <InlineLoading description={t('processing', 'Processing...')} />
356
356
  ) : (