@mindbill/react 0.9.3 → 0.10.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 +32 -15
- package/dist/index.d.ts +13 -29
- package/dist/index.js +82 -56
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,27 +6,25 @@ Native React billing components and connected lifecycle hooks. Install with:
|
|
|
6
6
|
npm install @mindbill/react @mindbill/node
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
## Connected
|
|
9
|
+
## Connected lifecycle
|
|
10
10
|
|
|
11
|
-
`
|
|
11
|
+
`ConnectedBillLifecycle` is the default integration. It owns bill loading, payer lookup, editable review, attachments, submission, status refresh, EORs, payment posting, Second Bill Review, correction/resubmission, and close.
|
|
12
12
|
|
|
13
13
|
```tsx
|
|
14
|
-
import {
|
|
14
|
+
import { ConnectedBillLifecycle } from "@mindbill/react";
|
|
15
15
|
|
|
16
|
-
<
|
|
16
|
+
<ConnectedBillLifecycle
|
|
17
17
|
billId={billId}
|
|
18
|
+
sessionEndpoint="/api/mindbill/billing-session"
|
|
18
19
|
appearance={{ accentColor: "#32a9d6", textColor: "#203743" }}
|
|
19
|
-
|
|
20
|
-
{ id: "eor", label: "View EOR", onClick: openEor },
|
|
21
|
-
{ id: "payment", label: "Post payment", onClick: postPayment, primary: true },
|
|
22
|
-
]}
|
|
20
|
+
onChanged={(lifecycle) => syncBillStatus(lifecycle.bill)}
|
|
23
21
|
/>
|
|
24
22
|
```
|
|
25
23
|
|
|
26
24
|
Add one authenticated route to your app. It verifies that the signed-in user may access the bill, then mints an exact-origin, bill-scoped token. The Partner API key stays on the server.
|
|
27
25
|
|
|
28
26
|
```ts
|
|
29
|
-
// app/api/mindbill/
|
|
27
|
+
// app/api/mindbill/billing-session/route.ts
|
|
30
28
|
import { mindbill } from "@/lib/mindbill";
|
|
31
29
|
|
|
32
30
|
export async function POST(request: Request) {
|
|
@@ -34,8 +32,8 @@ export async function POST(request: Request) {
|
|
|
34
32
|
const { billId } = await request.json();
|
|
35
33
|
await requireBillAccess(user, billId); // your existing authorization
|
|
36
34
|
|
|
37
|
-
const session = await mindbill.
|
|
38
|
-
component: "bill-
|
|
35
|
+
const session = await mindbill.createBrowserSession({
|
|
36
|
+
component: "bill-review",
|
|
39
37
|
billId,
|
|
40
38
|
allowedOrigin: new URL(request.url).origin,
|
|
41
39
|
expiresIn: 900,
|
|
@@ -48,13 +46,29 @@ export async function POST(request: Request) {
|
|
|
48
46
|
}
|
|
49
47
|
```
|
|
50
48
|
|
|
51
|
-
|
|
49
|
+
The component searches MindBill's claims-administrator directory with both payer text and the current claim number. It explains name and claim-pattern evidence, shows delivery availability, and only preselects a high-confidence exact name or alias match.
|
|
52
50
|
|
|
53
51
|
This is the minimum safe browser integration. A permanent Partner API key must never enter frontend code. A completely serverless partner integration requires MindBill-hosted sign-in/SSO so MindBill can authenticate the end user itself.
|
|
54
52
|
|
|
55
|
-
##
|
|
53
|
+
## Compact status
|
|
54
|
+
|
|
55
|
+
Use `ConnectedBillStatus` when the partner page only needs a small status and aging surface. Add a second session route using the same server pattern and mint `component: "bill-timeline"`.
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { ConnectedBillStatus } from "@mindbill/react";
|
|
59
|
+
|
|
60
|
+
<ConnectedBillStatus
|
|
61
|
+
billId={billId}
|
|
62
|
+
sessionEndpoint="/api/mindbill/status-session"
|
|
63
|
+
appearance={{ accentColor: "#32a9d6", textColor: "#203743" }}
|
|
64
|
+
/>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Use `useBillStatus({ billId })` when you want to render custom status UI. It returns `data`, `error`, `isLoading`, `isRefreshing`, and `refresh`. Use `createBillStatusClient` outside React.
|
|
56
68
|
|
|
57
|
-
|
|
69
|
+
## Controlled escape hatch
|
|
70
|
+
|
|
71
|
+
Use `BillReviewForm` only when your application intentionally owns the API calls and local review state. Known bill values and payer documents remain explicit and editable.
|
|
58
72
|
|
|
59
73
|
```tsx
|
|
60
74
|
import { BillReviewForm } from "@mindbill/react";
|
|
@@ -70,6 +84,9 @@ import { BillReviewForm } from "@mindbill/react";
|
|
|
70
84
|
onRemoveAttachment={(attachmentId) =>
|
|
71
85
|
api.delete(`/billing/attachments/${attachmentId}`)
|
|
72
86
|
}
|
|
87
|
+
onSearchClaimsAdministrators={(query, claimNumber) =>
|
|
88
|
+
api.searchPayers({ query, claimNumber })
|
|
89
|
+
}
|
|
73
90
|
/>
|
|
74
91
|
```
|
|
75
92
|
|
|
@@ -90,6 +107,6 @@ Use `BillStatusSummary` only when your application already owns status loading a
|
|
|
90
107
|
/>
|
|
91
108
|
```
|
|
92
109
|
|
|
93
|
-
`
|
|
110
|
+
`MindBillBillReview` and `MindBillBillTimeline` are available when a hosted flow is a better fit. Native and hosted UI paths use the same bill ID.
|
|
94
111
|
|
|
95
112
|
Never send a Partner API key or long-lived credential to React/browser code.
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
|
4
4
|
|
|
5
5
|
type BillReviewDocumentType = "final_report" | "letter_of_attestation" | "proof_of_service" | "form_122" | "return_to_work_voucher" | "w9" | "medical_records" | "appeal" | "other";
|
|
6
6
|
type BillReviewBillingProvider = {
|
|
7
|
-
id?: string;
|
|
8
7
|
name: string;
|
|
9
8
|
taxId: string;
|
|
10
9
|
npi: string;
|
|
@@ -16,7 +15,6 @@ type BillReviewBillingProvider = {
|
|
|
16
15
|
billingZip?: string;
|
|
17
16
|
};
|
|
18
17
|
type BillReviewClinician = {
|
|
19
|
-
id?: string;
|
|
20
18
|
name: string;
|
|
21
19
|
specialty: string;
|
|
22
20
|
npi: string;
|
|
@@ -31,8 +29,6 @@ type BillReviewClinician = {
|
|
|
31
29
|
active?: boolean;
|
|
32
30
|
};
|
|
33
31
|
type BillReviewLocation = {
|
|
34
|
-
id?: string;
|
|
35
|
-
billingProviderId?: string;
|
|
36
32
|
name: string;
|
|
37
33
|
nickname?: string;
|
|
38
34
|
street: string;
|
|
@@ -67,6 +63,13 @@ type BillReviewPayer = {
|
|
|
67
63
|
name: string;
|
|
68
64
|
hasElectronic?: boolean;
|
|
69
65
|
states?: string[];
|
|
66
|
+
confidence?: "high" | "medium" | "directory";
|
|
67
|
+
recommended?: boolean;
|
|
68
|
+
signals?: Array<{
|
|
69
|
+
kind: "name" | "claim_number";
|
|
70
|
+
state: "match" | "warning";
|
|
71
|
+
label: string;
|
|
72
|
+
}>;
|
|
70
73
|
};
|
|
71
74
|
type BillReviewFeatures = {
|
|
72
75
|
authorizationNumber?: boolean;
|
|
@@ -88,10 +91,7 @@ type BillReviewData = {
|
|
|
88
91
|
transmissionState?: string;
|
|
89
92
|
dos: string;
|
|
90
93
|
dosEnd?: string | null;
|
|
91
|
-
placeOfServiceId?: string;
|
|
92
94
|
authorizationNumber?: string | null;
|
|
93
|
-
billingProviderId?: string;
|
|
94
|
-
renderingProviderId?: string;
|
|
95
95
|
billingSnapshot?: {
|
|
96
96
|
billingProvider?: BillReviewBillingProvider;
|
|
97
97
|
renderingProvider?: BillReviewClinician;
|
|
@@ -121,11 +121,6 @@ type BillReviewData = {
|
|
|
121
121
|
claimsAdminName?: string;
|
|
122
122
|
claimPatternStatus?: BillReviewClaimPatternStatus;
|
|
123
123
|
};
|
|
124
|
-
options?: {
|
|
125
|
-
billingProviders?: BillReviewBillingProvider[];
|
|
126
|
-
renderingProviders?: BillReviewClinician[];
|
|
127
|
-
locations?: BillReviewLocation[];
|
|
128
|
-
};
|
|
129
124
|
};
|
|
130
125
|
type BillReviewSaveInput = {
|
|
131
126
|
claimsAdminId: string;
|
|
@@ -146,12 +141,9 @@ type BillReviewSaveInput = {
|
|
|
146
141
|
dos: string;
|
|
147
142
|
dosEnd?: string | null;
|
|
148
143
|
authorizationNumber?: string | null;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
renderingProvider?: Omit<BillReviewClinician, "id">;
|
|
153
|
-
placeOfServiceId?: string;
|
|
154
|
-
placeOfService?: Omit<BillReviewLocation, "id">;
|
|
144
|
+
billingProvider?: BillReviewBillingProvider;
|
|
145
|
+
renderingProvider?: BillReviewClinician;
|
|
146
|
+
placeOfService?: BillReviewLocation;
|
|
155
147
|
lineItems: Array<{
|
|
156
148
|
id?: string;
|
|
157
149
|
code: string;
|
|
@@ -167,7 +159,7 @@ type BillReviewFormProps = {
|
|
|
167
159
|
onAddAttachment: (file: File, documentType: BillReviewDocumentType, description?: string) => Promise<void>;
|
|
168
160
|
onRemoveAttachment: (attachmentId: string) => Promise<void>;
|
|
169
161
|
onOpenAttachment?: (attachment: BillReviewAttachment) => void;
|
|
170
|
-
onSearchClaimsAdministrators?: (query: string) => Promise<BillReviewPayer[]>;
|
|
162
|
+
onSearchClaimsAdministrators?: (query: string, claimNumber?: string) => Promise<BillReviewPayer[]>;
|
|
171
163
|
className?: string;
|
|
172
164
|
style?: CSSProperties;
|
|
173
165
|
appearance?: MindBillAppearance;
|
|
@@ -347,7 +339,7 @@ type BillLifecycleClientOptions = {
|
|
|
347
339
|
};
|
|
348
340
|
type BillLifecycleClient = {
|
|
349
341
|
getLifecycle: (signal?: AbortSignal) => Promise<BillLifecycleData>;
|
|
350
|
-
searchClaimsAdministrators: (query: string) => Promise<BillReviewPayer[]>;
|
|
342
|
+
searchClaimsAdministrators: (query: string, claimNumber?: string) => Promise<BillReviewPayer[]>;
|
|
351
343
|
saveReview: (input: BillReviewSaveInput) => Promise<BillLifecycleData>;
|
|
352
344
|
submitBill: (input: BillReviewSaveInput, route: BillSubmissionRoute) => Promise<BillLifecycleData>;
|
|
353
345
|
addAttachment: (file: File, documentType: BillReviewDocumentType, description?: string) => Promise<BillLifecycleData>;
|
|
@@ -418,13 +410,5 @@ type MindBillWidgetProps = {
|
|
|
418
410
|
};
|
|
419
411
|
declare function MindBillBillTimeline(props: MindBillWidgetProps): ReactElement;
|
|
420
412
|
declare function MindBillBillReview(props: MindBillWidgetProps): ReactElement;
|
|
421
|
-
declare function MindBillBillFromReport(props: MindBillWidgetProps): ReactElement;
|
|
422
|
-
declare function MindBillCollections(props: MindBillWidgetProps): ReactElement;
|
|
423
|
-
declare function MindBillOnboarding(props: MindBillWidgetProps): ReactElement;
|
|
424
|
-
declare const HostedBillTimeline: typeof MindBillBillTimeline;
|
|
425
|
-
declare const HostedBillReview: typeof MindBillBillReview;
|
|
426
|
-
declare const HostedBillFromReport: typeof MindBillBillFromReport;
|
|
427
|
-
declare const HostedCollections: typeof MindBillCollections;
|
|
428
|
-
declare const HostedOnboarding: typeof MindBillOnboarding;
|
|
429
413
|
|
|
430
|
-
export { type BillEorDocument, type BillLifecycleAction, type BillLifecycleActionId, type BillLifecycleClient, type BillLifecycleClientOptions, type BillLifecycleData, type BillLifecycleSession, type BillLifecycleSessionProvider, type BillLifecycleSessionRequest, 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, type BillStatusAction, type BillStatusClient, type BillStatusClientOptions, type BillStatusData, type BillStatusSession, type BillStatusSessionProvider, type BillStatusSessionRequest, BillStatusSummary, type BillStatusSummaryProps, type BillSubmissionRoute, type CloseBillInput, ConnectedBillLifecycle, type ConnectedBillLifecycleProps, ConnectedBillStatus, type ConnectedBillStatusProps,
|
|
414
|
+
export { type BillEorDocument, type BillLifecycleAction, type BillLifecycleActionId, type BillLifecycleClient, type BillLifecycleClientOptions, type BillLifecycleData, type BillLifecycleSession, type BillLifecycleSessionProvider, type BillLifecycleSessionRequest, 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, type BillStatusAction, type BillStatusClient, type BillStatusClientOptions, type BillStatusData, type BillStatusSession, type BillStatusSessionProvider, type BillStatusSessionRequest, BillStatusSummary, type BillStatusSummaryProps, type BillSubmissionRoute, type CloseBillInput, ConnectedBillLifecycle, type ConnectedBillLifecycleProps, ConnectedBillStatus, type ConnectedBillStatusProps, MindBillBillReview, MindBillBillTimeline, type MindBillWidgetProps, type PostBillPaymentInput, type SubmitSecondReviewInput, type UseBillLifecycleOptions, type UseBillLifecycleResult, type UseBillStatusOptions, type UseBillStatusResult, buildBillReviewSaveInput, createBillLifecycleClient, createBillStatusClient, useBillLifecycle, useBillStatus };
|
package/dist/index.js
CHANGED
|
@@ -66,11 +66,6 @@ var MODIFIER_CODES = {
|
|
|
66
66
|
"97": ["ML201", "ML202", "ML203"],
|
|
67
67
|
"98": ["ML201", "ML202", "ML203"]
|
|
68
68
|
};
|
|
69
|
-
function withoutId(value) {
|
|
70
|
-
const result = { ...value };
|
|
71
|
-
delete result.id;
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
69
|
function toDraft(data) {
|
|
75
70
|
const snapshot = data.bill.billingSnapshot;
|
|
76
71
|
const nameParts = data.patient.name.trim().split(/\s+/);
|
|
@@ -119,12 +114,9 @@ function buildBillReviewSaveInput(draft) {
|
|
|
119
114
|
dos: draft.dos,
|
|
120
115
|
dosEnd: draft.dosEnd || null,
|
|
121
116
|
authorizationNumber: draft.authorizationNumber.trim() || null,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
renderingProvider: withoutId(draft.clinician),
|
|
126
|
-
...draft.location.id ? { placeOfServiceId: draft.location.id } : {},
|
|
127
|
-
placeOfService: withoutId(draft.location),
|
|
117
|
+
billingProvider: { ...draft.billingProvider },
|
|
118
|
+
renderingProvider: { ...draft.clinician },
|
|
119
|
+
placeOfService: { ...draft.location },
|
|
128
120
|
lineItems: draft.lineItems.filter((line) => line.code.trim()).map(({ id, code, modifiers, units }) => ({
|
|
129
121
|
...id ? { id } : {},
|
|
130
122
|
code: code.trim().toUpperCase(),
|
|
@@ -248,7 +240,10 @@ function Combobox({ label, value, options, onChange, placeholder, required, disa
|
|
|
248
240
|
)
|
|
249
241
|
] }),
|
|
250
242
|
open && filtered.length ? /* @__PURE__ */ jsx("ul", { id: listId, role: "listbox", className: "mb-native-combo-list", children: filtered.map((option, index) => /* @__PURE__ */ jsx("li", { id: `${listId}-${index}`, role: "option", "aria-selected": index === active, children: /* @__PURE__ */ jsxs("button", { type: "button", className: index === active ? "active" : "", onMouseDown: (event) => event.preventDefault(), onClick: () => select(option), children: [
|
|
251
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ jsxs("span", { className: "mb-native-combo-title", children: [
|
|
244
|
+
/* @__PURE__ */ jsx("strong", { children: option.label }),
|
|
245
|
+
option.badge ? /* @__PURE__ */ jsx("em", { children: option.badge }) : null
|
|
246
|
+
] }),
|
|
252
247
|
option.detail ? /* @__PURE__ */ jsx("span", { children: option.detail }) : null
|
|
253
248
|
] }) }, `${option.value}-${index}`)) }) : null
|
|
254
249
|
] });
|
|
@@ -328,7 +323,9 @@ function BillReviewForm({
|
|
|
328
323
|
setPayerQuery(data.injury.claimsAdminName || "");
|
|
329
324
|
}, [data]);
|
|
330
325
|
useEffect(() => {
|
|
331
|
-
|
|
326
|
+
const query = payerQuery.trim();
|
|
327
|
+
const claimNumber = draft.claimNumber.trim();
|
|
328
|
+
if (!onSearchClaimsAdministrators || query.length < 2 && claimNumber.length < 4) {
|
|
332
329
|
setPayerResults([]);
|
|
333
330
|
setPayerBusy(false);
|
|
334
331
|
return;
|
|
@@ -336,8 +333,23 @@ function BillReviewForm({
|
|
|
336
333
|
let current = true;
|
|
337
334
|
const timer = window.setTimeout(() => {
|
|
338
335
|
setPayerBusy(true);
|
|
339
|
-
void onSearchClaimsAdministrators(
|
|
340
|
-
if (current)
|
|
336
|
+
void onSearchClaimsAdministrators(query, claimNumber).then((results) => {
|
|
337
|
+
if (!current) return;
|
|
338
|
+
setPayerResults(results);
|
|
339
|
+
const recommendation = results.find(
|
|
340
|
+
(payer) => payer.recommended && payer.confidence === "high"
|
|
341
|
+
);
|
|
342
|
+
if (!draft.claimsAdminId && recommendation) {
|
|
343
|
+
setDraft((currentDraft) => ({
|
|
344
|
+
...currentDraft,
|
|
345
|
+
claimsAdminId: recommendation.id,
|
|
346
|
+
claimsAdminName: recommendation.name
|
|
347
|
+
}));
|
|
348
|
+
setPayerQuery(recommendation.name);
|
|
349
|
+
setNotice(
|
|
350
|
+
"Claims administrator matched from the case data. Review and save to keep it on this bill."
|
|
351
|
+
);
|
|
352
|
+
}
|
|
341
353
|
}).catch((cause) => {
|
|
342
354
|
if (current) {
|
|
343
355
|
setPayerResults([]);
|
|
@@ -353,7 +365,15 @@ function BillReviewForm({
|
|
|
353
365
|
current = false;
|
|
354
366
|
window.clearTimeout(timer);
|
|
355
367
|
};
|
|
356
|
-
}, [
|
|
368
|
+
}, [
|
|
369
|
+
draft.claimNumber,
|
|
370
|
+
draft.claimsAdminId,
|
|
371
|
+
onSearchClaimsAdministrators,
|
|
372
|
+
payerQuery
|
|
373
|
+
]);
|
|
374
|
+
const selectedPayer = payerResults.find(
|
|
375
|
+
(payer) => payer.id === draft.claimsAdminId
|
|
376
|
+
);
|
|
357
377
|
const adjFormatValid = !draft.adjNumber || /^ADJ\d{7,}$/i.test(draft.adjNumber.replace(/[\s-]/g, ""));
|
|
358
378
|
const blockers = useMemo(() => {
|
|
359
379
|
const result = [];
|
|
@@ -481,12 +501,19 @@ function BillReviewForm({
|
|
|
481
501
|
disabled: !editable,
|
|
482
502
|
placeholder: "Search by payer or administrator name",
|
|
483
503
|
name: "mindbill-payer-query",
|
|
484
|
-
options: payerResults.map((payer) => ({
|
|
504
|
+
options: payerResults.map((payer) => ({
|
|
505
|
+
value: payer.id,
|
|
506
|
+
label: payer.name,
|
|
507
|
+
...payer.recommended ? { badge: "Recommended" } : payer.confidence === "medium" ? { badge: "Claim match" } : {},
|
|
508
|
+
detail: [
|
|
509
|
+
...(payer.signals ?? []).map((signal) => signal.label),
|
|
510
|
+
payer.hasElectronic ? "Electronic billing available." : "Billing route confirmed after review."
|
|
511
|
+
].join(" ")
|
|
512
|
+
})),
|
|
485
513
|
onChange: (value, option) => {
|
|
486
514
|
if (option) {
|
|
487
515
|
setDraft((current) => ({ ...current, claimsAdminId: option.value, claimsAdminName: option.label }));
|
|
488
516
|
setPayerQuery(option.label);
|
|
489
|
-
setPayerResults([]);
|
|
490
517
|
setNotice("Claims administrator selected. Save changes to keep it on this bill.");
|
|
491
518
|
} else {
|
|
492
519
|
setPayerQuery(value);
|
|
@@ -496,7 +523,8 @@ function BillReviewForm({
|
|
|
496
523
|
}
|
|
497
524
|
),
|
|
498
525
|
payerBusy ? /* @__PURE__ */ jsx("span", { className: "mb-native-payer-help", children: "Searching\u2026" }) : null,
|
|
499
|
-
!payerBusy && payerQuery.trim().length > 1 && payerResults.length === 0 && !draft.claimsAdminId ? /* @__PURE__ */ jsx("span", { className: "mb-native-payer-help", children: "No matching administrator selected yet." }) : null
|
|
526
|
+
!payerBusy && payerQuery.trim().length > 1 && payerResults.length === 0 && !draft.claimsAdminId ? /* @__PURE__ */ jsx("span", { className: "mb-native-payer-help", children: "No matching administrator selected yet." }) : null,
|
|
527
|
+
selectedPayer?.signals?.length ? /* @__PURE__ */ jsx("div", { className: "mb-native-payer-insight", role: "status", children: selectedPayer.signals.map((signal) => /* @__PURE__ */ jsx("span", { className: signal.state, children: signal.label }, `${signal.kind}-${signal.label}`)) }) : null
|
|
500
528
|
] })
|
|
501
529
|
] }),
|
|
502
530
|
/* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
|
|
@@ -780,7 +808,8 @@ var NATIVE_BILL_REVIEW_STYLES = `
|
|
|
780
808
|
.mb-native-hint{color:var(--mb-muted);font-size:12px;font-weight:500}
|
|
781
809
|
.mb-native-combo{position:relative;min-width:0}
|
|
782
810
|
.mb-native-combo-list{position:absolute;z-index:20;top:calc(100% + 6px);right:0;left:0;max-height:300px;overflow:auto;list-style:none;margin:0;padding:6px;border:1px solid var(--mb-border);border-radius:10px;background:var(--mb-surface);box-shadow:0 18px 42px rgba(28,58,72,.18)}
|
|
783
|
-
.mb-native-combo-list li{margin:0;padding:0}.mb-native-combo-list button{display:grid;width:100%;gap:
|
|
811
|
+
.mb-native-combo-list li{margin:0;padding:0}.mb-native-combo-list button{display:grid;width:100%;gap:4px;padding:11px 12px;border:0;border-radius:7px;background:transparent;color:var(--mb-text);font:inherit;text-align:left;cursor:pointer}.mb-native-combo-list button:hover,.mb-native-combo-list button.active{background:var(--mb-soft);outline:0}.mb-native-combo-list button>span{color:var(--mb-muted);font-size:12px;font-weight:500}.mb-native-combo-list .mb-native-combo-title{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--mb-text);font-size:14px}.mb-native-combo-title em{border-radius:999px;background:#e9f6f3;color:#24725f;font-size:10px;font-style:normal;font-weight:800;letter-spacing:.03em;padding:3px 7px;text-transform:uppercase}
|
|
812
|
+
.mb-native-payer-insight{display:grid;gap:5px;margin-top:10px;padding:11px 13px;border:1px solid #c9dfe7;border-radius:9px;background:#f4fafc}.mb-native-payer-insight span{color:#426570;font-size:12px}.mb-native-payer-insight span.warning{color:#8a5c17}
|
|
784
813
|
.mb-native-presets{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:-2px 0 14px}.mb-native-presets button{min-height:36px;border:1px solid var(--mb-border);border-radius:8px;background:#fff;color:var(--mb-text);cursor:pointer;font:inherit;font-weight:750;padding:7px 13px}.mb-native-presets button.active{border-color:var(--mb-accent);background:var(--mb-accent);color:#fff}.mb-native-presets span{margin-left:5px;color:var(--mb-muted);font-size:12px}
|
|
785
814
|
.mb-native-modifiers{display:grid;gap:7px}.mb-native-chips{display:flex;flex-wrap:wrap;gap:5px}.mb-native-chips button{border:1px solid #c9dce3;border-radius:999px;background:#fff;color:var(--mb-text);cursor:pointer;font:inherit;font-size:11px;font-weight:750;padding:4px 8px}
|
|
786
815
|
.mb-native-blockers{grid-column:1/-1;display:grid;gap:2px;padding:11px 13px;border:1px solid #e8cf9a;border-radius:8px;background:#fff9ea;color:#74531b}.mb-native-blockers span{font-size:12px}
|
|
@@ -892,7 +921,7 @@ function createBillStatusClient({
|
|
|
892
921
|
};
|
|
893
922
|
const requestStatus = async (browserSession, signal) => {
|
|
894
923
|
const baseUrl = (browserSession.apiBaseUrl ?? apiBaseUrl).replace(/\/$/, "");
|
|
895
|
-
return fetcher(`${baseUrl}/
|
|
924
|
+
return fetcher(`${baseUrl}/partner/v2/browser/status`, {
|
|
896
925
|
headers: { authorization: `Bearer ${browserSession.token}` },
|
|
897
926
|
signal
|
|
898
927
|
});
|
|
@@ -1164,16 +1193,19 @@ function createBillLifecycleClient({
|
|
|
1164
1193
|
return response;
|
|
1165
1194
|
};
|
|
1166
1195
|
const loadLifecycle = async (signal) => {
|
|
1167
|
-
const response = await request("/
|
|
1196
|
+
const response = await request("/partner/v2/browser/bill", {}, signal);
|
|
1168
1197
|
if (!response.ok) {
|
|
1169
1198
|
throw await responseError2(response, "Bill lifecycle could not be loaded.");
|
|
1170
1199
|
}
|
|
1171
1200
|
const body = await response.json();
|
|
1172
1201
|
return normalizeLifecycle(body.data);
|
|
1173
1202
|
};
|
|
1174
|
-
const searchClaimsAdministrators = async (query) => {
|
|
1203
|
+
const searchClaimsAdministrators = async (query, claimNumber) => {
|
|
1204
|
+
const params = new URLSearchParams();
|
|
1205
|
+
if (query.trim()) params.set("q", query.trim());
|
|
1206
|
+
if (claimNumber?.trim()) params.set("claimNumber", claimNumber.trim());
|
|
1175
1207
|
const response = await request(
|
|
1176
|
-
`/
|
|
1208
|
+
`/partner/v2/browser/claims-administrators?${params.toString()}`
|
|
1177
1209
|
);
|
|
1178
1210
|
if (!response.ok) {
|
|
1179
1211
|
throw await responseError2(
|
|
@@ -1195,7 +1227,23 @@ function createBillLifecycleClient({
|
|
|
1195
1227
|
id: payer.id,
|
|
1196
1228
|
name: payer.name,
|
|
1197
1229
|
...typeof payer.hasElectronic === "boolean" ? { hasElectronic: payer.hasElectronic } : {},
|
|
1198
|
-
...Array.isArray(payer.states) ? { states: payer.states.filter((state) => typeof state === "string") } : {}
|
|
1230
|
+
...Array.isArray(payer.states) ? { states: payer.states.filter((state) => typeof state === "string") } : {},
|
|
1231
|
+
...["high", "medium", "directory"].includes(payer.confidence ?? "") ? {
|
|
1232
|
+
confidence: payer.confidence
|
|
1233
|
+
} : {},
|
|
1234
|
+
...typeof payer.recommended === "boolean" ? { recommended: payer.recommended } : {},
|
|
1235
|
+
...Array.isArray(payer.signals) ? {
|
|
1236
|
+
signals: payer.signals.flatMap((signal) => {
|
|
1237
|
+
if (!signal || typeof signal !== "object") return [];
|
|
1238
|
+
const candidate = signal;
|
|
1239
|
+
if (!["name", "claim_number"].includes(String(candidate.kind)) || !["match", "warning"].includes(String(candidate.state)) || typeof candidate.label !== "string") return [];
|
|
1240
|
+
return [{
|
|
1241
|
+
kind: candidate.kind,
|
|
1242
|
+
state: candidate.state,
|
|
1243
|
+
label: candidate.label
|
|
1244
|
+
}];
|
|
1245
|
+
})
|
|
1246
|
+
} : {}
|
|
1199
1247
|
}];
|
|
1200
1248
|
});
|
|
1201
1249
|
};
|
|
@@ -1208,7 +1256,7 @@ function createBillLifecycleClient({
|
|
|
1208
1256
|
};
|
|
1209
1257
|
const action = async (input, fallback) => {
|
|
1210
1258
|
const response = await mutation(
|
|
1211
|
-
"/
|
|
1259
|
+
"/partner/v2/browser/actions",
|
|
1212
1260
|
{
|
|
1213
1261
|
method: "POST",
|
|
1214
1262
|
headers: { "content-type": "application/json" },
|
|
@@ -1221,7 +1269,7 @@ function createBillLifecycleClient({
|
|
|
1221
1269
|
};
|
|
1222
1270
|
const saveReview = async (input) => {
|
|
1223
1271
|
await mutation(
|
|
1224
|
-
"/
|
|
1272
|
+
"/partner/v2/browser/bill",
|
|
1225
1273
|
{
|
|
1226
1274
|
method: "PATCH",
|
|
1227
1275
|
headers: { "content-type": "application/json" },
|
|
@@ -1242,7 +1290,7 @@ function createBillLifecycleClient({
|
|
|
1242
1290
|
async submitBill(input, route) {
|
|
1243
1291
|
await saveReview(input);
|
|
1244
1292
|
await mutation(
|
|
1245
|
-
"/
|
|
1293
|
+
"/partner/v2/browser/submissions",
|
|
1246
1294
|
{
|
|
1247
1295
|
method: "POST",
|
|
1248
1296
|
headers: { "content-type": "application/json" },
|
|
@@ -1258,7 +1306,7 @@ function createBillLifecycleClient({
|
|
|
1258
1306
|
body.set("documentType", documentType);
|
|
1259
1307
|
if (description) body.set("description", description);
|
|
1260
1308
|
await mutation(
|
|
1261
|
-
"/
|
|
1309
|
+
"/partner/v2/browser/documents",
|
|
1262
1310
|
{ method: "POST", body },
|
|
1263
1311
|
"Document could not be attached."
|
|
1264
1312
|
);
|
|
@@ -1266,7 +1314,7 @@ function createBillLifecycleClient({
|
|
|
1266
1314
|
},
|
|
1267
1315
|
async removeAttachment(attachmentId) {
|
|
1268
1316
|
await mutation(
|
|
1269
|
-
`/
|
|
1317
|
+
`/partner/v2/browser/documents/${encodeURIComponent(attachmentId)}`,
|
|
1270
1318
|
{ method: "DELETE" },
|
|
1271
1319
|
"Document could not be removed."
|
|
1272
1320
|
);
|
|
@@ -1274,7 +1322,7 @@ function createBillLifecycleClient({
|
|
|
1274
1322
|
},
|
|
1275
1323
|
async getAttachment(attachmentId) {
|
|
1276
1324
|
const response = await request(
|
|
1277
|
-
`/
|
|
1325
|
+
`/partner/v2/browser/documents/${encodeURIComponent(attachmentId)}`
|
|
1278
1326
|
);
|
|
1279
1327
|
if (!response.ok) {
|
|
1280
1328
|
throw await responseError2(response, "Document could not be opened.");
|
|
@@ -1283,7 +1331,7 @@ function createBillLifecycleClient({
|
|
|
1283
1331
|
},
|
|
1284
1332
|
async getEor(documentId) {
|
|
1285
1333
|
const response = await request(
|
|
1286
|
-
`/
|
|
1334
|
+
`/partner/v2/browser/eors/${encodeURIComponent(documentId)}`
|
|
1287
1335
|
);
|
|
1288
1336
|
if (!response.ok) throw await responseError2(response, "EOR could not be opened.");
|
|
1289
1337
|
return response.blob();
|
|
@@ -1305,7 +1353,7 @@ function createBillLifecycleClient({
|
|
|
1305
1353
|
},
|
|
1306
1354
|
async startCorrection() {
|
|
1307
1355
|
const response = await mutation(
|
|
1308
|
-
"/
|
|
1356
|
+
"/partner/v2/browser/actions",
|
|
1309
1357
|
{
|
|
1310
1358
|
method: "POST",
|
|
1311
1359
|
headers: { "content-type": "application/json" },
|
|
@@ -1420,7 +1468,7 @@ function useBillLifecycle({
|
|
|
1420
1468
|
[client, mutate]
|
|
1421
1469
|
);
|
|
1422
1470
|
const searchClaimsAdministrators = useCallback2(
|
|
1423
|
-
(query) => client.searchClaimsAdministrators(query),
|
|
1471
|
+
(query, claimNumber) => client.searchClaimsAdministrators(query, claimNumber),
|
|
1424
1472
|
[client]
|
|
1425
1473
|
);
|
|
1426
1474
|
const submitBill = useCallback2(
|
|
@@ -1856,35 +1904,13 @@ function MindBillBillTimeline(props) {
|
|
|
1856
1904
|
function MindBillBillReview(props) {
|
|
1857
1905
|
return widget("mindbill-bill-review", props);
|
|
1858
1906
|
}
|
|
1859
|
-
function MindBillBillFromReport(props) {
|
|
1860
|
-
return widget("mindbill-bill-from-report", props);
|
|
1861
|
-
}
|
|
1862
|
-
function MindBillCollections(props) {
|
|
1863
|
-
return widget("mindbill-collections", props);
|
|
1864
|
-
}
|
|
1865
|
-
function MindBillOnboarding(props) {
|
|
1866
|
-
return widget("mindbill-onboarding", props);
|
|
1867
|
-
}
|
|
1868
|
-
var HostedBillTimeline = MindBillBillTimeline;
|
|
1869
|
-
var HostedBillReview = MindBillBillReview;
|
|
1870
|
-
var HostedBillFromReport = MindBillBillFromReport;
|
|
1871
|
-
var HostedCollections = MindBillCollections;
|
|
1872
|
-
var HostedOnboarding = MindBillOnboarding;
|
|
1873
1907
|
export {
|
|
1874
1908
|
BillReviewForm,
|
|
1875
1909
|
BillStatusSummary,
|
|
1876
1910
|
ConnectedBillLifecycle,
|
|
1877
1911
|
ConnectedBillStatus,
|
|
1878
|
-
HostedBillFromReport,
|
|
1879
|
-
HostedBillReview,
|
|
1880
|
-
HostedBillTimeline,
|
|
1881
|
-
HostedCollections,
|
|
1882
|
-
HostedOnboarding,
|
|
1883
|
-
MindBillBillFromReport,
|
|
1884
1912
|
MindBillBillReview,
|
|
1885
1913
|
MindBillBillTimeline,
|
|
1886
|
-
MindBillCollections,
|
|
1887
|
-
MindBillOnboarding,
|
|
1888
1914
|
buildBillReviewSaveInput,
|
|
1889
1915
|
createBillLifecycleClient,
|
|
1890
1916
|
createBillStatusClient,
|