@kenyaemr/esm-billing-app 5.4.2-pre.2805 → 5.4.2-pre.2821

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},{"component":"billingAdmin","route":"billing-admin"}],"extensions":[{"component":"accountingDashboardLink","name":"accounting-dashboard-link","slots":["homepage-dashboard-slot"],"meta":{"name":"accounting","slot":"accounting-dashboard-slot","title":"Accounting"}},{"name":"billing-dashboard","component":"billingDashboard","slot":"accounting-dashboard-slot"},{"component":"benefitsPackageDashboardLink","name":"benefits-package-dashboard-link","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","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":"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":"claimsManagementOverviewDashboardLink","name":"claims-management-overview-link","slots":["claims-management-dashboard-link-slot"]},{"component":"preAuthRequestsDashboardLink","name":"preauthrequest-overview-link","slots":["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"},{"name":"patient-info-sha-status","component":"patientBannerShaStatus","slot":"patient-banner-tags-slot"},{"name":"payments-points-dashboard-link","component":"paymentPointDashboardLink","slot":"billing-admin-dashboard-slot","meta":{"name":"cashier-points","title":"Payment Point","slot":"payment-point-dashboard-slot"}},{"name":"payment-points-dashboard","component":"paymentPoints","slot":"payment-point-dashboard-slot"},{"name":"payment-mode-dashboard-link","component":"paymentModeLink","slot":"billing-admin-dashboard-slot","meta":{"name":"payment-modes","title":"Payment Mode","slot":"payment-mode-dashboard-slot"}},{"name":"payment-mode-dashboard","component":"paymentModeDashboard","slot":"payment-mode-dashboard-slot"},{"name":"bill-deposit-dashboard-link","component":"billDepositDashboardLink","slot":"billing-admin-dashboard-slot","meta":{"name":"bill-deposit","title":"Bill Deposit","slot":"billing-deposit-dashboard-slot"}},{"name":"bill-deposit-dashboard","component":"billDepositDashboard","slot":"billing-deposit-dashboard-slot"},{"name":"billable-exemptions-dashboard-link","component":"billableExemptionsLink","slot":"billing-admin-dashboard-slot","meta":{"name":"billable-exemptions","title":"Billable Exemptions","slot":"billing-exemptions-dashboard-slot"}},{"name":"billable-exemptions-dashboard","component":"billableExemptions","slot":"billing-exemptions-dashboard-slot"},{"name":"clinical-charges-dashboard-link","component":"clinicalChargesLink","slot":"billing-admin-dashboard-slot","meta":{"name":"clinical-charges","title":"Clinical Charges","slot":"clinical-charges-dashboard-slot"}},{"name":"clinical-charges-dashboard","component":"clinicalCharges","slot":"clinical-charges-dashboard-slot"},{"name":"payment-history-dashboard-link","component":"paymentHistoryLink","slot":"billing-admin-dashboard-slot","meta":{"name":"payment-history","title":"Payment History","slot":"payment-history-dashboard-slot"}},{"name":"payment-history-dashboard","component":"paymentHistoryDashboard","slot":"payment-history-dashboard-slot"},{"name":"patient-billing-dashboard-link","component":"patientBillingLink","slot":"billing-admin-dashboard-slot","meta":{"name":"patient-billing","title":"Patient Billing","slot":"patient-billing-dashboard-slot"}},{"name":"patient-billing-dashboard","component":"patientBilling","slot":"patient-billing-dashboard-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":"commodityForm","title":"Charge Commodity 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":"add-deposit-workspace","component":"addDepositWorkspace","title":"Add Deposit","type":"other-form"},{"name":"deposit-transaction-workspace","component":"depositTransactionWorkspace","title":"Deposit Transaction","type":"other-form"},{"name":"payment-workspace","component":"paymentWorkspace","title":"Payment 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":"clock-in-modal","component":"clockIn"},{"name":"create-bill-item-modal","component":"createBillItemModal"},{"name":"delete-deposit-modal","component":"deleteDepositModal"},{"name":"reverse-transaction-modal","component":"reverseTransactionModal"},{"name":"print-preview-modal","component":"printPreviewModal"},{"name":"bill-action-modal","component":"billActionModal"},{"name":"require-billing-modal","component":"requirePaymentModal"}],"version":"5.4.2-pre.2805"}
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},{"component":"billingAdmin","route":"billing-admin"}],"extensions":[{"component":"accountingDashboardLink","name":"accounting-dashboard-link","slots":["homepage-dashboard-slot"],"meta":{"name":"accounting","slot":"accounting-dashboard-slot","title":"Accounting"}},{"name":"billing-dashboard","component":"billingDashboard","slot":"accounting-dashboard-slot"},{"component":"benefitsPackageDashboardLink","name":"benefits-package-dashboard-link","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","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":"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":"claimsManagementOverviewDashboardLink","name":"claims-management-overview-link","slots":["claims-management-dashboard-link-slot"]},{"component":"preAuthRequestsDashboardLink","name":"preauthrequest-overview-link","slots":["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"},{"name":"patient-info-sha-status","component":"patientBannerShaStatus","slot":"patient-banner-tags-slot"},{"name":"payments-points-dashboard-link","component":"paymentPointDashboardLink","slot":"billing-admin-dashboard-slot","meta":{"name":"cashier-points","title":"Payment Point","slot":"payment-point-dashboard-slot"}},{"name":"payment-points-dashboard","component":"paymentPoints","slot":"payment-point-dashboard-slot"},{"name":"payment-mode-dashboard-link","component":"paymentModeLink","slot":"billing-admin-dashboard-slot","meta":{"name":"payment-modes","title":"Payment Mode","slot":"payment-mode-dashboard-slot"}},{"name":"payment-mode-dashboard","component":"paymentModeDashboard","slot":"payment-mode-dashboard-slot"},{"name":"bill-deposit-dashboard-link","component":"billDepositDashboardLink","slot":"billing-admin-dashboard-slot","meta":{"name":"bill-deposit","title":"Bill Deposit","slot":"billing-deposit-dashboard-slot"}},{"name":"bill-deposit-dashboard","component":"billDepositDashboard","slot":"billing-deposit-dashboard-slot"},{"name":"billable-exemptions-dashboard-link","component":"billableExemptionsLink","slot":"billing-admin-dashboard-slot","meta":{"name":"billable-exemptions","title":"Billable Exemptions","slot":"billing-exemptions-dashboard-slot"}},{"name":"billable-exemptions-dashboard","component":"billableExemptions","slot":"billing-exemptions-dashboard-slot"},{"name":"clinical-charges-dashboard-link","component":"clinicalChargesLink","slot":"billing-admin-dashboard-slot","meta":{"name":"clinical-charges","title":"Clinical Charges","slot":"clinical-charges-dashboard-slot"}},{"name":"clinical-charges-dashboard","component":"clinicalCharges","slot":"clinical-charges-dashboard-slot"},{"name":"payment-history-dashboard-link","component":"paymentHistoryLink","slot":"billing-admin-dashboard-slot","meta":{"name":"payment-history","title":"Payment History","slot":"payment-history-dashboard-slot"}},{"name":"payment-history-dashboard","component":"paymentHistoryDashboard","slot":"payment-history-dashboard-slot"},{"name":"patient-billing-dashboard-link","component":"patientBillingLink","slot":"billing-admin-dashboard-slot","meta":{"name":"patient-billing","title":"Patient Billing","slot":"patient-billing-dashboard-slot"}},{"name":"patient-billing-dashboard","component":"patientBilling","slot":"patient-billing-dashboard-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":"commodityForm","title":"Charge Commodity 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":"add-deposit-workspace","component":"addDepositWorkspace","title":"Add Deposit","type":"other-form"},{"name":"deposit-transaction-workspace","component":"depositTransactionWorkspace","title":"Deposit Transaction","type":"other-form"},{"name":"payment-workspace","component":"paymentWorkspace","title":"Payment 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":"claim-summary-modal","component":"claimSummaryModal"},{"name":"clock-in-modal","component":"clockIn"},{"name":"create-bill-item-modal","component":"createBillItemModal"},{"name":"delete-deposit-modal","component":"deleteDepositModal"},{"name":"reverse-transaction-modal","component":"reverseTransactionModal"},{"name":"print-preview-modal","component":"printPreviewModal"},{"name":"bill-action-modal","component":"billActionModal"},{"name":"require-billing-modal","component":"requirePaymentModal"}],"version":"5.4.2-pre.2821"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-billing-app",
3
- "version": "5.4.2-pre.2805",
3
+ "version": "5.4.2-pre.2821",
4
4
  "description": "Billing app for KenyaEMR",
5
5
  "keywords": [
6
6
  "openmrs"
@@ -0,0 +1,153 @@
1
+ import { Button, ModalBody, ModalFooter, ModalHeader, Tag } from '@carbon/react';
2
+ import { formatDate, parseDate } from '@openmrs/esm-framework';
3
+ import React from 'react';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { FacilityClaim } from '../../../../types';
6
+ import { useFacilityClaims } from '../use-facility-claims';
7
+ import { statusColors } from '../../../utils';
8
+ import { CardHeader } from '@openmrs/esm-patient-common-lib';
9
+ import styles from './claim-summary.scss';
10
+ import upperCase from 'lodash-es/upperCase';
11
+
12
+ type ExtendedClaim = FacilityClaim & {
13
+ id: string;
14
+ providerName: string;
15
+ patientName: string;
16
+ patientId?: string;
17
+ visitType?: { uuid: string; display: string };
18
+ patient?: {
19
+ uuid: string;
20
+ display: string;
21
+ person?: {
22
+ display?: string;
23
+ gender: string;
24
+ age: number;
25
+ birthdate: string;
26
+ };
27
+ };
28
+ };
29
+
30
+ export const ClaimSummaryModal = ({ closeModal, claimId }: { closeModal: () => void; claimId: string }) => {
31
+ const { t } = useTranslation();
32
+ const { claims } = useFacilityClaims();
33
+
34
+ const claim = claims.find((claim) => claim.id === claimId) as ExtendedClaim | undefined;
35
+
36
+ if (!claim) {
37
+ return (
38
+ <React.Fragment>
39
+ <ModalHeader closeModal={closeModal}>{t('claimSummary', 'Claim Summary')}</ModalHeader>
40
+ <ModalBody>
41
+ <p>{t('claimNotFound', 'Claim not found')}</p>
42
+ </ModalBody>
43
+ <ModalFooter>
44
+ <Button kind="primary" onClick={closeModal} type="button">
45
+ {t('close', 'Close')}
46
+ </Button>
47
+ </ModalFooter>
48
+ </React.Fragment>
49
+ );
50
+ }
51
+
52
+ return (
53
+ <React.Fragment>
54
+ <ModalHeader closeModal={closeModal}>{t('claimSummary', 'Claim Summary')}</ModalHeader>
55
+ <ModalBody>
56
+ <div className={styles.container}>
57
+ <CardHeader title={t('patientInformation', 'Patient Information')}>
58
+ <div />
59
+ </CardHeader>
60
+ <div className={styles.section}>
61
+ <div className={styles.grid}>
62
+ <div className={styles.field}>
63
+ <span className={styles.label}>{t('patientName', 'Patient Name')}</span>
64
+ <span className={styles.value}>{upperCase(claim.patient?.person?.display) || '-'}</span>
65
+ </div>
66
+ <div className={styles.field}>
67
+ <span className={styles.label}>{t('gender', 'Gender')}</span>
68
+ <span className={styles.value}>{claim.patient?.person?.gender || '-'}</span>
69
+ </div>
70
+ <div className={styles.field}>
71
+ <span className={styles.label}>{t('age', 'Age')}</span>
72
+ <span className={styles.value}>
73
+ {claim.patient?.person?.age ? `${claim.patient.person.age} years` : '-'}
74
+ </span>
75
+ </div>
76
+ <div className={styles.field}>
77
+ <span className={styles.label}>{t('birthdate', 'Birthdate')}</span>
78
+ <span className={styles.value}>
79
+ {claim.patient?.person?.birthdate
80
+ ? formatDate(parseDate(claim.patient.person.birthdate), { time: false, noToday: true })
81
+ : '-'}
82
+ </span>
83
+ </div>
84
+ </div>
85
+ </div>
86
+
87
+ <CardHeader title={t('claimInformation', 'Claim Information')}>
88
+ <div />
89
+ </CardHeader>
90
+ <div className={styles.section}>
91
+ <div className={styles.grid}>
92
+ <div className={styles.field}>
93
+ <span className={styles.label}>{t('claimNumber', 'Claim Number')}</span>
94
+ <span className={styles.value}>{t('CO-01878', 'CO-01878')}</span>
95
+ </div>
96
+ <div className={styles.field}>
97
+ <span className={styles.label}>{t('dateFrom', 'Date From')}</span>
98
+ <span className={styles.value}>
99
+ {claim.dateFrom ? formatDate(parseDate(claim.dateFrom), { time: false, noToday: true }) : '-'}
100
+ </span>
101
+ </div>
102
+ <div className={styles.field}>
103
+ <span className={styles.label}>{t('dateTo', 'Date To')}</span>
104
+ <span className={styles.value}>
105
+ {claim.dateTo ? formatDate(parseDate(claim.dateTo), { time: false, noToday: true }) : '-'}
106
+ </span>
107
+ </div>
108
+ <div className={styles.field}>
109
+ <span className={styles.label}>{t('visitType', 'Visit Type')}</span>
110
+ <span className={styles.value}>{claim.visitType?.display || claim.use || '-'}</span>
111
+ </div>
112
+ </div>
113
+ </div>
114
+
115
+ <CardHeader title={t('providerInformation', 'Provider Information')}>
116
+ <div />
117
+ </CardHeader>
118
+ <div className={styles.section}>
119
+ <div className={styles.grid}>
120
+ <div className={styles.field}>
121
+ <span className={styles.label}>{t('providerName', 'Provider Name')}</span>
122
+ <span className={styles.value}>{claim.providerName || '-'}</span>
123
+ </div>
124
+ </div>
125
+ </div>
126
+
127
+ <CardHeader title={t('financialSummary', 'Financial Summary')}>
128
+ <div />
129
+ </CardHeader>
130
+ <div className={styles.section}>
131
+ <div className={styles.totalContainer}>
132
+ <span className={styles.totalLabel}>{t('claimedAmount', 'Claimed Amount')}</span>
133
+ <span className={styles.totalValue}>
134
+ {claim.claimedTotal ? `KES ${claim.claimedTotal.toLocaleString()}` : 'KES 0'}
135
+ </span>
136
+ </div>
137
+ <div className={styles.totalContainer}>
138
+ <span className={styles.totalLabel}>{t('approvedAmount', 'Approved Amount')}</span>
139
+ <span className={styles.totalValue}>
140
+ {claim.approvedTotal ? `KES ${claim.approvedTotal.toLocaleString()}` : 'KES 0'}
141
+ </span>
142
+ </div>
143
+ </div>
144
+ </div>
145
+ </ModalBody>
146
+ <ModalFooter>
147
+ <Button kind="primary" onClick={closeModal} type="button">
148
+ {t('close', 'Close')}
149
+ </Button>
150
+ </ModalFooter>
151
+ </React.Fragment>
152
+ );
153
+ };
@@ -0,0 +1,54 @@
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@carbon/colors';
4
+ .container {
5
+ padding: layout.$spacing-05;
6
+ }
7
+
8
+ .section {
9
+ margin-top: layout.$spacing-06;
10
+ background-color:colors.$white;
11
+ padding: layout.$spacing-05;
12
+ margin-bottom: layout.$spacing-06;
13
+ }
14
+
15
+ .grid {
16
+ display: grid;
17
+ grid-template-columns: repeat(2, 1fr);
18
+ gap: layout.$spacing-05;
19
+ margin-bottom: layout.$spacing-05;
20
+ }
21
+
22
+ .field {
23
+ display: flex;
24
+ flex-direction: column;
25
+ gap: layout.$spacing-02;
26
+ }
27
+
28
+ .label {
29
+ @include type.type-style('label-01');
30
+ font-weight: 600;
31
+ text-transform: uppercase;
32
+ }
33
+
34
+ .value {
35
+ @include type.type-style('body-short-01');
36
+ }
37
+
38
+ .totalContainer {
39
+ display: flex;
40
+ justify-content: space-between;
41
+ padding: layout.$spacing-05;
42
+ border-radius: layout.$spacing-02;
43
+ margin-top: layout.$spacing-03;
44
+ }
45
+
46
+ .totalLabel {
47
+ @include type.type-style('body-short-01');
48
+ font-weight: 600;
49
+ }
50
+
51
+ .totalValue {
52
+ @include type.type-style('heading-compact-01');
53
+ font-weight: 600;
54
+ }
@@ -153,6 +153,13 @@ const ClaimsTable: React.FC<TableProps> = ({
153
153
  });
154
154
  };
155
155
 
156
+ const handleViewSummary = (claimId: string) => {
157
+ const dispose = showModal('claim-summary-modal', {
158
+ closeModal: () => dispose(),
159
+ claimId,
160
+ });
161
+ };
162
+
156
163
  // Cell rendering functions
157
164
  const renderStatusCell = (row: DataTableRow) => {
158
165
  return <ClaimStatus row={row} />;
@@ -161,6 +168,7 @@ const ClaimsTable: React.FC<TableProps> = ({
161
168
  const renderActionCell = (row: DataTableRow, rowStatus: string, size: 'lg' | 'md' | 'sm') => {
162
169
  return (
163
170
  <OverflowMenu size={size} flipped>
171
+ <OverflowMenuItem itemText={t('viewSummary', 'View Summary')} onClick={() => handleViewSummary(row.id)} />
164
172
  {['ENTERED', 'ERRORED'].includes(rowStatus) && (
165
173
  <OverflowMenuItem
166
174
  itemText={t('retryRequest', 'Retry request')}
@@ -4,7 +4,7 @@ import { FacilityClaim } from '../../../types';
4
4
 
5
5
  export const useFacilityClaims = () => {
6
6
  const customPresentation =
7
- 'custom:(uuid,claimCode,use,dateFrom,dateTo,claimedTotal,approvedTotal,status,externalId,responseUUID,provider:(person:(display),display),patient:(uuid,display))';
7
+ 'custom:(uuid,claimCode,use,dateFrom,dateTo,claimedTotal,approvedTotal,status,externalId,responseUUID,provider:(person:(display),display),patient:(uuid,display,person:(display,gender,age,birthdate)),visitType:(uuid,display))';
8
8
  const url = `${restBaseUrl}/claim?v=${customPresentation}`;
9
9
 
10
10
  const { data, error, isLoading, mutate, isValidating } = useSWR<FetchResponse<{ results: Array<FacilityClaim> }>>(
@@ -14,15 +14,22 @@ export const useFacilityClaims = () => {
14
14
 
15
15
  const formatClaim = (
16
16
  claim: FacilityClaim,
17
- ): FacilityClaim & { id: string; providerName: string; patientName: string; patientId?: string } => ({
17
+ ): FacilityClaim & {
18
+ id: string;
19
+ providerName: string;
20
+ patientName: string;
21
+ patientId?: string;
22
+ visitType?: { uuid: string; display: string };
23
+ } => ({
18
24
  ...claim,
19
25
  id: claim.uuid,
20
- providerName: claim.provider?.person?.display,
26
+ providerName: claim.provider?.person?.display || claim.provider?.display || '',
21
27
  approvedTotal: claim.approvedTotal ?? 0,
22
28
  status: claim.status,
23
- patientName: claim.patient?.display,
29
+ patientName: claim.patient?.display || '',
24
30
  insurer: claim.insurer ?? '',
25
31
  patientId: claim.patient?.uuid,
32
+ visitType: claim.visitType,
26
33
  });
27
34
 
28
35
  const formattedClaims = data?.data.results.map(formatClaim) ?? [];
@@ -20,6 +20,7 @@ import { Controller, FormProvider, useForm } from 'react-hook-form';
20
20
  import { useTranslation } from 'react-i18next';
21
21
  import { useParams } from 'react-router-dom';
22
22
  import { z } from 'zod';
23
+ import debounce from 'lodash-es/debounce';
23
24
  import SHABenefitPackangesAndInterventions from '../../../benefits-package/forms/packages-and-interventions-form.component';
24
25
  import { BillingConfig } from '../../../config-schema';
25
26
  import { useSystemSetting } from '../../../hooks/getMflCode';
@@ -29,9 +30,7 @@ import useProviderList from '../../../hooks/useProviderList';
29
30
  import { ClaimSummary, LineItem, MappedBill, OTPVerificationModalOptions } from '../../../types';
30
31
  import ClaimExplanationAndJusificationInput from './claims-explanation-and-justification-form-input.component';
31
32
  import { ClaimsFormSchema, ClaimsFormSchemaBase, processClaims, useVisit } from './claims-form.resource';
32
-
33
- import debounce from 'lodash-es/debounce';
34
- import { otpManager } from '../../../hooks/useOTP';
33
+ import { otpManager, useOtpSource } from '../../../hooks/useOTP';
35
34
  import { usePhoneNumberAttribute } from '../../../hooks/usePhoneNumber';
36
35
  import { formatDateTime } from '../../utils';
37
36
  import styles from './claims-form.scss';
@@ -63,6 +62,7 @@ const ClaimsForm: React.FC<ClaimsFormProps> = ({ bill, selectedLineItems }) => {
63
62
  const { providers, providersLoading } = useProviderList();
64
63
  const { phoneNumber } = usePhoneNumberAttribute(patientUuid);
65
64
  const { nationalId, isLoading: isLoadingNationalId, error: errorNationalId } = usePatientIdentifier(patientUuid);
65
+ const { otpSource, isLoading: isLoadingOtpSource } = useOtpSource();
66
66
 
67
67
  const [otpState, setOtpState] = useState<OTPState>(OTPState.NOT_STARTED);
68
68
  const [pendingClaimData, setPendingClaimData] = useState<z.infer<typeof ClaimsFormSchema> | null>(null);
@@ -77,6 +77,12 @@ const ClaimsForm: React.FC<ClaimsFormProps> = ({ bill, selectedLineItems }) => {
77
77
  const patientName = `${bill.patientName}`;
78
78
  const otpExpiryMinutes = 5;
79
79
 
80
+ useEffect(() => {
81
+ if (otpSource) {
82
+ otpManager.setOtpSource(otpSource);
83
+ }
84
+ }, [otpSource]);
85
+
80
86
  const form = useForm<z.infer<typeof ClaimsFormSchema>>({
81
87
  mode: 'onTouched',
82
88
  resolver: zodResolver(validationEnabled ? ClaimsFormSchema : ClaimsFormSchemaBase),
@@ -207,7 +213,14 @@ const ClaimsForm: React.FC<ClaimsFormProps> = ({ bill, selectedLineItems }) => {
207
213
  throw new Error('No claim data available for OTP request');
208
214
  }
209
215
 
210
- await otpManager.requestOTP(phoneNumber, patientName, currentSummary, otpExpiryMinutes, nationalId || null);
216
+ await otpManager.requestOTP(
217
+ phoneNumber,
218
+ patientName,
219
+ currentSummary,
220
+ otpExpiryMinutes,
221
+ nationalId || null,
222
+ t,
223
+ );
211
224
  },
212
225
  onVerify: async (otp: string): Promise<void> => {
213
226
  const phoneForVerification = currentPhoneRef.current;
@@ -444,6 +457,7 @@ const ClaimsForm: React.FC<ClaimsFormProps> = ({ bill, selectedLineItems }) => {
444
457
 
445
458
  const isFormValid = isValid && packages?.length > 0 && interventions?.length > 0 && selectedLineItems?.length > 0;
446
459
  const displayPhoneNumber = currentOtpPhoneNumber || phoneNumber;
460
+ const isOtpDisabled = !isFormValid || !displayPhoneNumber || isLoadingOtpSource;
447
461
 
448
462
  return (
449
463
  <FormProvider {...form}>
@@ -667,10 +681,10 @@ const ClaimsForm: React.FC<ClaimsFormProps> = ({ bill, selectedLineItems }) => {
667
681
  className={styles.button}
668
682
  kind="primary"
669
683
  onClick={handleSubmit(handleInitiateOTPVerification)}
670
- disabled={!isFormValid || !displayPhoneNumber}
684
+ disabled={isOtpDisabled}
671
685
  tooltipPosition="top"
672
686
  tooltipAlignment="center">
673
- {t('sendOtp', 'Send OTP')}
687
+ {isLoadingOtpSource ? t('loading', 'Loading...') : t('sendOtp', 'Send OTP')}
674
688
  </Button>
675
689
  )}
676
690