@mindbill/react 0.37.1 → 0.39.0
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/README.md +9 -0
- package/dist/index.d.ts +37 -3
- package/dist/index.js +114 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -123,6 +123,15 @@ the next immutable attempt under the same logical `billId`; the original
|
|
|
123
123
|
attempt and rejection remain in history. The host application does not build a
|
|
124
124
|
second correction form or pass bill seed data back into the lifecycle.
|
|
125
125
|
|
|
126
|
+
For a **closed** bill the server authorizes exactly two actions — **Reopen**
|
|
127
|
+
and **Submit New Bill**. Submit New Bill opens the same `BillSubmissionForm`,
|
|
128
|
+
prefilled from the closed bill's snapshot with its documents carried forward,
|
|
129
|
+
and a Cancel button returns to the closed-bill view. Submitting creates a
|
|
130
|
+
fresh original bill linked to the closed predecessor: the closed bill stays
|
|
131
|
+
closed and keeps its record, and the submissions ribbon/timeline chains both
|
|
132
|
+
bills. Failures surface inline in the dialog, exactly like the correction
|
|
133
|
+
flow.
|
|
134
|
+
|
|
126
135
|
## Lifecycle actions
|
|
127
136
|
|
|
128
137
|
MindBill returns the actions that are valid for the bill's current state. Render that server-authoritative list instead of duplicating rejection, EOR, denial, review, payment, and closure rules in your application.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MindBillAppearance, MindBillEventDetail, MindBillErrorDetail } from '@mindbill/embed';
|
|
2
2
|
export { MindBillAppearance, MindBillErrorDetail, MindBillEventDetail } from '@mindbill/embed';
|
|
3
3
|
import { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
4
|
-
import { BillReviewData as BillReviewData$1, BillLifecycleDelivery, BillReviewAttachment as BillReviewAttachment$1, BrowserBillSubmissionResult, BillLifecycleSessionProvider, BillReviewPayer as BillReviewPayer$1, BrowserBillSubmissionDocument, BillDeliveryOptions as BillDeliveryOptions$1, SubmitBillInput, BillTasksDashboardData, BillTasksAgingBucket, BillHistoryEntry, ReportBillStatusInput, OrganizationProfileData, BillRemittanceSummary, BillEorDocument, BillPaymentRecord, BillLifecycleAction, BillRejection, BillLifecycleData, BillLifecycleClientOptions, BillLifecycleClient } from '@mindbill/browser';
|
|
5
|
-
export { BILL_TASKS_AGING_BUCKETS, BillActivityRecord, BillClaimsAdministratorContact, BillClaimsAdministratorDirectory, BillClaimsAdministratorMailingAddress, BillClaimsAdministratorPattern, BillEorDocument, BillLifecycleAction, BillLifecycleActionId, BillLifecycleClient, BillLifecycleClientOptions, BillLifecycleData, BillLifecycleDelivery, BillLifecycleSession, BillLifecycleSessionProvider, BillLifecycleSessionRequest, BillPaymentRecord, BillRejection, BillRemittanceSummary, BillTasksAgingBucket, BillTasksDashboardData, BillTasksDashboardItem, BillTasksDashboardRow, BillTasksDashboardSection, BillTasksDashboardSectionInput, BillTasksDashboardTone, BrowserBillSubmissionResult, CloseBillInput, PostBillPaymentInput, REPORT_BILL_STATUS_OPTIONS, ReopenBillInput, ReportBillStatusContacts, ReportBillStatusId, ReportBillStatusInput, SECOND_REVIEW_REASON_TEMPLATE, SECOND_REVIEW_WINDOW_DAYS, SecondReviewDeadline, SendDuplicateBillInput, SubmitSecondReviewInput, billTasksAgingBucketIndex, buildBillTasksDashboard, createBillLifecycleClient, reportBillStatusContacts, secondReviewDeadline } from '@mindbill/browser';
|
|
4
|
+
import { BillReviewData as BillReviewData$1, BillLifecycleDelivery, BillReviewAttachment as BillReviewAttachment$1, BillReviewPayerOption, BrowserBillSubmissionResult, BillLifecycleSessionProvider, BillReviewPayer as BillReviewPayer$1, BrowserBillSubmissionDocument, BillDeliveryOptions as BillDeliveryOptions$1, SubmitBillInput, BillTasksDashboardData, BillTasksAgingBucket, BillHistoryEntry, ReportBillStatusInput, OrganizationProfileData, BillRemittanceSummary, BillEorDocument, BillPaymentRecord, BillLifecycleAction, BillRejection, BillLifecycleData, BillLifecycleClientOptions, BillLifecycleClient } from '@mindbill/browser';
|
|
5
|
+
export { BILL_TASKS_AGING_BUCKETS, BillActivityRecord, BillClaimsAdministratorContact, BillClaimsAdministratorDirectory, BillClaimsAdministratorMailingAddress, BillClaimsAdministratorPattern, BillEorDocument, BillLifecycleAction, BillLifecycleActionId, BillLifecycleClient, BillLifecycleClientOptions, BillLifecycleData, BillLifecycleDelivery, BillLifecycleSession, BillLifecycleSessionProvider, BillLifecycleSessionRequest, BillPaymentRecord, BillRejection, BillRemittanceSummary, BillReviewPayerOption, BillTasksAgingBucket, BillTasksDashboardData, BillTasksDashboardItem, BillTasksDashboardRow, BillTasksDashboardSection, BillTasksDashboardSectionInput, BillTasksDashboardTone, BrowserBillSubmissionResult, CloseBillInput, PostBillPaymentInput, REPORT_BILL_STATUS_OPTIONS, ReopenBillInput, ReportBillStatusContacts, ReportBillStatusId, ReportBillStatusInput, SECOND_REVIEW_REASON_TEMPLATE, SECOND_REVIEW_WINDOW_DAYS, SecondReviewDeadline, SendDuplicateBillInput, SubmitSecondReviewInput, billTasksAgingBucketIndex, buildBillTasksDashboard, createBillLifecycleClient, reportBillStatusContacts, secondReviewDeadline } from '@mindbill/browser';
|
|
6
6
|
|
|
7
7
|
type MindBillThemePreset = "mindbill" | "qme-companion" | "orange-bright" | "clinical-blue" | "midnight-cyan";
|
|
8
8
|
type MindBillReactAppearance = MindBillAppearance & {
|
|
@@ -179,6 +179,14 @@ type BillReviewPayer = {
|
|
|
179
179
|
state: "match" | "warning";
|
|
180
180
|
label: string;
|
|
181
181
|
}>;
|
|
182
|
+
/** True when a bill for this claims administrator must name one of `payers`. */
|
|
183
|
+
payerSelectionRequired?: boolean;
|
|
184
|
+
/** Selectable payers (subpayors) under this claims administrator. */
|
|
185
|
+
payers?: Array<{
|
|
186
|
+
id: string;
|
|
187
|
+
label: string;
|
|
188
|
+
default?: boolean;
|
|
189
|
+
}>;
|
|
182
190
|
};
|
|
183
191
|
type BillReviewFeatures = {
|
|
184
192
|
authorizationNumber?: boolean;
|
|
@@ -234,6 +242,8 @@ type BillReviewData = {
|
|
|
234
242
|
};
|
|
235
243
|
type BillReviewSaveInput = {
|
|
236
244
|
claimsAdminId: string;
|
|
245
|
+
/** The chosen payer (subpayor) when the claims administrator requires payer selection. */
|
|
246
|
+
payerId?: string;
|
|
237
247
|
patientOverrides?: {
|
|
238
248
|
firstName: string;
|
|
239
249
|
middleName?: string;
|
|
@@ -439,6 +449,11 @@ type BillSubmissionInput = {
|
|
|
439
449
|
claimsAdministrator?: {
|
|
440
450
|
id?: string;
|
|
441
451
|
name: string;
|
|
452
|
+
/** The chosen payer (subpayor) when the claims administrator requires payer selection. */
|
|
453
|
+
payerId?: string;
|
|
454
|
+
/** Directory metadata carried while editing; stripped from the submitted bill. */
|
|
455
|
+
payerSelectionRequired?: boolean;
|
|
456
|
+
payers?: BillReviewPayerOption[];
|
|
442
457
|
};
|
|
443
458
|
};
|
|
444
459
|
service: {
|
|
@@ -488,6 +503,7 @@ type CompleteBillSubmissionInput = Omit<BillSubmissionInput, "claim" | "billingP
|
|
|
488
503
|
claimsAdministrator: {
|
|
489
504
|
id: string;
|
|
490
505
|
name: string;
|
|
506
|
+
payerId?: string;
|
|
491
507
|
};
|
|
492
508
|
};
|
|
493
509
|
billingProvider: {
|
|
@@ -609,6 +625,23 @@ declare function validateBillSubmission(bill: BillSubmissionInput): BillSubmissi
|
|
|
609
625
|
declare function normalizeClaimsAdministratorName(value: string): string;
|
|
610
626
|
declare function exactClaimsAdministratorMatch(results: BillReviewPayer$1[], suppliedName: string): BillReviewPayer$1 | undefined;
|
|
611
627
|
declare function claimsAdministratorRecommendations(results: BillReviewPayer$1[], limit?: number): BillReviewPayer$1[];
|
|
628
|
+
/**
|
|
629
|
+
* Form-state claims administrator for a directory pick. When the administrator
|
|
630
|
+
* requires payer selection it carries the payer (subpayor) choices and
|
|
631
|
+
* preselects the directory default; administrators without subpayors stay a
|
|
632
|
+
* plain `{ id, name }` reference.
|
|
633
|
+
*/
|
|
634
|
+
declare function chooseClaimsAdministrator(payer: Pick<BillReviewPayer$1, "id" | "name" | "payerSelectionRequired" | "payers">): NonNullable<BillSubmissionInput["claim"]["claimsAdministrator"]>;
|
|
635
|
+
/**
|
|
636
|
+
* The claims administrator reference exactly as submitted to MindBill: picker
|
|
637
|
+
* metadata (payerSelectionRequired, payers) stays client-side and the chosen
|
|
638
|
+
* payerId rides on the wire only when set.
|
|
639
|
+
*/
|
|
640
|
+
declare function submittedClaimsAdministrator(administrator: NonNullable<BillSubmissionInput["claim"]["claimsAdministrator"]>): {
|
|
641
|
+
id: string;
|
|
642
|
+
name: string;
|
|
643
|
+
payerId?: string;
|
|
644
|
+
};
|
|
612
645
|
type BillSubmissionSectionId = "header" | "patient" | "claim" | "providers" | "serviceLines" | "attachments" | "actions";
|
|
613
646
|
declare function BillSubmissionHeader(): ReactElement;
|
|
614
647
|
declare function BillSubmissionPatientSection(): ReactElement;
|
|
@@ -1054,6 +1087,7 @@ type UseBillLifecycleResult = {
|
|
|
1054
1087
|
postPayment: BillLifecycleClient["postPayment"];
|
|
1055
1088
|
submitSecondReview: BillLifecycleClient["submitSecondReview"];
|
|
1056
1089
|
resubmitBill: BillLifecycleClient["resubmitBill"];
|
|
1090
|
+
submitNewBill: BillLifecycleClient["submitNewBill"];
|
|
1057
1091
|
sendDuplicateBill: BillLifecycleClient["sendDuplicateBill"];
|
|
1058
1092
|
reportBillStatus: BillLifecycleClient["reportBillStatus"];
|
|
1059
1093
|
simulateSandbox: BillLifecycleClient["simulateSandbox"];
|
|
@@ -1087,4 +1121,4 @@ type MindBillWidgetProps = {
|
|
|
1087
1121
|
declare function MindBillBillTimeline(props: MindBillWidgetProps): ReactElement;
|
|
1088
1122
|
declare function MindBillBillReview(props: MindBillWidgetProps): ReactElement;
|
|
1089
1123
|
|
|
1090
|
-
export { BILL_STATUS_AGING_BUCKETS, BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS, BILL_SUBMISSION_DOCUMENT_TYPES, BILL_SUBMISSION_REPORT_TYPES, BILL_SUBMISSION_REQUIRED_FIELDS, type BillActivityEvent, BillActivityTimeline, type BillActivityTimelineProps, type BillAgingBucket, type BillAgingBucketId, BillAgingSummary, type BillAgingSummaryProps, BillExplanationOfReview, type BillExplanationOfReviewProps, BillHistoryTable, type BillHistoryTableProps, BillLifecycleActions, type BillLifecycleActionsProps, BillLifecycleProgress, type BillLifecycleProgressProps, type BillLifecycleStage, BillList, type BillListProps, BillPayerContactCard, type BillPayerContactCardProps, BillPaymentLedger, type BillPaymentLedgerProps, BillReadOnlyForm, type BillReadOnlyFormProps, BillRejectionNotice, type BillRejectionNoticeProps, BillRemittanceCard, type BillRemittanceCardProps, type BillReviewAttachment, type BillReviewBillingProvider, type BillReviewClinician, type BillReviewData, type BillReviewDocumentType, type BillReviewDraft, type BillReviewFeatures, BillReviewForm, type BillReviewFormProps, type BillReviewLineItem, type BillReviewLocation, type BillReviewPayer, type BillReviewSaveInput, BillSnapshotSummary, type BillSnapshotSummaryProps, type BillStatusAction, type BillStatusAgingCell, BillStatusAgingMatrix, type BillStatusAgingMatrixData, type BillStatusAgingMatrixProps, type BillStatusAgingRow, type BillStatusClient, type BillStatusClientOptions, type BillStatusData, type BillStatusSession, type BillStatusSessionProvider, type BillStatusSessionRequest, BillStatusSummary, type BillStatusSummaryProps, BillSubmissionActions, type BillSubmissionAddress, type BillSubmissionAttachmentReportTypeMode, BillSubmissionAttachmentsSection, BillSubmissionClaimSection, type BillSubmissionDiagnosisOption, type BillSubmissionDocumentType, type BillSubmissionEvaluationType, BillSubmissionForm, type BillSubmissionFormProps, type BillSubmissionFormValue, BillSubmissionHeader, type BillSubmissionInput, type BillSubmissionModifierOption, BillSubmissionPatientSection, type BillSubmissionPostalPlace, type BillSubmissionProcedureOption, BillSubmissionProvidersSection, type BillSubmissionReportTypeOption, type BillSubmissionRibbonItem, type BillSubmissionRoute, type BillSubmissionSectionId, BillSubmissionServiceLinesSection, type BillSubmissionSourceAttachment, type BillSubmissionTaxonomyOption, type BillSubmissionUpload, type BillSubmissionValidation, BillSubmissionsRibbon, type BillSubmissionsRibbonProps, BillTasksDashboard, type BillTasksDashboardCell, type BillTasksDashboardProps, type BillingComponentProps, BillingDashboard, type BillingDashboardBill, type BillingDashboardProps, type BillingDashboardSummary, BillingReport, type BillingReportDimension, type BillingReportProps, type BillingReportRow, BillingSettings, ConnectedBillLifecycle, type ConnectedBillLifecycleProps, ConnectedBillStatus, type ConnectedBillStatusProps, DEFAULT_BILL_SUBMISSION_MODIFIERS, DEFAULT_BILL_SUBMISSION_PROCEDURES, DEFAULT_BILL_SUBMISSION_TAXONOMIES, MED_LEGAL_REPORT_TYPE_CODE, MindBillBillReview, MindBillBillTimeline, type MindBillReactAppearance, type MindBillThemePreset, type MindBillWidgetProps, OrganizationOnboarding, type OrganizationOnboardingProps, PSYCH_QME_DEFAULT_DIAGNOSIS, ReportBillStatusDialog, type ReportBillStatusDialogProps, SendRouteDialog, type SendRouteDialogProps, type SendRouteSubmission, type UseBillLifecycleOptions, type UseBillLifecycleResult, type UseBillStatusOptions, type UseBillStatusResult, applyBillSubmissionEvaluationDiagnoses, applyBillSubmissionEvaluationModifiers, billActivityEventLabel, billAgingBucket, billAgingDays, billLifecycleDisplayLabel, billLifecycleStage, billSubmissionsRibbonDeliveryLabel, billSubmissionsRibbonFromHistory, buildBillReviewSaveInput, buildBillStatusAgingCsv, buildBillStatusAgingMatrix, buildBillingReportCsv, buildBillingReportRows, calculateBillSubmissionAllowedAmount, claimsAdministratorRecommendations, createBillStatusClient, ensureTrailingBillSubmissionLine, ensureTrailingProcedureLine, exactClaimsAdministratorMatch, extractSendRouteEmail, formatBillSubmissionDate, formatSendRouteFax, mindBillAppearanceStyle, mindBillThemePresets, normalizeClaimsAdministratorName, parseBillSubmissionDate, prepareBillSubmissionDocuments, resolveMindBillAppearance, summarizeBillingDashboard, useBillLifecycle, useBillStatus, validateBillSubmission, visibleBillLifecycleActions };
|
|
1124
|
+
export { BILL_STATUS_AGING_BUCKETS, BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS, BILL_SUBMISSION_DOCUMENT_TYPES, BILL_SUBMISSION_REPORT_TYPES, BILL_SUBMISSION_REQUIRED_FIELDS, type BillActivityEvent, BillActivityTimeline, type BillActivityTimelineProps, type BillAgingBucket, type BillAgingBucketId, BillAgingSummary, type BillAgingSummaryProps, BillExplanationOfReview, type BillExplanationOfReviewProps, BillHistoryTable, type BillHistoryTableProps, BillLifecycleActions, type BillLifecycleActionsProps, BillLifecycleProgress, type BillLifecycleProgressProps, type BillLifecycleStage, BillList, type BillListProps, BillPayerContactCard, type BillPayerContactCardProps, BillPaymentLedger, type BillPaymentLedgerProps, BillReadOnlyForm, type BillReadOnlyFormProps, BillRejectionNotice, type BillRejectionNoticeProps, BillRemittanceCard, type BillRemittanceCardProps, type BillReviewAttachment, type BillReviewBillingProvider, type BillReviewClinician, type BillReviewData, type BillReviewDocumentType, type BillReviewDraft, type BillReviewFeatures, BillReviewForm, type BillReviewFormProps, type BillReviewLineItem, type BillReviewLocation, type BillReviewPayer, type BillReviewSaveInput, BillSnapshotSummary, type BillSnapshotSummaryProps, type BillStatusAction, type BillStatusAgingCell, BillStatusAgingMatrix, type BillStatusAgingMatrixData, type BillStatusAgingMatrixProps, type BillStatusAgingRow, type BillStatusClient, type BillStatusClientOptions, type BillStatusData, type BillStatusSession, type BillStatusSessionProvider, type BillStatusSessionRequest, BillStatusSummary, type BillStatusSummaryProps, BillSubmissionActions, type BillSubmissionAddress, type BillSubmissionAttachmentReportTypeMode, BillSubmissionAttachmentsSection, BillSubmissionClaimSection, type BillSubmissionDiagnosisOption, type BillSubmissionDocumentType, type BillSubmissionEvaluationType, BillSubmissionForm, type BillSubmissionFormProps, type BillSubmissionFormValue, BillSubmissionHeader, type BillSubmissionInput, type BillSubmissionModifierOption, BillSubmissionPatientSection, type BillSubmissionPostalPlace, type BillSubmissionProcedureOption, BillSubmissionProvidersSection, type BillSubmissionReportTypeOption, type BillSubmissionRibbonItem, type BillSubmissionRoute, type BillSubmissionSectionId, BillSubmissionServiceLinesSection, type BillSubmissionSourceAttachment, type BillSubmissionTaxonomyOption, type BillSubmissionUpload, type BillSubmissionValidation, BillSubmissionsRibbon, type BillSubmissionsRibbonProps, BillTasksDashboard, type BillTasksDashboardCell, type BillTasksDashboardProps, type BillingComponentProps, BillingDashboard, type BillingDashboardBill, type BillingDashboardProps, type BillingDashboardSummary, BillingReport, type BillingReportDimension, type BillingReportProps, type BillingReportRow, BillingSettings, ConnectedBillLifecycle, type ConnectedBillLifecycleProps, ConnectedBillStatus, type ConnectedBillStatusProps, DEFAULT_BILL_SUBMISSION_MODIFIERS, DEFAULT_BILL_SUBMISSION_PROCEDURES, DEFAULT_BILL_SUBMISSION_TAXONOMIES, MED_LEGAL_REPORT_TYPE_CODE, MindBillBillReview, MindBillBillTimeline, type MindBillReactAppearance, type MindBillThemePreset, type MindBillWidgetProps, OrganizationOnboarding, type OrganizationOnboardingProps, PSYCH_QME_DEFAULT_DIAGNOSIS, ReportBillStatusDialog, type ReportBillStatusDialogProps, SendRouteDialog, type SendRouteDialogProps, type SendRouteSubmission, type UseBillLifecycleOptions, type UseBillLifecycleResult, type UseBillStatusOptions, type UseBillStatusResult, applyBillSubmissionEvaluationDiagnoses, applyBillSubmissionEvaluationModifiers, billActivityEventLabel, billAgingBucket, billAgingDays, billLifecycleDisplayLabel, billLifecycleStage, billSubmissionsRibbonDeliveryLabel, billSubmissionsRibbonFromHistory, buildBillReviewSaveInput, buildBillStatusAgingCsv, buildBillStatusAgingMatrix, buildBillingReportCsv, buildBillingReportRows, calculateBillSubmissionAllowedAmount, chooseClaimsAdministrator, claimsAdministratorRecommendations, createBillStatusClient, ensureTrailingBillSubmissionLine, ensureTrailingProcedureLine, exactClaimsAdministratorMatch, extractSendRouteEmail, formatBillSubmissionDate, formatSendRouteFax, mindBillAppearanceStyle, mindBillThemePresets, normalizeClaimsAdministratorName, parseBillSubmissionDate, prepareBillSubmissionDocuments, resolveMindBillAppearance, submittedClaimsAdministrator, summarizeBillingDashboard, useBillLifecycle, useBillStatus, validateBillSubmission, visibleBillLifecycleActions };
|
package/dist/index.js
CHANGED
|
@@ -1296,7 +1296,8 @@ var READ_ONLY_STYLES = `
|
|
|
1296
1296
|
import { createContext, useCallback, useContext, useEffect as useEffect4, useMemo as useMemo3, useRef as useRef2, useState as useState4 } from "react";
|
|
1297
1297
|
import {
|
|
1298
1298
|
createBillReferenceClient,
|
|
1299
|
-
createBillSubmissionClient
|
|
1299
|
+
createBillSubmissionClient,
|
|
1300
|
+
defaultBillReviewPayerOption
|
|
1300
1301
|
} from "@mindbill/browser";
|
|
1301
1302
|
|
|
1302
1303
|
// src/send-route-dialog.tsx
|
|
@@ -2153,6 +2154,9 @@ function validateBillSubmission(bill) {
|
|
|
2153
2154
|
if (bill.claim.claimsAdministrator?.name && !bill.claim.claimsAdministrator.id) {
|
|
2154
2155
|
errors["claim.claimsAdministrator"] = "Select a claims administrator from the payer directory.";
|
|
2155
2156
|
}
|
|
2157
|
+
if (bill.claim.claimsAdministrator?.payerSelectionRequired && !bill.claim.claimsAdministrator.payerId?.trim()) {
|
|
2158
|
+
errors["claim.claimsAdministrator.payerId"] = "Select the payer for this claims administrator.";
|
|
2159
|
+
}
|
|
2156
2160
|
if (bill.patient.dateOfBirth && !parseBillSubmissionDate(bill.patient.dateOfBirth)) errors["patient.dateOfBirth"] = "Use MM/DD/YYYY";
|
|
2157
2161
|
if (bill.claim.dateOfInjury && !parseBillSubmissionDate(bill.claim.dateOfInjury)) errors["claim.dateOfInjury"] = "Use MM/DD/YYYY";
|
|
2158
2162
|
if (bill.patient.address.state.trim().length !== 2) errors["patient.address.state"] = "Use a 2-letter state code";
|
|
@@ -2298,6 +2302,25 @@ function exactClaimsAdministratorMatch(results, suppliedName) {
|
|
|
2298
2302
|
function claimsAdministratorRecommendations(results, limit = 5) {
|
|
2299
2303
|
return [...results].sort((left, right) => Number(Boolean(right.recommended)) - Number(Boolean(left.recommended))).slice(0, Math.max(0, limit));
|
|
2300
2304
|
}
|
|
2305
|
+
function chooseClaimsAdministrator(payer) {
|
|
2306
|
+
if (!payer.payerSelectionRequired) return { id: payer.id, name: payer.name };
|
|
2307
|
+
const payers = (payer.payers ?? []).map((option) => ({ ...option }));
|
|
2308
|
+
const preselected = defaultBillReviewPayerOption(payer);
|
|
2309
|
+
return {
|
|
2310
|
+
id: payer.id,
|
|
2311
|
+
name: payer.name,
|
|
2312
|
+
payerSelectionRequired: true,
|
|
2313
|
+
...payers.length ? { payers } : {},
|
|
2314
|
+
...preselected ? { payerId: preselected.id } : {}
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
function submittedClaimsAdministrator(administrator) {
|
|
2318
|
+
return {
|
|
2319
|
+
id: administrator.id ?? "",
|
|
2320
|
+
name: administrator.name,
|
|
2321
|
+
...administrator.payerId ? { payerId: administrator.payerId } : {}
|
|
2322
|
+
};
|
|
2323
|
+
}
|
|
2301
2324
|
var BillSubmissionSectionsContext = createContext(null);
|
|
2302
2325
|
function BillSubmissionSection({ id }) {
|
|
2303
2326
|
const sections = useContext(BillSubmissionSectionsContext);
|
|
@@ -2497,7 +2520,7 @@ function BillSubmissionForm({
|
|
|
2497
2520
|
if (request !== payerRequest.current) return;
|
|
2498
2521
|
setPayerResults(results);
|
|
2499
2522
|
const exact = autoSelect ? exactClaimsAdministratorMatch(results, trimmed) : void 0;
|
|
2500
|
-
if (exact) setBill((current) => ({ ...current, claim: { ...current.claim, claimsAdministrator:
|
|
2523
|
+
if (exact) setBill((current) => ({ ...current, claim: { ...current.claim, claimsAdministrator: chooseClaimsAdministrator(exact) } }));
|
|
2501
2524
|
} catch (caught) {
|
|
2502
2525
|
if (request === payerRequest.current) setFormError(caught instanceof Error ? caught.message : "Claims administrator search is unavailable.");
|
|
2503
2526
|
} finally {
|
|
@@ -2592,7 +2615,14 @@ function BillSubmissionForm({
|
|
|
2592
2615
|
return;
|
|
2593
2616
|
}
|
|
2594
2617
|
if (selectedIds.length + uploads.length > MAX_DOCUMENTS) return setFormError(`A bill can include at most ${MAX_DOCUMENTS} attachments.`);
|
|
2595
|
-
const
|
|
2618
|
+
const administrator2 = clean.claim.claimsAdministrator;
|
|
2619
|
+
const complete = {
|
|
2620
|
+
...clean,
|
|
2621
|
+
claim: {
|
|
2622
|
+
...clean.claim,
|
|
2623
|
+
...administrator2 ? { claimsAdministrator: submittedClaimsAdministrator(administrator2) } : {}
|
|
2624
|
+
}
|
|
2625
|
+
};
|
|
2596
2626
|
if (onSubmit) {
|
|
2597
2627
|
setSubmitting(true);
|
|
2598
2628
|
try {
|
|
@@ -2652,7 +2682,12 @@ function BillSubmissionForm({
|
|
|
2652
2682
|
const claimsAdministratorError = errors["claim.claimsAdministrator"];
|
|
2653
2683
|
const selectedPayer = payerResults.find((payer) => payer.id === bill.claim.claimsAdministrator?.id);
|
|
2654
2684
|
const payerRecommendations = bill.claim.claimsAdministrator?.id ? [] : claimsAdministratorRecommendations(payerResults);
|
|
2655
|
-
const choosePayer = (payer) => setBill((current) => ({ ...current, claim: { ...current.claim, claimsAdministrator:
|
|
2685
|
+
const choosePayer = (payer) => setBill((current) => ({ ...current, claim: { ...current.claim, claimsAdministrator: chooseClaimsAdministrator(payer) } }));
|
|
2686
|
+
const administrator = bill.claim.claimsAdministrator;
|
|
2687
|
+
const subpayorOptions = administrator?.payerSelectionRequired ? administrator.payers ?? [] : [];
|
|
2688
|
+
const subpayorError = errors["claim.claimsAdministrator.payerId"];
|
|
2689
|
+
const selectedSubpayor = subpayorOptions.find((option) => option.id === administrator?.payerId);
|
|
2690
|
+
const chooseSubpayor = (payerId) => setBill((current) => current.claim.claimsAdministrator ? { ...current, claim: { ...current.claim, claimsAdministrator: { ...current.claim.claimsAdministrator, payerId } } } : current);
|
|
2656
2691
|
const headerSection = /* @__PURE__ */ jsxs4("div", { className: "mbsf-head", children: [
|
|
2657
2692
|
/* @__PURE__ */ jsxs4("div", { children: [
|
|
2658
2693
|
/* @__PURE__ */ jsx4("h3", { className: "mbsf-title", children: heading }),
|
|
@@ -2693,7 +2728,7 @@ function BillSubmissionForm({
|
|
|
2693
2728
|
/* @__PURE__ */ jsx4(Field2, { path: "claim.claimNumber", label: "Claim number", required: true, error: errors["claim.claimNumber"], children: text(bill.claim.claimNumber, (claimNumber) => setBill((c) => ({ ...c, claim: { ...c.claim, claimNumber } }))) }),
|
|
2694
2729
|
/* @__PURE__ */ jsx4(Field2, { label: "WCAB / ADJ number (optional)", children: text(bill.claim.adjNumber, (adjNumber) => setBill((c) => ({ ...c, claim: { ...c.claim, adjNumber } }))) }),
|
|
2695
2730
|
/* @__PURE__ */ jsxs4(Field2, { path: "claim.claimsAdministrator", label: "Claims administrator", required: true, span: true, error: claimsAdministratorError, children: [
|
|
2696
|
-
/* @__PURE__ */ jsx4(ComboBox, { ariaLabel: "Claims administrator", invalid: Boolean(claimsAdministratorError), disabled: locked, loading: payerLoading, preserveValueOnOpen: true, value: bill.claim.claimsAdministrator?.name ?? "", placeholder: "Search the payer directory\u2026", options: payerResults.map((payer) => ({ id: payer.id, label: payer.name, detail: [payer.hasElectronic ? "Electronic" : "Work comp", ...payer.states ?? []].join(" \xB7 ") })), onQuery: searchPayers, onSelect: (option) => choosePayer({ id: option.id, name: option.label }) }),
|
|
2731
|
+
/* @__PURE__ */ jsx4(ComboBox, { ariaLabel: "Claims administrator", invalid: Boolean(claimsAdministratorError), disabled: locked, loading: payerLoading, preserveValueOnOpen: true, value: bill.claim.claimsAdministrator?.name ?? "", placeholder: "Search the payer directory\u2026", options: payerResults.map((payer) => ({ id: payer.id, label: payer.name, detail: [payer.hasElectronic ? "Electronic" : "Work comp", ...payer.states ?? []].join(" \xB7 ") })), onQuery: searchPayers, onSelect: (option) => choosePayer(payerResults.find((payer) => payer.id === option.id) ?? { id: option.id, name: option.label }) }),
|
|
2697
2732
|
selectedPayer ? /* @__PURE__ */ jsxs4("div", { className: "mbsf-payer-status", role: "status", children: [
|
|
2698
2733
|
/* @__PURE__ */ jsx4("strong", { children: "\u2713 Routing match set:" }),
|
|
2699
2734
|
" ",
|
|
@@ -2724,6 +2759,14 @@ function BillSubmissionForm({
|
|
|
2724
2759
|
] }) : null,
|
|
2725
2760
|
!selectedPayer && !payerLoading && !payerRecommendations.length && (bill.claim.claimsAdministrator?.name.trim().length ?? 0) >= 2 ? /* @__PURE__ */ jsx4("small", { className: "mbsf-help", children: "No confident route selected yet. Search the directory and choose a claims administrator." }) : null
|
|
2726
2761
|
] }),
|
|
2762
|
+
administrator?.payerSelectionRequired && subpayorOptions.length ? /* @__PURE__ */ jsxs4(Field2, { path: "claim.claimsAdministrator.payerId", label: "Payer", required: true, span: true, error: subpayorError, children: [
|
|
2763
|
+
/* @__PURE__ */ jsx4(ComboBox, { ariaLabel: "Payer", invalid: Boolean(subpayorError), disabled: locked, preserveValueOnOpen: true, value: selectedSubpayor?.label ?? "", placeholder: "Select the payer for this claims administrator\u2026", options: subpayorOptions.map((option) => ({ id: option.id, label: option.label, ...option.default ? { detail: "Default" } : {} })), onSelect: (option) => chooseSubpayor(option.id) }),
|
|
2764
|
+
selectedSubpayor ? /* @__PURE__ */ jsxs4("div", { className: "mbsf-payer-status", role: "status", children: [
|
|
2765
|
+
/* @__PURE__ */ jsx4("strong", { children: "\u2713 Payer set:" }),
|
|
2766
|
+
" ",
|
|
2767
|
+
selectedSubpayor.label
|
|
2768
|
+
] }) : /* @__PURE__ */ jsx4("small", { className: "mbsf-help", children: "This claims administrator routes bills per payer. Choose the payer that should receive this bill." })
|
|
2769
|
+
] }) : null,
|
|
2727
2770
|
/* @__PURE__ */ jsx4(Field2, { label: "Injury description (optional)", span: true, children: text(bill.claim.description, (description2) => setBill((c) => ({ ...c, claim: { ...c.claim, description: description2 } }))) }),
|
|
2728
2771
|
/* @__PURE__ */ jsxs4(Field2, { path: "diagnoses", label: "Diagnosis codes (ICD-10)", required: true, span: true, error: errors.diagnoses, children: [
|
|
2729
2772
|
/* @__PURE__ */ jsx4("div", { className: "mbsf-quick-picks", "aria-label": "Common diagnosis codes", children: BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS.map((option) => {
|
|
@@ -5064,6 +5107,7 @@ function useBillLifecycle({
|
|
|
5064
5107
|
postPayment: (input) => mutate(() => client.postPayment(input)),
|
|
5065
5108
|
submitSecondReview: (input) => mutate(() => client.submitSecondReview(input)),
|
|
5066
5109
|
resubmitBill: (input) => mutate(() => client.resubmitBill(input)),
|
|
5110
|
+
submitNewBill: (input) => mutate(() => client.submitNewBill(input)),
|
|
5067
5111
|
sendDuplicateBill: (input) => mutate(() => client.sendDuplicateBill(input)),
|
|
5068
5112
|
reportBillStatus: (input) => mutate(() => client.reportBillStatus(input)),
|
|
5069
5113
|
simulateSandbox: (input) => mutate(() => client.simulateSandbox(input))
|
|
@@ -5175,6 +5219,7 @@ function usDate(isoDate) {
|
|
|
5175
5219
|
}
|
|
5176
5220
|
function actionPanel(action) {
|
|
5177
5221
|
if (action.id === "resubmit") return "resubmit";
|
|
5222
|
+
if (action.id === "submit_new_bill") return "submit_new_bill";
|
|
5178
5223
|
if (action.id === "second_review") return "second_review";
|
|
5179
5224
|
if (action.id === "post_payment") return "payment";
|
|
5180
5225
|
if (action.id === "close") return "close";
|
|
@@ -5205,6 +5250,7 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
|
|
|
5205
5250
|
const [notice, setNotice] = useState10("");
|
|
5206
5251
|
const [reason, setReason] = useState10("");
|
|
5207
5252
|
const [correctionError, setCorrectionError] = useState10("");
|
|
5253
|
+
const [newBillError, setNewBillError] = useState10("");
|
|
5208
5254
|
const [payment, setPayment] = useState10({ amount: 0, penaltyAmount: 0, interestAmount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
|
|
5209
5255
|
const [review, setReview] = useState10({ reason: "", payerClaimControlNumber: "", disputedAmount: void 0, attachmentIds: [], route: "ebill" });
|
|
5210
5256
|
const [duplicateDelivery, setDuplicateDelivery] = useState10(null);
|
|
@@ -5287,13 +5333,39 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
|
|
|
5287
5333
|
setReason("");
|
|
5288
5334
|
setNotice("Corrected submission sent.");
|
|
5289
5335
|
};
|
|
5336
|
+
const submitNewBillFromForm = async (value) => {
|
|
5337
|
+
setNotice("");
|
|
5338
|
+
setNewBillError("");
|
|
5339
|
+
try {
|
|
5340
|
+
const documents = await prepareBillSubmissionDocuments({
|
|
5341
|
+
attachments: correctionAttachments,
|
|
5342
|
+
selectedIds: value.sourceAttachmentIds,
|
|
5343
|
+
reportTypeCodeByAttachmentId: value.sourceAttachmentReportTypes,
|
|
5344
|
+
uploads: value.uploads,
|
|
5345
|
+
...options.fetch ? { fetch: options.fetch } : {}
|
|
5346
|
+
});
|
|
5347
|
+
await lifecycle.submitNewBill({
|
|
5348
|
+
bill: value.bill,
|
|
5349
|
+
...documents.length ? { documents } : {},
|
|
5350
|
+
...reason.trim() ? { reason: reason.trim() } : {}
|
|
5351
|
+
});
|
|
5352
|
+
} catch (cause) {
|
|
5353
|
+
setNewBillError(
|
|
5354
|
+
cause instanceof Error && cause.message ? cause.message : "The new bill could not be submitted."
|
|
5355
|
+
);
|
|
5356
|
+
return;
|
|
5357
|
+
}
|
|
5358
|
+
setPanel("");
|
|
5359
|
+
setReason("");
|
|
5360
|
+
setNotice("New bill submitted.");
|
|
5361
|
+
};
|
|
5290
5362
|
const loadDuplicateDelivery = () => {
|
|
5291
5363
|
setDuplicateDeliveryError("");
|
|
5292
5364
|
if (duplicateDelivery) return;
|
|
5293
5365
|
lifecycle.getDeliveryOptions().then((options2) => setDuplicateDelivery(options2)).catch((cause) => setDuplicateDeliveryError(cause instanceof Error ? cause.message : "Delivery options could not be loaded."));
|
|
5294
5366
|
};
|
|
5295
5367
|
const viewEor = data.lifecycle.actions.find((action) => action.id === "view_eor" && action.enabled);
|
|
5296
|
-
const supportedActions = /* @__PURE__ */ new Set(["resubmit", "second_review", "post_payment", "close", "reopen", "send_duplicate", "report_bill_status"]);
|
|
5368
|
+
const supportedActions = /* @__PURE__ */ new Set(["resubmit", "submit_new_bill", "second_review", "post_payment", "close", "reopen", "send_duplicate", "report_bill_status"]);
|
|
5297
5369
|
const actions = data.lifecycle.actions.filter((action) => action.enabled && supportedActions.has(action.id));
|
|
5298
5370
|
const showSandboxControls = shouldShowSandboxControls(data.environment, sandboxControls);
|
|
5299
5371
|
const simulations = showSandboxControls ? sandboxScenarios(data.lifecycle.state) : [];
|
|
@@ -5344,6 +5416,7 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
|
|
|
5344
5416
|
const next = actionPanel(action);
|
|
5345
5417
|
if (!next) return;
|
|
5346
5418
|
if (next === "resubmit") setCorrectionError("");
|
|
5419
|
+
if (next === "submit_new_bill") setNewBillError("");
|
|
5347
5420
|
if (next === "send_duplicate") loadDuplicateDelivery();
|
|
5348
5421
|
if (next === "second_review") setReview((current) => current.reason.trim() ? current : { ...current, reason: SECOND_REVIEW_REASON_TEMPLATE });
|
|
5349
5422
|
setPanel(next);
|
|
@@ -5400,6 +5473,39 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
|
|
|
5400
5473
|
),
|
|
5401
5474
|
correctionError ? /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-message error", role: "alert", children: correctionError }) : null
|
|
5402
5475
|
] }) }) : null,
|
|
5476
|
+
panel === "submit_new_bill" && correctionInitialBill ? /* @__PURE__ */ jsx13(LifecycleDialog, { title: "Submit New Bill", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-correction", children: [
|
|
5477
|
+
/* @__PURE__ */ jsxs13("header", { children: [
|
|
5478
|
+
/* @__PURE__ */ jsxs13("div", { children: [
|
|
5479
|
+
/* @__PURE__ */ jsx13("h3", { children: "Submit New Bill" }),
|
|
5480
|
+
/* @__PURE__ */ jsx13("p", { children: "This closed bill stays closed and keeps its record. Review the carried-over snapshot below and submit a fresh bill \u2014 both bills stay linked in the submissions timeline." })
|
|
5481
|
+
] }),
|
|
5482
|
+
/* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" })
|
|
5483
|
+
] }),
|
|
5484
|
+
/* @__PURE__ */ jsxs13("label", { className: "mb-lifecycle-correction-note", children: [
|
|
5485
|
+
/* @__PURE__ */ jsx13("span", { children: "Submission note (optional)" }),
|
|
5486
|
+
/* @__PURE__ */ jsx13("textarea", { value: reason, placeholder: "Why is a new bill being submitted?", onChange: (event) => setReason(event.target.value) })
|
|
5487
|
+
] }),
|
|
5488
|
+
/* @__PURE__ */ jsx13(
|
|
5489
|
+
BillSubmissionForm,
|
|
5490
|
+
{
|
|
5491
|
+
initialBill: correctionInitialBill,
|
|
5492
|
+
attachments: correctionAttachments,
|
|
5493
|
+
onSubmit: submitNewBillFromForm,
|
|
5494
|
+
onSearchClaimsAdministrators: lifecycle.searchClaimsAdministrators,
|
|
5495
|
+
attentionMessage: "Confirm every value carried over from the closed bill before submitting the new bill.",
|
|
5496
|
+
submitLabel: lifecycle.isMutating ? "Submitting\u2026" : "Submit New Bill",
|
|
5497
|
+
heading: "New bill information",
|
|
5498
|
+
description: "The closed bill stays unchanged. This form submits a fresh bill linked to it.",
|
|
5499
|
+
disabled: lifecycle.isMutating,
|
|
5500
|
+
...options.getSession ? { getSession: options.getSession } : {},
|
|
5501
|
+
...options.sessionEndpoint ? { sessionEndpoint: options.sessionEndpoint } : {},
|
|
5502
|
+
...options.apiBaseUrl ? { apiBaseUrl: options.apiBaseUrl } : {},
|
|
5503
|
+
...options.fetch ? { fetch: options.fetch } : {},
|
|
5504
|
+
...appearance ? { appearance } : {}
|
|
5505
|
+
}
|
|
5506
|
+
),
|
|
5507
|
+
newBillError ? /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-message error", role: "alert", children: newBillError }) : null
|
|
5508
|
+
] }) }) : null,
|
|
5403
5509
|
panel === "second_review" ? /* @__PURE__ */ jsx13(LifecycleDialog, { title: "Submit Second Review", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-panel", children: [
|
|
5404
5510
|
/* @__PURE__ */ jsxs13("div", { children: [
|
|
5405
5511
|
/* @__PURE__ */ jsx13("h3", { children: "Submit Second Review" }),
|
|
@@ -5666,6 +5772,7 @@ export {
|
|
|
5666
5772
|
buildBillingReportCsv,
|
|
5667
5773
|
buildBillingReportRows,
|
|
5668
5774
|
calculateBillSubmissionAllowedAmount,
|
|
5775
|
+
chooseClaimsAdministrator,
|
|
5669
5776
|
claimsAdministratorRecommendations,
|
|
5670
5777
|
createBillLifecycleClient2 as createBillLifecycleClient,
|
|
5671
5778
|
createBillStatusClient,
|
|
@@ -5683,6 +5790,7 @@ export {
|
|
|
5683
5790
|
reportBillStatusContacts2 as reportBillStatusContacts,
|
|
5684
5791
|
resolveMindBillAppearance,
|
|
5685
5792
|
secondReviewDeadline2 as secondReviewDeadline,
|
|
5793
|
+
submittedClaimsAdministrator,
|
|
5686
5794
|
summarizeBillingDashboard,
|
|
5687
5795
|
useBillLifecycle,
|
|
5688
5796
|
useBillStatus,
|