@mindbill/react 0.23.1 → 0.24.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 +3 -3
- package/dist/index.d.ts +25 -3
- package/dist/index.js +236 -42
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1233,6 +1233,7 @@ var DEFAULT_BILL_SUBMISSION_MODIFIERS = [
|
|
|
1233
1233
|
{ code: "XU", description: "Unusual non-overlapping service" }
|
|
1234
1234
|
];
|
|
1235
1235
|
var BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS = [
|
|
1236
|
+
{ label: "Psych", code: "Z04.6", description: "General psychiatric examination requested by authority" },
|
|
1236
1237
|
{ label: "Back", code: "M54.50", description: "Low back pain, unspecified" },
|
|
1237
1238
|
{ label: "Neck", code: "M54.2", description: "Cervicalgia" },
|
|
1238
1239
|
{ label: "Left hand", code: "M79.642", description: "Pain in left hand" },
|
|
@@ -1293,6 +1294,79 @@ var BILL_SUBMISSION_DOCUMENT_TYPES = [
|
|
|
1293
1294
|
"appeal",
|
|
1294
1295
|
"other"
|
|
1295
1296
|
];
|
|
1297
|
+
var MED_LEGAL_REPORT_TYPE_CODE = "OZ:J4";
|
|
1298
|
+
var BILL_SUBMISSION_REPORT_TYPES = [
|
|
1299
|
+
{ code: "OZ:J1", label: "Doctor's First Report (DLSR 5021)" },
|
|
1300
|
+
{ code: "OZ:J2", label: "Supplemental Medical Report (BRs)" },
|
|
1301
|
+
{ code: "OZ:J3", label: "Medical Permanent Impairment Report" },
|
|
1302
|
+
{ code: MED_LEGAL_REPORT_TYPE_CODE, label: "Med-Legal Report" },
|
|
1303
|
+
{ code: "OZ:J5", label: "Vocational Report" },
|
|
1304
|
+
{ code: "OZ:J6", label: "Work Status Report" },
|
|
1305
|
+
{ code: "OZ:J7", label: "Consultation Report" },
|
|
1306
|
+
{ code: "OZ:J8", label: "Permanent Disability Report" },
|
|
1307
|
+
{ code: "OZ:J9", label: "Itemized Statement" },
|
|
1308
|
+
{ code: "03", label: "Justifying Treatment Beyond Utilization Guidelines" },
|
|
1309
|
+
{ code: "04", label: "Drugs Administered" },
|
|
1310
|
+
{ code: "05", label: "Treatment Diagnosis" },
|
|
1311
|
+
{ code: "06", label: "Initial Assessment" },
|
|
1312
|
+
{ code: "07", label: "Plan of Treatment" },
|
|
1313
|
+
{ code: "08", label: "Plan of Treatment" },
|
|
1314
|
+
{ code: "09", label: "PR2 (Progress Report)" },
|
|
1315
|
+
{ code: "10", label: "Continued Treatment" },
|
|
1316
|
+
{ code: "11", label: "Chemical Analysis" },
|
|
1317
|
+
{ code: "13", label: "Certified Test Report" },
|
|
1318
|
+
{ code: "15", label: "Justification for Admission" },
|
|
1319
|
+
{ code: "21", label: "Recovery Plan" },
|
|
1320
|
+
{ code: "A3", label: "Allergies/Sensitivities Document" },
|
|
1321
|
+
{ code: "A4", label: "Autopsy Report" },
|
|
1322
|
+
{ code: "AM", label: "Ambulance Certification" },
|
|
1323
|
+
{ code: "AS", label: "Admission Summary" },
|
|
1324
|
+
{ code: "B2", label: "Prescription" },
|
|
1325
|
+
{ code: "B3", label: "Physician Order" },
|
|
1326
|
+
{ code: "B4", label: "Referral Form" },
|
|
1327
|
+
{ code: "BR", label: "Benchmark Testing Results" },
|
|
1328
|
+
{ code: "BS", label: "Baseline" },
|
|
1329
|
+
{ code: "BT", label: "Blanket Test Results" },
|
|
1330
|
+
{ code: "CB", label: "Chiropractic Justification" },
|
|
1331
|
+
{ code: "CK", label: "Canceled Check" },
|
|
1332
|
+
{ code: "CT", label: "Certification" },
|
|
1333
|
+
{ code: "D2", label: "Drug Profile Document" },
|
|
1334
|
+
{ code: "DA", label: "Dental Models" },
|
|
1335
|
+
{ code: "DB", label: "Durable Medical Equipment RX" },
|
|
1336
|
+
{ code: "DG", label: "Diagnostic Report" },
|
|
1337
|
+
{ code: "DJ", label: "Discharge Monitoring Report" },
|
|
1338
|
+
{ code: "DS", label: "Discharge Summary" },
|
|
1339
|
+
{ code: "EB", label: "Explanation of Benefits" },
|
|
1340
|
+
{ code: "HC", label: "Health Clinic Records (HC)" },
|
|
1341
|
+
{ code: "HR", label: "Health Clinic Records (HR)" },
|
|
1342
|
+
{ code: "I5", label: "Immunization Record" },
|
|
1343
|
+
{ code: "IR", label: "State School Immunization Records" },
|
|
1344
|
+
{ code: "LA", label: "Laboratory Results" },
|
|
1345
|
+
{ code: "M1", label: "Medical Record Attachment" },
|
|
1346
|
+
{ code: "MT", label: "Nursing Notes" },
|
|
1347
|
+
{ code: "NN", label: "Minor Deviation Request" },
|
|
1348
|
+
{ code: "OB", label: "Operative Note" },
|
|
1349
|
+
{ code: "OC", label: "Oxygen Content Averaging Report" },
|
|
1350
|
+
{ code: "OD", label: "Orders and Treatments Document" },
|
|
1351
|
+
{ code: "OE", label: "Objective Physical Examination Doc" },
|
|
1352
|
+
{ code: "OX", label: "Oxygen Therapy Certification" },
|
|
1353
|
+
{ code: "OZ", label: "Support Data for Bill" },
|
|
1354
|
+
{ code: "P4", label: "Pathology Report" },
|
|
1355
|
+
{ code: "P5", label: "Patient Medical History Document" },
|
|
1356
|
+
{ code: "PE", label: "Periodontal Charts" },
|
|
1357
|
+
{ code: "PN", label: "Physical Therapy Notes" },
|
|
1358
|
+
{ code: "PO", label: "Prosthetics or Orthotic Certification" },
|
|
1359
|
+
{ code: "PQ", label: "Paramedical Results" },
|
|
1360
|
+
{ code: "PY", label: "Physician's Report" },
|
|
1361
|
+
{ code: "PZ", label: "Physical Therapy Certification" },
|
|
1362
|
+
{ code: "RB", label: "Radiology Films" },
|
|
1363
|
+
{ code: "RR", label: "Radiology Reports" },
|
|
1364
|
+
{ code: "RT", label: "Report of tests and Analysis Report" },
|
|
1365
|
+
{ code: "RX", label: "Renewable Oxygen Content Averaging Report" },
|
|
1366
|
+
{ code: "SG", label: "Symptoms Document" },
|
|
1367
|
+
{ code: "V5", label: "Death Notification" },
|
|
1368
|
+
{ code: "XP", label: "Photographs" }
|
|
1369
|
+
];
|
|
1296
1370
|
var BILL_SUBMISSION_REQUIRED_FIELDS = [
|
|
1297
1371
|
"patient.firstName",
|
|
1298
1372
|
"patient.lastName",
|
|
@@ -1343,6 +1417,8 @@ async function prepareBillSubmissionDocuments({
|
|
|
1343
1417
|
attachments,
|
|
1344
1418
|
selectedIds,
|
|
1345
1419
|
uploads,
|
|
1420
|
+
reportTypeCodeByAttachmentId = {},
|
|
1421
|
+
defaultReportTypeCode,
|
|
1346
1422
|
fetch: fetchOverride
|
|
1347
1423
|
}) {
|
|
1348
1424
|
const fetcher = fetchOverride ?? globalThis.fetch;
|
|
@@ -1356,12 +1432,14 @@ async function prepareBillSubmissionDocuments({
|
|
|
1356
1432
|
externalId: attachment.id,
|
|
1357
1433
|
filename: attachment.fileName,
|
|
1358
1434
|
documentType: attachment.documentType,
|
|
1435
|
+
...reportTypeCodeByAttachmentId[attachment.id] || attachment.reportTypeCode || defaultReportTypeCode ? { reportTypeCode: reportTypeCodeByAttachmentId[attachment.id] || attachment.reportTypeCode || defaultReportTypeCode } : {},
|
|
1359
1436
|
...attachment.description ? { description: attachment.description } : {}
|
|
1360
1437
|
});
|
|
1361
1438
|
}));
|
|
1362
|
-
const uploadedDocuments = await Promise.all(uploads.map(({ file, documentType, description }) => pdfDocument(file, {
|
|
1439
|
+
const uploadedDocuments = await Promise.all(uploads.map(({ file, documentType, description, reportTypeCode }) => pdfDocument(file, {
|
|
1363
1440
|
filename: file.name,
|
|
1364
1441
|
documentType,
|
|
1442
|
+
...reportTypeCode || defaultReportTypeCode ? { reportTypeCode: reportTypeCode || defaultReportTypeCode } : {},
|
|
1365
1443
|
...description ? { description } : {}
|
|
1366
1444
|
})));
|
|
1367
1445
|
return [...sourceDocuments, ...uploadedDocuments];
|
|
@@ -1416,6 +1494,20 @@ function applyBillSubmissionEvaluationModifiers(lines, type) {
|
|
|
1416
1494
|
return { ...line, modifiers: auto ? [auto, ...modifiers] : modifiers };
|
|
1417
1495
|
});
|
|
1418
1496
|
}
|
|
1497
|
+
var PSYCH_QME_DEFAULT_DIAGNOSIS = "Z04.6";
|
|
1498
|
+
function applyBillSubmissionEvaluationDiagnoses(diagnoses, type) {
|
|
1499
|
+
const current = [...diagnoses ?? []];
|
|
1500
|
+
return type === "psych_qme" && !current.some((code) => code.trim()) ? [PSYCH_QME_DEFAULT_DIAGNOSIS] : current;
|
|
1501
|
+
}
|
|
1502
|
+
function initialEvaluationType(bill) {
|
|
1503
|
+
if (bill.renderingProvider?.isAme) return "ame";
|
|
1504
|
+
return bill.renderingProvider?.specialty?.toLowerCase().includes("psych") ? "psych_qme" : "qme";
|
|
1505
|
+
}
|
|
1506
|
+
function cloneInitialBill(bill) {
|
|
1507
|
+
const cloned = cloneBill(bill);
|
|
1508
|
+
cloned.diagnoses = applyBillSubmissionEvaluationDiagnoses(cloned.diagnoses, initialEvaluationType(bill));
|
|
1509
|
+
return cloned;
|
|
1510
|
+
}
|
|
1419
1511
|
function submittedLines(lines) {
|
|
1420
1512
|
return lines.filter(lineHasContent).map((line) => ({ ...line, code: line.code.trim(), modifiers: [...line.modifiers ?? []] }));
|
|
1421
1513
|
}
|
|
@@ -1467,13 +1559,14 @@ function validateBillSubmission(bill) {
|
|
|
1467
1559
|
var css = `
|
|
1468
1560
|
.mbsf{display:grid;gap:20px;color:var(--mb-text);font-family:var(--mb-font);font-size:15px}.mbsf *{box-sizing:border-box}
|
|
1469
1561
|
.mbsf-head,.mbsf-section-head,.mbsf-attach-row,.mbsf-actions{display:flex;align-items:center;justify-content:space-between;gap:16px}.mbsf-title{margin:0;font-size:24px}.mbsf-copy,.mbsf-help{color:var(--mb-muted);margin:5px 0 0}.mbsf-required{font-size:13px;color:var(--mb-muted);white-space:nowrap}.mbsf-star,.mbsf-error{color:var(--mb-danger)}
|
|
1470
|
-
.mbsf-card{min-width:0;margin:0;padding:24px;border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow)}.mbsf-legend{padding:0 10px;font-size:18px;font-weight:760}.mbsf-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px}.mbsf-span{grid-column:1/-1}.mbsf-field{display:grid;align-content:start;gap:7px;min-width:0}.mbsf-label{font-weight:680}.mbsf-input,.mbsf-select{width:100%;min-height:46px;padding:10px 12px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-input);color:var(--mb-text);font:inherit}.mbsf-input:focus,.mbsf-select:focus{outline:3px solid color-mix(in srgb,var(--mb-accent) 22%,transparent);border-color:var(--mb-accent)}.mbsf-field[data-invalid=true] .mbsf-input,.mbsf-field[data-invalid=true] .mbsf-select,.mbsf-invalid-control .mbsf-input{border-color:var(--mb-danger);background:color-mix(in srgb,var(--mb-danger) 4%,var(--mb-input))}.mbsf-field[data-invalid=true] .mbsf-input:focus,.mbsf-field[data-invalid=true] .mbsf-select:focus{outline-color:color-mix(in srgb,var(--mb-danger) 24%,transparent)}
|
|
1562
|
+
.mbsf-card{min-width:0;margin:0;padding:24px;border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow)}.mbsf-card[data-invalid=true]{border-color:var(--mb-danger)}.mbsf-legend{padding:0 10px;font-size:18px;font-weight:760}.mbsf-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px}.mbsf-span{grid-column:1/-1}.mbsf-field{display:grid;align-content:start;gap:7px;min-width:0}.mbsf-label{font-weight:680}.mbsf-input,.mbsf-select{width:100%;min-height:46px;padding:10px 12px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-input);color:var(--mb-text);font:inherit}.mbsf-input:focus,.mbsf-select:focus{outline:3px solid color-mix(in srgb,var(--mb-accent) 22%,transparent);border-color:var(--mb-accent)}.mbsf-field[data-invalid=true] .mbsf-input,.mbsf-field[data-invalid=true] .mbsf-select,.mbsf-invalid-control .mbsf-input{border-color:var(--mb-danger);background:color-mix(in srgb,var(--mb-danger) 4%,var(--mb-input))}.mbsf-field[data-invalid=true] .mbsf-input:focus,.mbsf-field[data-invalid=true] .mbsf-select:focus{outline-color:color-mix(in srgb,var(--mb-danger) 24%,transparent)}
|
|
1471
1563
|
.mbsf-combo{position:relative}.mbsf-menu{position:absolute;z-index:20;top:calc(100% + 5px);left:0;right:0;max-height:min(360px,46vh);overflow:auto;overscroll-behavior:contain;padding:7px;border:1px solid var(--mb-border);border-radius:12px;background:var(--mb-surface);box-shadow:0 14px 35px rgba(17,38,49,.16)}.mbsf-option{display:grid;width:100%;gap:2px;padding:10px;border:0;border-radius:8px;background:transparent;color:var(--mb-text);font:inherit;text-align:left;cursor:pointer}.mbsf-option:hover,.mbsf-option:focus{background:color-mix(in srgb,var(--mb-accent) 9%,var(--mb-surface))}.mbsf-option small{color:var(--mb-muted)}.mbsf-menu-status{padding:12px;text-align:center;color:var(--mb-muted);font-size:13px}
|
|
1564
|
+
.mbsf-payer-status{display:flex;align-items:center;gap:7px;color:#087f5b;font-size:13px;font-weight:650}.mbsf-payer-intro{margin:4px 0 0;color:var(--mb-muted)}.mbsf-payer-list{display:grid;gap:8px}.mbsf-payer-option{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 12px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 3%,var(--mb-surface))}.mbsf-payer-option-main{display:grid;gap:5px;min-width:0}.mbsf-payer-option-main strong{overflow-wrap:anywhere}.mbsf-payer-signals{display:flex;flex-wrap:wrap;gap:6px}.mbsf-payer-signal{padding:2px 7px;border:1px solid var(--mb-border);border-radius:999px;color:var(--mb-muted);font-size:12px}.mbsf-payer-signal[data-state=match]{border-color:color-mix(in srgb,#159447 45%,var(--mb-border));color:#087f5b}.mbsf-payer-signal[data-state=warning]{border-color:color-mix(in srgb,#c56a00 55%,var(--mb-border));color:#9a5200}
|
|
1472
1565
|
.mbsf-chips,.mbsf-quick-picks{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:8px}.mbsf-chip,.mbsf-quick-pick{display:inline-flex;align-items:center;gap:7px;padding:5px 9px;border:1px solid var(--mb-border);border-radius:999px;background:var(--mb-input)}.mbsf-chip button{border:0;background:transparent;color:var(--mb-muted);cursor:pointer;font:inherit}.mbsf-quick-pick{color:var(--mb-text);font:inherit;cursor:pointer}.mbsf-quick-pick[data-selected=true]{border-color:var(--mb-accent);color:var(--mb-accent)}
|
|
1473
1566
|
.mbsf-segments{display:grid;grid-template-columns:repeat(3,1fr);border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);overflow:hidden}.mbsf-segment{min-height:44px;border:0;border-right:1px solid var(--mb-border);background:var(--mb-input);color:var(--mb-text);font:inherit;font-weight:700;cursor:pointer}.mbsf-segment:last-child{border-right:0}.mbsf-segment[aria-pressed=true]{background:var(--mb-accent);color:var(--mb-accent-contrast)}
|
|
1474
1567
|
.mbsf-lines{margin-top:18px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);overflow:visible}.mbsf-lines[data-invalid=true]{border-color:var(--mb-danger)}.mbsf-line-head,.mbsf-line{display:grid;grid-template-columns:minmax(190px,1.05fr) minmax(220px,1.5fr) 100px 120px 42px;gap:12px;align-items:start;padding:12px}.mbsf-line-head{color:var(--mb-muted);font-size:13px;font-weight:700;border-bottom:1px solid var(--mb-border)}.mbsf-line{border-bottom:1px solid var(--mb-border)}.mbsf-line:last-child{border-bottom:0}.mbsf-line [data-invalid=true] .mbsf-input{border-color:var(--mb-danger);background:color-mix(in srgb,var(--mb-danger) 4%,var(--mb-input))}.mbsf-money{padding-top:12px;text-align:right;font-variant-numeric:tabular-nums}.mbsf-total{display:flex;justify-content:flex-end;gap:45px;padding:16px 56px 16px 16px;font-size:17px;font-weight:760}
|
|
1475
|
-
.mbsf-icon-btn{width:40px;height:42px;border:0;background:transparent;color:var(--mb-text);font-size:22px;cursor:pointer}.mbsf-secondary{min-height:40px;padding:8px 14px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);color:var(--mb-text);font:inherit;font-weight:680;cursor:pointer}.mbsf-attach-list{display:grid;gap:10px;margin-bottom:18px}.mbsf-attach-row{padding:14px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius)}.mbsf-attach-row[data-auto=true]{border-color:color-mix(in srgb,#159447 45%,var(--mb-border));background:color-mix(in srgb,#159447 5%,var(--mb-surface))}.mbsf-attach-main{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.mbsf-attach-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}.mbsf-file{min-width:0}.mbsf-file strong{overflow-wrap:anywhere}.mbsf-badge{display:inline-block;margin-left:8px;padding:2px 7px;border:1px solid var(--mb-border);border-radius:7px;color:var(--mb-muted);font-size:12px;font-weight:600}.mbsf-drop{display:grid;width:100%;place-items:center;min-height:210px;padding:30px;border:2px dashed color-mix(in srgb,var(--mb-muted) 55%,transparent);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 3%,var(--mb-surface));color:var(--mb-text);font:inherit;text-align:center;cursor:pointer}.mbsf-drop[data-active=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface))}.mbsf-alert{padding:12px 14px;border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 10%,transparent);color:var(--mb-danger)}.mbsf-actions{justify-content:flex-end}.mbsf-submit{min-width:180px;min-height:48px;padding:11px 24px;border:0;border-radius:var(--mb-control-radius);background:var(--mb-accent);color:var(--mb-accent-contrast);font:inherit;font-weight:780;cursor:pointer}
|
|
1476
|
-
@media(max-width:820px){.mbsf{gap:16px}.mbsf-grid{grid-template-columns:1fr}.mbsf-span{grid-column:auto}.mbsf-card{padding:18px 16px}.mbsf-line-head{display:none}.mbsf-line{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 86px;gap:14px;padding:18px 16px}.mbsf-line>div:before{display:block;margin-bottom:6px;color:var(--mb-muted);font-size:12px;font-weight:700;content:attr(data-label)}.mbsf-line>div:nth-child(1),.mbsf-line>div:nth-child(2){grid-column:1/-1}.mbsf-money{align-self:end;padding:0 0 12px;text-align:right}.mbsf-line .mbsf-icon-btn{position:absolute;right:8px;bottom:3px}.mbsf-total{padding:16px 18px;gap:24px}.mbsf-head{align-items:flex-start}.mbsf-segments{grid-template-columns:repeat(3,minmax(0,1fr))}.mbsf-segment{min-width:0;padding:8px 4px;border-right:1px solid var(--mb-border);border-bottom:0;font-size:13px}.mbsf-segment:last-child{border-right:0}.mbsf-attach-row{align-items:flex-start;flex-wrap:wrap}.mbsf-attach-main{align-items:flex-start}.mbsf-attach-actions{margin-left:auto}.mbsf-drop{min-height:190px;padding:24px 18px}.mbsf-actions{position:sticky;bottom:86px;z-index:10}.mbsf-submit{width:100%}}
|
|
1568
|
+
.mbsf-icon-btn{width:40px;height:42px;border:0;background:transparent;color:var(--mb-text);font-size:22px;cursor:pointer}.mbsf-secondary{min-height:40px;padding:8px 14px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);color:var(--mb-text);font:inherit;font-weight:680;cursor:pointer}.mbsf-attach-list{display:grid;gap:10px;margin-bottom:18px}.mbsf-attach-row{padding:14px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius)}.mbsf-attach-row[data-auto=true]{border-color:color-mix(in srgb,#159447 45%,var(--mb-border));background:color-mix(in srgb,#159447 5%,var(--mb-surface))}.mbsf-attach-main{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.mbsf-attach-type{width:min(360px,32vw);flex:0 1 360px}.mbsf-attach-type .mbsf-label{display:block;margin-bottom:6px;font-size:12px}.mbsf-attach-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}.mbsf-file{min-width:0}.mbsf-file strong{overflow-wrap:anywhere}.mbsf-badge{display:inline-block;margin-left:8px;padding:2px 7px;border:1px solid var(--mb-border);border-radius:7px;color:var(--mb-muted);font-size:12px;font-weight:600}.mbsf-drop{display:grid;width:100%;place-items:center;min-height:210px;padding:30px;border:2px dashed color-mix(in srgb,var(--mb-muted) 55%,transparent);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 3%,var(--mb-surface));color:var(--mb-text);font:inherit;text-align:center;cursor:pointer}.mbsf-drop[data-active=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface))}.mbsf-alert{padding:12px 14px;border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 10%,transparent);color:var(--mb-danger)}.mbsf-actions{justify-content:flex-end}.mbsf-submit{min-width:180px;min-height:48px;padding:11px 24px;border:0;border-radius:var(--mb-control-radius);background:var(--mb-accent);color:var(--mb-accent-contrast);font:inherit;font-weight:780;cursor:pointer}
|
|
1569
|
+
@media(max-width:820px){.mbsf{gap:16px}.mbsf-grid{grid-template-columns:1fr}.mbsf-span{grid-column:auto}.mbsf-card{padding:18px 16px}.mbsf-line-head{display:none}.mbsf-line{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 86px;gap:14px;padding:18px 16px}.mbsf-line>div:before{display:block;margin-bottom:6px;color:var(--mb-muted);font-size:12px;font-weight:700;content:attr(data-label)}.mbsf-line>div:nth-child(1),.mbsf-line>div:nth-child(2){grid-column:1/-1}.mbsf-money{align-self:end;padding:0 0 12px;text-align:right}.mbsf-line .mbsf-icon-btn{position:absolute;right:8px;bottom:3px}.mbsf-total{padding:16px 18px;gap:24px}.mbsf-head{align-items:flex-start}.mbsf-segments{grid-template-columns:repeat(3,minmax(0,1fr))}.mbsf-segment{min-width:0;padding:8px 4px;border-right:1px solid var(--mb-border);border-bottom:0;font-size:13px}.mbsf-segment:last-child{border-right:0}.mbsf-payer-option{align-items:flex-start}.mbsf-attach-row{align-items:flex-start;flex-wrap:wrap}.mbsf-attach-main{align-items:flex-start;flex-basis:calc(100% - 150px)}.mbsf-attach-type{width:100%;flex-basis:100%;order:3}.mbsf-attach-actions{margin-left:auto}.mbsf-drop{min-height:190px;padding:24px 18px}.mbsf-actions{position:sticky;bottom:86px;z-index:10}.mbsf-submit{width:100%}}
|
|
1477
1570
|
`;
|
|
1478
1571
|
function RequiredMark() {
|
|
1479
1572
|
return /* @__PURE__ */ jsx3("span", { className: "mbsf-star", children: " *" });
|
|
@@ -1507,7 +1600,7 @@ function TextDateInput({ value, onChange, disabled, required, ariaLabel }) {
|
|
|
1507
1600
|
invalid ? /* @__PURE__ */ jsx3("small", { className: "mbsf-error", children: "Use MM/DD/YYYY" }) : null
|
|
1508
1601
|
] });
|
|
1509
1602
|
}
|
|
1510
|
-
function ComboBox({ value, placeholder, options, disabled, loading, loadingMore, invalid, onOpen, onQuery, onEndReached, onSelect, createOption, ariaLabel }) {
|
|
1603
|
+
function ComboBox({ value, placeholder, options, disabled, loading, loadingMore, invalid, preserveValueOnOpen = false, onOpen, onQuery, onEndReached, onSelect, createOption, ariaLabel }) {
|
|
1511
1604
|
const [open, setOpen] = useState2(false);
|
|
1512
1605
|
const [query, setQuery] = useState2("");
|
|
1513
1606
|
const visible = useMemo2(() => {
|
|
@@ -1519,9 +1612,11 @@ function ComboBox({ value, placeholder, options, disabled, loading, loadingMore,
|
|
|
1519
1612
|
const showMenu = open && (loading || visible.length > 0 || query.trim().length >= 2);
|
|
1520
1613
|
return /* @__PURE__ */ jsxs3("div", { className: "mbsf-combo", children: [
|
|
1521
1614
|
/* @__PURE__ */ jsx3("input", { className: "mbsf-input", role: "combobox", "aria-label": ariaLabel, "aria-invalid": invalid, "aria-expanded": showMenu, autoComplete: "off", disabled, placeholder, value: open ? query : value, onFocus: () => {
|
|
1615
|
+
const next = preserveValueOnOpen ? value : "";
|
|
1522
1616
|
setOpen(true);
|
|
1523
|
-
setQuery(
|
|
1617
|
+
setQuery(next);
|
|
1524
1618
|
onOpen?.();
|
|
1619
|
+
if (next) onQuery?.(next);
|
|
1525
1620
|
}, onChange: (event) => {
|
|
1526
1621
|
setOpen(true);
|
|
1527
1622
|
setQuery(event.target.value);
|
|
@@ -1531,7 +1626,7 @@ function ComboBox({ value, placeholder, options, disabled, loading, loadingMore,
|
|
|
1531
1626
|
const menu = event.currentTarget;
|
|
1532
1627
|
if (menu.scrollHeight - menu.scrollTop - menu.clientHeight < 120) onEndReached?.();
|
|
1533
1628
|
}, children: [
|
|
1534
|
-
loading && !visible.length ? /* @__PURE__ */ jsx3("div", { className: "mbsf-menu-status", children: "Loading
|
|
1629
|
+
loading && !visible.length ? /* @__PURE__ */ jsx3("div", { className: "mbsf-menu-status", children: "Loading\u2026" }) : visible.length ? visible.map((option) => /* @__PURE__ */ jsxs3("button", { className: "mbsf-option", type: "button", role: "option", onMouseDown: (event) => event.preventDefault(), onClick: () => {
|
|
1535
1630
|
onSelect(option);
|
|
1536
1631
|
setOpen(false);
|
|
1537
1632
|
setQuery("");
|
|
@@ -1575,6 +1670,16 @@ function mergeOptions(defaults, supplied) {
|
|
|
1575
1670
|
function mergeDiagnosisOptions(options) {
|
|
1576
1671
|
return [...new Map(options.map((item) => [item.code.toUpperCase(), item])).values()].sort((left, right) => left.code.localeCompare(right.code, void 0, { numeric: true }));
|
|
1577
1672
|
}
|
|
1673
|
+
function normalizeClaimsAdministratorName(value) {
|
|
1674
|
+
return value.toUpperCase().replace(/\[[^\]]*]/g, " ").replace(/\b(?:INCORPORATED|INC|COMPANY|CO|CORPORATION|CORP|GROUP|INSURANCE|SERVICES)\b/g, " ").replace(/[^A-Z0-9]+/g, " ").trim().replace(/\s+/g, " ");
|
|
1675
|
+
}
|
|
1676
|
+
function exactClaimsAdministratorMatch(results, suppliedName) {
|
|
1677
|
+
const normalized = normalizeClaimsAdministratorName(suppliedName);
|
|
1678
|
+
return results.find((payer) => normalizeClaimsAdministratorName(payer.name) === normalized) ?? results.find((payer) => payer.confidence === "high" && payer.recommended);
|
|
1679
|
+
}
|
|
1680
|
+
function claimsAdministratorRecommendations(results, limit = 5) {
|
|
1681
|
+
return [...results].sort((left, right) => Number(Boolean(right.recommended)) - Number(Boolean(left.recommended))).slice(0, Math.max(0, limit));
|
|
1682
|
+
}
|
|
1578
1683
|
var BillSubmissionSectionsContext = createContext(null);
|
|
1579
1684
|
function BillSubmissionSection({ id }) {
|
|
1580
1685
|
const sections = useContext(BillSubmissionSectionsContext);
|
|
@@ -1617,6 +1722,9 @@ function BillSubmissionForm({
|
|
|
1617
1722
|
onLookupPostalCode,
|
|
1618
1723
|
procedureOptions,
|
|
1619
1724
|
modifierOptions,
|
|
1725
|
+
attachmentReportTypeMode = "auto",
|
|
1726
|
+
attachmentReportTypes = BILL_SUBMISSION_REPORT_TYPES,
|
|
1727
|
+
defaultAttachmentReportType,
|
|
1620
1728
|
appearance,
|
|
1621
1729
|
className = "bill-submission-form",
|
|
1622
1730
|
style,
|
|
@@ -1626,11 +1734,12 @@ function BillSubmissionForm({
|
|
|
1626
1734
|
description = "Review the bill details, add attachments, and submit.",
|
|
1627
1735
|
children
|
|
1628
1736
|
}) {
|
|
1629
|
-
const [bill, setBill] = useState2(() =>
|
|
1737
|
+
const [bill, setBill] = useState2(() => cloneInitialBill(initialBill));
|
|
1630
1738
|
const [selectedIds, setSelectedIds] = useState2(() => attachments.map((item) => item.id));
|
|
1631
1739
|
const [removedSourceIds, setRemovedSourceIds] = useState2([]);
|
|
1632
1740
|
const [uploads, setUploads] = useState2([]);
|
|
1633
1741
|
const [errors, setErrors] = useState2({});
|
|
1742
|
+
const [sourceAttachmentReportTypes, setSourceAttachmentReportTypes] = useState2(() => Object.fromEntries(attachments.flatMap((item) => item.reportTypeCode ? [[item.id, item.reportTypeCode]] : [])));
|
|
1634
1743
|
const [validationActive, setValidationActive] = useState2(false);
|
|
1635
1744
|
const [formError, setFormError] = useState2(null);
|
|
1636
1745
|
const [submitting, setSubmitting] = useState2(false);
|
|
@@ -1647,18 +1756,25 @@ function BillSubmissionForm({
|
|
|
1647
1756
|
const fileInput = useRef2(null);
|
|
1648
1757
|
const diagnosisRequest = useRef2(0);
|
|
1649
1758
|
const diagnosisAppendPending = useRef2(false);
|
|
1759
|
+
const payerRequest = useRef2(0);
|
|
1650
1760
|
const procedures = useMemo2(() => mergeOptions(DEFAULT_BILL_SUBMISSION_PROCEDURES, procedureOptions), [procedureOptions]);
|
|
1651
1761
|
const modifiers = useMemo2(() => mergeOptions(DEFAULT_BILL_SUBMISSION_MODIFIERS, modifierOptions), [modifierOptions]);
|
|
1652
|
-
const [evaluationType, setEvaluationType] = useState2(() => initialBill
|
|
1762
|
+
const [evaluationType, setEvaluationType] = useState2(() => initialEvaluationType(initialBill));
|
|
1653
1763
|
const connected = !onSubmit;
|
|
1654
1764
|
const referenceClient = useMemo2(() => getSession || sessionEndpoint || connected ? createBillReferenceClient({ getSession, sessionEndpoint, apiBaseUrl, fetch: fetchOverride }) : null, [getSession, sessionEndpoint, apiBaseUrl, fetchOverride, connected]);
|
|
1655
1765
|
const submissionClient = useMemo2(() => connected ? createBillSubmissionClient({ getSession, sessionEndpoint, apiBaseUrl, fetch: fetchOverride }) : null, [getSession, sessionEndpoint, apiBaseUrl, fetchOverride, connected]);
|
|
1656
1766
|
const locked = disabled || submitting;
|
|
1767
|
+
const showAttachmentReportTypes = attachmentReportTypeMode === "visible" || attachmentReportTypeMode === "auto" && bill.billingMode !== "med_legal";
|
|
1768
|
+
const forcedAttachmentReportType = showAttachmentReportTypes ? void 0 : defaultAttachmentReportType ?? MED_LEGAL_REPORT_TYPE_CODE;
|
|
1769
|
+
const reportTypeOptions = useMemo2(() => attachmentReportTypes.map((item) => ({ id: item.code, label: item.code.replace(/^OZ:/, ""), detail: item.label })), [attachmentReportTypes]);
|
|
1770
|
+
const missingAttachmentReportType = showAttachmentReportTypes && (selectedIds.some((id) => !(sourceAttachmentReportTypes[id] || attachments.find((item) => item.id === id)?.reportTypeCode || defaultAttachmentReportType)) || uploads.some((upload) => !(upload.reportTypeCode || defaultAttachmentReportType)));
|
|
1657
1771
|
useEffect2(() => {
|
|
1658
|
-
setBill(
|
|
1772
|
+
setBill(cloneInitialBill(initialBill));
|
|
1773
|
+
setEvaluationType(initialEvaluationType(initialBill));
|
|
1659
1774
|
setSelectedIds(attachments.map((item) => item.id));
|
|
1660
1775
|
setRemovedSourceIds([]);
|
|
1661
1776
|
setUploads([]);
|
|
1777
|
+
setSourceAttachmentReportTypes(Object.fromEntries(attachments.flatMap((item) => item.reportTypeCode ? [[item.id, item.reportTypeCode]] : [])));
|
|
1662
1778
|
setErrors({});
|
|
1663
1779
|
setValidationActive(false);
|
|
1664
1780
|
setFormError(null);
|
|
@@ -1669,8 +1785,10 @@ function BillSubmissionForm({
|
|
|
1669
1785
|
diagnosisAppendPending.current = false;
|
|
1670
1786
|
}, [initialBill, attachments]);
|
|
1671
1787
|
useEffect2(() => {
|
|
1672
|
-
if (validationActive)
|
|
1673
|
-
|
|
1788
|
+
if (!validationActive) return;
|
|
1789
|
+
const next = validateBillSubmission(bill).fieldErrors;
|
|
1790
|
+
setErrors(missingAttachmentReportType ? { ...next, attachments: "Select a report type for every attachment." } : next);
|
|
1791
|
+
}, [bill, missingAttachmentReportType, validationActive]);
|
|
1674
1792
|
const addFiles = useCallback((fileList) => {
|
|
1675
1793
|
const files = Array.from(fileList);
|
|
1676
1794
|
if (!files.length) return;
|
|
@@ -1682,8 +1800,8 @@ function BillSubmissionForm({
|
|
|
1682
1800
|
const nextBytes = [...uploads.map((item) => item.file), ...files].reduce((sum, file) => sum + file.size, 0);
|
|
1683
1801
|
if (nextBytes > MAX_UPLOAD_BYTES) return setFormError("Attachments exceed the 100 MB upload limit.");
|
|
1684
1802
|
if (selectedIds.length + uploads.length + files.length > MAX_DOCUMENTS) return setFormError(`A bill can include at most ${MAX_DOCUMENTS} attachments.`);
|
|
1685
|
-
setUploads((current) => [...current, ...files.map((file) => ({ file, documentType: "other" }))]);
|
|
1686
|
-
}, [selectedIds.length, uploads]);
|
|
1803
|
+
setUploads((current) => [...current, ...files.map((file) => ({ file, documentType: "other", ...defaultAttachmentReportType ? { reportTypeCode: defaultAttachmentReportType } : {} }))]);
|
|
1804
|
+
}, [defaultAttachmentReportType, selectedIds.length, uploads]);
|
|
1687
1805
|
useEffect2(() => {
|
|
1688
1806
|
const over = (event) => {
|
|
1689
1807
|
if (event.dataTransfer?.types.includes("Files")) {
|
|
@@ -1724,16 +1842,41 @@ function BillSubmissionForm({
|
|
|
1724
1842
|
return next;
|
|
1725
1843
|
})) }));
|
|
1726
1844
|
const text = (value, onChange, options = {}) => /* @__PURE__ */ jsx3("input", { className: "mbsf-input", disabled: locked, value: value ?? "", onChange: (event) => onChange(event.target.value), ...options });
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
if (!search) {
|
|
1732
|
-
setPayerLoading(false);
|
|
1845
|
+
const runPayerSearch = useCallback(async (query, autoSelect) => {
|
|
1846
|
+
const trimmed = query.trim();
|
|
1847
|
+
if (trimmed.length < 2) {
|
|
1848
|
+
setPayerResults([]);
|
|
1733
1849
|
return;
|
|
1734
1850
|
}
|
|
1735
|
-
|
|
1851
|
+
const search = onSearchClaimsAdministrators ?? referenceClient?.searchClaimsAdministrators;
|
|
1852
|
+
if (!search) return;
|
|
1853
|
+
const request = ++payerRequest.current;
|
|
1854
|
+
setPayerLoading(true);
|
|
1855
|
+
try {
|
|
1856
|
+
const results = await search(trimmed, bill.claim.claimNumber);
|
|
1857
|
+
if (request !== payerRequest.current) return;
|
|
1858
|
+
setPayerResults(results);
|
|
1859
|
+
const exact = autoSelect ? exactClaimsAdministratorMatch(results, trimmed) : void 0;
|
|
1860
|
+
if (exact) setBill((current) => ({ ...current, claim: { ...current.claim, claimsAdministrator: { id: exact.id, name: exact.name } } }));
|
|
1861
|
+
} catch (caught) {
|
|
1862
|
+
if (request === payerRequest.current) setFormError(caught instanceof Error ? caught.message : "Claims administrator search is unavailable.");
|
|
1863
|
+
} finally {
|
|
1864
|
+
if (request === payerRequest.current) setPayerLoading(false);
|
|
1865
|
+
}
|
|
1866
|
+
}, [bill.claim.claimNumber, onSearchClaimsAdministrators, referenceClient]);
|
|
1867
|
+
const searchPayers = (query) => {
|
|
1868
|
+
setBill((current) => {
|
|
1869
|
+
const selected = current.claim.claimsAdministrator;
|
|
1870
|
+
if (selected?.id && selected.name === query) return current;
|
|
1871
|
+
return { ...current, claim: { ...current.claim, claimsAdministrator: { name: query } } };
|
|
1872
|
+
});
|
|
1873
|
+
void runPayerSearch(query, true);
|
|
1736
1874
|
};
|
|
1875
|
+
useEffect2(() => {
|
|
1876
|
+
const payer = bill.claim.claimsAdministrator;
|
|
1877
|
+
if (!payer?.name || payer.name.trim().length < 2) return;
|
|
1878
|
+
void runPayerSearch(payer.name, !payer.id);
|
|
1879
|
+
}, [bill.claim.claimsAdministrator?.id, bill.claim.claimsAdministrator?.name, bill.claim.claimNumber, runPayerSearch]);
|
|
1737
1880
|
const loadDiagnoses = (query, append = false) => {
|
|
1738
1881
|
const trimmed = query.trim();
|
|
1739
1882
|
const search = onSearchDiagnoses ?? referenceClient?.searchDiagnosisCodes;
|
|
@@ -1785,7 +1928,7 @@ function BillSubmissionForm({
|
|
|
1785
1928
|
};
|
|
1786
1929
|
const changeEvaluation = (type) => {
|
|
1787
1930
|
setEvaluationType(type);
|
|
1788
|
-
setBill((current) => ({ ...current, renderingProvider: { ...current.renderingProvider, isAme: type === "ame", isQme: type !== "ame", ...type === "psych_qme" && !current.renderingProvider?.specialty ? { specialty: "Psychiatry" } : {} }, serviceLines: applyBillSubmissionEvaluationModifiers(current.serviceLines, type) }));
|
|
1931
|
+
setBill((current) => ({ ...current, diagnoses: applyBillSubmissionEvaluationDiagnoses(current.diagnoses, type), renderingProvider: { ...current.renderingProvider, isAme: type === "ame", isQme: type !== "ame", ...type === "psych_qme" && !current.renderingProvider?.specialty ? { specialty: "Psychiatry" } : {} }, serviceLines: applyBillSubmissionEvaluationModifiers(current.serviceLines, type) }));
|
|
1789
1932
|
};
|
|
1790
1933
|
const lineCharge = (line) => calculateBillSubmissionAllowedAmount(line, procedures) ?? (Number.isFinite(line.charge) ? Number(line.charge) : void 0);
|
|
1791
1934
|
const total = submittedLines(bill.serviceLines).reduce((sum, line) => sum + (lineCharge(line) ?? 0), 0);
|
|
@@ -1795,12 +1938,13 @@ function BillSubmissionForm({
|
|
|
1795
1938
|
return charge == null ? line : { ...line, charge };
|
|
1796
1939
|
}) };
|
|
1797
1940
|
const validation = validateBillSubmission(clean);
|
|
1941
|
+
const fieldErrors = missingAttachmentReportType ? { ...validation.fieldErrors, attachments: "Select a report type for every attachment." } : validation.fieldErrors;
|
|
1798
1942
|
setValidationActive(true);
|
|
1799
|
-
setErrors(
|
|
1943
|
+
setErrors(fieldErrors);
|
|
1800
1944
|
setFormError(null);
|
|
1801
|
-
if (
|
|
1802
|
-
const count = Object.keys(
|
|
1803
|
-
const first = Object.values(
|
|
1945
|
+
if (Object.keys(fieldErrors).length) {
|
|
1946
|
+
const count = Object.keys(fieldErrors).length;
|
|
1947
|
+
const first = Object.values(fieldErrors)[0];
|
|
1804
1948
|
setFormError(`Fix ${count} highlighted field${count === 1 ? "" : "s"} before submitting. ${first}`);
|
|
1805
1949
|
window.requestAnimationFrame(() => {
|
|
1806
1950
|
if (formRef.current) focusFirstInvalid(formRef.current);
|
|
@@ -1811,13 +1955,15 @@ function BillSubmissionForm({
|
|
|
1811
1955
|
setSubmitting(true);
|
|
1812
1956
|
try {
|
|
1813
1957
|
if (onSubmit) {
|
|
1814
|
-
await onSubmit({ bill: clean, sourceAttachmentIds: selectedIds, uploads });
|
|
1958
|
+
await onSubmit({ bill: clean, sourceAttachmentIds: selectedIds, sourceAttachmentReportTypes, uploads });
|
|
1815
1959
|
} else {
|
|
1816
1960
|
if (!submissionClient) throw new Error("The connected billing client is unavailable.");
|
|
1817
1961
|
const documents = await prepareBillSubmissionDocuments({
|
|
1818
1962
|
attachments,
|
|
1819
1963
|
selectedIds,
|
|
1820
1964
|
uploads,
|
|
1965
|
+
reportTypeCodeByAttachmentId: sourceAttachmentReportTypes,
|
|
1966
|
+
...forcedAttachmentReportType ? { defaultReportTypeCode: forcedAttachmentReportType } : {},
|
|
1821
1967
|
...fetchOverride ? { fetch: fetchOverride } : {}
|
|
1822
1968
|
});
|
|
1823
1969
|
const result = await submissionClient.submitBill({ bill: clean, documents });
|
|
@@ -1829,7 +1975,10 @@ function BillSubmissionForm({
|
|
|
1829
1975
|
setSubmitting(false);
|
|
1830
1976
|
}
|
|
1831
1977
|
}
|
|
1832
|
-
const claimsAdministratorError = errors["claim.claimsAdministrator"]
|
|
1978
|
+
const claimsAdministratorError = errors["claim.claimsAdministrator"];
|
|
1979
|
+
const selectedPayer = payerResults.find((payer) => payer.id === bill.claim.claimsAdministrator?.id);
|
|
1980
|
+
const payerRecommendations = bill.claim.claimsAdministrator?.id ? [] : claimsAdministratorRecommendations(payerResults);
|
|
1981
|
+
const choosePayer = (payer) => setBill((current) => ({ ...current, claim: { ...current.claim, claimsAdministrator: { id: payer.id, name: payer.name } } }));
|
|
1833
1982
|
const headerSection = /* @__PURE__ */ jsxs3("div", { className: "mbsf-head", children: [
|
|
1834
1983
|
/* @__PURE__ */ jsxs3("div", { children: [
|
|
1835
1984
|
/* @__PURE__ */ jsx3("h3", { className: "mbsf-title", children: heading }),
|
|
@@ -1865,7 +2014,38 @@ function BillSubmissionForm({
|
|
|
1865
2014
|
/* @__PURE__ */ jsx3(Field2, { label: "Employer (optional)", children: text(bill.claim.employer, (employer) => setBill((c) => ({ ...c, claim: { ...c.claim, employer } }))) }),
|
|
1866
2015
|
/* @__PURE__ */ jsx3(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 } }))) }),
|
|
1867
2016
|
/* @__PURE__ */ jsx3(Field2, { label: "WCAB / ADJ number (optional)", children: text(bill.claim.adjNumber, (adjNumber) => setBill((c) => ({ ...c, claim: { ...c.claim, adjNumber } }))) }),
|
|
1868
|
-
/* @__PURE__ */
|
|
2017
|
+
/* @__PURE__ */ jsxs3(Field2, { path: "claim.claimsAdministrator", label: "Claims administrator", required: true, span: true, error: claimsAdministratorError, children: [
|
|
2018
|
+
/* @__PURE__ */ jsx3(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 }) }),
|
|
2019
|
+
selectedPayer ? /* @__PURE__ */ jsxs3("div", { className: "mbsf-payer-status", role: "status", children: [
|
|
2020
|
+
/* @__PURE__ */ jsx3("strong", { children: "\u2713 Routing match set:" }),
|
|
2021
|
+
" ",
|
|
2022
|
+
selectedPayer.name
|
|
2023
|
+
] }) : null,
|
|
2024
|
+
selectedPayer?.signals?.length ? /* @__PURE__ */ jsx3("div", { className: "mbsf-payer-signals", children: selectedPayer.signals.map((signal, index) => /* @__PURE__ */ jsxs3("span", { "data-state": signal.state, children: [
|
|
2025
|
+
signal.state === "match" ? "\u2713" : "!",
|
|
2026
|
+
" ",
|
|
2027
|
+
signal.label
|
|
2028
|
+
] }, `${signal.kind}-${index}`)) }) : null,
|
|
2029
|
+
!selectedPayer && payerRecommendations.length ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
2030
|
+
/* @__PURE__ */ jsxs3("p", { className: "mbsf-payer-intro", children: [
|
|
2031
|
+
"Confirm the best routing match for ",
|
|
2032
|
+
/* @__PURE__ */ jsx3("strong", { children: bill.claim.claimsAdministrator?.name }),
|
|
2033
|
+
":"
|
|
2034
|
+
] }),
|
|
2035
|
+
/* @__PURE__ */ jsx3("div", { className: "mbsf-payer-list", children: payerRecommendations.map((payer) => /* @__PURE__ */ jsxs3("div", { className: "mbsf-payer-option", children: [
|
|
2036
|
+
/* @__PURE__ */ jsxs3("div", { className: "mbsf-payer-option-main", children: [
|
|
2037
|
+
/* @__PURE__ */ jsx3("strong", { children: payer.name }),
|
|
2038
|
+
payer.signals?.length ? /* @__PURE__ */ jsx3("div", { className: "mbsf-payer-signals", children: payer.signals.map((signal, index) => /* @__PURE__ */ jsxs3("span", { "data-state": signal.state, children: [
|
|
2039
|
+
signal.state === "match" ? "\u2713" : "!",
|
|
2040
|
+
" ",
|
|
2041
|
+
signal.label
|
|
2042
|
+
] }, `${signal.kind}-${index}`)) }) : /* @__PURE__ */ jsx3("small", { className: "mbsf-help", children: "Directory match" })
|
|
2043
|
+
] }),
|
|
2044
|
+
/* @__PURE__ */ jsx3("button", { className: "mbsf-secondary", type: "button", onClick: () => choosePayer(payer), children: "Use" })
|
|
2045
|
+
] }, payer.id)) })
|
|
2046
|
+
] }) : null,
|
|
2047
|
+
!selectedPayer && !payerLoading && !payerRecommendations.length && (bill.claim.claimsAdministrator?.name.trim().length ?? 0) >= 2 ? /* @__PURE__ */ jsx3("small", { className: "mbsf-help", children: "No confident route selected yet. Search the directory and choose a claims administrator." }) : null
|
|
2048
|
+
] }),
|
|
1869
2049
|
/* @__PURE__ */ jsx3(Field2, { label: "Injury description (optional)", span: true, children: text(bill.claim.description, (description2) => setBill((c) => ({ ...c, claim: { ...c.claim, description: description2 } }))) }),
|
|
1870
2050
|
/* @__PURE__ */ jsxs3(Field2, { path: "diagnoses", label: "Diagnosis codes (ICD-10)", required: true, span: true, error: errors.diagnoses, children: [
|
|
1871
2051
|
/* @__PURE__ */ jsx3("div", { className: "mbsf-quick-picks", "aria-label": "Common diagnosis codes", children: BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS.map((option) => {
|
|
@@ -1951,12 +2131,13 @@ function BillSubmissionForm({
|
|
|
1951
2131
|
] }),
|
|
1952
2132
|
errors.serviceLines ? /* @__PURE__ */ jsx3("p", { className: "mbsf-error", role: "alert", children: errors.serviceLines }) : null
|
|
1953
2133
|
] });
|
|
1954
|
-
const attachmentsSection = /* @__PURE__ */ jsxs3("fieldset", { className: "mbsf-card", disabled: locked, children: [
|
|
2134
|
+
const attachmentsSection = /* @__PURE__ */ jsxs3("fieldset", { className: "mbsf-card", "data-field-path": "attachments", "data-invalid": Boolean(errors.attachments), disabled: locked, children: [
|
|
1955
2135
|
/* @__PURE__ */ jsx3("legend", { className: "mbsf-legend", children: "Attachments" }),
|
|
1956
2136
|
/* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-list", children: [
|
|
1957
2137
|
attachments.filter((attachment) => !removedSourceIds.includes(attachment.id)).map((attachment) => {
|
|
1958
2138
|
const auto = attachment.autoAttached || attachment.documentType === "w9";
|
|
1959
2139
|
const removable = !auto && attachment.removable !== false;
|
|
2140
|
+
const reportTypeCode = sourceAttachmentReportTypes[attachment.id] || attachment.reportTypeCode || defaultAttachmentReportType || "";
|
|
1960
2141
|
return /* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-row", "data-auto": auto, children: [
|
|
1961
2142
|
/* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-main", children: [
|
|
1962
2143
|
auto ? /* @__PURE__ */ jsx3("span", { "aria-label": "Always attached", role: "img", children: "\u2713" }) : null,
|
|
@@ -1966,6 +2147,7 @@ function BillSubmissionForm({
|
|
|
1966
2147
|
/* @__PURE__ */ jsx3("span", { className: "mbsf-help", style: { display: "block" }, children: attachment.description || (auto ? "Included automatically with every bill." : documentLabels[attachment.documentType]) })
|
|
1967
2148
|
] })
|
|
1968
2149
|
] }),
|
|
2150
|
+
showAttachmentReportTypes ? /* @__PURE__ */ jsx3("div", { className: "mbsf-attach-type", children: /* @__PURE__ */ jsx3(ComboBox, { ariaLabel: `Report type for ${attachment.fileName}`, invalid: !reportTypeCode, disabled: locked, preserveValueOnOpen: true, value: reportTypeCode, placeholder: "Select report type\u2026", options: reportTypeOptions, onSelect: (option) => setSourceAttachmentReportTypes((current) => ({ ...current, [attachment.id]: option.id })) }) }) : null,
|
|
1969
2151
|
/* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-actions", children: [
|
|
1970
2152
|
attachment.previewUrl ? /* @__PURE__ */ jsx3("a", { className: "mbsf-secondary", href: attachment.previewUrl, target: "_blank", rel: "noopener noreferrer", children: "Preview" }) : null,
|
|
1971
2153
|
removable ? /* @__PURE__ */ jsx3("button", { className: "mbsf-icon-btn", type: "button", "aria-label": `Remove ${attachment.fileName}`, disabled: locked, onClick: () => {
|
|
@@ -1975,20 +2157,25 @@ function BillSubmissionForm({
|
|
|
1975
2157
|
] })
|
|
1976
2158
|
] }, attachment.id);
|
|
1977
2159
|
}),
|
|
1978
|
-
uploads.map((upload, index) =>
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
/* @__PURE__ */
|
|
1982
|
-
(upload.file.
|
|
1983
|
-
"
|
|
2160
|
+
uploads.map((upload, index) => {
|
|
2161
|
+
const reportTypeCode = upload.reportTypeCode || defaultAttachmentReportType || "";
|
|
2162
|
+
return /* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-row", children: [
|
|
2163
|
+
/* @__PURE__ */ jsx3("div", { className: "mbsf-attach-main", children: /* @__PURE__ */ jsxs3("span", { className: "mbsf-file", children: [
|
|
2164
|
+
/* @__PURE__ */ jsx3("strong", { children: upload.file.name }),
|
|
2165
|
+
/* @__PURE__ */ jsxs3("span", { className: "mbsf-help", style: { display: "block" }, children: [
|
|
2166
|
+
(upload.file.size / 1024 / 1024).toFixed(1),
|
|
2167
|
+
" MB"
|
|
2168
|
+
] })
|
|
2169
|
+
] }) }),
|
|
2170
|
+
showAttachmentReportTypes ? /* @__PURE__ */ jsx3("div", { className: "mbsf-attach-type", children: /* @__PURE__ */ jsx3(ComboBox, { ariaLabel: `Report type for ${upload.file.name}`, invalid: !reportTypeCode, disabled: locked, preserveValueOnOpen: true, value: reportTypeCode, placeholder: "Select report type\u2026", options: reportTypeOptions, onSelect: (option) => setUploads((current) => current.map((item, itemIndex) => itemIndex === index ? { ...item, reportTypeCode: option.id } : item)) }) }) : null,
|
|
2171
|
+
/* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-actions", children: [
|
|
2172
|
+
/* @__PURE__ */ jsx3("button", { className: "mbsf-secondary", type: "button", onClick: () => previewUploadedPdf(upload.file), children: "Preview" }),
|
|
2173
|
+
/* @__PURE__ */ jsx3("button", { className: "mbsf-icon-btn", type: "button", "aria-label": `Remove ${upload.file.name}`, onClick: () => setUploads((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
|
|
1984
2174
|
] })
|
|
1985
|
-
] }
|
|
1986
|
-
|
|
1987
|
-
/* @__PURE__ */ jsx3("button", { className: "mbsf-secondary", type: "button", onClick: () => previewUploadedPdf(upload.file), children: "Preview" }),
|
|
1988
|
-
/* @__PURE__ */ jsx3("button", { className: "mbsf-icon-btn", type: "button", "aria-label": `Remove ${upload.file.name}`, onClick: () => setUploads((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
|
|
1989
|
-
] })
|
|
1990
|
-
] }, `${upload.file.name}-${index}`))
|
|
2175
|
+
] }, `${upload.file.name}-${index}`);
|
|
2176
|
+
})
|
|
1991
2177
|
] }),
|
|
2178
|
+
errors.attachments ? /* @__PURE__ */ jsx3("p", { className: "mbsf-error", role: "alert", children: errors.attachments }) : null,
|
|
1992
2179
|
/* @__PURE__ */ jsx3("input", { ref: fileInput, hidden: true, type: "file", accept: "application/pdf,.pdf", multiple: true, onChange: (event) => {
|
|
1993
2180
|
if (event.target.files) addFiles(event.target.files);
|
|
1994
2181
|
event.target.value = "";
|
|
@@ -3240,6 +3427,7 @@ function MindBillBillReview(props) {
|
|
|
3240
3427
|
export {
|
|
3241
3428
|
BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS,
|
|
3242
3429
|
BILL_SUBMISSION_DOCUMENT_TYPES,
|
|
3430
|
+
BILL_SUBMISSION_REPORT_TYPES,
|
|
3243
3431
|
BILL_SUBMISSION_REQUIRED_FIELDS,
|
|
3244
3432
|
BillActivityTimeline,
|
|
3245
3433
|
BillAgingSummary,
|
|
@@ -3267,8 +3455,11 @@ export {
|
|
|
3267
3455
|
ConnectedBillStatus,
|
|
3268
3456
|
DEFAULT_BILL_SUBMISSION_MODIFIERS,
|
|
3269
3457
|
DEFAULT_BILL_SUBMISSION_PROCEDURES,
|
|
3458
|
+
MED_LEGAL_REPORT_TYPE_CODE,
|
|
3270
3459
|
MindBillBillReview,
|
|
3271
3460
|
MindBillBillTimeline,
|
|
3461
|
+
PSYCH_QME_DEFAULT_DIAGNOSIS,
|
|
3462
|
+
applyBillSubmissionEvaluationDiagnoses,
|
|
3272
3463
|
applyBillSubmissionEvaluationModifiers,
|
|
3273
3464
|
billActivityEventLabel,
|
|
3274
3465
|
billAgingBucket,
|
|
@@ -3279,13 +3470,16 @@ export {
|
|
|
3279
3470
|
buildBillingReportCsv,
|
|
3280
3471
|
buildBillingReportRows,
|
|
3281
3472
|
calculateBillSubmissionAllowedAmount,
|
|
3473
|
+
claimsAdministratorRecommendations,
|
|
3282
3474
|
createBillLifecycleClient2 as createBillLifecycleClient,
|
|
3283
3475
|
createBillStatusClient,
|
|
3284
3476
|
ensureTrailingBillSubmissionLine,
|
|
3285
3477
|
ensureTrailingProcedureLine,
|
|
3478
|
+
exactClaimsAdministratorMatch,
|
|
3286
3479
|
formatBillSubmissionDate,
|
|
3287
3480
|
mindBillAppearanceStyle,
|
|
3288
3481
|
mindBillThemePresets,
|
|
3482
|
+
normalizeClaimsAdministratorName,
|
|
3289
3483
|
parseBillSubmissionDate,
|
|
3290
3484
|
prepareBillSubmissionDocuments,
|
|
3291
3485
|
resolveMindBillAppearance,
|