@mindbill/react 0.23.2 → 0.25.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 +4 -2
- package/dist/index.d.ts +55 -5
- package/dist/index.js +299 -54
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1294,6 +1294,79 @@ var BILL_SUBMISSION_DOCUMENT_TYPES = [
|
|
|
1294
1294
|
"appeal",
|
|
1295
1295
|
"other"
|
|
1296
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
|
+
];
|
|
1297
1370
|
var BILL_SUBMISSION_REQUIRED_FIELDS = [
|
|
1298
1371
|
"patient.firstName",
|
|
1299
1372
|
"patient.lastName",
|
|
@@ -1303,8 +1376,26 @@ var BILL_SUBMISSION_REQUIRED_FIELDS = [
|
|
|
1303
1376
|
"patient.address.state",
|
|
1304
1377
|
"patient.address.postalCode",
|
|
1305
1378
|
"claim.claimNumber",
|
|
1379
|
+
"claim.employer",
|
|
1380
|
+
"claim.dateOfInjury",
|
|
1306
1381
|
"claim.claimsAdministrator",
|
|
1307
1382
|
"service.date",
|
|
1383
|
+
"billingProvider.name",
|
|
1384
|
+
"billingProvider.taxId",
|
|
1385
|
+
"billingProvider.npi",
|
|
1386
|
+
"billingProvider.phone",
|
|
1387
|
+
"billingProvider.address.line1",
|
|
1388
|
+
"billingProvider.address.city",
|
|
1389
|
+
"billingProvider.address.state",
|
|
1390
|
+
"billingProvider.address.postalCode",
|
|
1391
|
+
"renderingProvider.name",
|
|
1392
|
+
"renderingProvider.npi",
|
|
1393
|
+
"renderingProvider.taxonomy",
|
|
1394
|
+
"serviceLocation.placeOfServiceCode",
|
|
1395
|
+
"serviceLocation.address.line1",
|
|
1396
|
+
"serviceLocation.address.city",
|
|
1397
|
+
"serviceLocation.address.state",
|
|
1398
|
+
"serviceLocation.address.postalCode",
|
|
1308
1399
|
"diagnoses[]",
|
|
1309
1400
|
"serviceLines[].code",
|
|
1310
1401
|
"serviceLines[].units"
|
|
@@ -1344,6 +1435,8 @@ async function prepareBillSubmissionDocuments({
|
|
|
1344
1435
|
attachments,
|
|
1345
1436
|
selectedIds,
|
|
1346
1437
|
uploads,
|
|
1438
|
+
reportTypeCodeByAttachmentId = {},
|
|
1439
|
+
defaultReportTypeCode,
|
|
1347
1440
|
fetch: fetchOverride
|
|
1348
1441
|
}) {
|
|
1349
1442
|
const fetcher = fetchOverride ?? globalThis.fetch;
|
|
@@ -1357,12 +1450,14 @@ async function prepareBillSubmissionDocuments({
|
|
|
1357
1450
|
externalId: attachment.id,
|
|
1358
1451
|
filename: attachment.fileName,
|
|
1359
1452
|
documentType: attachment.documentType,
|
|
1453
|
+
...reportTypeCodeByAttachmentId[attachment.id] || attachment.reportTypeCode || defaultReportTypeCode ? { reportTypeCode: reportTypeCodeByAttachmentId[attachment.id] || attachment.reportTypeCode || defaultReportTypeCode } : {},
|
|
1360
1454
|
...attachment.description ? { description: attachment.description } : {}
|
|
1361
1455
|
});
|
|
1362
1456
|
}));
|
|
1363
|
-
const uploadedDocuments = await Promise.all(uploads.map(({ file, documentType, description }) => pdfDocument(file, {
|
|
1457
|
+
const uploadedDocuments = await Promise.all(uploads.map(({ file, documentType, description, reportTypeCode }) => pdfDocument(file, {
|
|
1364
1458
|
filename: file.name,
|
|
1365
1459
|
documentType,
|
|
1460
|
+
...reportTypeCode || defaultReportTypeCode ? { reportTypeCode: reportTypeCode || defaultReportTypeCode } : {},
|
|
1366
1461
|
...description ? { description } : {}
|
|
1367
1462
|
})));
|
|
1368
1463
|
return [...sourceDocuments, ...uploadedDocuments];
|
|
@@ -1460,8 +1555,26 @@ function validateBillSubmission(bill) {
|
|
|
1460
1555
|
required("patient.address.state", bill.patient.address.state, "Enter the patient's 2-letter state code.");
|
|
1461
1556
|
required("patient.address.postalCode", bill.patient.address.postalCode, "Enter the patient's ZIP code.");
|
|
1462
1557
|
required("claim.claimNumber", bill.claim.claimNumber, "Enter the claim number.");
|
|
1558
|
+
required("claim.employer", bill.claim.employer, "Enter the employer name.");
|
|
1559
|
+
required("claim.dateOfInjury", bill.claim.dateOfInjury, "Enter the date of injury.");
|
|
1463
1560
|
required("claim.claimsAdministrator", bill.claim.claimsAdministrator?.name, "Select a claims administrator so MindBill can route this bill.");
|
|
1464
1561
|
required("service.date", bill.service.date, "Enter the date of service.");
|
|
1562
|
+
required("billingProvider.name", bill.billingProvider?.name, "Enter the billing provider name.");
|
|
1563
|
+
required("billingProvider.taxId", bill.billingProvider?.taxId, "Enter the billing provider Tax ID (EIN or SSN).");
|
|
1564
|
+
required("billingProvider.npi", bill.billingProvider?.npi, "Enter the billing provider NPI.");
|
|
1565
|
+
required("billingProvider.phone", bill.billingProvider?.phone, "Enter the billing provider phone number.");
|
|
1566
|
+
required("billingProvider.address.line1", bill.billingProvider?.address?.line1, "Enter the billing provider street address.");
|
|
1567
|
+
required("billingProvider.address.city", bill.billingProvider?.address?.city, "Enter the billing provider city.");
|
|
1568
|
+
required("billingProvider.address.state", bill.billingProvider?.address?.state, "Enter the billing provider 2-letter state code.");
|
|
1569
|
+
required("billingProvider.address.postalCode", bill.billingProvider?.address?.postalCode, "Enter the billing provider ZIP code.");
|
|
1570
|
+
required("renderingProvider.name", bill.renderingProvider?.name, "Enter the rendering provider name.");
|
|
1571
|
+
required("renderingProvider.npi", bill.renderingProvider?.npi, "Enter the rendering provider NPI.");
|
|
1572
|
+
required("renderingProvider.taxonomy", bill.renderingProvider?.taxonomy, "Enter the rendering provider taxonomy code.");
|
|
1573
|
+
required("serviceLocation.placeOfServiceCode", bill.serviceLocation?.placeOfServiceCode, "Enter the 2-digit place of service code.");
|
|
1574
|
+
required("serviceLocation.address.line1", bill.serviceLocation?.address?.line1, "Enter the service facility street address.");
|
|
1575
|
+
required("serviceLocation.address.city", bill.serviceLocation?.address?.city, "Enter the service facility city.");
|
|
1576
|
+
required("serviceLocation.address.state", bill.serviceLocation?.address?.state, "Enter the service facility 2-letter state code.");
|
|
1577
|
+
required("serviceLocation.address.postalCode", bill.serviceLocation?.address?.postalCode, "Enter the service facility ZIP code.");
|
|
1465
1578
|
if (!(bill.diagnoses ?? []).some((code) => code.trim())) {
|
|
1466
1579
|
errors.diagnoses = "Select at least one ICD-10 diagnosis code.";
|
|
1467
1580
|
}
|
|
@@ -1469,7 +1582,16 @@ function validateBillSubmission(bill) {
|
|
|
1469
1582
|
errors["claim.claimsAdministrator"] = "Select a claims administrator from the payer directory.";
|
|
1470
1583
|
}
|
|
1471
1584
|
if (bill.patient.dateOfBirth && !parseBillSubmissionDate(bill.patient.dateOfBirth)) errors["patient.dateOfBirth"] = "Use MM/DD/YYYY";
|
|
1585
|
+
if (bill.claim.dateOfInjury && !parseBillSubmissionDate(bill.claim.dateOfInjury)) errors["claim.dateOfInjury"] = "Use MM/DD/YYYY";
|
|
1472
1586
|
if (bill.patient.address.state.trim().length !== 2) errors["patient.address.state"] = "Use a 2-letter state code";
|
|
1587
|
+
if (bill.billingProvider?.address?.state && bill.billingProvider.address.state.trim().length !== 2) errors["billingProvider.address.state"] = "Use a 2-letter state code.";
|
|
1588
|
+
if (bill.serviceLocation?.address?.state && bill.serviceLocation.address.state.trim().length !== 2) errors["serviceLocation.address.state"] = "Use a 2-letter state code.";
|
|
1589
|
+
const digits = (value) => value?.replace(/\D/g, "") ?? "";
|
|
1590
|
+
if (bill.billingProvider?.taxId && digits(bill.billingProvider.taxId).length !== 9) errors["billingProvider.taxId"] = "Enter a valid 9-digit EIN or SSN.";
|
|
1591
|
+
if (bill.billingProvider?.npi && !/^\d{10}$/.test(digits(bill.billingProvider.npi))) errors["billingProvider.npi"] = "Enter a valid 10-digit NPI.";
|
|
1592
|
+
if (bill.renderingProvider?.npi && !/^\d{10}$/.test(digits(bill.renderingProvider.npi))) errors["renderingProvider.npi"] = "Enter a valid 10-digit NPI.";
|
|
1593
|
+
if (bill.renderingProvider?.taxonomy && !/^[A-Za-z0-9]{10}$/.test(bill.renderingProvider.taxonomy.trim())) errors["renderingProvider.taxonomy"] = "Enter a valid 10-character taxonomy code.";
|
|
1594
|
+
if (bill.serviceLocation?.placeOfServiceCode && !/^\d{2}$/.test(bill.serviceLocation.placeOfServiceCode.trim())) errors["serviceLocation.placeOfServiceCode"] = "Enter a valid 2-digit place of service code.";
|
|
1473
1595
|
const lines = submittedLines(bill.serviceLines);
|
|
1474
1596
|
if (!lines.length) errors.serviceLines = "Add at least one service line";
|
|
1475
1597
|
lines.forEach((line, index) => {
|
|
@@ -1482,13 +1604,14 @@ function validateBillSubmission(bill) {
|
|
|
1482
1604
|
var css = `
|
|
1483
1605
|
.mbsf{display:grid;gap:20px;color:var(--mb-text);font-family:var(--mb-font);font-size:15px}.mbsf *{box-sizing:border-box}
|
|
1484
1606
|
.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)}
|
|
1485
|
-
.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)}
|
|
1607
|
+
.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-subhead{grid-column:1/-1;margin:6px 0 -2px;padding-top:14px;border-top:1px solid var(--mb-border);font-size:15px;font-weight:780;letter-spacing:.01em}.mbsf-subhead:first-child{margin-top:0;padding-top:0;border-top:0}.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)}
|
|
1486
1608
|
.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}
|
|
1609
|
+
.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}
|
|
1487
1610
|
.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)}
|
|
1488
1611
|
.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)}
|
|
1489
1612
|
.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}
|
|
1490
|
-
.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}
|
|
1491
|
-
@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%}}
|
|
1613
|
+
.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}
|
|
1614
|
+
@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%}}
|
|
1492
1615
|
`;
|
|
1493
1616
|
function RequiredMark() {
|
|
1494
1617
|
return /* @__PURE__ */ jsx3("span", { className: "mbsf-star", children: " *" });
|
|
@@ -1522,7 +1645,7 @@ function TextDateInput({ value, onChange, disabled, required, ariaLabel }) {
|
|
|
1522
1645
|
invalid ? /* @__PURE__ */ jsx3("small", { className: "mbsf-error", children: "Use MM/DD/YYYY" }) : null
|
|
1523
1646
|
] });
|
|
1524
1647
|
}
|
|
1525
|
-
function ComboBox({ value, placeholder, options, disabled, loading, loadingMore, invalid, onOpen, onQuery, onEndReached, onSelect, createOption, ariaLabel }) {
|
|
1648
|
+
function ComboBox({ value, placeholder, options, disabled, loading, loadingMore, invalid, preserveValueOnOpen = false, onOpen, onQuery, onEndReached, onSelect, createOption, ariaLabel }) {
|
|
1526
1649
|
const [open, setOpen] = useState2(false);
|
|
1527
1650
|
const [query, setQuery] = useState2("");
|
|
1528
1651
|
const visible = useMemo2(() => {
|
|
@@ -1534,9 +1657,11 @@ function ComboBox({ value, placeholder, options, disabled, loading, loadingMore,
|
|
|
1534
1657
|
const showMenu = open && (loading || visible.length > 0 || query.trim().length >= 2);
|
|
1535
1658
|
return /* @__PURE__ */ jsxs3("div", { className: "mbsf-combo", children: [
|
|
1536
1659
|
/* @__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: () => {
|
|
1660
|
+
const next = preserveValueOnOpen ? value : "";
|
|
1537
1661
|
setOpen(true);
|
|
1538
|
-
setQuery(
|
|
1662
|
+
setQuery(next);
|
|
1539
1663
|
onOpen?.();
|
|
1664
|
+
if (next) onQuery?.(next);
|
|
1540
1665
|
}, onChange: (event) => {
|
|
1541
1666
|
setOpen(true);
|
|
1542
1667
|
setQuery(event.target.value);
|
|
@@ -1546,7 +1671,7 @@ function ComboBox({ value, placeholder, options, disabled, loading, loadingMore,
|
|
|
1546
1671
|
const menu = event.currentTarget;
|
|
1547
1672
|
if (menu.scrollHeight - menu.scrollTop - menu.clientHeight < 120) onEndReached?.();
|
|
1548
1673
|
}, children: [
|
|
1549
|
-
loading && !visible.length ? /* @__PURE__ */ jsx3("div", { className: "mbsf-menu-status", children: "Loading
|
|
1674
|
+
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: () => {
|
|
1550
1675
|
onSelect(option);
|
|
1551
1676
|
setOpen(false);
|
|
1552
1677
|
setQuery("");
|
|
@@ -1590,6 +1715,16 @@ function mergeOptions(defaults, supplied) {
|
|
|
1590
1715
|
function mergeDiagnosisOptions(options) {
|
|
1591
1716
|
return [...new Map(options.map((item) => [item.code.toUpperCase(), item])).values()].sort((left, right) => left.code.localeCompare(right.code, void 0, { numeric: true }));
|
|
1592
1717
|
}
|
|
1718
|
+
function normalizeClaimsAdministratorName(value) {
|
|
1719
|
+
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, " ");
|
|
1720
|
+
}
|
|
1721
|
+
function exactClaimsAdministratorMatch(results, suppliedName) {
|
|
1722
|
+
const normalized = normalizeClaimsAdministratorName(suppliedName);
|
|
1723
|
+
return results.find((payer) => normalizeClaimsAdministratorName(payer.name) === normalized) ?? results.find((payer) => payer.confidence === "high" && payer.recommended);
|
|
1724
|
+
}
|
|
1725
|
+
function claimsAdministratorRecommendations(results, limit = 5) {
|
|
1726
|
+
return [...results].sort((left, right) => Number(Boolean(right.recommended)) - Number(Boolean(left.recommended))).slice(0, Math.max(0, limit));
|
|
1727
|
+
}
|
|
1593
1728
|
var BillSubmissionSectionsContext = createContext(null);
|
|
1594
1729
|
function BillSubmissionSection({ id }) {
|
|
1595
1730
|
const sections = useContext(BillSubmissionSectionsContext);
|
|
@@ -1632,6 +1767,9 @@ function BillSubmissionForm({
|
|
|
1632
1767
|
onLookupPostalCode,
|
|
1633
1768
|
procedureOptions,
|
|
1634
1769
|
modifierOptions,
|
|
1770
|
+
attachmentReportTypeMode = "auto",
|
|
1771
|
+
attachmentReportTypes = BILL_SUBMISSION_REPORT_TYPES,
|
|
1772
|
+
defaultAttachmentReportType,
|
|
1635
1773
|
appearance,
|
|
1636
1774
|
className = "bill-submission-form",
|
|
1637
1775
|
style,
|
|
@@ -1646,6 +1784,7 @@ function BillSubmissionForm({
|
|
|
1646
1784
|
const [removedSourceIds, setRemovedSourceIds] = useState2([]);
|
|
1647
1785
|
const [uploads, setUploads] = useState2([]);
|
|
1648
1786
|
const [errors, setErrors] = useState2({});
|
|
1787
|
+
const [sourceAttachmentReportTypes, setSourceAttachmentReportTypes] = useState2(() => Object.fromEntries(attachments.flatMap((item) => item.reportTypeCode ? [[item.id, item.reportTypeCode]] : [])));
|
|
1649
1788
|
const [validationActive, setValidationActive] = useState2(false);
|
|
1650
1789
|
const [formError, setFormError] = useState2(null);
|
|
1651
1790
|
const [submitting, setSubmitting] = useState2(false);
|
|
@@ -1662,6 +1801,7 @@ function BillSubmissionForm({
|
|
|
1662
1801
|
const fileInput = useRef2(null);
|
|
1663
1802
|
const diagnosisRequest = useRef2(0);
|
|
1664
1803
|
const diagnosisAppendPending = useRef2(false);
|
|
1804
|
+
const payerRequest = useRef2(0);
|
|
1665
1805
|
const procedures = useMemo2(() => mergeOptions(DEFAULT_BILL_SUBMISSION_PROCEDURES, procedureOptions), [procedureOptions]);
|
|
1666
1806
|
const modifiers = useMemo2(() => mergeOptions(DEFAULT_BILL_SUBMISSION_MODIFIERS, modifierOptions), [modifierOptions]);
|
|
1667
1807
|
const [evaluationType, setEvaluationType] = useState2(() => initialEvaluationType(initialBill));
|
|
@@ -1669,12 +1809,17 @@ function BillSubmissionForm({
|
|
|
1669
1809
|
const referenceClient = useMemo2(() => getSession || sessionEndpoint || connected ? createBillReferenceClient({ getSession, sessionEndpoint, apiBaseUrl, fetch: fetchOverride }) : null, [getSession, sessionEndpoint, apiBaseUrl, fetchOverride, connected]);
|
|
1670
1810
|
const submissionClient = useMemo2(() => connected ? createBillSubmissionClient({ getSession, sessionEndpoint, apiBaseUrl, fetch: fetchOverride }) : null, [getSession, sessionEndpoint, apiBaseUrl, fetchOverride, connected]);
|
|
1671
1811
|
const locked = disabled || submitting;
|
|
1812
|
+
const showAttachmentReportTypes = attachmentReportTypeMode === "visible" || attachmentReportTypeMode === "auto" && bill.billingMode !== "med_legal";
|
|
1813
|
+
const forcedAttachmentReportType = showAttachmentReportTypes ? void 0 : defaultAttachmentReportType ?? MED_LEGAL_REPORT_TYPE_CODE;
|
|
1814
|
+
const reportTypeOptions = useMemo2(() => attachmentReportTypes.map((item) => ({ id: item.code, label: item.code.replace(/^OZ:/, ""), detail: item.label })), [attachmentReportTypes]);
|
|
1815
|
+
const missingAttachmentReportType = showAttachmentReportTypes && (selectedIds.some((id) => !(sourceAttachmentReportTypes[id] || attachments.find((item) => item.id === id)?.reportTypeCode || defaultAttachmentReportType)) || uploads.some((upload) => !(upload.reportTypeCode || defaultAttachmentReportType)));
|
|
1672
1816
|
useEffect2(() => {
|
|
1673
1817
|
setBill(cloneInitialBill(initialBill));
|
|
1674
1818
|
setEvaluationType(initialEvaluationType(initialBill));
|
|
1675
1819
|
setSelectedIds(attachments.map((item) => item.id));
|
|
1676
1820
|
setRemovedSourceIds([]);
|
|
1677
1821
|
setUploads([]);
|
|
1822
|
+
setSourceAttachmentReportTypes(Object.fromEntries(attachments.flatMap((item) => item.reportTypeCode ? [[item.id, item.reportTypeCode]] : [])));
|
|
1678
1823
|
setErrors({});
|
|
1679
1824
|
setValidationActive(false);
|
|
1680
1825
|
setFormError(null);
|
|
@@ -1685,8 +1830,10 @@ function BillSubmissionForm({
|
|
|
1685
1830
|
diagnosisAppendPending.current = false;
|
|
1686
1831
|
}, [initialBill, attachments]);
|
|
1687
1832
|
useEffect2(() => {
|
|
1688
|
-
if (validationActive)
|
|
1689
|
-
|
|
1833
|
+
if (!validationActive) return;
|
|
1834
|
+
const next = validateBillSubmission(bill).fieldErrors;
|
|
1835
|
+
setErrors(missingAttachmentReportType ? { ...next, attachments: "Select a report type for every attachment." } : next);
|
|
1836
|
+
}, [bill, missingAttachmentReportType, validationActive]);
|
|
1690
1837
|
const addFiles = useCallback((fileList) => {
|
|
1691
1838
|
const files = Array.from(fileList);
|
|
1692
1839
|
if (!files.length) return;
|
|
@@ -1698,8 +1845,8 @@ function BillSubmissionForm({
|
|
|
1698
1845
|
const nextBytes = [...uploads.map((item) => item.file), ...files].reduce((sum, file) => sum + file.size, 0);
|
|
1699
1846
|
if (nextBytes > MAX_UPLOAD_BYTES) return setFormError("Attachments exceed the 100 MB upload limit.");
|
|
1700
1847
|
if (selectedIds.length + uploads.length + files.length > MAX_DOCUMENTS) return setFormError(`A bill can include at most ${MAX_DOCUMENTS} attachments.`);
|
|
1701
|
-
setUploads((current) => [...current, ...files.map((file) => ({ file, documentType: "other" }))]);
|
|
1702
|
-
}, [selectedIds.length, uploads]);
|
|
1848
|
+
setUploads((current) => [...current, ...files.map((file) => ({ file, documentType: "other", ...defaultAttachmentReportType ? { reportTypeCode: defaultAttachmentReportType } : {} }))]);
|
|
1849
|
+
}, [defaultAttachmentReportType, selectedIds.length, uploads]);
|
|
1703
1850
|
useEffect2(() => {
|
|
1704
1851
|
const over = (event) => {
|
|
1705
1852
|
if (event.dataTransfer?.types.includes("Files")) {
|
|
@@ -1740,16 +1887,41 @@ function BillSubmissionForm({
|
|
|
1740
1887
|
return next;
|
|
1741
1888
|
})) }));
|
|
1742
1889
|
const text = (value, onChange, options = {}) => /* @__PURE__ */ jsx3("input", { className: "mbsf-input", disabled: locked, value: value ?? "", onChange: (event) => onChange(event.target.value), ...options });
|
|
1743
|
-
const
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
if (!search) {
|
|
1748
|
-
setPayerLoading(false);
|
|
1890
|
+
const runPayerSearch = useCallback(async (query, autoSelect) => {
|
|
1891
|
+
const trimmed = query.trim();
|
|
1892
|
+
if (trimmed.length < 2) {
|
|
1893
|
+
setPayerResults([]);
|
|
1749
1894
|
return;
|
|
1750
1895
|
}
|
|
1751
|
-
|
|
1896
|
+
const search = onSearchClaimsAdministrators ?? referenceClient?.searchClaimsAdministrators;
|
|
1897
|
+
if (!search) return;
|
|
1898
|
+
const request = ++payerRequest.current;
|
|
1899
|
+
setPayerLoading(true);
|
|
1900
|
+
try {
|
|
1901
|
+
const results = await search(trimmed, bill.claim.claimNumber);
|
|
1902
|
+
if (request !== payerRequest.current) return;
|
|
1903
|
+
setPayerResults(results);
|
|
1904
|
+
const exact = autoSelect ? exactClaimsAdministratorMatch(results, trimmed) : void 0;
|
|
1905
|
+
if (exact) setBill((current) => ({ ...current, claim: { ...current.claim, claimsAdministrator: { id: exact.id, name: exact.name } } }));
|
|
1906
|
+
} catch (caught) {
|
|
1907
|
+
if (request === payerRequest.current) setFormError(caught instanceof Error ? caught.message : "Claims administrator search is unavailable.");
|
|
1908
|
+
} finally {
|
|
1909
|
+
if (request === payerRequest.current) setPayerLoading(false);
|
|
1910
|
+
}
|
|
1911
|
+
}, [bill.claim.claimNumber, onSearchClaimsAdministrators, referenceClient]);
|
|
1912
|
+
const searchPayers = (query) => {
|
|
1913
|
+
setBill((current) => {
|
|
1914
|
+
const selected = current.claim.claimsAdministrator;
|
|
1915
|
+
if (selected?.id && selected.name === query) return current;
|
|
1916
|
+
return { ...current, claim: { ...current.claim, claimsAdministrator: { name: query } } };
|
|
1917
|
+
});
|
|
1918
|
+
void runPayerSearch(query, true);
|
|
1752
1919
|
};
|
|
1920
|
+
useEffect2(() => {
|
|
1921
|
+
const payer = bill.claim.claimsAdministrator;
|
|
1922
|
+
if (!payer?.name || payer.name.trim().length < 2) return;
|
|
1923
|
+
void runPayerSearch(payer.name, !payer.id);
|
|
1924
|
+
}, [bill.claim.claimsAdministrator?.id, bill.claim.claimsAdministrator?.name, bill.claim.claimNumber, runPayerSearch]);
|
|
1753
1925
|
const loadDiagnoses = (query, append = false) => {
|
|
1754
1926
|
const trimmed = query.trim();
|
|
1755
1927
|
const search = onSearchDiagnoses ?? referenceClient?.searchDiagnosisCodes;
|
|
@@ -1811,12 +1983,13 @@ function BillSubmissionForm({
|
|
|
1811
1983
|
return charge == null ? line : { ...line, charge };
|
|
1812
1984
|
}) };
|
|
1813
1985
|
const validation = validateBillSubmission(clean);
|
|
1986
|
+
const fieldErrors = missingAttachmentReportType ? { ...validation.fieldErrors, attachments: "Select a report type for every attachment." } : validation.fieldErrors;
|
|
1814
1987
|
setValidationActive(true);
|
|
1815
|
-
setErrors(
|
|
1988
|
+
setErrors(fieldErrors);
|
|
1816
1989
|
setFormError(null);
|
|
1817
|
-
if (
|
|
1818
|
-
const count = Object.keys(
|
|
1819
|
-
const first = Object.values(
|
|
1990
|
+
if (Object.keys(fieldErrors).length) {
|
|
1991
|
+
const count = Object.keys(fieldErrors).length;
|
|
1992
|
+
const first = Object.values(fieldErrors)[0];
|
|
1820
1993
|
setFormError(`Fix ${count} highlighted field${count === 1 ? "" : "s"} before submitting. ${first}`);
|
|
1821
1994
|
window.requestAnimationFrame(() => {
|
|
1822
1995
|
if (formRef.current) focusFirstInvalid(formRef.current);
|
|
@@ -1824,19 +1997,22 @@ function BillSubmissionForm({
|
|
|
1824
1997
|
return;
|
|
1825
1998
|
}
|
|
1826
1999
|
if (selectedIds.length + uploads.length > MAX_DOCUMENTS) return setFormError(`A bill can include at most ${MAX_DOCUMENTS} attachments.`);
|
|
2000
|
+
const complete = clean;
|
|
1827
2001
|
setSubmitting(true);
|
|
1828
2002
|
try {
|
|
1829
2003
|
if (onSubmit) {
|
|
1830
|
-
await onSubmit({ bill:
|
|
2004
|
+
await onSubmit({ bill: complete, sourceAttachmentIds: selectedIds, sourceAttachmentReportTypes, uploads });
|
|
1831
2005
|
} else {
|
|
1832
2006
|
if (!submissionClient) throw new Error("The connected billing client is unavailable.");
|
|
1833
2007
|
const documents = await prepareBillSubmissionDocuments({
|
|
1834
2008
|
attachments,
|
|
1835
2009
|
selectedIds,
|
|
1836
2010
|
uploads,
|
|
2011
|
+
reportTypeCodeByAttachmentId: sourceAttachmentReportTypes,
|
|
2012
|
+
...forcedAttachmentReportType ? { defaultReportTypeCode: forcedAttachmentReportType } : {},
|
|
1837
2013
|
...fetchOverride ? { fetch: fetchOverride } : {}
|
|
1838
2014
|
});
|
|
1839
|
-
const result = await submissionClient.submitBill({ bill:
|
|
2015
|
+
const result = await submissionClient.submitBill({ bill: complete, documents });
|
|
1840
2016
|
await onSubmitted?.(result);
|
|
1841
2017
|
}
|
|
1842
2018
|
} catch (caught) {
|
|
@@ -1845,7 +2021,10 @@ function BillSubmissionForm({
|
|
|
1845
2021
|
setSubmitting(false);
|
|
1846
2022
|
}
|
|
1847
2023
|
}
|
|
1848
|
-
const claimsAdministratorError = errors["claim.claimsAdministrator"]
|
|
2024
|
+
const claimsAdministratorError = errors["claim.claimsAdministrator"];
|
|
2025
|
+
const selectedPayer = payerResults.find((payer) => payer.id === bill.claim.claimsAdministrator?.id);
|
|
2026
|
+
const payerRecommendations = bill.claim.claimsAdministrator?.id ? [] : claimsAdministratorRecommendations(payerResults);
|
|
2027
|
+
const choosePayer = (payer) => setBill((current) => ({ ...current, claim: { ...current.claim, claimsAdministrator: { id: payer.id, name: payer.name } } }));
|
|
1849
2028
|
const headerSection = /* @__PURE__ */ jsxs3("div", { className: "mbsf-head", children: [
|
|
1850
2029
|
/* @__PURE__ */ jsxs3("div", { children: [
|
|
1851
2030
|
/* @__PURE__ */ jsx3("h3", { className: "mbsf-title", children: heading }),
|
|
@@ -1877,11 +2056,42 @@ function BillSubmissionForm({
|
|
|
1877
2056
|
/* @__PURE__ */ jsx3("legend", { className: "mbsf-legend", children: "Injury & claim" }),
|
|
1878
2057
|
/* @__PURE__ */ jsxs3("div", { className: "mbsf-grid", children: [
|
|
1879
2058
|
/* @__PURE__ */ jsx3(Field2, { path: "service.date", label: "Date of service", required: true, error: errors["service.date"], children: /* @__PURE__ */ jsx3(TextDateInput, { ariaLabel: "Date of service", value: bill.service.date, disabled: locked, required: true, onChange: (date2) => setBill((c) => ({ ...c, service: { ...c.service, date: date2 } })) }) }),
|
|
1880
|
-
/* @__PURE__ */ jsx3(Field2, { label: "Date of injury", children: /* @__PURE__ */ jsx3(TextDateInput, { ariaLabel: "Date of injury", value: bill.claim.dateOfInjury, disabled: locked, onChange: (dateOfInjury) => setBill((c) => ({ ...c, claim: { ...c.claim, dateOfInjury } })) }) }),
|
|
1881
|
-
/* @__PURE__ */ jsx3(Field2, { label: "Employer
|
|
2059
|
+
/* @__PURE__ */ jsx3(Field2, { path: "claim.dateOfInjury", label: "Date of injury", required: true, error: errors["claim.dateOfInjury"], children: /* @__PURE__ */ jsx3(TextDateInput, { ariaLabel: "Date of injury", value: bill.claim.dateOfInjury, disabled: locked, required: true, onChange: (dateOfInjury) => setBill((c) => ({ ...c, claim: { ...c.claim, dateOfInjury } })) }) }),
|
|
2060
|
+
/* @__PURE__ */ jsx3(Field2, { path: "claim.employer", label: "Employer name", required: true, error: errors["claim.employer"], children: text(bill.claim.employer, (employer) => setBill((c) => ({ ...c, claim: { ...c.claim, employer } }))) }),
|
|
1882
2061
|
/* @__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 } }))) }),
|
|
1883
2062
|
/* @__PURE__ */ jsx3(Field2, { label: "WCAB / ADJ number (optional)", children: text(bill.claim.adjNumber, (adjNumber) => setBill((c) => ({ ...c, claim: { ...c.claim, adjNumber } }))) }),
|
|
1884
|
-
/* @__PURE__ */
|
|
2063
|
+
/* @__PURE__ */ jsxs3(Field2, { path: "claim.claimsAdministrator", label: "Claims administrator", required: true, span: true, error: claimsAdministratorError, children: [
|
|
2064
|
+
/* @__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 }) }),
|
|
2065
|
+
selectedPayer ? /* @__PURE__ */ jsxs3("div", { className: "mbsf-payer-status", role: "status", children: [
|
|
2066
|
+
/* @__PURE__ */ jsx3("strong", { children: "\u2713 Routing match set:" }),
|
|
2067
|
+
" ",
|
|
2068
|
+
selectedPayer.name
|
|
2069
|
+
] }) : null,
|
|
2070
|
+
selectedPayer?.signals?.length ? /* @__PURE__ */ jsx3("div", { className: "mbsf-payer-signals", children: selectedPayer.signals.map((signal, index) => /* @__PURE__ */ jsxs3("span", { "data-state": signal.state, children: [
|
|
2071
|
+
signal.state === "match" ? "\u2713" : "!",
|
|
2072
|
+
" ",
|
|
2073
|
+
signal.label
|
|
2074
|
+
] }, `${signal.kind}-${index}`)) }) : null,
|
|
2075
|
+
!selectedPayer && payerRecommendations.length ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
2076
|
+
/* @__PURE__ */ jsxs3("p", { className: "mbsf-payer-intro", children: [
|
|
2077
|
+
"Confirm the best routing match for ",
|
|
2078
|
+
/* @__PURE__ */ jsx3("strong", { children: bill.claim.claimsAdministrator?.name }),
|
|
2079
|
+
":"
|
|
2080
|
+
] }),
|
|
2081
|
+
/* @__PURE__ */ jsx3("div", { className: "mbsf-payer-list", children: payerRecommendations.map((payer) => /* @__PURE__ */ jsxs3("div", { className: "mbsf-payer-option", children: [
|
|
2082
|
+
/* @__PURE__ */ jsxs3("div", { className: "mbsf-payer-option-main", children: [
|
|
2083
|
+
/* @__PURE__ */ jsx3("strong", { children: payer.name }),
|
|
2084
|
+
payer.signals?.length ? /* @__PURE__ */ jsx3("div", { className: "mbsf-payer-signals", children: payer.signals.map((signal, index) => /* @__PURE__ */ jsxs3("span", { "data-state": signal.state, children: [
|
|
2085
|
+
signal.state === "match" ? "\u2713" : "!",
|
|
2086
|
+
" ",
|
|
2087
|
+
signal.label
|
|
2088
|
+
] }, `${signal.kind}-${index}`)) }) : /* @__PURE__ */ jsx3("small", { className: "mbsf-help", children: "Directory match" })
|
|
2089
|
+
] }),
|
|
2090
|
+
/* @__PURE__ */ jsx3("button", { className: "mbsf-secondary", type: "button", onClick: () => choosePayer(payer), children: "Use" })
|
|
2091
|
+
] }, payer.id)) })
|
|
2092
|
+
] }) : null,
|
|
2093
|
+
!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
|
|
2094
|
+
] }),
|
|
1885
2095
|
/* @__PURE__ */ jsx3(Field2, { label: "Injury description (optional)", span: true, children: text(bill.claim.description, (description2) => setBill((c) => ({ ...c, claim: { ...c.claim, description: description2 } }))) }),
|
|
1886
2096
|
/* @__PURE__ */ jsxs3(Field2, { path: "diagnoses", label: "Diagnosis codes (ICD-10)", required: true, span: true, error: errors.diagnoses, children: [
|
|
1887
2097
|
/* @__PURE__ */ jsx3("div", { className: "mbsf-quick-picks", "aria-label": "Common diagnosis codes", children: BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS.map((option) => {
|
|
@@ -1909,17 +2119,34 @@ function BillSubmissionForm({
|
|
|
1909
2119
|
const providersSection = /* @__PURE__ */ jsxs3("fieldset", { className: "mbsf-card", disabled: locked, children: [
|
|
1910
2120
|
/* @__PURE__ */ jsx3("legend", { className: "mbsf-legend", children: "Providers & place of service" }),
|
|
1911
2121
|
/* @__PURE__ */ jsxs3("div", { className: "mbsf-grid", children: [
|
|
1912
|
-
/* @__PURE__ */ jsx3(
|
|
1913
|
-
/* @__PURE__ */ jsx3(Field2, { label: "Billing
|
|
1914
|
-
/* @__PURE__ */ jsx3(Field2, { label: "
|
|
1915
|
-
/* @__PURE__ */ jsx3(Field2, { label: "Billing
|
|
1916
|
-
/* @__PURE__ */ jsx3(Field2, { label: "
|
|
1917
|
-
/* @__PURE__ */ jsx3(Field2, { label: "
|
|
1918
|
-
/* @__PURE__ */ jsx3(Field2, { label: "
|
|
1919
|
-
/* @__PURE__ */ jsx3(Field2, { label: "
|
|
1920
|
-
/* @__PURE__ */ jsx3(Field2, { label: "
|
|
1921
|
-
/* @__PURE__ */ jsx3(Field2, { label: "
|
|
1922
|
-
/* @__PURE__ */ jsx3(
|
|
2122
|
+
/* @__PURE__ */ jsx3("h4", { className: "mbsf-subhead", children: "Billing provider" }),
|
|
2123
|
+
/* @__PURE__ */ jsx3(Field2, { path: "billingProvider.name", label: "Billing provider name", required: true, error: errors["billingProvider.name"], children: text(bill.billingProvider?.name, (name) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, name } }))) }),
|
|
2124
|
+
/* @__PURE__ */ jsx3(Field2, { path: "billingProvider.taxId", label: "Tax ID (EIN / SSN)", required: true, error: errors["billingProvider.taxId"], children: text(bill.billingProvider?.taxId, (taxId) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, taxId } })), { inputMode: "numeric" }) }),
|
|
2125
|
+
/* @__PURE__ */ jsx3(Field2, { path: "billingProvider.npi", label: "Billing provider NPI", required: true, error: errors["billingProvider.npi"], children: text(bill.billingProvider?.npi, (npi) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, npi } })), { inputMode: "numeric", maxLength: 10 }) }),
|
|
2126
|
+
/* @__PURE__ */ jsx3(Field2, { path: "billingProvider.phone", label: "Billing provider phone", required: true, error: errors["billingProvider.phone"], children: text(bill.billingProvider?.phone, (phone) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, phone } })), { type: "tel" }) }),
|
|
2127
|
+
/* @__PURE__ */ jsx3(Field2, { path: "billingProvider.address.line1", label: "Billing address line 1", required: true, span: true, error: errors["billingProvider.address.line1"], children: text(bill.billingProvider?.address?.line1, (line1) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, address: { line1, line2: c.billingProvider?.address?.line2 ?? "", city: c.billingProvider?.address?.city ?? "", state: c.billingProvider?.address?.state ?? "", postalCode: c.billingProvider?.address?.postalCode ?? "" } } }))) }),
|
|
2128
|
+
/* @__PURE__ */ jsx3(Field2, { label: "Billing address line 2 (optional)", span: true, children: text(bill.billingProvider?.address?.line2, (line2) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, address: { line1: c.billingProvider?.address?.line1 ?? "", line2, city: c.billingProvider?.address?.city ?? "", state: c.billingProvider?.address?.state ?? "", postalCode: c.billingProvider?.address?.postalCode ?? "" } } }))) }),
|
|
2129
|
+
/* @__PURE__ */ jsx3(Field2, { path: "billingProvider.address.city", label: "Billing city", required: true, error: errors["billingProvider.address.city"], children: text(bill.billingProvider?.address?.city, (city) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, address: { line1: c.billingProvider?.address?.line1 ?? "", line2: c.billingProvider?.address?.line2 ?? "", city, state: c.billingProvider?.address?.state ?? "", postalCode: c.billingProvider?.address?.postalCode ?? "" } } }))) }),
|
|
2130
|
+
/* @__PURE__ */ jsx3(Field2, { path: "billingProvider.address.state", label: "Billing state", required: true, error: errors["billingProvider.address.state"], children: text(bill.billingProvider?.address?.state, (state) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, address: { line1: c.billingProvider?.address?.line1 ?? "", line2: c.billingProvider?.address?.line2 ?? "", city: c.billingProvider?.address?.city ?? "", state: state.toUpperCase(), postalCode: c.billingProvider?.address?.postalCode ?? "" } } })), { maxLength: 2 }) }),
|
|
2131
|
+
/* @__PURE__ */ jsx3(Field2, { path: "billingProvider.address.postalCode", label: "Billing ZIP", required: true, error: errors["billingProvider.address.postalCode"], children: text(bill.billingProvider?.address?.postalCode, (postalCode) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, address: { line1: c.billingProvider?.address?.line1 ?? "", line2: c.billingProvider?.address?.line2 ?? "", city: c.billingProvider?.address?.city ?? "", state: c.billingProvider?.address?.state ?? "", postalCode } } }))) }),
|
|
2132
|
+
/* @__PURE__ */ jsx3("h4", { className: "mbsf-subhead", children: "Rendering provider" }),
|
|
2133
|
+
/* @__PURE__ */ jsx3(Field2, { path: "renderingProvider.name", label: "Rendering provider name", required: true, error: errors["renderingProvider.name"], children: text(bill.renderingProvider?.name, (name) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, name } }))) }),
|
|
2134
|
+
/* @__PURE__ */ jsx3(Field2, { path: "renderingProvider.npi", label: "Rendering provider NPI", required: true, error: errors["renderingProvider.npi"], children: text(bill.renderingProvider?.npi, (npi) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, npi } })), { inputMode: "numeric", maxLength: 10 }) }),
|
|
2135
|
+
/* @__PURE__ */ jsxs3(Field2, { path: "renderingProvider.taxonomy", label: "Rendering taxonomy code", required: true, error: errors["renderingProvider.taxonomy"], children: [
|
|
2136
|
+
text(bill.renderingProvider?.taxonomy, (taxonomy) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, taxonomy: taxonomy.toUpperCase() } })), { maxLength: 10, placeholder: "10-character NUCC code" }),
|
|
2137
|
+
/* @__PURE__ */ jsx3("small", { className: "mbsf-help", children: "Sent in CMS-1500 Box 24J with qualifier ZZ." })
|
|
2138
|
+
] }),
|
|
2139
|
+
/* @__PURE__ */ jsx3(Field2, { label: "Specialty (optional)", children: text(bill.renderingProvider?.specialty, (specialty) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, specialty } }))) }),
|
|
2140
|
+
/* @__PURE__ */ jsx3(Field2, { label: "License number (optional)", children: text(bill.renderingProvider?.licenseNumber, (licenseNumber) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, licenseNumber } }))) }),
|
|
2141
|
+
/* @__PURE__ */ jsx3(Field2, { label: "License state (optional)", children: text(bill.renderingProvider?.licenseState, (licenseState) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, licenseState: licenseState.toUpperCase() } })), { maxLength: 2 }) }),
|
|
2142
|
+
/* @__PURE__ */ jsx3("h4", { className: "mbsf-subhead", children: "Service facility (CMS-1500 Box 32)" }),
|
|
2143
|
+
/* @__PURE__ */ jsx3(Field2, { label: "Service facility name (optional)", children: text(bill.serviceLocation?.name, (name) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, name } }))) }),
|
|
2144
|
+
/* @__PURE__ */ jsx3(Field2, { path: "serviceLocation.placeOfServiceCode", label: "Place of service code", required: true, error: errors["serviceLocation.placeOfServiceCode"], children: text(bill.serviceLocation?.placeOfServiceCode, (placeOfServiceCode) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, placeOfServiceCode } })), { inputMode: "numeric", maxLength: 2, placeholder: "11" }) }),
|
|
2145
|
+
/* @__PURE__ */ jsx3(Field2, { path: "serviceLocation.address.line1", label: "Service address line 1", required: true, span: true, error: errors["serviceLocation.address.line1"], children: text(bill.serviceLocation?.address?.line1, (line1) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, address: { line1, line2: c.serviceLocation?.address?.line2 ?? "", city: c.serviceLocation?.address?.city ?? "", state: c.serviceLocation?.address?.state ?? "", postalCode: c.serviceLocation?.address?.postalCode ?? "" } } }))) }),
|
|
2146
|
+
/* @__PURE__ */ jsx3(Field2, { label: "Service address line 2 (optional)", span: true, children: text(bill.serviceLocation?.address?.line2, (line2) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, address: { line1: c.serviceLocation?.address?.line1 ?? "", line2, city: c.serviceLocation?.address?.city ?? "", state: c.serviceLocation?.address?.state ?? "", postalCode: c.serviceLocation?.address?.postalCode ?? "" } } }))) }),
|
|
2147
|
+
/* @__PURE__ */ jsx3(Field2, { path: "serviceLocation.address.city", label: "Service city", required: true, error: errors["serviceLocation.address.city"], children: text(bill.serviceLocation?.address?.city, (city) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, address: { line1: c.serviceLocation?.address?.line1 ?? "", line2: c.serviceLocation?.address?.line2 ?? "", city, state: c.serviceLocation?.address?.state ?? "", postalCode: c.serviceLocation?.address?.postalCode ?? "" } } }))) }),
|
|
2148
|
+
/* @__PURE__ */ jsx3(Field2, { path: "serviceLocation.address.state", label: "Service state", required: true, error: errors["serviceLocation.address.state"], children: text(bill.serviceLocation?.address?.state, (state) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, address: { line1: c.serviceLocation?.address?.line1 ?? "", line2: c.serviceLocation?.address?.line2 ?? "", city: c.serviceLocation?.address?.city ?? "", state: state.toUpperCase(), postalCode: c.serviceLocation?.address?.postalCode ?? "" } } })), { maxLength: 2 }) }),
|
|
2149
|
+
/* @__PURE__ */ jsx3(Field2, { path: "serviceLocation.address.postalCode", label: "Service ZIP", required: true, error: errors["serviceLocation.address.postalCode"], children: text(bill.serviceLocation?.address?.postalCode, (postalCode) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, address: { line1: c.serviceLocation?.address?.line1 ?? "", line2: c.serviceLocation?.address?.line2 ?? "", city: c.serviceLocation?.address?.city ?? "", state: c.serviceLocation?.address?.state ?? "", postalCode } } }))) })
|
|
1923
2150
|
] })
|
|
1924
2151
|
] });
|
|
1925
2152
|
const serviceLinesSection = /* @__PURE__ */ jsxs3("fieldset", { className: "mbsf-card", disabled: locked, children: [
|
|
@@ -1929,9 +2156,15 @@ function BillSubmissionForm({
|
|
|
1929
2156
|
/* @__PURE__ */ jsx3("p", { className: "mbsf-help", children: evaluationType === "ame" ? "Agreed Medical Evaluator \u2014 eligible ML evaluation codes default to modifier -94." : evaluationType === "psych_qme" ? "Psychiatric QME \u2014 eligible ML evaluation codes default to modifier -96 (-95 for ML200)." : "Qualified Medical Evaluator \u2014 eligible ML evaluation codes default to modifier -95." }),
|
|
1930
2157
|
/* @__PURE__ */ jsxs3("div", { className: "mbsf-lines", "data-field-path": "serviceLines", "data-invalid": Boolean(errors.serviceLines), children: [
|
|
1931
2158
|
/* @__PURE__ */ jsxs3("div", { className: "mbsf-line-head", children: [
|
|
1932
|
-
/* @__PURE__ */
|
|
2159
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
2160
|
+
"Procedure code",
|
|
2161
|
+
/* @__PURE__ */ jsx3(RequiredMark, {})
|
|
2162
|
+
] }),
|
|
1933
2163
|
/* @__PURE__ */ jsx3("span", { children: "Modifiers" }),
|
|
1934
|
-
/* @__PURE__ */
|
|
2164
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
2165
|
+
"Units",
|
|
2166
|
+
/* @__PURE__ */ jsx3(RequiredMark, {})
|
|
2167
|
+
] }),
|
|
1935
2168
|
/* @__PURE__ */ jsx3("span", { children: "Allowed" }),
|
|
1936
2169
|
/* @__PURE__ */ jsx3("span", {}),
|
|
1937
2170
|
" "
|
|
@@ -1967,12 +2200,13 @@ function BillSubmissionForm({
|
|
|
1967
2200
|
] }),
|
|
1968
2201
|
errors.serviceLines ? /* @__PURE__ */ jsx3("p", { className: "mbsf-error", role: "alert", children: errors.serviceLines }) : null
|
|
1969
2202
|
] });
|
|
1970
|
-
const attachmentsSection = /* @__PURE__ */ jsxs3("fieldset", { className: "mbsf-card", disabled: locked, children: [
|
|
2203
|
+
const attachmentsSection = /* @__PURE__ */ jsxs3("fieldset", { className: "mbsf-card", "data-field-path": "attachments", "data-invalid": Boolean(errors.attachments), disabled: locked, children: [
|
|
1971
2204
|
/* @__PURE__ */ jsx3("legend", { className: "mbsf-legend", children: "Attachments" }),
|
|
1972
2205
|
/* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-list", children: [
|
|
1973
2206
|
attachments.filter((attachment) => !removedSourceIds.includes(attachment.id)).map((attachment) => {
|
|
1974
2207
|
const auto = attachment.autoAttached || attachment.documentType === "w9";
|
|
1975
2208
|
const removable = !auto && attachment.removable !== false;
|
|
2209
|
+
const reportTypeCode = sourceAttachmentReportTypes[attachment.id] || attachment.reportTypeCode || defaultAttachmentReportType || "";
|
|
1976
2210
|
return /* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-row", "data-auto": auto, children: [
|
|
1977
2211
|
/* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-main", children: [
|
|
1978
2212
|
auto ? /* @__PURE__ */ jsx3("span", { "aria-label": "Always attached", role: "img", children: "\u2713" }) : null,
|
|
@@ -1982,6 +2216,7 @@ function BillSubmissionForm({
|
|
|
1982
2216
|
/* @__PURE__ */ jsx3("span", { className: "mbsf-help", style: { display: "block" }, children: attachment.description || (auto ? "Included automatically with every bill." : documentLabels[attachment.documentType]) })
|
|
1983
2217
|
] })
|
|
1984
2218
|
] }),
|
|
2219
|
+
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,
|
|
1985
2220
|
/* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-actions", children: [
|
|
1986
2221
|
attachment.previewUrl ? /* @__PURE__ */ jsx3("a", { className: "mbsf-secondary", href: attachment.previewUrl, target: "_blank", rel: "noopener noreferrer", children: "Preview" }) : null,
|
|
1987
2222
|
removable ? /* @__PURE__ */ jsx3("button", { className: "mbsf-icon-btn", type: "button", "aria-label": `Remove ${attachment.fileName}`, disabled: locked, onClick: () => {
|
|
@@ -1991,20 +2226,25 @@ function BillSubmissionForm({
|
|
|
1991
2226
|
] })
|
|
1992
2227
|
] }, attachment.id);
|
|
1993
2228
|
}),
|
|
1994
|
-
uploads.map((upload, index) =>
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
/* @__PURE__ */
|
|
1998
|
-
(upload.file.
|
|
1999
|
-
"
|
|
2229
|
+
uploads.map((upload, index) => {
|
|
2230
|
+
const reportTypeCode = upload.reportTypeCode || defaultAttachmentReportType || "";
|
|
2231
|
+
return /* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-row", children: [
|
|
2232
|
+
/* @__PURE__ */ jsx3("div", { className: "mbsf-attach-main", children: /* @__PURE__ */ jsxs3("span", { className: "mbsf-file", children: [
|
|
2233
|
+
/* @__PURE__ */ jsx3("strong", { children: upload.file.name }),
|
|
2234
|
+
/* @__PURE__ */ jsxs3("span", { className: "mbsf-help", style: { display: "block" }, children: [
|
|
2235
|
+
(upload.file.size / 1024 / 1024).toFixed(1),
|
|
2236
|
+
" MB"
|
|
2237
|
+
] })
|
|
2238
|
+
] }) }),
|
|
2239
|
+
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,
|
|
2240
|
+
/* @__PURE__ */ jsxs3("div", { className: "mbsf-attach-actions", children: [
|
|
2241
|
+
/* @__PURE__ */ jsx3("button", { className: "mbsf-secondary", type: "button", onClick: () => previewUploadedPdf(upload.file), children: "Preview" }),
|
|
2242
|
+
/* @__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" })
|
|
2000
2243
|
] })
|
|
2001
|
-
] }
|
|
2002
|
-
|
|
2003
|
-
/* @__PURE__ */ jsx3("button", { className: "mbsf-secondary", type: "button", onClick: () => previewUploadedPdf(upload.file), children: "Preview" }),
|
|
2004
|
-
/* @__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" })
|
|
2005
|
-
] })
|
|
2006
|
-
] }, `${upload.file.name}-${index}`))
|
|
2244
|
+
] }, `${upload.file.name}-${index}`);
|
|
2245
|
+
})
|
|
2007
2246
|
] }),
|
|
2247
|
+
errors.attachments ? /* @__PURE__ */ jsx3("p", { className: "mbsf-error", role: "alert", children: errors.attachments }) : null,
|
|
2008
2248
|
/* @__PURE__ */ jsx3("input", { ref: fileInput, hidden: true, type: "file", accept: "application/pdf,.pdf", multiple: true, onChange: (event) => {
|
|
2009
2249
|
if (event.target.files) addFiles(event.target.files);
|
|
2010
2250
|
event.target.value = "";
|
|
@@ -3256,6 +3496,7 @@ function MindBillBillReview(props) {
|
|
|
3256
3496
|
export {
|
|
3257
3497
|
BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS,
|
|
3258
3498
|
BILL_SUBMISSION_DOCUMENT_TYPES,
|
|
3499
|
+
BILL_SUBMISSION_REPORT_TYPES,
|
|
3259
3500
|
BILL_SUBMISSION_REQUIRED_FIELDS,
|
|
3260
3501
|
BillActivityTimeline,
|
|
3261
3502
|
BillAgingSummary,
|
|
@@ -3283,6 +3524,7 @@ export {
|
|
|
3283
3524
|
ConnectedBillStatus,
|
|
3284
3525
|
DEFAULT_BILL_SUBMISSION_MODIFIERS,
|
|
3285
3526
|
DEFAULT_BILL_SUBMISSION_PROCEDURES,
|
|
3527
|
+
MED_LEGAL_REPORT_TYPE_CODE,
|
|
3286
3528
|
MindBillBillReview,
|
|
3287
3529
|
MindBillBillTimeline,
|
|
3288
3530
|
PSYCH_QME_DEFAULT_DIAGNOSIS,
|
|
@@ -3297,13 +3539,16 @@ export {
|
|
|
3297
3539
|
buildBillingReportCsv,
|
|
3298
3540
|
buildBillingReportRows,
|
|
3299
3541
|
calculateBillSubmissionAllowedAmount,
|
|
3542
|
+
claimsAdministratorRecommendations,
|
|
3300
3543
|
createBillLifecycleClient2 as createBillLifecycleClient,
|
|
3301
3544
|
createBillStatusClient,
|
|
3302
3545
|
ensureTrailingBillSubmissionLine,
|
|
3303
3546
|
ensureTrailingProcedureLine,
|
|
3547
|
+
exactClaimsAdministratorMatch,
|
|
3304
3548
|
formatBillSubmissionDate,
|
|
3305
3549
|
mindBillAppearanceStyle,
|
|
3306
3550
|
mindBillThemePresets,
|
|
3551
|
+
normalizeClaimsAdministratorName,
|
|
3307
3552
|
parseBillSubmissionDate,
|
|
3308
3553
|
prepareBillSubmissionDocuments,
|
|
3309
3554
|
resolveMindBillAppearance,
|