@kenyaemr/esm-billing-app 5.4.1-pre.1710 → 5.4.1-pre.1729

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.
Files changed (42) hide show
  1. package/.turbo/turbo-build.log +58 -79
  2. package/dist/{10.js → 11.js} +1 -1
  3. package/dist/11.js.map +1 -0
  4. package/dist/114.js +2 -0
  5. package/dist/114.js.map +1 -0
  6. package/dist/300.js +1 -1
  7. package/dist/495.js +1 -2
  8. package/dist/495.js.map +1 -1
  9. package/dist/876.js +8 -1
  10. package/dist/876.js.map +1 -1
  11. package/dist/kenyaemr-esm-billing-app.js +1 -1
  12. package/dist/kenyaemr-esm-billing-app.js.buildmanifest.json +268 -268
  13. package/dist/kenyaemr-esm-billing-app.js.map +1 -1
  14. package/dist/main.js +3 -3
  15. package/dist/main.js.map +1 -1
  16. package/dist/routes.json +1 -1
  17. package/package.json +1 -1
  18. package/src/benefits-package/benefits-package.mock.ts +3 -3
  19. package/src/benefits-package/forms/benefit-pre-auth-form.workspace.tsx +5 -4
  20. package/src/benefits-package/forms/{package-intervensions.component.tsx → package-interventions.component.tsx} +30 -10
  21. package/src/claims/dashboard/form/claims-form.component.tsx +4 -4
  22. package/src/claims/metrics/metrics.component.tsx +2 -2
  23. package/src/config-schema.ts +1 -1
  24. package/src/hooks/use-pre-auth-requests.ts +13 -1
  25. package/src/hooks/useInterventions.ts +27 -5
  26. package/src/root.component.tsx +0 -2
  27. package/src/types/index.ts +1 -1
  28. package/translations/en.json +3 -18
  29. package/dist/10.js.map +0 -1
  30. package/dist/13.js +0 -8
  31. package/dist/13.js.map +0 -1
  32. package/src/claims/pre-auth/form/pre-auth-form.component.tsx +0 -364
  33. package/src/claims/pre-auth/form/pre-auth-form.resource.ts +0 -20
  34. package/src/claims/pre-auth/form/pre-auth-form.scss +0 -141
  35. package/src/claims/pre-auth/form/pre-auth-mock-data.ts +0 -44
  36. package/src/claims/pre-auth/hook/pre-auth.mock.ts +0 -40
  37. package/src/claims/pre-auth/pre-auth-dashboard.component.tsx +0 -79
  38. package/src/claims/pre-auth/pre-auth-dashboard.scss +0 -42
  39. package/src/claims/pre-auth/table/pre-auth-table.component.tsx +0 -234
  40. package/src/claims/pre-auth/table/pre-auth-table.scss +0 -111
  41. /package/dist/{495.js.LICENSE.txt → 114.js.LICENSE.txt} +0 -0
  42. /package/dist/{13.js.LICENSE.txt → 876.js.LICENSE.txt} +0 -0
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":"billing-test-order-action","component":"testOrderAction","slot":"tests-ordered-actions-slot","order":0},{"component":"billingOverviewLink","name":"billing-overview-link","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","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":"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"}],"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"}],"version":"5.4.1-pre.1710"}
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":"billing-test-order-action","component":"testOrderAction","slot":"tests-ordered-actions-slot","order":0},{"component":"billingOverviewLink","name":"billing-overview-link","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","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":"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"}],"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"}],"version":"5.4.1-pre.1729"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-billing-app",
3
- "version": "5.4.1-pre.1710",
3
+ "version": "5.4.1-pre.1729",
4
4
  "description": "Billing app for KenyaEMR",
5
5
  "browser": "dist/kenyaemr-esm-billing-app.js",
6
6
  "main": "src/index.ts",
@@ -4,7 +4,7 @@ import {
4
4
  Diagnosis,
5
5
  Package,
6
6
  PatientBenefit,
7
- SHAIntervension,
7
+ SHAIntervention,
8
8
  shifIdentifiersResponse,
9
9
  } from '../types';
10
10
 
@@ -52,10 +52,10 @@ export const packages = [
52
52
  },
53
53
  ] as Array<Package>;
54
54
 
55
- export const intervensions = patientBenefits.map(({ interventionCode, interventionName }) => ({
55
+ export const interventions = patientBenefits.map(({ interventionCode, interventionName }) => ({
56
56
  interventionCode,
57
57
  interventionName,
58
- })) as Array<SHAIntervension>;
58
+ })) as Array<SHAIntervention>;
59
59
 
60
60
  export const coverageEligibilityResponse = [
61
61
  {
@@ -28,7 +28,7 @@ import useProvider from '../../hooks/useProvider';
28
28
  import { PatientBenefit } from '../../types';
29
29
  import { preAuthenticateBenefit, preauthSchema } from '../benefits-package.resources';
30
30
  import styles from './benefits-pre-auth-form.scss';
31
- import PackageIntervensions from './package-intervensions.component';
31
+ import PackageInterventions from './package-interventions.component';
32
32
  import { ErrorState } from '@openmrs/esm-patient-common-lib';
33
33
 
34
34
  type BenefitsPreAuth = z.infer<typeof preauthSchema>;
@@ -240,8 +240,9 @@ const BenefitPreAuthForm: React.FC<BenefitPreAuthFormProps> = ({ closeWorkspace,
240
240
  </Column>
241
241
  {selectedPackageObservable && (
242
242
  <Column>
243
- <PackageIntervensions
243
+ <PackageInterventions
244
244
  category={packages.find((package_) => package_.uuid === selectedPackageObservable)?.packageCode ?? ''}
245
+ patientUuid={patientUuid}
245
246
  />
246
247
  </Column>
247
248
  )}
@@ -255,7 +256,7 @@ const BenefitPreAuthForm: React.FC<BenefitPreAuthFormProps> = ({ closeWorkspace,
255
256
  invalid={form.formState.errors[field.name]?.message}
256
257
  invalidText={form.formState.errors[field.name]?.message}
257
258
  id="diagnoses"
258
- titleText={t('diagnosis', 'Diagnosis')}
259
+ titleText={t('finalDiagnosis', 'Final Diagnosis')}
259
260
  selectedItems={field.value}
260
261
  label="Choose option"
261
262
  items={diagnoses.map((r) => r.id)}
@@ -279,7 +280,7 @@ const BenefitPreAuthForm: React.FC<BenefitPreAuthFormProps> = ({ closeWorkspace,
279
280
  <Button className={styles.button} kind="secondary" onClick={closeWorkspace}>
280
281
  {t('discard', 'Discard')}
281
282
  </Button>
282
- <Button className={styles.button} kind="primary" type="submit">
283
+ <Button className={styles.button} kind="primary" type="submit" disabled={isSubmitting}>
283
284
  {isSubmitting ? (
284
285
  <>
285
286
  <Loading className={styles.button_spinner} withOverlay={false} small /> {t('submitting', 'Submitting')}
@@ -1,37 +1,57 @@
1
1
  import { InlineLoading, InlineNotification, MultiSelect } from '@carbon/react';
2
- import React, { useEffect } from 'react';
2
+ import React, { useEffect, useState } from 'react';
3
3
  import { Controller, useFormContext } from 'react-hook-form';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { z } from 'zod';
6
- import { useInterventions } from '../../hooks/useInterventions';
6
+ import { InterventionsFilter, toQueryParams, useInterventions } from '../../hooks/useInterventions';
7
7
  import { eligibilityRequestShema } from '../benefits-package.resources';
8
+ import { usePatient } from '@openmrs/esm-framework';
8
9
 
9
10
  type EligibilityRequest = z.infer<typeof eligibilityRequestShema>;
10
11
 
11
- type PackageIntervensionsProps = {
12
+ type PackageInterventionsProps = {
12
13
  category: string;
14
+ patientUuid: string;
13
15
  };
14
- const PackageIntervensions: React.FC<PackageIntervensionsProps> = ({ category }) => {
15
- const { error, interventions, isLoading } = useInterventions(category);
16
+ const PackageInterventions: React.FC<PackageInterventionsProps> = ({ category, patientUuid }) => {
17
+ const [filters, setFilters] = useState<InterventionsFilter>({ package_code: category });
18
+ const { error: patientError, isLoading: isPatientLoading, patient } = usePatient(patientUuid);
19
+ const { error, interventions, isLoading } = useInterventions(filters);
20
+
16
21
  const form = useFormContext<EligibilityRequest>();
17
22
  const { t } = useTranslation();
18
23
 
24
+ useEffect(() => {
25
+ setFilters((state) => ({
26
+ ...state,
27
+ package_code: category,
28
+ applicable_gender: patient?.gender === 'male' ? 'MALE' : patient?.gender === 'female' ? 'FEMALE' : undefined,
29
+ }));
30
+ }, [category, patient]);
31
+
19
32
  useEffect(() => {
20
33
  form.setValue('interventions', []);
21
34
  }, [category]);
22
35
 
23
- if (isLoading) {
24
- return <InlineLoading status="active" iconDescription="Loading" description="Loading intervensions..." />;
36
+ if (isLoading || isPatientLoading) {
37
+ return (
38
+ <InlineLoading
39
+ status="active"
40
+ iconDescription="Loading"
41
+ description={t('loadingInterventions', 'Loading interventions') + '...'}
42
+ />
43
+ );
25
44
  }
26
45
 
27
- if (error) {
46
+ if (error || patientError) {
28
47
  return (
29
48
  <InlineNotification
30
49
  aria-label="closes notification"
31
50
  kind="error"
32
51
  lowContrast={true}
33
52
  statusIconDescription="notification"
34
- title={t('failure', 'Error loading intervensions')}
53
+ title={t('failure', 'Error loading interventions')}
54
+ subtitle={error?.message ?? patientError?.message}
35
55
  />
36
56
  );
37
57
  }
@@ -60,4 +80,4 @@ const PackageIntervensions: React.FC<PackageIntervensionsProps> = ({ category })
60
80
  );
61
81
  };
62
82
 
63
- export default PackageIntervensions;
83
+ export default PackageInterventions;
@@ -21,7 +21,7 @@ import { Controller, FormProvider, useForm } from 'react-hook-form';
21
21
  import { useTranslation } from 'react-i18next';
22
22
  import { useParams } from 'react-router-dom';
23
23
  import { z } from 'zod';
24
- import PackageIntervensions from '../../../benefits-package/forms/package-intervensions.component';
24
+ import PackageInterventions from '../../../benefits-package/forms/package-interventions.component';
25
25
  import { formatDate } from '../../../helpers/functions';
26
26
  import { useSystemSetting } from '../../../hooks/getMflCode';
27
27
  import usePackages from '../../../hooks/usePackages';
@@ -200,7 +200,6 @@ const ClaimsForm: React.FC<ClaimsFormProps> = ({ bill, selectedLineItems }) => {
200
200
  </Layer>
201
201
  );
202
202
  }
203
-
204
203
  return (
205
204
  <FormProvider {...form}>
206
205
  <Form className={styles.form} onSubmit={handleSubmit(onSubmit)}>
@@ -315,8 +314,9 @@ const ClaimsForm: React.FC<ClaimsFormProps> = ({ bill, selectedLineItems }) => {
315
314
  {selectedPackageObservable && (
316
315
  <Column>
317
316
  <Layer className={styles.input}>
318
- <PackageIntervensions
317
+ <PackageInterventions
319
318
  category={packages.find((package_) => package_.uuid === selectedPackageObservable)?.packageCode ?? ''}
319
+ patientUuid={patientUuid}
320
320
  />
321
321
  </Layer>
322
322
  </Column>
@@ -333,7 +333,7 @@ const ClaimsForm: React.FC<ClaimsFormProps> = ({ bill, selectedLineItems }) => {
333
333
  invalid={form.formState.errors[field.name]?.message}
334
334
  invalidText={form.formState.errors[field.name]?.message}
335
335
  id="diagnoses"
336
- titleText={t('diagnosis', 'Diagnosis')}
336
+ titleText={t('finalDiagnosis', 'Final Diagnosis')}
337
337
  selectedItems={field.value}
338
338
  label="Choose option"
339
339
  items={diagnoses.map((r) => r.id)}
@@ -35,9 +35,9 @@ const MainMetrics: React.FC<MainMetricsProps> = ({ selectedLineItems, bill }) =>
35
35
  headerLabel={t('claimsItems', 'Claims Items')}
36
36
  />
37
37
  <MetricsCard
38
- label={t('date', 'Date of Claimed')}
38
+ label={t('date', 'Date of Claim')}
39
39
  value={formatDate(bill.dateCreated)}
40
- headerLabel={t('date', 'Date of Claimed')}
40
+ headerLabel={t('date', 'Date of Claim')}
41
41
  />
42
42
  </div>
43
43
  </>
@@ -62,7 +62,7 @@ export const configSchema: ConfigSchema = {
62
62
  },
63
63
  hieBaseUrl: {
64
64
  _type: Type.String,
65
- _description: 'HIE Base URL for getting intervensions and benefit packages',
65
+ _description: 'HIE Base URL for getting interventions and benefit packages',
66
66
  _default: 'https://payers.apeiro-digital.com/api/v1',
67
67
  },
68
68
  visitAttributeTypes: {
@@ -195,7 +195,19 @@ export const usePreAuthRequests = () => {
195
195
  const { hieBaseUrl } = useConfig<BillingConfig>();
196
196
  const url = `${hieBaseUrl}/claim/byFacility?facilityCode=Organization/${mflCodeValue}&type=preauthorization&claimResponseId=`;
197
197
 
198
- const { data, error, isLoading, mutate } = useSWR<{ data: Array<PreAuthRequest> }>(url, openmrsFetch);
198
+ const { data, error, isLoading, mutate } = useSWR<{ data: Array<PreAuthRequest> }>(
199
+ url,
200
+ () =>
201
+ new Promise<{ data: Array<PreAuthRequest> }>((resolve) =>
202
+ setTimeout(
203
+ () =>
204
+ resolve({
205
+ data: preAuthRequests as any,
206
+ }),
207
+ 3000,
208
+ ),
209
+ ),
210
+ );
199
211
 
200
212
  return {
201
213
  preAuthRequests: (data?.data?.length ? data?.data : preAuthRequests).map((r) => {
@@ -1,20 +1,42 @@
1
1
  import { FetchResponse, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2
2
  import useSWR from 'swr';
3
- import { SHAIntervension } from '../types';
3
+ import { SHAIntervention } from '../types';
4
4
 
5
- export const useInterventions = (code: string) => {
5
+ export type InterventionsFilter = {
6
+ package_code?: string;
7
+ scheme_code?: string;
8
+ applicable_gender?: 'MALE' | 'FEMALE';
9
+ };
10
+
11
+ export const toQueryParams = (q: Record<string, any>) => {
12
+ return (
13
+ '?' +
14
+ Object.entries(q)
15
+ .reduce((prev, [key, val]) => {
16
+ if (val !== undefined && val !== null) {
17
+ return [...prev, `${key}=${val}`];
18
+ }
19
+ return prev;
20
+ }, [])
21
+ .join('&')
22
+ );
23
+ };
24
+
25
+ export const useInterventions = (filters: InterventionsFilter) => {
6
26
  const fetcher = (url: string) => {
7
27
  return openmrsFetch(url, {
8
28
  method: 'POST',
9
29
  body: {
10
30
  searchKeyAndValues: {
31
+ ...filters,
11
32
  // scheme_code: 'UHC',
12
- package_code: code,
33
+ applicable_gender: filters.applicable_gender ? `ALL,${filters.applicable_gender}` : undefined,
13
34
  },
14
35
  },
15
36
  });
16
37
  };
17
- const url = `${restBaseUrl}/insuranceclaims/claims/interventions/query?code=${code}`;
38
+
39
+ const url = `${restBaseUrl}/insuranceclaims/claims/interventions/query${toQueryParams(filters)}`;
18
40
  const { isLoading, error, data } = useSWR<
19
41
  FetchResponse<{
20
42
  status: string;
@@ -35,7 +57,7 @@ export const useInterventions = (code: string) => {
35
57
  interventionCode,
36
58
  subCategoryBenefitsPackage: interventionSubPackage,
37
59
  interventionName,
38
- } as SHAIntervension),
60
+ } as SHAIntervention),
39
61
  ),
40
62
  error,
41
63
  };
@@ -8,7 +8,6 @@ import { BillingDashboard } from './billing-dashboard/billing-dashboard.componen
8
8
  import ClaimsManagementOverview from './claims/claims-management/main/claims-overview-main.component';
9
9
  import ClaimsManagementPreAuthRequest from './claims/claims-management/main/claims-pre-auth-main.component';
10
10
  import ClaimScreen from './claims/dashboard/claims-dashboard.component';
11
- import PreAuthRequestDashboard from './claims/pre-auth/pre-auth-dashboard.component';
12
11
  import Invoice from './invoice/invoice.component';
13
12
  import PaymentModeHome from './payment-modes/payment-mode-home.component';
14
13
  import { ClockInBoundary } from './payment-points/clock-in-boundary.component';
@@ -24,7 +23,6 @@ const RootComponent: React.FC = () => {
24
23
  <Route path="/" element={<BillingDashboard />} />
25
24
  <Route path="/claims-overview" element={<ClaimsManagementOverview />} />
26
25
  <Route path="/preauth-requests" element={<ClaimsManagementPreAuthRequest />} />
27
- <Route path="/patient/:patientUuid/:billUuid/pre-auth-request" element={<PreAuthRequestDashboard />} />
28
26
  <Route
29
27
  path="/patient/:patientUuid/:billUuid"
30
28
  element={
@@ -491,7 +491,7 @@ export type PaymentMode = {
491
491
  resourceVersion?: string;
492
492
  };
493
493
 
494
- export type SHAIntervension = {
494
+ export type SHAIntervention = {
495
495
  interventionCode: string;
496
496
  shaCategory: string;
497
497
  accessCode: string;
@@ -21,7 +21,6 @@
21
21
  "attributeRequired": "Attribute required",
22
22
  "attributeRetired": "Attribute retired",
23
23
  "attributeRetiredReason": "Attribute retired reason",
24
- "backButton": "Back",
25
24
  "benefits": "Benefits",
26
25
  "billableExemptionAdministration": "Exemption Administration",
27
26
  "billableServicesError": "Billable services error",
@@ -56,9 +55,7 @@
56
55
  "chargeItemsDescription": "Charge Items and Services Dashboard",
57
56
  "checked": "Checked",
58
57
  "checkFilters": "Check the filters above",
59
- "chooseDiagnosis": "Choose diagnosis",
60
58
  "claim": "Process claims",
61
- "claimcode": "Claim Code",
62
59
  "claimCode": "Claim Code",
63
60
  "claimedAmount": "Claimed Amount",
64
61
  "claimError": "Claim Error",
@@ -76,12 +73,11 @@
76
73
  "createClaimError": "Create Claim error",
77
74
  "created": "Created",
78
75
  "creating": "Creating",
79
- "date": "Date of Claimed",
76
+ "date": "Date of Claim",
80
77
  "dateCreated": "Date Created",
81
78
  "delete": "Delete",
82
79
  "deleteBill": "Delete Bill",
83
80
  "description": "Description",
84
- "diagnoses": "Diagnoses",
85
81
  "diagnosis": "Diagnosis",
86
82
  "discard": "Discard",
87
83
  "discardClaim": "Discard Claim",
@@ -120,16 +116,14 @@
120
116
  "errorOnLine": "Error on line",
121
117
  "errorRetrievingHIESubscription": "Error retrieving HIE subscription",
122
118
  "exemptionCategory": "Exemption category",
123
- "exemptionSchema": "Exemption Schema",
124
119
  "facility": "Facility",
125
120
  "failedBillPayment": "Bill payment failed",
126
- "failure": "Error loading intervensions",
121
+ "failure": "Error loading interventions",
127
122
  "filterBy": "Filter by",
128
123
  "filterByTimesheet": "Filter by timesheet",
129
124
  "filterTable": "Filter table",
130
125
  "formTitle": "Fill in the form details",
131
126
  "generatedMessage": "The invoice has been electronically generated and is a valid document. It was created by {{userName}} on {{date}} at {{time}}",
132
- "guaranteeId": "Guarantee Id",
133
127
  "home": "Home",
134
128
  "identifier": "Identifier",
135
129
  "inactive": "Inactive",
@@ -141,7 +135,6 @@
141
135
  "insurer": "Insurer",
142
136
  "interventionCode": "Intervention Code",
143
137
  "interventions": "Interventions",
144
- "interventionsOption": "Choose interventions",
145
138
  "invalidJsonError": "Invalid JSON received for the schema.",
146
139
  "invoice": "Invoice",
147
140
  "invoiceError": "Invoice error",
@@ -156,9 +149,9 @@
156
149
  "loadingBillingServices": "Loading billing services...",
157
150
  "loadingData": "Loading data...",
158
151
  "loadingDescription": "Loading",
152
+ "loadingInterventions": "Loading interventions",
159
153
  "loadingSchema": "Loading schema",
160
154
  "makeclaims": "Make Claims",
161
- "makePreauthRequest": "Make Pre-auth Request",
162
155
  "makePreAuthRequests": "Make Pre Auth Request",
163
156
  "mpesaPayment": "MPESA Payment",
164
157
  "name": "Name",
@@ -185,8 +178,6 @@
185
178
  "overPayment": "Over payment",
186
179
  "overPaymentSubtitle": "Amount paid {{totalAmountTendered}} should not be greater than amount due {{selectedLineItemsAmountDue}} for selected line items",
187
180
  "package": "Package",
188
- "packages": "Packages",
189
- "packagesOptions": "Choose packages",
190
181
  "patient": "Patient",
191
182
  "patientBilling": "Verifying patient bills",
192
183
  "patientBillingAlert": "Patient Billing Alert",
@@ -213,10 +204,7 @@
213
204
  "Phone Number": "Phone Number",
214
205
  "pickLabRequest": "Pick Lab Request",
215
206
  "policyNumber": "Policy number",
216
- "preAuthJustification": "Pre-Auth Justification",
217
207
  "preauthRequest": "Preauth requests",
218
- "preAuthRequest": "Pre-Auth Request",
219
- "preAuthRequestError": "Pre-authorization request error page",
220
208
  "preAuthRequests": "Pre-auth requests",
221
209
  "preAuthRequets": "Pre-Auth Requests",
222
210
  "preauthStatus": "Filter by Status",
@@ -242,8 +230,6 @@
242
230
  "regExp": "Regular expression",
243
231
  "rejected": "Rejected",
244
232
  "remove": "Remove",
245
- "requestPreAuth": "Pre Authorization",
246
- "requestPreAuthError": "Pre Authorization Error",
247
233
  "retryRequest": "Retry request",
248
234
  "saveAndClose": "Save & Close",
249
235
  "saveError": "Failed to save schema.",
@@ -265,7 +251,6 @@
265
251
  "selectExemptionCategory": "Select exemption category",
266
252
  "selectInsuranceScheme": "Select insurance scheme",
267
253
  "selectitemstobeclaimed": "Select items that are to be included in the claims",
268
- "selectitemstorequestforpreauth": "Select items that are to be included in the pre authorization request",
269
254
  "selectPaymentMethod": "Select payment method",
270
255
  "selectPaymentMode": "Select payment mode",
271
256
  "selectTimesheet": "Select timesheet",