@mindbill/react 0.9.2 → 0.9.4
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 +2 -0
- package/dist/index.d.ts +49 -2
- package/dist/index.js +406 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
// src/index.tsx
|
|
4
4
|
import "@mindbill/embed";
|
|
5
|
-
import { createElement, useEffect as useEffect4, useRef as
|
|
5
|
+
import { createElement, useEffect as useEffect4, useRef as useRef4 } from "react";
|
|
6
6
|
|
|
7
7
|
// src/native-bill-review.tsx
|
|
8
|
-
import { useEffect, useId, useMemo, useState } from "react";
|
|
8
|
+
import { useEffect, useId, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
var EMPTY_BILLING_PROVIDER = {
|
|
11
11
|
name: "",
|
|
@@ -37,6 +37,35 @@ var DOCUMENT_LABELS = {
|
|
|
37
37
|
appeal: "Appeal or review support",
|
|
38
38
|
other: "Other supporting document"
|
|
39
39
|
};
|
|
40
|
+
var US_STATES = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "DC"];
|
|
41
|
+
var PROCEDURES = [
|
|
42
|
+
["ML200", "Missed med-legal appointment"],
|
|
43
|
+
["ML201", "Comprehensive med-legal evaluation"],
|
|
44
|
+
["ML202", "Follow-up med-legal evaluation"],
|
|
45
|
+
["ML203", "Supplemental med-legal evaluation"],
|
|
46
|
+
["ML204", "Medical-legal testimony"],
|
|
47
|
+
["ML205", "Sub rosa recording review"],
|
|
48
|
+
["MLPRR", "Medical record review"]
|
|
49
|
+
];
|
|
50
|
+
var MODIFIERS = [
|
|
51
|
+
["92", "Primary treating physician"],
|
|
52
|
+
["93", "Interpreter required"],
|
|
53
|
+
["94", "Agreed medical evaluator (AME)"],
|
|
54
|
+
["95", "Qualified medical evaluator (QME)"],
|
|
55
|
+
["96", "Psychiatric or psychological evaluation"],
|
|
56
|
+
["97", "Toxicology evaluation"],
|
|
57
|
+
["98", "Oncology evaluation"]
|
|
58
|
+
];
|
|
59
|
+
var MANAGED_EVALUATOR_MODIFIERS = /* @__PURE__ */ new Set(["94", "95", "96"]);
|
|
60
|
+
var MODIFIER_CODES = {
|
|
61
|
+
"92": ["ML201", "ML202", "ML203"],
|
|
62
|
+
"93": ["ML201", "ML202"],
|
|
63
|
+
"94": ["ML201", "ML202", "ML203"],
|
|
64
|
+
"95": ["ML200", "ML201", "ML202", "ML203", "MLPRR"],
|
|
65
|
+
"96": ["ML201", "ML202", "ML203"],
|
|
66
|
+
"97": ["ML201", "ML202", "ML203"],
|
|
67
|
+
"98": ["ML201", "ML202", "ML203"]
|
|
68
|
+
};
|
|
40
69
|
function withoutId(value) {
|
|
41
70
|
const result = { ...value };
|
|
42
71
|
delete result.id;
|
|
@@ -44,9 +73,20 @@ function withoutId(value) {
|
|
|
44
73
|
}
|
|
45
74
|
function toDraft(data) {
|
|
46
75
|
const snapshot = data.bill.billingSnapshot;
|
|
76
|
+
const nameParts = data.patient.name.trim().split(/\s+/);
|
|
47
77
|
return {
|
|
48
78
|
claimsAdminId: data.injury.claimsAdminId || "",
|
|
49
79
|
claimsAdminName: data.injury.claimsAdminName || "",
|
|
80
|
+
patientFirstName: data.patient.firstName || nameParts[0] || "",
|
|
81
|
+
patientMiddleName: data.patient.middleName || (nameParts.length > 2 ? nameParts.slice(1, -1).join(" ") : ""),
|
|
82
|
+
patientLastName: data.patient.lastName || (nameParts.length > 1 ? nameParts.at(-1) || "" : ""),
|
|
83
|
+
patientDob: data.patient.dob || "",
|
|
84
|
+
claimNumber: data.injury.claimNumber || "",
|
|
85
|
+
employer: data.injury.employer || "",
|
|
86
|
+
doi: data.injury.doi || "",
|
|
87
|
+
injuryEndDate: data.injury.injuryEndDate || "",
|
|
88
|
+
cumulativeTrauma: Boolean(data.injury.cumulativeTrauma),
|
|
89
|
+
adjNumber: data.injury.adjNumber || "",
|
|
50
90
|
dos: data.bill.dos || "",
|
|
51
91
|
dosEnd: data.bill.dosEnd || "",
|
|
52
92
|
authorizationNumber: data.bill.authorizationNumber || "",
|
|
@@ -62,6 +102,20 @@ function toDraft(data) {
|
|
|
62
102
|
function buildBillReviewSaveInput(draft) {
|
|
63
103
|
return {
|
|
64
104
|
claimsAdminId: draft.claimsAdminId,
|
|
105
|
+
patientOverrides: {
|
|
106
|
+
firstName: draft.patientFirstName.trim(),
|
|
107
|
+
...draft.patientMiddleName.trim() ? { middleName: draft.patientMiddleName.trim() } : {},
|
|
108
|
+
lastName: draft.patientLastName.trim(),
|
|
109
|
+
...draft.patientDob ? { dob: draft.patientDob } : {}
|
|
110
|
+
},
|
|
111
|
+
injuryOverrides: {
|
|
112
|
+
...draft.claimNumber.trim() ? { claimNumber: draft.claimNumber.trim() } : {},
|
|
113
|
+
...draft.employer.trim() ? { employer: draft.employer.trim() } : {},
|
|
114
|
+
...draft.doi ? { doi: draft.doi } : {},
|
|
115
|
+
...draft.injuryEndDate ? { injuryEndDate: draft.injuryEndDate } : {},
|
|
116
|
+
cumulativeTrauma: draft.cumulativeTrauma,
|
|
117
|
+
...draft.adjNumber.trim() ? { adjNumber: draft.adjNumber.trim().toUpperCase().replace(/\s+/g, "") } : {}
|
|
118
|
+
},
|
|
65
119
|
dos: draft.dos,
|
|
66
120
|
dosEnd: draft.dosEnd || null,
|
|
67
121
|
authorizationNumber: draft.authorizationNumber.trim() || null,
|
|
@@ -71,7 +125,7 @@ function buildBillReviewSaveInput(draft) {
|
|
|
71
125
|
renderingProvider: withoutId(draft.clinician),
|
|
72
126
|
...draft.location.id ? { placeOfServiceId: draft.location.id } : {},
|
|
73
127
|
placeOfService: withoutId(draft.location),
|
|
74
|
-
lineItems: draft.lineItems.map(({ id, code, modifiers, units }) => ({
|
|
128
|
+
lineItems: draft.lineItems.filter((line) => line.code.trim()).map(({ id, code, modifiers, units }) => ({
|
|
75
129
|
...id ? { id } : {},
|
|
76
130
|
code: code.trim().toUpperCase(),
|
|
77
131
|
modifiers,
|
|
@@ -103,7 +157,9 @@ function Field({
|
|
|
103
157
|
onChange,
|
|
104
158
|
type = "text",
|
|
105
159
|
optional,
|
|
106
|
-
required
|
|
160
|
+
required,
|
|
161
|
+
disabled,
|
|
162
|
+
hint
|
|
107
163
|
}) {
|
|
108
164
|
return /* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
|
|
109
165
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
@@ -117,11 +173,131 @@ function Field({
|
|
|
117
173
|
type,
|
|
118
174
|
value,
|
|
119
175
|
required,
|
|
176
|
+
disabled,
|
|
177
|
+
autoComplete: "off",
|
|
120
178
|
onChange: (event) => onChange(event.target.value)
|
|
121
179
|
}
|
|
122
|
-
)
|
|
180
|
+
),
|
|
181
|
+
hint ? /* @__PURE__ */ jsx("small", { className: "mb-native-hint", children: hint }) : null
|
|
123
182
|
] });
|
|
124
183
|
}
|
|
184
|
+
function Combobox({ label, value, options, onChange, placeholder, required, disabled, name }) {
|
|
185
|
+
const listId = useId();
|
|
186
|
+
const root = useRef(null);
|
|
187
|
+
const [open, setOpen] = useState(false);
|
|
188
|
+
const [active, setActive] = useState(0);
|
|
189
|
+
const filtered = useMemo(() => {
|
|
190
|
+
const query = value.trim().toLowerCase();
|
|
191
|
+
return options.filter((option) => !query || option.label.toLowerCase().includes(query) || option.value.toLowerCase().includes(query)).slice(0, 40);
|
|
192
|
+
}, [options, value]);
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
const close = (event) => {
|
|
195
|
+
if (!root.current?.contains(event.target)) setOpen(false);
|
|
196
|
+
};
|
|
197
|
+
document.addEventListener("mousedown", close);
|
|
198
|
+
return () => document.removeEventListener("mousedown", close);
|
|
199
|
+
}, []);
|
|
200
|
+
const select = (option) => {
|
|
201
|
+
onChange(option.value, option);
|
|
202
|
+
setOpen(false);
|
|
203
|
+
setActive(0);
|
|
204
|
+
};
|
|
205
|
+
const keyDown = (event) => {
|
|
206
|
+
if (event.key === "ArrowDown") {
|
|
207
|
+
event.preventDefault();
|
|
208
|
+
setOpen(true);
|
|
209
|
+
setActive((value2) => Math.min(value2 + 1, filtered.length - 1));
|
|
210
|
+
}
|
|
211
|
+
if (event.key === "ArrowUp") {
|
|
212
|
+
event.preventDefault();
|
|
213
|
+
setActive((value2) => Math.max(value2 - 1, 0));
|
|
214
|
+
}
|
|
215
|
+
if (event.key === "Enter" && open && filtered[active]) {
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
select(filtered[active]);
|
|
218
|
+
}
|
|
219
|
+
if (event.key === "Escape") setOpen(false);
|
|
220
|
+
};
|
|
221
|
+
return /* @__PURE__ */ jsxs("div", { className: "mb-native-combo", ref: root, children: [
|
|
222
|
+
/* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
|
|
223
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
224
|
+
/* @__PURE__ */ jsx(
|
|
225
|
+
"input",
|
|
226
|
+
{
|
|
227
|
+
role: "combobox",
|
|
228
|
+
"aria-autocomplete": "list",
|
|
229
|
+
"aria-controls": listId,
|
|
230
|
+
"aria-expanded": open && filtered.length > 0,
|
|
231
|
+
"aria-activedescendant": open && filtered[active] ? `${listId}-${active}` : void 0,
|
|
232
|
+
name: name || "mindbill-search-value",
|
|
233
|
+
autoComplete: "new-password",
|
|
234
|
+
"data-1p-ignore": "true",
|
|
235
|
+
"data-lpignore": "true",
|
|
236
|
+
value,
|
|
237
|
+
placeholder,
|
|
238
|
+
required,
|
|
239
|
+
disabled,
|
|
240
|
+
onFocus: () => setOpen(true),
|
|
241
|
+
onKeyDown: keyDown,
|
|
242
|
+
onChange: (event) => {
|
|
243
|
+
onChange(event.target.value);
|
|
244
|
+
setOpen(true);
|
|
245
|
+
setActive(0);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
] }),
|
|
250
|
+
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__ */ jsxs("span", { className: "mb-native-combo-title", children: [
|
|
252
|
+
/* @__PURE__ */ jsx("strong", { children: option.label }),
|
|
253
|
+
option.badge ? /* @__PURE__ */ jsx("em", { children: option.badge }) : null
|
|
254
|
+
] }),
|
|
255
|
+
option.detail ? /* @__PURE__ */ jsx("span", { children: option.detail }) : null
|
|
256
|
+
] }) }, `${option.value}-${index}`)) }) : null
|
|
257
|
+
] });
|
|
258
|
+
}
|
|
259
|
+
function StateCombobox({ label, value, onChange, required, disabled }) {
|
|
260
|
+
return /* @__PURE__ */ jsx(
|
|
261
|
+
Combobox,
|
|
262
|
+
{
|
|
263
|
+
label,
|
|
264
|
+
value,
|
|
265
|
+
onChange: (next) => onChange(next.toUpperCase().slice(0, 2)),
|
|
266
|
+
options: US_STATES.map((state) => ({ value: state, label: state })),
|
|
267
|
+
...required === void 0 ? {} : { required },
|
|
268
|
+
...disabled === void 0 ? {} : { disabled },
|
|
269
|
+
name: "mindbill-state-value"
|
|
270
|
+
}
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
function inferPreset(lines) {
|
|
274
|
+
const modifiers = new Set(lines.flatMap((line) => line.modifiers));
|
|
275
|
+
return modifiers.has("94") ? "ame" : modifiers.has("96") ? "psych_qme" : "qme";
|
|
276
|
+
}
|
|
277
|
+
function presetModifiersForCode(preset, code) {
|
|
278
|
+
if (code === "MLPRR") return ["95"];
|
|
279
|
+
if (preset === "qme" && ["ML200", "ML201", "ML202", "ML203"].includes(code)) return ["95"];
|
|
280
|
+
if (preset === "ame" && ["ML201", "ML202", "ML203"].includes(code)) return ["94"];
|
|
281
|
+
if (preset === "psych_qme") {
|
|
282
|
+
if (code === "ML200") return ["95"];
|
|
283
|
+
if (["ML201", "ML202", "ML203"].includes(code)) return ["96"];
|
|
284
|
+
}
|
|
285
|
+
return [];
|
|
286
|
+
}
|
|
287
|
+
function modifierAppliesToCode(modifier, code) {
|
|
288
|
+
return !code || (MODIFIER_CODES[modifier]?.includes(code) ?? true);
|
|
289
|
+
}
|
|
290
|
+
function applyPreset(lines, preset) {
|
|
291
|
+
return lines.map((line) => {
|
|
292
|
+
const preserved = line.modifiers.filter(
|
|
293
|
+
(value) => !MANAGED_EVALUATOR_MODIFIERS.has(value) && modifierAppliesToCode(value, line.code)
|
|
294
|
+
);
|
|
295
|
+
return {
|
|
296
|
+
...line,
|
|
297
|
+
modifiers: [.../* @__PURE__ */ new Set([...presetModifiersForCode(preset, line.code), ...preserved])]
|
|
298
|
+
};
|
|
299
|
+
});
|
|
300
|
+
}
|
|
125
301
|
function BillReviewForm({
|
|
126
302
|
data,
|
|
127
303
|
onSave,
|
|
@@ -149,14 +325,15 @@ function BillReviewForm({
|
|
|
149
325
|
const [error, setError] = useState("");
|
|
150
326
|
const [notice, setNotice] = useState("");
|
|
151
327
|
const routeName = useId();
|
|
152
|
-
const payerListId = useId();
|
|
153
328
|
const editable = data.bill.status === "incomplete" && !disabled;
|
|
154
329
|
useEffect(() => {
|
|
155
330
|
setDraft(toDraft(data));
|
|
156
331
|
setPayerQuery(data.injury.claimsAdminName || "");
|
|
157
332
|
}, [data]);
|
|
158
333
|
useEffect(() => {
|
|
159
|
-
|
|
334
|
+
const query = payerQuery.trim();
|
|
335
|
+
const claimNumber = draft.claimNumber.trim();
|
|
336
|
+
if (!onSearchClaimsAdministrators || query.length < 2 && claimNumber.length < 4) {
|
|
160
337
|
setPayerResults([]);
|
|
161
338
|
setPayerBusy(false);
|
|
162
339
|
return;
|
|
@@ -164,8 +341,23 @@ function BillReviewForm({
|
|
|
164
341
|
let current = true;
|
|
165
342
|
const timer = window.setTimeout(() => {
|
|
166
343
|
setPayerBusy(true);
|
|
167
|
-
void onSearchClaimsAdministrators(
|
|
168
|
-
if (current)
|
|
344
|
+
void onSearchClaimsAdministrators(query, claimNumber).then((results) => {
|
|
345
|
+
if (!current) return;
|
|
346
|
+
setPayerResults(results);
|
|
347
|
+
const recommendation = results.find(
|
|
348
|
+
(payer) => payer.recommended && payer.confidence === "high"
|
|
349
|
+
);
|
|
350
|
+
if (!draft.claimsAdminId && recommendation) {
|
|
351
|
+
setDraft((currentDraft) => ({
|
|
352
|
+
...currentDraft,
|
|
353
|
+
claimsAdminId: recommendation.id,
|
|
354
|
+
claimsAdminName: recommendation.name
|
|
355
|
+
}));
|
|
356
|
+
setPayerQuery(recommendation.name);
|
|
357
|
+
setNotice(
|
|
358
|
+
"Claims administrator matched from the case data. Review and save to keep it on this bill."
|
|
359
|
+
);
|
|
360
|
+
}
|
|
169
361
|
}).catch((cause) => {
|
|
170
362
|
if (current) {
|
|
171
363
|
setPayerResults([]);
|
|
@@ -181,13 +373,34 @@ function BillReviewForm({
|
|
|
181
373
|
current = false;
|
|
182
374
|
window.clearTimeout(timer);
|
|
183
375
|
};
|
|
184
|
-
}, [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
376
|
+
}, [
|
|
377
|
+
draft.claimNumber,
|
|
378
|
+
draft.claimsAdminId,
|
|
379
|
+
onSearchClaimsAdministrators,
|
|
380
|
+
payerQuery
|
|
381
|
+
]);
|
|
382
|
+
const selectedPayer = payerResults.find(
|
|
383
|
+
(payer) => payer.id === draft.claimsAdminId
|
|
190
384
|
);
|
|
385
|
+
const adjFormatValid = !draft.adjNumber || /^ADJ\d{7,}$/i.test(draft.adjNumber.replace(/[\s-]/g, ""));
|
|
386
|
+
const blockers = useMemo(() => {
|
|
387
|
+
const result = [];
|
|
388
|
+
if (!draft.patientFirstName.trim() || !draft.patientLastName.trim()) result.push("Patient name");
|
|
389
|
+
if (!draft.claimsAdminId) result.push("Claims administrator");
|
|
390
|
+
if (!draft.claimNumber.trim()) result.push("Claim number");
|
|
391
|
+
if (!draft.doi) result.push("Date of injury");
|
|
392
|
+
if (!adjFormatValid) result.push("Valid WCAB / ADJ number");
|
|
393
|
+
if (!draft.dos) result.push("Date of service");
|
|
394
|
+
if (!draft.billingProvider.name.trim()) result.push("Practice name");
|
|
395
|
+
if (!draft.billingProvider.taxId.trim()) result.push("Tax ID");
|
|
396
|
+
if (!draft.billingProvider.npi.trim()) result.push("Billing NPI");
|
|
397
|
+
if (!draft.clinician.name.trim() || !draft.clinician.npi.trim()) result.push("Clinician and NPI");
|
|
398
|
+
if (![draft.location.name, draft.location.street, draft.location.city, draft.location.state, draft.location.zip].every((value) => value.trim())) result.push("Service location");
|
|
399
|
+
const completedLines = draft.lineItems.filter((line) => line.code.trim());
|
|
400
|
+
if (!completedLines.length || completedLines.some((line) => line.units <= 0)) result.push("Valid procedure line");
|
|
401
|
+
return result;
|
|
402
|
+
}, [adjFormatValid, draft]);
|
|
403
|
+
const canSubmit = blockers.length === 0;
|
|
191
404
|
const updateBillingProvider = (key, value) => setDraft((current) => ({
|
|
192
405
|
...current,
|
|
193
406
|
billingProvider: { ...current.billingProvider, [key]: value }
|
|
@@ -264,19 +477,19 @@ function BillReviewForm({
|
|
|
264
477
|
/* @__PURE__ */ jsxs("dl", { className: "mb-native-summary", children: [
|
|
265
478
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
266
479
|
/* @__PURE__ */ jsx("dt", { children: "Patient" }),
|
|
267
|
-
/* @__PURE__ */ jsx("dd", { children:
|
|
480
|
+
/* @__PURE__ */ jsx("dd", { children: [draft.patientFirstName, draft.patientMiddleName, draft.patientLastName].filter(Boolean).join(" ") || "\u2014" })
|
|
268
481
|
] }),
|
|
269
482
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
270
483
|
/* @__PURE__ */ jsx("dt", { children: "Claim" }),
|
|
271
|
-
/* @__PURE__ */ jsx("dd", { children:
|
|
484
|
+
/* @__PURE__ */ jsx("dd", { children: draft.claimNumber || "\u2014" })
|
|
272
485
|
] }),
|
|
273
486
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
274
487
|
/* @__PURE__ */ jsx("dt", { children: "Employer" }),
|
|
275
|
-
/* @__PURE__ */ jsx("dd", { children:
|
|
488
|
+
/* @__PURE__ */ jsx("dd", { children: draft.employer || "\u2014" })
|
|
276
489
|
] }),
|
|
277
490
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
278
491
|
/* @__PURE__ */ jsx("dt", { children: "Date of injury" }),
|
|
279
|
-
/* @__PURE__ */ jsx("dd", { children:
|
|
492
|
+
/* @__PURE__ */ jsx("dd", { children: draft.doi || "\u2014" })
|
|
280
493
|
] })
|
|
281
494
|
] }),
|
|
282
495
|
/* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
|
|
@@ -288,61 +501,74 @@ function BillReviewForm({
|
|
|
288
501
|
draft.claimsAdminId ? /* @__PURE__ */ jsx("span", { children: "Selected" }) : /* @__PURE__ */ jsx("span", { children: "Required" })
|
|
289
502
|
] }),
|
|
290
503
|
/* @__PURE__ */ jsxs("div", { className: "mb-native-payer-picker", children: [
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
"
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
value:
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
504
|
+
/* @__PURE__ */ jsx(
|
|
505
|
+
Combobox,
|
|
506
|
+
{
|
|
507
|
+
label: "Insurance company or claims administrator",
|
|
508
|
+
value: payerQuery,
|
|
509
|
+
disabled: !editable,
|
|
510
|
+
placeholder: "Search by payer or administrator name",
|
|
511
|
+
name: "mindbill-payer-query",
|
|
512
|
+
options: payerResults.map((payer) => ({
|
|
513
|
+
value: payer.id,
|
|
514
|
+
label: payer.name,
|
|
515
|
+
...payer.recommended ? { badge: "Recommended" } : payer.confidence === "medium" ? { badge: "Claim match" } : {},
|
|
516
|
+
detail: [
|
|
517
|
+
...(payer.signals ?? []).map((signal) => signal.label),
|
|
518
|
+
payer.hasElectronic ? "Electronic billing available." : "Billing route confirmed after review."
|
|
519
|
+
].join(" ")
|
|
520
|
+
})),
|
|
521
|
+
onChange: (value, option) => {
|
|
522
|
+
if (option) {
|
|
523
|
+
setDraft((current) => ({ ...current, claimsAdminId: option.value, claimsAdminName: option.label }));
|
|
524
|
+
setPayerQuery(option.label);
|
|
525
|
+
setNotice("Claims administrator selected. Save changes to keep it on this bill.");
|
|
526
|
+
} else {
|
|
305
527
|
setPayerQuery(value);
|
|
306
|
-
setDraft((current) =>
|
|
307
|
-
...current,
|
|
308
|
-
...value === current.claimsAdminName ? {} : { claimsAdminId: "", claimsAdminName: "" }
|
|
309
|
-
}));
|
|
528
|
+
setDraft((current) => value === current.claimsAdminName ? current : { ...current, claimsAdminId: "", claimsAdminName: "" });
|
|
310
529
|
}
|
|
311
530
|
}
|
|
312
|
-
|
|
313
|
-
|
|
531
|
+
}
|
|
532
|
+
),
|
|
314
533
|
payerBusy ? /* @__PURE__ */ jsx("span", { className: "mb-native-payer-help", children: "Searching\u2026" }) : null,
|
|
315
534
|
!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,
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
535
|
+
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
|
|
536
|
+
] })
|
|
537
|
+
] }),
|
|
538
|
+
/* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
|
|
539
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-native-section-head", children: [
|
|
540
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
541
|
+
/* @__PURE__ */ jsx("h3", { children: "Patient and claim" }),
|
|
542
|
+
/* @__PURE__ */ jsx("p", { children: "Prefilled from the case. Correct anything that should print differently on this bill." })
|
|
543
|
+
] }),
|
|
544
|
+
/* @__PURE__ */ jsx("span", { children: "Editable" })
|
|
545
|
+
] }),
|
|
546
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-native-grid three", children: [
|
|
547
|
+
/* @__PURE__ */ jsx(Field, { label: "Patient first name", required: true, disabled: !editable, value: draft.patientFirstName, onChange: (patientFirstName) => setDraft((current) => ({ ...current, patientFirstName })) }),
|
|
548
|
+
/* @__PURE__ */ jsx(Field, { label: "Middle name", optional: true, disabled: !editable, value: draft.patientMiddleName, onChange: (patientMiddleName) => setDraft((current) => ({ ...current, patientMiddleName })) }),
|
|
549
|
+
/* @__PURE__ */ jsx(Field, { label: "Patient last name", required: true, disabled: !editable, value: draft.patientLastName, onChange: (patientLastName) => setDraft((current) => ({ ...current, patientLastName })) }),
|
|
550
|
+
/* @__PURE__ */ jsx(Field, { label: "Date of birth", type: "date", required: true, disabled: !editable, value: draft.patientDob, onChange: (patientDob) => setDraft((current) => ({ ...current, patientDob })) }),
|
|
551
|
+
/* @__PURE__ */ jsx(Field, { label: "Claim number", required: true, disabled: !editable, value: draft.claimNumber, onChange: (claimNumber) => setDraft((current) => ({ ...current, claimNumber })), ...data.injury.claimPatternStatus?.detail || data.injury.claimPatternStatus?.label ? { hint: data.injury.claimPatternStatus?.detail || data.injury.claimPatternStatus?.label || "" } : {} }),
|
|
552
|
+
/* @__PURE__ */ jsx(Field, { label: "Employer", disabled: !editable, value: draft.employer, onChange: (employer) => setDraft((current) => ({ ...current, employer })) }),
|
|
553
|
+
/* @__PURE__ */ jsx(Field, { label: "Date of injury", type: "date", required: true, disabled: !editable, value: draft.doi, onChange: (doi) => setDraft((current) => ({ ...current, doi })) }),
|
|
554
|
+
draft.cumulativeTrauma ? /* @__PURE__ */ jsx(Field, { label: "Cumulative trauma end date", type: "date", required: true, disabled: !editable, value: draft.injuryEndDate, onChange: (injuryEndDate) => setDraft((current) => ({ ...current, injuryEndDate })) }) : null,
|
|
555
|
+
features?.wcabNumber === false ? null : /* @__PURE__ */ jsx(Field, { label: "WCAB / ADJ number", optional: true, disabled: !editable, value: draft.adjNumber, onChange: (adjNumber) => setDraft((current) => ({ ...current, adjNumber })), hint: adjFormatValid ? "Use the EAMS case number shown as ADJ followed by digits." : "Expected format: ADJ followed by at least 7 digits." })
|
|
556
|
+
] }),
|
|
557
|
+
features?.wcabNumber === false ? null : /* @__PURE__ */ jsxs("p", { className: "mb-native-eams", children: [
|
|
558
|
+
"EAMS lookup requires California DWC verification. ",
|
|
559
|
+
/* @__PURE__ */ jsx("a", { href: "https://eams.dwc.ca.gov/WebEnhancement/", target: "_blank", rel: "noreferrer", children: "Verify in EAMS" }),
|
|
560
|
+
"."
|
|
335
561
|
] })
|
|
336
562
|
] }),
|
|
337
563
|
/* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
|
|
338
564
|
/* @__PURE__ */ jsx("div", { className: "mb-native-section-head", children: /* @__PURE__ */ jsxs("div", { children: [
|
|
339
|
-
/* @__PURE__ */ jsx("h3", { children: "
|
|
340
|
-
/* @__PURE__ */ jsx("p", { children: "
|
|
565
|
+
/* @__PURE__ */ jsx("h3", { children: "Service" }),
|
|
566
|
+
/* @__PURE__ */ jsx("p", { children: "The service date and optional payer authorization printed on this bill." })
|
|
341
567
|
] }) }),
|
|
342
|
-
/* @__PURE__ */ jsxs("div", { className: `mb-native-grid ${features?.authorizationNumber
|
|
343
|
-
/* @__PURE__ */ jsx(Field, { label: "Date of service", type: "date", required: true, value: draft.dos, onChange: (dos) => setDraft((current) => ({ ...current, dos })) }),
|
|
344
|
-
/* @__PURE__ */ jsx(Field, { label: "
|
|
345
|
-
features?.authorizationNumber === false ? null : /* @__PURE__ */ jsx(Field, { label: "Authorization number", optional: true, value: draft.authorizationNumber, onChange: (authorizationNumber) => setDraft((current) => ({ ...current, authorizationNumber })) })
|
|
568
|
+
/* @__PURE__ */ jsxs("div", { className: `mb-native-grid ${features?.serviceDateRange || features?.authorizationNumber !== false ? "three" : "one"}`, children: [
|
|
569
|
+
/* @__PURE__ */ jsx(Field, { label: "Date of service", type: "date", required: true, disabled: !editable, value: draft.dos, onChange: (dos) => setDraft((current) => ({ ...current, dos })) }),
|
|
570
|
+
features?.serviceDateRange ? /* @__PURE__ */ jsx(Field, { label: "Service end date", type: "date", optional: true, disabled: !editable, value: draft.dosEnd, onChange: (dosEnd) => setDraft((current) => ({ ...current, dosEnd })) }) : null,
|
|
571
|
+
features?.authorizationNumber === false ? null : /* @__PURE__ */ jsx(Field, { label: "Authorization number", optional: true, disabled: !editable, value: draft.authorizationNumber, onChange: (authorizationNumber) => setDraft((current) => ({ ...current, authorizationNumber })) })
|
|
346
572
|
] })
|
|
347
573
|
] }),
|
|
348
574
|
/* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
|
|
@@ -360,7 +586,7 @@ function BillReviewForm({
|
|
|
360
586
|
/* @__PURE__ */ jsx(Field, { label: "Phone", optional: true, value: draft.billingProvider.phone || "", onChange: (value) => updateBillingProvider("phone", value) }),
|
|
361
587
|
/* @__PURE__ */ jsx(Field, { label: "Billing street", required: true, value: draft.billingProvider.billingStreet || "", onChange: (value) => updateBillingProvider("billingStreet", value) }),
|
|
362
588
|
/* @__PURE__ */ jsx(Field, { label: "City", required: true, value: draft.billingProvider.billingCity || "", onChange: (value) => updateBillingProvider("billingCity", value) }),
|
|
363
|
-
/* @__PURE__ */ jsx(
|
|
589
|
+
/* @__PURE__ */ jsx(StateCombobox, { label: "State", required: true, disabled: !editable, value: draft.billingProvider.billingState || "", onChange: (value) => updateBillingProvider("billingState", value) }),
|
|
364
590
|
/* @__PURE__ */ jsx(Field, { label: "ZIP", required: true, value: draft.billingProvider.billingZip || "", onChange: (value) => updateBillingProvider("billingZip", value) })
|
|
365
591
|
] })
|
|
366
592
|
] }),
|
|
@@ -378,7 +604,7 @@ function BillReviewForm({
|
|
|
378
604
|
/* @__PURE__ */ jsx(Field, { label: "NPI", required: true, value: draft.clinician.npi, onChange: (value) => updateClinician("npi", value) }),
|
|
379
605
|
/* @__PURE__ */ jsx(Field, { label: "Taxonomy", optional: true, value: draft.clinician.taxonomy || "", onChange: (value) => updateClinician("taxonomy", value) }),
|
|
380
606
|
/* @__PURE__ */ jsx(Field, { label: "License number", optional: true, value: draft.clinician.licenseNumber || "", onChange: (value) => updateClinician("licenseNumber", value) }),
|
|
381
|
-
/* @__PURE__ */ jsx(
|
|
607
|
+
/* @__PURE__ */ jsx(StateCombobox, { label: "License state (optional)", disabled: !editable, value: draft.clinician.licenseState || "", onChange: (value) => updateClinician("licenseState", value) })
|
|
382
608
|
] })
|
|
383
609
|
] }),
|
|
384
610
|
/* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
|
|
@@ -393,7 +619,7 @@ function BillReviewForm({
|
|
|
393
619
|
/* @__PURE__ */ jsx(Field, { label: "Location name", required: true, value: draft.location.name, onChange: (value) => updateLocation("name", value) }),
|
|
394
620
|
/* @__PURE__ */ jsx(Field, { label: "Street", required: true, value: draft.location.street, onChange: (value) => updateLocation("street", value) }),
|
|
395
621
|
/* @__PURE__ */ jsx(Field, { label: "City", required: true, value: draft.location.city, onChange: (value) => updateLocation("city", value) }),
|
|
396
|
-
/* @__PURE__ */ jsx(
|
|
622
|
+
/* @__PURE__ */ jsx(StateCombobox, { label: "State", required: true, disabled: !editable, value: draft.location.state, onChange: (value) => updateLocation("state", value) }),
|
|
397
623
|
/* @__PURE__ */ jsx(Field, { label: "ZIP", required: true, value: draft.location.zip, onChange: (value) => updateLocation("zip", value) }),
|
|
398
624
|
/* @__PURE__ */ jsx(Field, { label: "Place of service code", required: true, value: draft.location.posCode || "11", onChange: (value) => updateLocation("posCode", value) })
|
|
399
625
|
] })
|
|
@@ -402,16 +628,75 @@ function BillReviewForm({
|
|
|
402
628
|
/* @__PURE__ */ jsxs("div", { className: "mb-native-section-head", children: [
|
|
403
629
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
404
630
|
/* @__PURE__ */ jsx("h3", { children: "Procedure lines" }),
|
|
405
|
-
/* @__PURE__ */ jsx("p", { children: "
|
|
631
|
+
/* @__PURE__ */ jsx("p", { children: "Choose a billing profile, then review the codes and modifiers. Allowed amounts recalculate on save." })
|
|
406
632
|
] }),
|
|
407
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: "mb-native-button quiet", disabled: !editable, onClick: () => setDraft((current) => ({ ...current, lineItems: [...current.lineItems, { code: "", modifiers: [], units: 1, charge: 0 }] })), children: "+ Add line" })
|
|
633
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "mb-native-button quiet", disabled: !editable || draft.lineItems.length >= 50, onClick: () => setDraft((current) => ({ ...current, lineItems: [...current.lineItems, { code: "", modifiers: [], units: 1, charge: 0 }] })), children: "+ Add line" })
|
|
634
|
+
] }),
|
|
635
|
+
features?.codingPresets === false ? null : /* @__PURE__ */ jsxs("div", { className: "mb-native-presets", role: "group", "aria-label": "Evaluation billing profile", children: [
|
|
636
|
+
[["qme", "QME"], ["ame", "AME"], ["psych_qme", "Psych QME"]].map(([value, label]) => /* @__PURE__ */ jsx("button", { type: "button", className: inferPreset(draft.lineItems) === value ? "active" : "", disabled: !editable, onClick: () => setDraft((current) => ({ ...current, lineItems: applyPreset(current.lineItems, value) })), children: label }, value)),
|
|
637
|
+
/* @__PURE__ */ jsx("span", { children: "Sets evaluator modifiers across med-legal lines. You can still edit each line." })
|
|
408
638
|
] }),
|
|
409
639
|
/* @__PURE__ */ jsx("div", { className: "mb-native-lines", children: draft.lineItems.map((line, index) => /* @__PURE__ */ jsxs("div", { className: "mb-native-line", children: [
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
|
|
640
|
+
/* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
|
|
641
|
+
/* @__PURE__ */ jsx("span", { children: "Procedure" }),
|
|
642
|
+
/* @__PURE__ */ jsxs("select", { disabled: !editable, value: line.code, onChange: (event) => {
|
|
643
|
+
const code = event.target.value;
|
|
644
|
+
setDraft((current) => {
|
|
645
|
+
const lineItems = current.lineItems.map((item, itemIndex) => {
|
|
646
|
+
if (itemIndex !== index) return item;
|
|
647
|
+
const presetLine = applyPreset(
|
|
648
|
+
[{ ...item, code }],
|
|
649
|
+
inferPreset(current.lineItems)
|
|
650
|
+
)[0];
|
|
651
|
+
return { ...item, code, modifiers: presetLine?.modifiers || [] };
|
|
652
|
+
});
|
|
653
|
+
if (code && index === lineItems.length - 1 && lineItems.length < 50) {
|
|
654
|
+
lineItems.push({
|
|
655
|
+
code: "",
|
|
656
|
+
modifiers: [],
|
|
657
|
+
units: 1,
|
|
658
|
+
charge: 0
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
return { ...current, lineItems };
|
|
662
|
+
});
|
|
663
|
+
}, children: [
|
|
664
|
+
line.code && !PROCEDURES.some(([code]) => code === line.code) ? /* @__PURE__ */ jsx("option", { value: line.code, children: line.code }) : null,
|
|
665
|
+
/* @__PURE__ */ jsx("option", { value: "", children: "Select code\u2026" }),
|
|
666
|
+
PROCEDURES.map(([code, label]) => /* @__PURE__ */ jsxs("option", { value: code, children: [
|
|
667
|
+
code,
|
|
668
|
+
" \u2014 ",
|
|
669
|
+
label
|
|
670
|
+
] }, code))
|
|
671
|
+
] }),
|
|
672
|
+
line.code ? /* @__PURE__ */ jsx("small", { children: PROCEDURES.find(([code]) => code === line.code)?.[1] }) : null
|
|
673
|
+
] }),
|
|
674
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-native-modifiers", children: [
|
|
675
|
+
/* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
|
|
676
|
+
/* @__PURE__ */ jsx("span", { children: "Modifiers" }),
|
|
677
|
+
/* @__PURE__ */ jsxs("select", { disabled: !editable, value: "", onChange: (event) => {
|
|
678
|
+
const modifier = event.target.value;
|
|
679
|
+
if (!modifier) return;
|
|
680
|
+
setDraft((current) => ({ ...current, lineItems: current.lineItems.map((item, itemIndex) => itemIndex === index ? { ...item, modifiers: [.../* @__PURE__ */ new Set([...item.modifiers, modifier])] } : item) }));
|
|
681
|
+
}, children: [
|
|
682
|
+
/* @__PURE__ */ jsx("option", { value: "", children: "Add modifier\u2026" }),
|
|
683
|
+
MODIFIERS.filter(([value]) => !line.modifiers.includes(value) && modifierAppliesToCode(value, line.code)).map(([value, label]) => /* @__PURE__ */ jsxs("option", { value, children: [
|
|
684
|
+
"-",
|
|
685
|
+
value,
|
|
686
|
+
" \u2014 ",
|
|
687
|
+
label
|
|
688
|
+
] }, value))
|
|
689
|
+
] })
|
|
690
|
+
] }),
|
|
691
|
+
/* @__PURE__ */ jsx("div", { className: "mb-native-chips", children: line.modifiers.map((modifier) => /* @__PURE__ */ jsxs("button", { type: "button", disabled: !editable, onClick: () => setDraft((current) => ({ ...current, lineItems: current.lineItems.map((item, itemIndex) => itemIndex === index ? { ...item, modifiers: item.modifiers.filter((value) => value !== modifier) } : item) })), children: [
|
|
692
|
+
"-",
|
|
693
|
+
modifier,
|
|
694
|
+
" \xD7"
|
|
695
|
+
] }, modifier)) })
|
|
696
|
+
] }),
|
|
412
697
|
/* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
|
|
413
698
|
/* @__PURE__ */ jsx("span", { children: "Units" }),
|
|
414
|
-
/* @__PURE__ */ jsx("input", { type: "number", min: "1", required: true, value: line.units, onChange: (event) => setDraft((current) => ({ ...current, lineItems: current.lineItems.map((item, itemIndex) => itemIndex === index ? { ...item, units: Number(event.target.value) } : item) })) })
|
|
699
|
+
/* @__PURE__ */ jsx("input", { type: "number", min: "1", required: true, disabled: !editable, value: line.units, onChange: (event) => setDraft((current) => ({ ...current, lineItems: current.lineItems.map((item, itemIndex) => itemIndex === index ? { ...item, units: Number(event.target.value) } : item) })) })
|
|
415
700
|
] }),
|
|
416
701
|
/* @__PURE__ */ jsxs("div", { className: "mb-native-allowed", children: [
|
|
417
702
|
/* @__PURE__ */ jsx("span", { children: "Allowed" }),
|
|
@@ -469,6 +754,10 @@ function BillReviewForm({
|
|
|
469
754
|
] }),
|
|
470
755
|
error ? /* @__PURE__ */ jsx("div", { className: "mb-native-message error", role: "alert", children: error }) : null,
|
|
471
756
|
notice ? /* @__PURE__ */ jsx("div", { className: "mb-native-message success", role: "status", children: notice }) : null,
|
|
757
|
+
!canSubmit ? /* @__PURE__ */ jsxs("div", { className: "mb-native-blockers", role: "status", children: [
|
|
758
|
+
/* @__PURE__ */ jsx("strong", { children: "Before you can submit:" }),
|
|
759
|
+
/* @__PURE__ */ jsx("span", { children: blockers.join(" \xB7 ") })
|
|
760
|
+
] }) : null,
|
|
472
761
|
/* @__PURE__ */ jsxs("div", { className: "mb-native-actions", children: [
|
|
473
762
|
/* @__PURE__ */ jsx("button", { className: "mb-native-button secondary", type: "submit", disabled: !editable || busy !== "", children: busy === "save" ? "Saving\u2026" : "Save changes" }),
|
|
474
763
|
/* @__PURE__ */ jsx("button", { className: "mb-native-button primary", type: "button", disabled: !editable || !canSubmit || busy !== "", onClick: () => void handleSubmit(), children: busy === "submit" ? "Submitting\u2026" : "Submit bill" })
|
|
@@ -520,6 +809,19 @@ var NATIVE_BILL_REVIEW_STYLES = `
|
|
|
520
809
|
.mb-native-payer-results button{display:grid;width:100%;gap:2px;padding:11px 12px;border:0;border-radius:7px;background:transparent;color:var(--mb-text);font:inherit;text-align:left;cursor:pointer}
|
|
521
810
|
.mb-native-payer-results button:hover,.mb-native-payer-results button:focus{background:var(--mb-soft);outline:0}
|
|
522
811
|
.mb-native-payer-results span{color:var(--mb-muted);font-size:12px}
|
|
812
|
+
.mb-native-grid.one{grid-template-columns:minmax(0,1fr)}
|
|
813
|
+
.mb-native-field select{width:100%;min-height:43px;border:1px solid var(--mb-border);border-radius:8px;background:#fff;color:var(--mb-text);font:inherit;padding:10px 36px 10px 12px}
|
|
814
|
+
.mb-native-field select:focus{border-color:var(--mb-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--mb-accent) 14%,transparent);outline:0}
|
|
815
|
+
.mb-native-field input:disabled,.mb-native-field select:disabled{cursor:not-allowed;background:#f6f8f9;color:#667982}
|
|
816
|
+
.mb-native-hint{color:var(--mb-muted);font-size:12px;font-weight:500}
|
|
817
|
+
.mb-native-combo{position:relative;min-width:0}
|
|
818
|
+
.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)}
|
|
819
|
+
.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}
|
|
820
|
+
.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}
|
|
821
|
+
.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}
|
|
822
|
+
.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}
|
|
823
|
+
.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}
|
|
824
|
+
.mb-native-eams{margin-top:13px!important;font-size:12px}.mb-native-eams a{color:var(--mb-accent);font-weight:750}
|
|
523
825
|
@media(max-width:620px){.mb-native-review{padding:12px}.mb-native-grid.two{grid-template-columns:1fr}}
|
|
524
826
|
`;
|
|
525
827
|
|
|
@@ -528,7 +830,7 @@ import {
|
|
|
528
830
|
useCallback,
|
|
529
831
|
useEffect as useEffect2,
|
|
530
832
|
useMemo as useMemo2,
|
|
531
|
-
useRef,
|
|
833
|
+
useRef as useRef2,
|
|
532
834
|
useState as useState2
|
|
533
835
|
} from "react";
|
|
534
836
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -677,11 +979,11 @@ function useBillStatus({
|
|
|
677
979
|
const [error, setError] = useState2(null);
|
|
678
980
|
const [isLoading, setIsLoading] = useState2(enabled && !initialData);
|
|
679
981
|
const [isRefreshing, setIsRefreshing] = useState2(false);
|
|
680
|
-
const dataRef =
|
|
681
|
-
const initialDataRef =
|
|
982
|
+
const dataRef = useRef2(initialData);
|
|
983
|
+
const initialDataRef = useRef2(initialData);
|
|
682
984
|
initialDataRef.current = initialData;
|
|
683
|
-
const activeControllerRef =
|
|
684
|
-
const requestSequence =
|
|
985
|
+
const activeControllerRef = useRef2(null);
|
|
986
|
+
const requestSequence = useRef2(0);
|
|
685
987
|
useEffect2(() => {
|
|
686
988
|
const seed = initialDataRef.current;
|
|
687
989
|
dataRef.current = seed;
|
|
@@ -787,7 +1089,7 @@ import {
|
|
|
787
1089
|
useCallback as useCallback2,
|
|
788
1090
|
useEffect as useEffect3,
|
|
789
1091
|
useMemo as useMemo3,
|
|
790
|
-
useRef as
|
|
1092
|
+
useRef as useRef3,
|
|
791
1093
|
useState as useState3
|
|
792
1094
|
} from "react";
|
|
793
1095
|
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -906,9 +1208,12 @@ function createBillLifecycleClient({
|
|
|
906
1208
|
const body = await response.json();
|
|
907
1209
|
return normalizeLifecycle(body.data);
|
|
908
1210
|
};
|
|
909
|
-
const searchClaimsAdministrators = async (query) => {
|
|
1211
|
+
const searchClaimsAdministrators = async (query, claimNumber) => {
|
|
1212
|
+
const params = new URLSearchParams();
|
|
1213
|
+
if (query.trim()) params.set("q", query.trim());
|
|
1214
|
+
if (claimNumber?.trim()) params.set("claimNumber", claimNumber.trim());
|
|
910
1215
|
const response = await request(
|
|
911
|
-
`/embed/api/bill-review/payers
|
|
1216
|
+
`/embed/api/bill-review/payers?${params.toString()}`
|
|
912
1217
|
);
|
|
913
1218
|
if (!response.ok) {
|
|
914
1219
|
throw await responseError2(
|
|
@@ -930,7 +1235,23 @@ function createBillLifecycleClient({
|
|
|
930
1235
|
id: payer.id,
|
|
931
1236
|
name: payer.name,
|
|
932
1237
|
...typeof payer.hasElectronic === "boolean" ? { hasElectronic: payer.hasElectronic } : {},
|
|
933
|
-
...Array.isArray(payer.states) ? { states: payer.states.filter((state) => typeof state === "string") } : {}
|
|
1238
|
+
...Array.isArray(payer.states) ? { states: payer.states.filter((state) => typeof state === "string") } : {},
|
|
1239
|
+
...["high", "medium", "directory"].includes(payer.confidence ?? "") ? {
|
|
1240
|
+
confidence: payer.confidence
|
|
1241
|
+
} : {},
|
|
1242
|
+
...typeof payer.recommended === "boolean" ? { recommended: payer.recommended } : {},
|
|
1243
|
+
...Array.isArray(payer.signals) ? {
|
|
1244
|
+
signals: payer.signals.flatMap((signal) => {
|
|
1245
|
+
if (!signal || typeof signal !== "object") return [];
|
|
1246
|
+
const candidate = signal;
|
|
1247
|
+
if (!["name", "claim_number"].includes(String(candidate.kind)) || !["match", "warning"].includes(String(candidate.state)) || typeof candidate.label !== "string") return [];
|
|
1248
|
+
return [{
|
|
1249
|
+
kind: candidate.kind,
|
|
1250
|
+
state: candidate.state,
|
|
1251
|
+
label: candidate.label
|
|
1252
|
+
}];
|
|
1253
|
+
})
|
|
1254
|
+
} : {}
|
|
934
1255
|
}];
|
|
935
1256
|
});
|
|
936
1257
|
};
|
|
@@ -1086,7 +1407,7 @@ function useBillLifecycle({
|
|
|
1086
1407
|
const [isLoading, setIsLoading] = useState3(enabled && !initialData);
|
|
1087
1408
|
const [isRefreshing, setIsRefreshing] = useState3(false);
|
|
1088
1409
|
const [isMutating, setIsMutating] = useState3(false);
|
|
1089
|
-
const mounted =
|
|
1410
|
+
const mounted = useRef3(true);
|
|
1090
1411
|
useEffect3(() => {
|
|
1091
1412
|
setBillId(providedBillId);
|
|
1092
1413
|
setData(initialData);
|
|
@@ -1155,7 +1476,7 @@ function useBillLifecycle({
|
|
|
1155
1476
|
[client, mutate]
|
|
1156
1477
|
);
|
|
1157
1478
|
const searchClaimsAdministrators = useCallback2(
|
|
1158
|
-
(query) => client.searchClaimsAdministrators(query),
|
|
1479
|
+
(query, claimNumber) => client.searchClaimsAdministrators(query, claimNumber),
|
|
1159
1480
|
[client]
|
|
1160
1481
|
);
|
|
1161
1482
|
const submitBill = useCallback2(
|
|
@@ -1298,7 +1619,7 @@ function ConnectedBillLifecycle({
|
|
|
1298
1619
|
attachmentIds: [],
|
|
1299
1620
|
route: "ebill"
|
|
1300
1621
|
});
|
|
1301
|
-
const lastData =
|
|
1622
|
+
const lastData = useRef3(null);
|
|
1302
1623
|
useEffect3(() => {
|
|
1303
1624
|
if (!data || data === lastData.current) return;
|
|
1304
1625
|
lastData.current = data;
|
|
@@ -1553,7 +1874,7 @@ var CONNECTED_LIFECYCLE_STYLES = `
|
|
|
1553
1874
|
|
|
1554
1875
|
// src/index.tsx
|
|
1555
1876
|
function widget(tagName, props) {
|
|
1556
|
-
const ref =
|
|
1877
|
+
const ref = useRef4(null);
|
|
1557
1878
|
const { onMindBill, onMindBillError } = props;
|
|
1558
1879
|
useEffect4(() => {
|
|
1559
1880
|
const element = ref.current;
|