@kenyaemr/esm-billing-app 5.4.1-pre.1941 → 5.4.1-pre.1945

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","slot":"prescription-action-button-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":"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"},{"name":"create-bill-item-modal","component":"createBillItemModal"}],"version":"5.4.1-pre.1941"}
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","slot":"prescription-action-button-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":"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"},{"name":"create-bill-item-modal","component":"createBillItemModal"}],"version":"5.4.1-pre.1945"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenyaemr/esm-billing-app",
3
- "version": "5.4.1-pre.1941",
3
+ "version": "5.4.1-pre.1945",
4
4
  "description": "Billing app for KenyaEMR",
5
5
  "browser": "dist/kenyaemr-esm-billing-app.js",
6
6
  "main": "src/index.ts",
@@ -1,9 +1,9 @@
1
1
  import { Column, InlineLoading, InlineNotification, MultiSelect } from '@carbon/react';
2
- import React, { useEffect } from 'react';
2
+ import React from 'react';
3
3
  import { Controller, useFormContext } from 'react-hook-form';
4
4
  import { useTranslation } from 'react-i18next';
5
- import PackageInterventions from './interventions-form.component';
6
5
  import usePackages from '../../hooks/usePackages';
6
+ import PackageInterventions from './interventions-form.component';
7
7
 
8
8
  type Props = {
9
9
  patientUuid: string;
@@ -21,6 +21,19 @@ const SHABenefitPackangesAndInterventions: React.FC<Props> = ({ patientUuid }) =
21
21
  );
22
22
  }
23
23
 
24
+ if (packageError) {
25
+ return (
26
+ <InlineNotification
27
+ aria-label="closes notification"
28
+ kind="error"
29
+ lowContrast={true}
30
+ statusIconDescription="notification"
31
+ title={t('errorLoadingpackages', 'Error loading packages')}
32
+ subtitle={packageError?.message}
33
+ />
34
+ );
35
+ }
36
+
24
37
  return (
25
38
  <>
26
39
  <Column>
@@ -0,0 +1,120 @@
1
+ import { Column, InlineLoading, InlineNotification, Layer, TextArea } from '@carbon/react';
2
+ import { usePatient } from '@openmrs/esm-framework';
3
+ import React, { useEffect, useMemo } from 'react';
4
+ import { Controller, useFormContext } from 'react-hook-form';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { InterventionsFilter, useInterventions } from '../../../hooks/useInterventions';
7
+ import usePackages from '../../../hooks/usePackages';
8
+ import styles from './claims-form.scss';
9
+
10
+ type ClaimExplanationAndJusificationInputProps = {
11
+ patientUuid: string;
12
+ };
13
+ const ClaimExplanationAndJusificationInput: React.FC<ClaimExplanationAndJusificationInputProps> = ({ patientUuid }) => {
14
+ const { error: patientError, isLoading: isPatientLoading, patient } = usePatient(patientUuid);
15
+
16
+ const form = useFormContext<{
17
+ claimExplanation: string;
18
+ claimJustification: string;
19
+ packages: Array<string>;
20
+ interventions: Array<string>;
21
+ }>();
22
+ const { t } = useTranslation();
23
+ const { isLoading: packagesLoading, error: packageError, packages: shaPackages } = usePackages();
24
+ const { setValue } = form;
25
+ const packagesObservable = form.watch('packages');
26
+ const interventionsObservable = form.watch('interventions');
27
+ const filters = useMemo<InterventionsFilter>(
28
+ () => ({
29
+ package_code: packagesObservable.join(','),
30
+ applicable_gender: patient?.gender === 'male' ? 'MALE' : 'FEMALE',
31
+ }),
32
+ [packagesObservable, patient],
33
+ );
34
+ const { error: interventionsError, isLoading: isLoadingInterventions, allInterventions } = useInterventions(filters);
35
+ const packagesSelected = useMemo(
36
+ () =>
37
+ packagesObservable
38
+ .map((packageCode) => shaPackages.find((pkg) => pkg.uuid === packageCode))
39
+ ?.map((p) => p?.packageName ?? '')
40
+ .filter(Boolean) ?? [],
41
+ [packagesObservable, shaPackages],
42
+ );
43
+ const interventionSelected = useMemo(
44
+ () =>
45
+ interventionsObservable.map(
46
+ (interventionCode) =>
47
+ allInterventions.find((intervention) => intervention.interventionCode === interventionCode)?.interventionName,
48
+ ) ?? [],
49
+ [interventionsObservable, allInterventions],
50
+ );
51
+
52
+ useEffect(() => {
53
+ setValue('claimExplanation', packagesSelected.join(', '));
54
+ setValue('claimJustification', interventionSelected.join(', '));
55
+ }, [packagesSelected, setValue, interventionSelected]);
56
+
57
+ if (packagesLoading || isPatientLoading || isLoadingInterventions) {
58
+ return (
59
+ <InlineLoading description={t('loading', 'Loading')} iconDescription={t('loading', 'Loading data') + '...'} />
60
+ );
61
+ }
62
+
63
+ if (packageError || patientError || interventionsError) {
64
+ return (
65
+ <InlineNotification
66
+ aria-label="closes notification"
67
+ kind="error"
68
+ lowContrast={true}
69
+ statusIconDescription="notification"
70
+ title={t('errorLoadingpackages', 'Error loading packages')}
71
+ subtitle={packageError?.message ?? packageError?.message ?? interventionsError?.message}
72
+ />
73
+ );
74
+ }
75
+
76
+ return (
77
+ <>
78
+ <Column>
79
+ <Layer className={styles.input}>
80
+ <Controller
81
+ control={form.control}
82
+ name="claimExplanation"
83
+ render={({ field, fieldState: { error } }) => (
84
+ <TextArea
85
+ {...field}
86
+ labelText={t('claimExplanation', 'Claim Explanation')}
87
+ rows={3}
88
+ placeholder="Claim Explanation"
89
+ id="claimExplanation"
90
+ invalid={!!error?.message}
91
+ invalidText={error?.message}
92
+ />
93
+ )}
94
+ />
95
+ </Layer>
96
+ </Column>
97
+ <Column>
98
+ <Layer className={styles.input}>
99
+ <Controller
100
+ control={form.control}
101
+ name="claimJustification"
102
+ render={({ field, fieldState: { error } }) => (
103
+ <TextArea
104
+ {...field}
105
+ labelText={t('claimJustification', 'Claim Justification')}
106
+ rows={3}
107
+ placeholder="Claim Justification"
108
+ id="claimJustification"
109
+ invalid={!!error?.message}
110
+ invalidText={error?.message}
111
+ />
112
+ )}
113
+ />
114
+ </Layer>
115
+ </Column>
116
+ </>
117
+ );
118
+ };
119
+
120
+ export default ClaimExplanationAndJusificationInput;
@@ -10,7 +10,6 @@ import {
10
10
  MultiSelect,
11
11
  Row,
12
12
  Stack,
13
- TextArea,
14
13
  TextInput,
15
14
  TextInputSkeleton,
16
15
  } from '@carbon/react';
@@ -21,15 +20,16 @@ import { Controller, FormProvider, useForm } from 'react-hook-form';
21
20
  import { useTranslation } from 'react-i18next';
22
21
  import { useParams } from 'react-router-dom';
23
22
  import { z } from 'zod';
23
+ import SHABenefitPackangesAndInterventions from '../../../benefits-package/forms/packages-and-interventions-form.component';
24
24
  import { BillingConfig } from '../../../config-schema';
25
25
  import { formatDate } from '../../../helpers/functions';
26
26
  import { useSystemSetting } from '../../../hooks/getMflCode';
27
27
  import usePatientDiagnosis from '../../../hooks/usePatientDiagnosis';
28
28
  import useProvider from '../../../hooks/useProvider';
29
29
  import { LineItem, MappedBill } from '../../../types';
30
+ import ClaimExplanationAndJusificationInput from './claims-explanation-and-justification-form-input.component';
30
31
  import { processClaims, SHAPackagesAndInterventionVisitAttribute, useVisit } from './claims-form.resource';
31
32
  import styles from './claims-form.scss';
32
- import SHABenefitPackangesAndInterventions from '../../../benefits-package/forms/packages-and-interventions-form.component';
33
33
 
34
34
  type ClaimsFormProps = {
35
35
  bill: MappedBill;
@@ -345,44 +345,7 @@ const ClaimsForm: React.FC<ClaimsFormProps> = ({ bill, selectedLineItems }) => {
345
345
  </Layer>
346
346
  </Column>
347
347
  </Row>
348
- <Column>
349
- <Layer className={styles.input}>
350
- <Controller
351
- control={control}
352
- name="claimExplanation"
353
- render={({ field }) => (
354
- <TextArea
355
- {...field}
356
- labelText={t('claimExplanation', 'Claim Explanation')}
357
- rows={3}
358
- placeholder="Claim Explanation"
359
- id="claimExplanation"
360
- invalid={!!errors.claimExplanation}
361
- invalidText={errors.claimExplanation?.message}
362
- />
363
- )}
364
- />
365
- </Layer>
366
- </Column>
367
- <Column>
368
- <Layer className={styles.input}>
369
- <Controller
370
- control={control}
371
- name="claimJustification"
372
- render={({ field }) => (
373
- <TextArea
374
- {...field}
375
- labelText={t('claimJustification', 'Claim Justification')}
376
- rows={3}
377
- placeholder="Claim Justification"
378
- id="claimJustification"
379
- invalid={!!errors.claimJustification}
380
- invalidText={errors.claimJustification?.message}
381
- />
382
- )}
383
- />
384
- </Layer>
385
- </Column>
348
+ <ClaimExplanationAndJusificationInput patientUuid={patientUuid} />
386
349
  <ButtonSet className={styles.buttonSet}>
387
350
  <Button className={styles.button} kind="secondary" onClick={handleNavigateToBillingOptions}>
388
351
  {t('discardClaim', 'Discard Claim')}