@mindbill/react 0.28.2 → 0.29.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 +13 -2
- package/dist/index.d.ts +40 -1
- package/dist/index.js +465 -312
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1787,9 +1787,9 @@ var css = `
|
|
|
1787
1787
|
.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}
|
|
1788
1788
|
.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)}
|
|
1789
1789
|
.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)}
|
|
1790
|
-
.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(
|
|
1790
|
+
.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(190px,1.3fr) minmax(112px,.7fr) 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-dx{display:flex;flex-wrap:wrap;gap:5px;padding-top:6px}.mbsf-dx-chip{width:30px;height:30px;border:1px solid var(--mb-border);border-radius:8px;background:var(--mb-surface);color:var(--mb-muted);font:inherit;font-size:13px;font-weight:750;cursor:pointer}.mbsf-dx-chip[data-active=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface));color:var(--mb-accent)}.mbsf-total{display:flex;justify-content:flex-end;gap:45px;padding:16px 56px 16px 16px;font-size:17px;font-weight:760}
|
|
1791
1791
|
.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}
|
|
1792
|
-
@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%}}
|
|
1792
|
+
@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),.mbsf-line>div:nth-child(3){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%}}
|
|
1793
1793
|
`;
|
|
1794
1794
|
function RequiredMark() {
|
|
1795
1795
|
return /* @__PURE__ */ jsx3("span", { className: "mbsf-star", children: " *" });
|
|
@@ -2236,6 +2236,10 @@ function BillSubmissionForm({
|
|
|
2236
2236
|
/* @__PURE__ */ jsx3("legend", { className: "mbsf-legend", children: "Injury & claim" }),
|
|
2237
2237
|
/* @__PURE__ */ jsxs3("div", { className: "mbsf-grid", children: [
|
|
2238
2238
|
/* @__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 } })) }) }),
|
|
2239
|
+
/* @__PURE__ */ jsxs3(Field2, { label: "Treatment authorization # (optional)", children: [
|
|
2240
|
+
text(bill.service.authorizationNumber, (authorizationNumber) => setBill((c) => ({ ...c, service: { ...c.service, authorizationNumber } })), { placeholder: "Utilization-review authorization number" }),
|
|
2241
|
+
/* @__PURE__ */ jsx3("small", { className: "mbsf-help", children: "Rides on the bill as CMS-1500 Box 23 / 837 REF*G1." })
|
|
2242
|
+
] }),
|
|
2239
2243
|
/* @__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 } })) }) }),
|
|
2240
2244
|
/* @__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 } }))) }),
|
|
2241
2245
|
/* @__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 } }))) }),
|
|
@@ -2340,6 +2344,7 @@ function BillSubmissionForm({
|
|
|
2340
2344
|
/* @__PURE__ */ jsx3(RequiredMark, {})
|
|
2341
2345
|
] }),
|
|
2342
2346
|
/* @__PURE__ */ jsx3("span", { children: "Modifiers" }),
|
|
2347
|
+
/* @__PURE__ */ jsx3("span", { children: "Dx" }),
|
|
2343
2348
|
/* @__PURE__ */ jsxs3("span", { children: [
|
|
2344
2349
|
"Units",
|
|
2345
2350
|
/* @__PURE__ */ jsx3(RequiredMark, {})
|
|
@@ -2365,6 +2370,11 @@ function BillSubmissionForm({
|
|
|
2365
2370
|
] }, modifier)) }),
|
|
2366
2371
|
/* @__PURE__ */ jsx3(ComboBox, { ariaLabel: `Modifiers ${index + 1}`, disabled: locked, value: "", placeholder: line.modifiers?.length ?? 0 ? `${line.modifiers.length} modifier${line.modifiers.length === 1 ? "" : "s"}` : "Add modifiers\u2026", options: modifiers.filter((item) => !(line.modifiers ?? []).includes(item.code)).map((item) => ({ id: item.code, label: `\u2212${item.code}`, detail: item.description })), onSelect: (option) => setLine(index, { modifiers: [.../* @__PURE__ */ new Set([...line.modifiers ?? [], option.id])] }) })
|
|
2367
2372
|
] }),
|
|
2373
|
+
/* @__PURE__ */ jsx3("div", { "data-label": "Dx", children: /* @__PURE__ */ jsx3("div", { className: "mbsf-dx", children: (bill.diagnoses ?? []).length ? (bill.diagnoses ?? []).map((code, dxIndex) => {
|
|
2374
|
+
const pointer = dxIndex + 1;
|
|
2375
|
+
const active = (line.diagnosisPointers ?? []).includes(pointer);
|
|
2376
|
+
return /* @__PURE__ */ jsx3("button", { type: "button", className: "mbsf-dx-chip", "data-active": active, title: `${String.fromCharCode(64 + pointer)} \u2014 ${code}`, "aria-pressed": active, "aria-label": `Point line ${index + 1} at diagnosis ${code}`, onClick: () => setLine(index, { diagnosisPointers: active ? (line.diagnosisPointers ?? []).filter((item) => item !== pointer) : [...line.diagnosisPointers ?? [], pointer].sort((left, right) => left - right) }), children: String.fromCharCode(64 + pointer) }, code);
|
|
2377
|
+
}) : /* @__PURE__ */ jsx3("small", { className: "mbsf-help", children: "Add diagnoses above" }) }) }),
|
|
2368
2378
|
/* @__PURE__ */ jsxs3("div", { "data-label": "Units", "data-field-path": `serviceLines.${index}.units`, "data-invalid": Boolean(errors[`serviceLines.${index}.units`]), children: [
|
|
2369
2379
|
/* @__PURE__ */ jsx3("input", { className: "mbsf-input", "aria-label": `Units ${index + 1}`, "aria-invalid": Boolean(errors[`serviceLines.${index}.units`]), type: "number", min: 1, value: line.units ?? 1, onChange: (event) => setLine(index, { units: Number(event.target.value) }) }),
|
|
2370
2380
|
errors[`serviceLines.${index}.units`] ? /* @__PURE__ */ jsx3("small", { className: "mbsf-error", role: "alert", children: errors[`serviceLines.${index}.units`] }) : null
|
|
@@ -2727,11 +2737,150 @@ function BillingReport({ bills, groupBy = "status", heading = "Billing report",
|
|
|
2727
2737
|
] }) });
|
|
2728
2738
|
}
|
|
2729
2739
|
|
|
2740
|
+
// src/status-aging-matrix.tsx
|
|
2741
|
+
import { useMemo as useMemo4 } from "react";
|
|
2742
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2743
|
+
var BILL_STATUS_AGING_BUCKETS = [
|
|
2744
|
+
{ id: "current", label: "0\u201330 days" },
|
|
2745
|
+
{ id: "31-60", label: "31\u201360 days" },
|
|
2746
|
+
{ id: "61-90", label: "61\u201390 days" },
|
|
2747
|
+
{ id: "91+", label: "91+ days" }
|
|
2748
|
+
];
|
|
2749
|
+
var DEFAULT_STATE_ORDER = [
|
|
2750
|
+
"draft",
|
|
2751
|
+
"incomplete",
|
|
2752
|
+
"created",
|
|
2753
|
+
"sent",
|
|
2754
|
+
"submitted",
|
|
2755
|
+
"accepted",
|
|
2756
|
+
"processed",
|
|
2757
|
+
"paid",
|
|
2758
|
+
"underpaid",
|
|
2759
|
+
"denied",
|
|
2760
|
+
"rejected",
|
|
2761
|
+
"appealing",
|
|
2762
|
+
"second_review",
|
|
2763
|
+
"ibr",
|
|
2764
|
+
"lien",
|
|
2765
|
+
"closed"
|
|
2766
|
+
];
|
|
2767
|
+
var money4 = (value) => Number(value || 0).toLocaleString(void 0, { style: "currency", currency: "USD" });
|
|
2768
|
+
var stateLabel2 = (state) => state.replaceAll("_", " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
|
|
2769
|
+
var emptyCell = (state, bucket) => ({ state, bucket, count: 0, balance: 0, bills: [] });
|
|
2770
|
+
function buildBillStatusAgingMatrix(bills, stateOrder = DEFAULT_STATE_ORDER, now = /* @__PURE__ */ new Date()) {
|
|
2771
|
+
const orderIndex = new Map(stateOrder.map((state, index) => [state.toLowerCase(), index]));
|
|
2772
|
+
const states = [...new Set(bills.map((bill) => bill.state))].sort((a, b) => {
|
|
2773
|
+
const left = orderIndex.get(a.toLowerCase()) ?? stateOrder.length;
|
|
2774
|
+
const right = orderIndex.get(b.toLowerCase()) ?? stateOrder.length;
|
|
2775
|
+
return left - right || a.localeCompare(b);
|
|
2776
|
+
});
|
|
2777
|
+
const columnTotals = BILL_STATUS_AGING_BUCKETS.map((bucket) => emptyCell("all", bucket.id));
|
|
2778
|
+
const grandTotal = emptyCell("all", "total");
|
|
2779
|
+
const rows = states.map((state) => {
|
|
2780
|
+
const cells = BILL_STATUS_AGING_BUCKETS.map((bucket) => emptyCell(state, bucket.id));
|
|
2781
|
+
const total = emptyCell(state, "total");
|
|
2782
|
+
return { state, label: stateLabel2(state), cells, total };
|
|
2783
|
+
});
|
|
2784
|
+
const rowByState = new Map(rows.map((row) => [row.state, row]));
|
|
2785
|
+
for (const bill of bills) {
|
|
2786
|
+
const row = rowByState.get(bill.state);
|
|
2787
|
+
const bucketIndex = BILL_STATUS_AGING_BUCKETS.findIndex((bucket) => bucket.id === billAgingBucket(bill, now));
|
|
2788
|
+
const balance = Number(bill.balanceDue || 0);
|
|
2789
|
+
for (const cell of [row.cells[bucketIndex], row.total, columnTotals[bucketIndex], grandTotal]) {
|
|
2790
|
+
cell.count += 1;
|
|
2791
|
+
cell.balance += balance;
|
|
2792
|
+
cell.bills.push(bill);
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
return { rows, columnTotals, grandTotal };
|
|
2796
|
+
}
|
|
2797
|
+
function buildBillStatusAgingCsv(bills, stateOrder) {
|
|
2798
|
+
const matrix = buildBillStatusAgingMatrix(bills, stateOrder);
|
|
2799
|
+
const escape = (value) => `"${String(value).replaceAll('"', '""')}"`;
|
|
2800
|
+
const header = ["Status", ...BILL_STATUS_AGING_BUCKETS.map((bucket) => bucket.label), "Total"];
|
|
2801
|
+
const lines = matrix.rows.map((row) => [row.label, ...row.cells.map((cell) => cell.count), row.total.count]);
|
|
2802
|
+
lines.push(["Total", ...matrix.columnTotals.map((cell) => cell.count), matrix.grandTotal.count]);
|
|
2803
|
+
return [header, ...lines].map((line) => line.map(escape).join(",")).join("\n");
|
|
2804
|
+
}
|
|
2805
|
+
var css3 = `
|
|
2806
|
+
.mbmx{color:var(--mb-text);font-family:var(--mb-font);font-size:15px}.mbmx *{box-sizing:border-box}.mbmx h2,.mbmx p{margin:0}
|
|
2807
|
+
.mbmx-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:16px}.mbmx-head h2{font-size:24px}.mbmx-copy{color:var(--mb-muted);margin-top:5px!important}
|
|
2808
|
+
.mbmx-card{border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow);overflow:auto}
|
|
2809
|
+
.mbmx-table{width:100%;border-collapse:collapse;min-width:640px}
|
|
2810
|
+
.mbmx-table th{padding:13px 16px;border-bottom:1px solid var(--mb-border);color:var(--mb-muted);font-size:12px;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;text-align:right}
|
|
2811
|
+
.mbmx-table th:first-child{text-align:left}
|
|
2812
|
+
.mbmx-table td{padding:0;border-bottom:1px solid var(--mb-border);border-left:1px solid color-mix(in srgb,var(--mb-border) 55%,transparent);text-align:right;vertical-align:middle}
|
|
2813
|
+
.mbmx-table td:first-child{border-left:0;padding:14px 16px;text-align:left;white-space:nowrap}
|
|
2814
|
+
.mbmx-table tr:last-child td{border-bottom:0}
|
|
2815
|
+
.mbmx-state{display:inline-flex;padding:4px 9px;border-radius:999px;background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface));color:var(--mb-text);font-size:12px;font-weight:720}
|
|
2816
|
+
.mbmx-cell{display:block;width:100%;min-height:56px;padding:9px 16px;border:0;background:none;color:var(--mb-text);font:inherit;text-align:right}
|
|
2817
|
+
.mbmx-cell[data-clickable=true]{cursor:pointer}.mbmx-cell[data-clickable=true]:hover{background:color-mix(in srgb,var(--mb-accent) 8%,var(--mb-surface))}
|
|
2818
|
+
.mbmx-count{display:block;font-size:17px;font-weight:760;font-variant-numeric:tabular-nums}
|
|
2819
|
+
.mbmx-balance{display:block;margin-top:2px;color:var(--mb-muted);font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
|
|
2820
|
+
.mbmx-zero{color:var(--mb-muted)}
|
|
2821
|
+
.mbmx-total td,.mbmx-table td.mbmx-rowtotal{background:var(--mb-soft);font-weight:760}
|
|
2822
|
+
`;
|
|
2823
|
+
function BillStatusAgingMatrix({
|
|
2824
|
+
bills,
|
|
2825
|
+
heading = "Bills by status and age",
|
|
2826
|
+
description = "Every bill grouped by lifecycle status, then by days outstanding.",
|
|
2827
|
+
stateOrder,
|
|
2828
|
+
showBalances = true,
|
|
2829
|
+
onSelectCell,
|
|
2830
|
+
appearance,
|
|
2831
|
+
className = "",
|
|
2832
|
+
style
|
|
2833
|
+
}) {
|
|
2834
|
+
const matrix = useMemo4(() => buildBillStatusAgingMatrix(bills, stateOrder), [bills, stateOrder]);
|
|
2835
|
+
const clickable = Boolean(onSelectCell);
|
|
2836
|
+
const cell = (data, key, isTotal = false) => /* @__PURE__ */ jsx5("td", { className: isTotal ? "mbmx-rowtotal" : void 0, children: /* @__PURE__ */ jsxs5(
|
|
2837
|
+
"button",
|
|
2838
|
+
{
|
|
2839
|
+
type: "button",
|
|
2840
|
+
className: "mbmx-cell",
|
|
2841
|
+
"data-clickable": clickable && data.count > 0,
|
|
2842
|
+
onClick: () => data.count > 0 && onSelectCell?.(data),
|
|
2843
|
+
disabled: !clickable || data.count === 0,
|
|
2844
|
+
"aria-label": `${stateLabel2(data.state)} \xB7 ${data.bucket === "total" ? "all ages" : data.bucket}: ${data.count} bills`,
|
|
2845
|
+
children: [
|
|
2846
|
+
/* @__PURE__ */ jsx5("span", { className: `mbmx-count ${data.count === 0 ? "mbmx-zero" : ""}`.trim(), children: data.count === 0 ? "\u2014" : data.count }),
|
|
2847
|
+
showBalances && data.count > 0 ? /* @__PURE__ */ jsx5("span", { className: "mbmx-balance", children: money4(data.balance) }) : null
|
|
2848
|
+
]
|
|
2849
|
+
}
|
|
2850
|
+
) }, key);
|
|
2851
|
+
return /* @__PURE__ */ jsxs5("div", { className: `mbmx ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
|
|
2852
|
+
/* @__PURE__ */ jsx5("style", { children: css3 }),
|
|
2853
|
+
/* @__PURE__ */ jsx5("div", { className: "mbmx-head", children: /* @__PURE__ */ jsxs5("div", { children: [
|
|
2854
|
+
/* @__PURE__ */ jsx5("h2", { children: heading }),
|
|
2855
|
+
/* @__PURE__ */ jsx5("p", { className: "mbmx-copy", children: description })
|
|
2856
|
+
] }) }),
|
|
2857
|
+
/* @__PURE__ */ jsx5("div", { className: "mbmx-card", children: /* @__PURE__ */ jsxs5("table", { className: "mbmx-table", children: [
|
|
2858
|
+
/* @__PURE__ */ jsx5("thead", { children: /* @__PURE__ */ jsxs5("tr", { children: [
|
|
2859
|
+
/* @__PURE__ */ jsx5("th", { children: "Status" }),
|
|
2860
|
+
BILL_STATUS_AGING_BUCKETS.map((bucket) => /* @__PURE__ */ jsx5("th", { children: bucket.label }, bucket.id)),
|
|
2861
|
+
/* @__PURE__ */ jsx5("th", { children: "Total" })
|
|
2862
|
+
] }) }),
|
|
2863
|
+
/* @__PURE__ */ jsxs5("tbody", { children: [
|
|
2864
|
+
matrix.rows.map((row) => /* @__PURE__ */ jsxs5("tr", { children: [
|
|
2865
|
+
/* @__PURE__ */ jsx5("td", { children: /* @__PURE__ */ jsx5("span", { className: "mbmx-state", children: row.label }) }),
|
|
2866
|
+
row.cells.map((data) => cell(data, `${row.state}-${data.bucket}`)),
|
|
2867
|
+
cell(row.total, `${row.state}-total`, true)
|
|
2868
|
+
] }, row.state)),
|
|
2869
|
+
/* @__PURE__ */ jsxs5("tr", { className: "mbmx-total", children: [
|
|
2870
|
+
/* @__PURE__ */ jsx5("td", { children: "Total" }),
|
|
2871
|
+
matrix.columnTotals.map((data) => cell(data, `all-${data.bucket}`)),
|
|
2872
|
+
cell(matrix.grandTotal, "all-total", true)
|
|
2873
|
+
] })
|
|
2874
|
+
] })
|
|
2875
|
+
] }) })
|
|
2876
|
+
] });
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2730
2879
|
// src/connected-bill-status.tsx
|
|
2731
2880
|
import {
|
|
2732
2881
|
useCallback as useCallback2,
|
|
2733
2882
|
useEffect as useEffect4,
|
|
2734
|
-
useMemo as
|
|
2883
|
+
useMemo as useMemo5,
|
|
2735
2884
|
useRef as useRef3,
|
|
2736
2885
|
useState as useState5
|
|
2737
2886
|
} from "react";
|
|
@@ -2739,7 +2888,7 @@ import {
|
|
|
2739
2888
|
DEFAULT_API_BASE_URL,
|
|
2740
2889
|
DEFAULT_SESSION_ENDPOINT
|
|
2741
2890
|
} from "@mindbill/browser";
|
|
2742
|
-
import { Fragment as Fragment4, jsx as
|
|
2891
|
+
import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2743
2892
|
var DEFAULT_REFRESH_INTERVAL = 6e4;
|
|
2744
2893
|
async function responseError(response, fallback) {
|
|
2745
2894
|
const body = await response.json().catch(() => null);
|
|
@@ -2872,7 +3021,7 @@ function useBillStatus({
|
|
|
2872
3021
|
initialData = null,
|
|
2873
3022
|
fetch: fetchOverride
|
|
2874
3023
|
}) {
|
|
2875
|
-
const client =
|
|
3024
|
+
const client = useMemo5(() => createBillStatusClient({
|
|
2876
3025
|
billId,
|
|
2877
3026
|
sessionEndpoint,
|
|
2878
3027
|
...getSession ? { getSession } : {},
|
|
@@ -2960,17 +3109,17 @@ function ConnectedBillStatus({
|
|
|
2960
3109
|
}) {
|
|
2961
3110
|
const status = useBillStatus(options);
|
|
2962
3111
|
if (status.isLoading && !status.data) {
|
|
2963
|
-
return /* @__PURE__ */
|
|
3112
|
+
return /* @__PURE__ */ jsx6(Fragment4, { children: loadingFallback ?? /* @__PURE__ */ jsx6("div", { role: "status", children: "Loading bill status\u2026" }) });
|
|
2964
3113
|
}
|
|
2965
3114
|
if (status.error && !status.data) {
|
|
2966
|
-
return /* @__PURE__ */
|
|
3115
|
+
return /* @__PURE__ */ jsx6(Fragment4, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs6("div", { role: "alert", children: [
|
|
2967
3116
|
status.error.message,
|
|
2968
3117
|
" ",
|
|
2969
|
-
/* @__PURE__ */
|
|
3118
|
+
/* @__PURE__ */ jsx6("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
|
|
2970
3119
|
] }) });
|
|
2971
3120
|
}
|
|
2972
3121
|
if (!status.data) return null;
|
|
2973
|
-
return /* @__PURE__ */
|
|
3122
|
+
return /* @__PURE__ */ jsx6(
|
|
2974
3123
|
BillStatusSummary,
|
|
2975
3124
|
{
|
|
2976
3125
|
status: status.data.state,
|
|
@@ -2989,7 +3138,7 @@ function ConnectedBillStatus({
|
|
|
2989
3138
|
}
|
|
2990
3139
|
|
|
2991
3140
|
// src/bill-lifecycle-surfaces.tsx
|
|
2992
|
-
import { jsx as
|
|
3141
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2993
3142
|
function visibleBillLifecycleActions(actions, showUnavailable = false) {
|
|
2994
3143
|
return actions.filter((action) => action.enabled || showUnavailable);
|
|
2995
3144
|
}
|
|
@@ -3004,11 +3153,11 @@ function BillLifecycleActions({
|
|
|
3004
3153
|
}) {
|
|
3005
3154
|
const visible = visibleBillLifecycleActions(actions, showUnavailable);
|
|
3006
3155
|
if (!visible.length) return null;
|
|
3007
|
-
return /* @__PURE__ */
|
|
3008
|
-
/* @__PURE__ */
|
|
3009
|
-
visible.map((action) => /* @__PURE__ */
|
|
3010
|
-
/* @__PURE__ */
|
|
3011
|
-
!action.enabled && action.reason ? /* @__PURE__ */
|
|
3156
|
+
return /* @__PURE__ */ jsxs7("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
|
|
3157
|
+
/* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
|
|
3158
|
+
visible.map((action) => /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-action", children: [
|
|
3159
|
+
/* @__PURE__ */ jsx7("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
|
|
3160
|
+
!action.enabled && action.reason ? /* @__PURE__ */ jsx7("span", { className: "mb-action-reason", children: action.reason }) : null
|
|
3012
3161
|
] }, action.id))
|
|
3013
3162
|
] });
|
|
3014
3163
|
}
|
|
@@ -3038,18 +3187,18 @@ function defaultFormatDate(createdAt) {
|
|
|
3038
3187
|
return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(parsed);
|
|
3039
3188
|
}
|
|
3040
3189
|
function BillActivityTimeline({ events, emptyLabel = "No bill activity yet.", appearance, className, style, formatDate = defaultFormatDate }) {
|
|
3041
|
-
return /* @__PURE__ */
|
|
3042
|
-
/* @__PURE__ */
|
|
3043
|
-
/* @__PURE__ */
|
|
3044
|
-
/* @__PURE__ */
|
|
3045
|
-
/* @__PURE__ */
|
|
3190
|
+
return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
|
|
3191
|
+
/* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
|
|
3192
|
+
/* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
|
|
3193
|
+
/* @__PURE__ */ jsx7("strong", { children: "Bill history" }),
|
|
3194
|
+
/* @__PURE__ */ jsx7("span", { children: "Submission, payer responses, follow-up, and payments." })
|
|
3046
3195
|
] }) }),
|
|
3047
|
-
!events.length ? /* @__PURE__ */
|
|
3048
|
-
/* @__PURE__ */
|
|
3049
|
-
/* @__PURE__ */
|
|
3050
|
-
/* @__PURE__ */
|
|
3051
|
-
event.description ? /* @__PURE__ */
|
|
3052
|
-
/* @__PURE__ */
|
|
3196
|
+
!events.length ? /* @__PURE__ */ jsx7("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx7("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs7("li", { className: "mb-activity-item", children: [
|
|
3197
|
+
/* @__PURE__ */ jsx7("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
|
|
3198
|
+
/* @__PURE__ */ jsxs7("div", { className: "mb-activity-content", children: [
|
|
3199
|
+
/* @__PURE__ */ jsx7("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
|
|
3200
|
+
event.description ? /* @__PURE__ */ jsx7("p", { children: event.description }) : null,
|
|
3201
|
+
/* @__PURE__ */ jsxs7("span", { children: [
|
|
3053
3202
|
formatDate(event.createdAt),
|
|
3054
3203
|
event.actor ? ` \xB7 ${event.actor}` : ""
|
|
3055
3204
|
] })
|
|
@@ -3084,20 +3233,20 @@ function billLifecycleDisplayLabel(state, nativeStatus) {
|
|
|
3084
3233
|
function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, appearance, className, style }) {
|
|
3085
3234
|
const current = billLifecycleStage(state);
|
|
3086
3235
|
const currentIndex = lifecycleStages.findIndex((stage) => stage.id === current);
|
|
3087
|
-
return /* @__PURE__ */
|
|
3088
|
-
/* @__PURE__ */
|
|
3089
|
-
/* @__PURE__ */
|
|
3090
|
-
/* @__PURE__ */
|
|
3091
|
-
/* @__PURE__ */
|
|
3236
|
+
return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-progress", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
|
|
3237
|
+
/* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
|
|
3238
|
+
/* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
|
|
3239
|
+
/* @__PURE__ */ jsx7("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
|
|
3240
|
+
/* @__PURE__ */ jsxs7("span", { children: [
|
|
3092
3241
|
submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted",
|
|
3093
3242
|
typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""
|
|
3094
3243
|
] })
|
|
3095
3244
|
] }) }),
|
|
3096
|
-
/* @__PURE__ */
|
|
3245
|
+
/* @__PURE__ */ jsx7("ol", { className: "mb-progress-list", children: lifecycleStages.map((stage, index) => {
|
|
3097
3246
|
const status = index < currentIndex ? "complete" : index === currentIndex ? "current" : "upcoming";
|
|
3098
|
-
return /* @__PURE__ */
|
|
3099
|
-
/* @__PURE__ */
|
|
3100
|
-
/* @__PURE__ */
|
|
3247
|
+
return /* @__PURE__ */ jsxs7("li", { className: `is-${status}`, "aria-current": status === "current" ? "step" : void 0, children: [
|
|
3248
|
+
/* @__PURE__ */ jsx7("span", { "aria-hidden": "true", children: status === "complete" ? "\u2713" : index + 1 }),
|
|
3249
|
+
/* @__PURE__ */ jsx7("b", { children: stage.label })
|
|
3101
3250
|
] }, stage.id);
|
|
3102
3251
|
}) })
|
|
3103
3252
|
] });
|
|
@@ -3111,18 +3260,18 @@ function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, clas
|
|
|
3111
3260
|
["Charged", currency(bill.totalCharge)],
|
|
3112
3261
|
["Balance", currency(bill.balanceDue)]
|
|
3113
3262
|
];
|
|
3114
|
-
return /* @__PURE__ */
|
|
3115
|
-
/* @__PURE__ */
|
|
3116
|
-
/* @__PURE__ */
|
|
3117
|
-
/* @__PURE__ */
|
|
3118
|
-
/* @__PURE__ */
|
|
3263
|
+
return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
|
|
3264
|
+
/* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
|
|
3265
|
+
/* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
|
|
3266
|
+
/* @__PURE__ */ jsx7("strong", { children: "Bill snapshot" }),
|
|
3267
|
+
/* @__PURE__ */ jsxs7("span", { children: [
|
|
3119
3268
|
"Bill #",
|
|
3120
3269
|
bill.billNumber
|
|
3121
3270
|
] })
|
|
3122
3271
|
] }) }),
|
|
3123
|
-
/* @__PURE__ */
|
|
3124
|
-
/* @__PURE__ */
|
|
3125
|
-
/* @__PURE__ */
|
|
3272
|
+
/* @__PURE__ */ jsx7("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs7("div", { children: [
|
|
3273
|
+
/* @__PURE__ */ jsx7("dt", { children: label }),
|
|
3274
|
+
/* @__PURE__ */ jsx7("dd", { children: value })
|
|
3126
3275
|
] }, label)) })
|
|
3127
3276
|
] });
|
|
3128
3277
|
}
|
|
@@ -3137,140 +3286,140 @@ function BillExplanationOfReview({
|
|
|
3137
3286
|
style
|
|
3138
3287
|
}) {
|
|
3139
3288
|
const rows = payments.length ? payments : [null];
|
|
3140
|
-
return /* @__PURE__ */
|
|
3141
|
-
/* @__PURE__ */
|
|
3142
|
-
/* @__PURE__ */
|
|
3143
|
-
/* @__PURE__ */
|
|
3144
|
-
/* @__PURE__ */
|
|
3289
|
+
return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
|
|
3290
|
+
/* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
|
|
3291
|
+
/* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
|
|
3292
|
+
/* @__PURE__ */ jsx7("strong", { children: "Explanation of Review" }),
|
|
3293
|
+
/* @__PURE__ */ jsx7("span", { children: "Payer response and payment reconciliation." })
|
|
3145
3294
|
] }) }),
|
|
3146
|
-
/* @__PURE__ */
|
|
3147
|
-
/* @__PURE__ */
|
|
3148
|
-
/* @__PURE__ */
|
|
3149
|
-
/* @__PURE__ */
|
|
3295
|
+
/* @__PURE__ */ jsxs7("dl", { className: "mb-eor-metrics", children: [
|
|
3296
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3297
|
+
/* @__PURE__ */ jsx7("dt", { children: "Amount billed" }),
|
|
3298
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.billedAmount) })
|
|
3150
3299
|
] }),
|
|
3151
|
-
/* @__PURE__ */
|
|
3152
|
-
/* @__PURE__ */
|
|
3153
|
-
/* @__PURE__ */
|
|
3300
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3301
|
+
/* @__PURE__ */ jsx7("dt", { children: "Payer allowed" }),
|
|
3302
|
+
/* @__PURE__ */ jsx7("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
|
|
3154
3303
|
] }),
|
|
3155
|
-
/* @__PURE__ */
|
|
3156
|
-
/* @__PURE__ */
|
|
3157
|
-
/* @__PURE__ */
|
|
3304
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3305
|
+
/* @__PURE__ */ jsx7("dt", { children: "Payer reported paid" }),
|
|
3306
|
+
/* @__PURE__ */ jsx7("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
|
|
3158
3307
|
] }),
|
|
3159
|
-
/* @__PURE__ */
|
|
3160
|
-
/* @__PURE__ */
|
|
3161
|
-
/* @__PURE__ */
|
|
3308
|
+
/* @__PURE__ */ jsxs7("div", { className: "is-balance", children: [
|
|
3309
|
+
/* @__PURE__ */ jsx7("dt", { children: "Balance due" }),
|
|
3310
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.balanceDue) })
|
|
3162
3311
|
] }),
|
|
3163
|
-
/* @__PURE__ */
|
|
3164
|
-
/* @__PURE__ */
|
|
3165
|
-
/* @__PURE__ */
|
|
3312
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3313
|
+
/* @__PURE__ */ jsx7("dt", { children: "Payment posted" }),
|
|
3314
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.postedPrincipal) })
|
|
3166
3315
|
] }),
|
|
3167
|
-
/* @__PURE__ */
|
|
3168
|
-
/* @__PURE__ */
|
|
3169
|
-
/* @__PURE__ */
|
|
3316
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3317
|
+
/* @__PURE__ */ jsx7("dt", { children: "Penalty & interest" }),
|
|
3318
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.postedAdditional) })
|
|
3170
3319
|
] }),
|
|
3171
|
-
/* @__PURE__ */
|
|
3172
|
-
/* @__PURE__ */
|
|
3173
|
-
/* @__PURE__ */
|
|
3320
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3321
|
+
/* @__PURE__ */ jsx7("dt", { children: "Total received" }),
|
|
3322
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.totalPostedCash) })
|
|
3174
3323
|
] }),
|
|
3175
|
-
/* @__PURE__ */
|
|
3176
|
-
/* @__PURE__ */
|
|
3177
|
-
/* @__PURE__ */
|
|
3324
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3325
|
+
/* @__PURE__ */ jsx7("dt", { children: "Expected" }),
|
|
3326
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.expectedAmount) })
|
|
3178
3327
|
] })
|
|
3179
3328
|
] }),
|
|
3180
|
-
remittance.denialReason ? /* @__PURE__ */
|
|
3181
|
-
/* @__PURE__ */
|
|
3182
|
-
/* @__PURE__ */
|
|
3329
|
+
remittance.denialReason ? /* @__PURE__ */ jsxs7("div", { className: "mb-denial", children: [
|
|
3330
|
+
/* @__PURE__ */ jsx7("strong", { children: "Denial reason" }),
|
|
3331
|
+
/* @__PURE__ */ jsx7("p", { children: remittance.denialReason })
|
|
3183
3332
|
] }) : null,
|
|
3184
|
-
/* @__PURE__ */
|
|
3185
|
-
/* @__PURE__ */
|
|
3186
|
-
/* @__PURE__ */
|
|
3187
|
-
/* @__PURE__ */
|
|
3188
|
-
/* @__PURE__ */
|
|
3189
|
-
/* @__PURE__ */
|
|
3190
|
-
/* @__PURE__ */
|
|
3333
|
+
/* @__PURE__ */ jsx7("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs7("table", { className: "mb-eor-table", children: [
|
|
3334
|
+
/* @__PURE__ */ jsxs7("thead", { children: [
|
|
3335
|
+
/* @__PURE__ */ jsxs7("tr", { className: "mb-eor-groups", children: [
|
|
3336
|
+
/* @__PURE__ */ jsx7("th", { colSpan: 2, children: "Submission" }),
|
|
3337
|
+
/* @__PURE__ */ jsx7("th", { colSpan: 5, children: "EOR payment information" }),
|
|
3338
|
+
/* @__PURE__ */ jsx7("th", { colSpan: 2, children: "EOR post" }),
|
|
3339
|
+
/* @__PURE__ */ jsx7("th", { children: "EOR" })
|
|
3191
3340
|
] }),
|
|
3192
|
-
/* @__PURE__ */
|
|
3193
|
-
/* @__PURE__ */
|
|
3194
|
-
/* @__PURE__ */
|
|
3195
|
-
/* @__PURE__ */
|
|
3196
|
-
/* @__PURE__ */
|
|
3197
|
-
/* @__PURE__ */
|
|
3198
|
-
/* @__PURE__ */
|
|
3199
|
-
/* @__PURE__ */
|
|
3200
|
-
/* @__PURE__ */
|
|
3201
|
-
/* @__PURE__ */
|
|
3202
|
-
/* @__PURE__ */
|
|
3341
|
+
/* @__PURE__ */ jsxs7("tr", { children: [
|
|
3342
|
+
/* @__PURE__ */ jsx7("th", { children: "Submission" }),
|
|
3343
|
+
/* @__PURE__ */ jsx7("th", { children: "Submission payment" }),
|
|
3344
|
+
/* @__PURE__ */ jsx7("th", { children: "Payment method" }),
|
|
3345
|
+
/* @__PURE__ */ jsx7("th", { children: "Reference" }),
|
|
3346
|
+
/* @__PURE__ */ jsx7("th", { children: "Effective date" }),
|
|
3347
|
+
/* @__PURE__ */ jsx7("th", { children: "Payment total" }),
|
|
3348
|
+
/* @__PURE__ */ jsx7("th", { children: "Deposit date" }),
|
|
3349
|
+
/* @__PURE__ */ jsx7("th", { children: "Post date" }),
|
|
3350
|
+
/* @__PURE__ */ jsx7("th", { children: "Source" }),
|
|
3351
|
+
/* @__PURE__ */ jsx7("th", { children: "Document" })
|
|
3203
3352
|
] })
|
|
3204
3353
|
] }),
|
|
3205
|
-
/* @__PURE__ */
|
|
3354
|
+
/* @__PURE__ */ jsx7("tbody", { children: rows.map((payment, index) => {
|
|
3206
3355
|
const eor = eors[index] ?? eors[0];
|
|
3207
|
-
return /* @__PURE__ */
|
|
3208
|
-
/* @__PURE__ */
|
|
3209
|
-
/* @__PURE__ */
|
|
3210
|
-
submittedAt ? /* @__PURE__ */
|
|
3356
|
+
return /* @__PURE__ */ jsxs7("tr", { children: [
|
|
3357
|
+
/* @__PURE__ */ jsxs7("td", { "data-label": "Submission", children: [
|
|
3358
|
+
/* @__PURE__ */ jsx7("strong", { children: "Original bill" }),
|
|
3359
|
+
submittedAt ? /* @__PURE__ */ jsxs7("span", { children: [
|
|
3211
3360
|
"Sent ",
|
|
3212
3361
|
defaultFormatDate(submittedAt)
|
|
3213
3362
|
] }) : null
|
|
3214
3363
|
] }),
|
|
3215
|
-
/* @__PURE__ */
|
|
3216
|
-
/* @__PURE__ */
|
|
3217
|
-
/* @__PURE__ */
|
|
3218
|
-
/* @__PURE__ */
|
|
3219
|
-
/* @__PURE__ */
|
|
3220
|
-
/* @__PURE__ */
|
|
3221
|
-
/* @__PURE__ */
|
|
3222
|
-
/* @__PURE__ */
|
|
3223
|
-
/* @__PURE__ */
|
|
3364
|
+
/* @__PURE__ */ jsx7("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
|
|
3365
|
+
/* @__PURE__ */ jsx7("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
|
|
3366
|
+
/* @__PURE__ */ jsx7("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
|
|
3367
|
+
/* @__PURE__ */ jsx7("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
|
|
3368
|
+
/* @__PURE__ */ jsx7("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
|
|
3369
|
+
/* @__PURE__ */ jsx7("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
|
|
3370
|
+
/* @__PURE__ */ jsx7("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
|
|
3371
|
+
/* @__PURE__ */ jsx7("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
|
|
3372
|
+
/* @__PURE__ */ jsx7("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
|
|
3224
3373
|
] }, payment?.id ?? `empty-${index}`);
|
|
3225
3374
|
}) })
|
|
3226
3375
|
] }) }),
|
|
3227
|
-
eors.length > rows.length ? /* @__PURE__ */
|
|
3376
|
+
eors.length > rows.length ? /* @__PURE__ */ jsx7("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx7("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
|
|
3228
3377
|
] });
|
|
3229
3378
|
}
|
|
3230
3379
|
function BillRemittanceCard({ remittance, appearance, className, style }) {
|
|
3231
|
-
return /* @__PURE__ */
|
|
3232
|
-
/* @__PURE__ */
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
/* @__PURE__ */
|
|
3235
|
-
/* @__PURE__ */
|
|
3380
|
+
return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
|
|
3381
|
+
/* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
|
|
3382
|
+
/* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
|
|
3383
|
+
/* @__PURE__ */ jsx7("strong", { children: "Remittance" }),
|
|
3384
|
+
/* @__PURE__ */ jsx7("span", { children: "Amounts reported by the payer and posted to the bill." })
|
|
3236
3385
|
] }) }),
|
|
3237
|
-
/* @__PURE__ */
|
|
3238
|
-
/* @__PURE__ */
|
|
3239
|
-
/* @__PURE__ */
|
|
3240
|
-
/* @__PURE__ */
|
|
3386
|
+
/* @__PURE__ */ jsxs7("dl", { children: [
|
|
3387
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3388
|
+
/* @__PURE__ */ jsx7("dt", { children: "Amount billed" }),
|
|
3389
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.billedAmount) })
|
|
3241
3390
|
] }),
|
|
3242
|
-
/* @__PURE__ */
|
|
3243
|
-
/* @__PURE__ */
|
|
3244
|
-
/* @__PURE__ */
|
|
3391
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3392
|
+
/* @__PURE__ */ jsx7("dt", { children: "Expected" }),
|
|
3393
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.expectedAmount) })
|
|
3245
3394
|
] }),
|
|
3246
|
-
/* @__PURE__ */
|
|
3247
|
-
/* @__PURE__ */
|
|
3248
|
-
/* @__PURE__ */
|
|
3395
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3396
|
+
/* @__PURE__ */ jsx7("dt", { children: "Payer allowed" }),
|
|
3397
|
+
/* @__PURE__ */ jsx7("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
|
|
3249
3398
|
] }),
|
|
3250
|
-
/* @__PURE__ */
|
|
3251
|
-
/* @__PURE__ */
|
|
3252
|
-
/* @__PURE__ */
|
|
3399
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3400
|
+
/* @__PURE__ */ jsx7("dt", { children: "Payer reported paid" }),
|
|
3401
|
+
/* @__PURE__ */ jsx7("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
|
|
3253
3402
|
] }),
|
|
3254
|
-
/* @__PURE__ */
|
|
3255
|
-
/* @__PURE__ */
|
|
3256
|
-
/* @__PURE__ */
|
|
3403
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3404
|
+
/* @__PURE__ */ jsx7("dt", { children: "Payment posted" }),
|
|
3405
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.postedPrincipal) })
|
|
3257
3406
|
] }),
|
|
3258
|
-
/* @__PURE__ */
|
|
3259
|
-
/* @__PURE__ */
|
|
3260
|
-
/* @__PURE__ */
|
|
3407
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3408
|
+
/* @__PURE__ */ jsx7("dt", { children: "Penalty & interest" }),
|
|
3409
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.postedAdditional) })
|
|
3261
3410
|
] }),
|
|
3262
|
-
/* @__PURE__ */
|
|
3263
|
-
/* @__PURE__ */
|
|
3264
|
-
/* @__PURE__ */
|
|
3411
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3412
|
+
/* @__PURE__ */ jsx7("dt", { children: "Total received" }),
|
|
3413
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.totalPostedCash) })
|
|
3265
3414
|
] }),
|
|
3266
|
-
/* @__PURE__ */
|
|
3267
|
-
/* @__PURE__ */
|
|
3268
|
-
/* @__PURE__ */
|
|
3415
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3416
|
+
/* @__PURE__ */ jsx7("dt", { children: "Balance due" }),
|
|
3417
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(remittance.balanceDue) })
|
|
3269
3418
|
] })
|
|
3270
3419
|
] }),
|
|
3271
|
-
remittance.denialReason ? /* @__PURE__ */
|
|
3272
|
-
/* @__PURE__ */
|
|
3273
|
-
/* @__PURE__ */
|
|
3420
|
+
remittance.denialReason ? /* @__PURE__ */ jsxs7("div", { className: "mb-denial", children: [
|
|
3421
|
+
/* @__PURE__ */ jsx7("strong", { children: "Denial reason" }),
|
|
3422
|
+
/* @__PURE__ */ jsx7("p", { children: remittance.denialReason })
|
|
3274
3423
|
] }) : null
|
|
3275
3424
|
] });
|
|
3276
3425
|
}
|
|
@@ -3285,72 +3434,72 @@ function BillPayerContactCard({ delivery, appearance, className, style }) {
|
|
|
3285
3434
|
delivery.contacts.portalUrl ? ["Portal", "Open payer portal", delivery.contacts.portalUrl] : null
|
|
3286
3435
|
].filter(Boolean);
|
|
3287
3436
|
if (!delivery.payerName && !contacts.length) return null;
|
|
3288
|
-
return /* @__PURE__ */
|
|
3289
|
-
/* @__PURE__ */
|
|
3290
|
-
/* @__PURE__ */
|
|
3291
|
-
/* @__PURE__ */
|
|
3292
|
-
/* @__PURE__ */
|
|
3437
|
+
return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
|
|
3438
|
+
/* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
|
|
3439
|
+
/* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
|
|
3440
|
+
/* @__PURE__ */ jsx7("strong", { children: delivery.payerName || "Claims administrator" }),
|
|
3441
|
+
/* @__PURE__ */ jsx7("span", { children: "Billing and follow-up contacts." })
|
|
3293
3442
|
] }) }),
|
|
3294
|
-
!contacts.length ? /* @__PURE__ */
|
|
3295
|
-
/* @__PURE__ */
|
|
3296
|
-
/* @__PURE__ */
|
|
3443
|
+
!contacts.length ? /* @__PURE__ */ jsx7("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx7("dl", { children: contacts.map(([label, value, href]) => /* @__PURE__ */ jsxs7("div", { children: [
|
|
3444
|
+
/* @__PURE__ */ jsx7("dt", { children: label }),
|
|
3445
|
+
/* @__PURE__ */ jsx7("dd", { children: href ? /* @__PURE__ */ jsx7("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
|
|
3297
3446
|
] }, label)) })
|
|
3298
3447
|
] });
|
|
3299
3448
|
}
|
|
3300
3449
|
function BillPaymentLedger({ payments, appearance, className, style }) {
|
|
3301
|
-
return /* @__PURE__ */
|
|
3302
|
-
/* @__PURE__ */
|
|
3303
|
-
/* @__PURE__ */
|
|
3304
|
-
/* @__PURE__ */
|
|
3305
|
-
/* @__PURE__ */
|
|
3450
|
+
return /* @__PURE__ */ jsxs7("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
|
|
3451
|
+
/* @__PURE__ */ jsx7("style", { children: lifecycleSurfaceStyles }),
|
|
3452
|
+
/* @__PURE__ */ jsx7("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs7("div", { children: [
|
|
3453
|
+
/* @__PURE__ */ jsx7("strong", { children: "Payments" }),
|
|
3454
|
+
/* @__PURE__ */ jsx7("span", { children: "Funds recorded against this bill." })
|
|
3306
3455
|
] }) }),
|
|
3307
|
-
!payments.length ? /* @__PURE__ */
|
|
3456
|
+
!payments.length ? /* @__PURE__ */ jsx7("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx7("div", { className: "mb-payment-list", children: payments.map((payment) => {
|
|
3308
3457
|
const additional = payment.feeAmount ?? 0;
|
|
3309
|
-
return /* @__PURE__ */
|
|
3310
|
-
/* @__PURE__ */
|
|
3311
|
-
/* @__PURE__ */
|
|
3312
|
-
/* @__PURE__ */
|
|
3458
|
+
return /* @__PURE__ */ jsxs7("article", { children: [
|
|
3459
|
+
/* @__PURE__ */ jsxs7("div", { className: "mb-payment-amount", children: [
|
|
3460
|
+
/* @__PURE__ */ jsx7("strong", { children: currency(payment.amount) }),
|
|
3461
|
+
/* @__PURE__ */ jsx7("span", { children: "Total received" })
|
|
3313
3462
|
] }),
|
|
3314
|
-
/* @__PURE__ */
|
|
3315
|
-
/* @__PURE__ */
|
|
3316
|
-
/* @__PURE__ */
|
|
3317
|
-
/* @__PURE__ */
|
|
3463
|
+
/* @__PURE__ */ jsxs7("dl", { children: [
|
|
3464
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3465
|
+
/* @__PURE__ */ jsx7("dt", { children: "Applied to bill" }),
|
|
3466
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(payment.principalAmount) })
|
|
3318
3467
|
] }),
|
|
3319
|
-
additional > 0 ? /* @__PURE__ */
|
|
3320
|
-
/* @__PURE__ */
|
|
3321
|
-
/* @__PURE__ */
|
|
3468
|
+
additional > 0 ? /* @__PURE__ */ jsxs7("div", { children: [
|
|
3469
|
+
/* @__PURE__ */ jsx7("dt", { children: "Penalty & interest" }),
|
|
3470
|
+
/* @__PURE__ */ jsx7("dd", { children: currency(additional) })
|
|
3322
3471
|
] }) : null,
|
|
3323
|
-
/* @__PURE__ */
|
|
3324
|
-
/* @__PURE__ */
|
|
3325
|
-
/* @__PURE__ */
|
|
3472
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3473
|
+
/* @__PURE__ */ jsx7("dt", { children: "Method" }),
|
|
3474
|
+
/* @__PURE__ */ jsx7("dd", { children: payment.method.toUpperCase() })
|
|
3326
3475
|
] }),
|
|
3327
|
-
/* @__PURE__ */
|
|
3328
|
-
/* @__PURE__ */
|
|
3329
|
-
/* @__PURE__ */
|
|
3476
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3477
|
+
/* @__PURE__ */ jsx7("dt", { children: "Reference" }),
|
|
3478
|
+
/* @__PURE__ */ jsx7("dd", { children: payment.checkNumber || "\u2014" })
|
|
3330
3479
|
] }),
|
|
3331
|
-
/* @__PURE__ */
|
|
3332
|
-
/* @__PURE__ */
|
|
3333
|
-
/* @__PURE__ */
|
|
3480
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3481
|
+
/* @__PURE__ */ jsx7("dt", { children: "Effective date" }),
|
|
3482
|
+
/* @__PURE__ */ jsx7("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
|
|
3334
3483
|
] }),
|
|
3335
|
-
/* @__PURE__ */
|
|
3336
|
-
/* @__PURE__ */
|
|
3337
|
-
/* @__PURE__ */
|
|
3484
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3485
|
+
/* @__PURE__ */ jsx7("dt", { children: "Deposit date" }),
|
|
3486
|
+
/* @__PURE__ */ jsx7("dd", { children: payment.depositDate || "Not recorded" })
|
|
3338
3487
|
] }),
|
|
3339
|
-
/* @__PURE__ */
|
|
3340
|
-
/* @__PURE__ */
|
|
3341
|
-
/* @__PURE__ */
|
|
3488
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3489
|
+
/* @__PURE__ */ jsx7("dt", { children: "Posted" }),
|
|
3490
|
+
/* @__PURE__ */ jsxs7("dd", { children: [
|
|
3342
3491
|
defaultFormatDate(payment.postedAt),
|
|
3343
3492
|
" \xB7 ",
|
|
3344
3493
|
payment.source.toUpperCase()
|
|
3345
3494
|
] })
|
|
3346
3495
|
] }),
|
|
3347
|
-
/* @__PURE__ */
|
|
3348
|
-
/* @__PURE__ */
|
|
3349
|
-
/* @__PURE__ */
|
|
3496
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3497
|
+
/* @__PURE__ */ jsx7("dt", { children: "Status" }),
|
|
3498
|
+
/* @__PURE__ */ jsx7("dd", { children: humanize(payment.status || "posted") })
|
|
3350
3499
|
] })
|
|
3351
3500
|
] }),
|
|
3352
|
-
payment.feeReason ? /* @__PURE__ */
|
|
3353
|
-
payment.note ? /* @__PURE__ */
|
|
3501
|
+
payment.feeReason ? /* @__PURE__ */ jsx7("p", { children: payment.feeReason }) : null,
|
|
3502
|
+
payment.note ? /* @__PURE__ */ jsx7("p", { children: payment.note }) : null
|
|
3354
3503
|
] }, payment.id);
|
|
3355
3504
|
}) })
|
|
3356
3505
|
] });
|
|
@@ -3381,7 +3530,7 @@ var lifecycleSurfaceStyles = `
|
|
|
3381
3530
|
import {
|
|
3382
3531
|
useCallback as useCallback3,
|
|
3383
3532
|
useEffect as useEffect5,
|
|
3384
|
-
useMemo as
|
|
3533
|
+
useMemo as useMemo6,
|
|
3385
3534
|
useRef as useRef4,
|
|
3386
3535
|
useState as useState6
|
|
3387
3536
|
} from "react";
|
|
@@ -3391,7 +3540,7 @@ import {
|
|
|
3391
3540
|
createBillLifecycleClient
|
|
3392
3541
|
} from "@mindbill/browser";
|
|
3393
3542
|
import { createBillLifecycleClient as createBillLifecycleClient2 } from "@mindbill/browser";
|
|
3394
|
-
import { Fragment as Fragment5, jsx as
|
|
3543
|
+
import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3395
3544
|
var DEFAULT_REFRESH_INTERVAL2 = 6e4;
|
|
3396
3545
|
function reservePreviewWindow() {
|
|
3397
3546
|
const preview = window.open("about:blank", "_blank");
|
|
@@ -3444,7 +3593,7 @@ function useBillLifecycle({
|
|
|
3444
3593
|
const [isRefreshing, setIsRefreshing] = useState6(false);
|
|
3445
3594
|
const [isMutating, setIsMutating] = useState6(false);
|
|
3446
3595
|
const mounted = useRef4(true);
|
|
3447
|
-
const client =
|
|
3596
|
+
const client = useMemo6(() => createBillLifecycleClient({
|
|
3448
3597
|
billId: providedBillId,
|
|
3449
3598
|
sessionEndpoint,
|
|
3450
3599
|
getSession,
|
|
@@ -3555,8 +3704,8 @@ function LifecycleDialog({ children, title, onClose }) {
|
|
|
3555
3704
|
previous?.focus();
|
|
3556
3705
|
};
|
|
3557
3706
|
}, [onClose]);
|
|
3558
|
-
return /* @__PURE__ */
|
|
3559
|
-
/* @__PURE__ */
|
|
3707
|
+
return /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs8("div", { ref: dialog, className: "mb-lifecycle-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
|
|
3708
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
|
|
3560
3709
|
children
|
|
3561
3710
|
] }) });
|
|
3562
3711
|
}
|
|
@@ -3613,13 +3762,13 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
|
|
|
3613
3762
|
attachmentIds: current.attachmentIds.length ? current.attachmentIds.filter((id) => data.bill.attachments.some((document2) => document2.id === id)) : data.bill.attachments.map((document2) => document2.id)
|
|
3614
3763
|
}));
|
|
3615
3764
|
}, [data, onChanged]);
|
|
3616
|
-
if (lifecycle.isLoading && !data) return /* @__PURE__ */
|
|
3765
|
+
if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx8(Fragment5, { children: loadingFallback ?? /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
|
|
3617
3766
|
if (!data) {
|
|
3618
3767
|
const error = lifecycle.error ?? new Error("Bill could not be loaded.");
|
|
3619
|
-
return /* @__PURE__ */
|
|
3620
|
-
/* @__PURE__ */
|
|
3621
|
-
/* @__PURE__ */
|
|
3622
|
-
/* @__PURE__ */
|
|
3768
|
+
return /* @__PURE__ */ jsx8(Fragment5, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-error", role: "alert", children: [
|
|
3769
|
+
/* @__PURE__ */ jsx8("strong", { children: "Billing is unavailable." }),
|
|
3770
|
+
/* @__PURE__ */ jsx8("span", { children: error.message }),
|
|
3771
|
+
/* @__PURE__ */ jsx8("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
|
|
3623
3772
|
] }) });
|
|
3624
3773
|
}
|
|
3625
3774
|
const complete = async (message, task) => {
|
|
@@ -3637,170 +3786,170 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
|
|
|
3637
3786
|
const actions = data.lifecycle.actions.filter((action) => action.enabled && supportedActions.has(action.id));
|
|
3638
3787
|
const showSandboxControls = shouldShowSandboxControls(data.environment, sandboxControls);
|
|
3639
3788
|
const simulations = showSandboxControls ? sandboxScenarios(data.lifecycle.state) : [];
|
|
3640
|
-
return /* @__PURE__ */
|
|
3641
|
-
/* @__PURE__ */
|
|
3642
|
-
/* @__PURE__ */
|
|
3643
|
-
/* @__PURE__ */
|
|
3644
|
-
/* @__PURE__ */
|
|
3645
|
-
/* @__PURE__ */
|
|
3789
|
+
return /* @__PURE__ */ jsxs8("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
|
|
3790
|
+
/* @__PURE__ */ jsx8("style", { children: CONNECTED_LIFECYCLE_STYLES }),
|
|
3791
|
+
/* @__PURE__ */ jsx8(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
|
|
3792
|
+
/* @__PURE__ */ jsxs8("header", { className: "mb-lifecycle-head", children: [
|
|
3793
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3794
|
+
/* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs8("h2", { children: [
|
|
3646
3795
|
"Bill #",
|
|
3647
3796
|
data.bill.billNumber
|
|
3648
3797
|
] }) }),
|
|
3649
|
-
/* @__PURE__ */
|
|
3798
|
+
/* @__PURE__ */ jsxs8("p", { children: [
|
|
3650
3799
|
"Claim ",
|
|
3651
3800
|
data.injury.claimNumber || "\u2014",
|
|
3652
3801
|
lifecycle.isRefreshing ? " \xB7 Refreshing\u2026" : ""
|
|
3653
3802
|
] })
|
|
3654
3803
|
] }),
|
|
3655
|
-
/* @__PURE__ */
|
|
3804
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
|
|
3656
3805
|
] }),
|
|
3657
|
-
/* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3806
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
|
|
3807
|
+
/* @__PURE__ */ jsx8("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
|
|
3808
|
+
/* @__PURE__ */ jsx8("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
|
|
3660
3809
|
] }),
|
|
3661
|
-
tab === "details" ? /* @__PURE__ */
|
|
3662
|
-
data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */
|
|
3663
|
-
showSandboxControls ? /* @__PURE__ */
|
|
3664
|
-
/* @__PURE__ */
|
|
3665
|
-
/* @__PURE__ */
|
|
3666
|
-
/* @__PURE__ */
|
|
3667
|
-
/* @__PURE__ */
|
|
3810
|
+
tab === "details" ? /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
|
|
3811
|
+
data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx8(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
|
|
3812
|
+
showSandboxControls ? /* @__PURE__ */ jsxs8("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
|
|
3813
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3814
|
+
/* @__PURE__ */ jsx8("span", { children: "Sandbox demo controls" }),
|
|
3815
|
+
/* @__PURE__ */ jsx8("h3", { children: "Simulate the next payer response" }),
|
|
3816
|
+
/* @__PURE__ */ jsx8("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
|
|
3668
3817
|
] }),
|
|
3669
|
-
simulations.length ? /* @__PURE__ */
|
|
3670
|
-
/* @__PURE__ */
|
|
3671
|
-
/* @__PURE__ */
|
|
3672
|
-
] }, scenario.id)) }) : /* @__PURE__ */
|
|
3818
|
+
simulations.length ? /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs8("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
|
|
3819
|
+
/* @__PURE__ */ jsx8("strong", { children: scenario.label }),
|
|
3820
|
+
/* @__PURE__ */ jsx8("span", { children: scenario.detail })
|
|
3821
|
+
] }, scenario.id)) }) : /* @__PURE__ */ jsx8("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
|
|
3673
3822
|
] }) : null,
|
|
3674
|
-
/* @__PURE__ */
|
|
3675
|
-
] }) : /* @__PURE__ */
|
|
3676
|
-
viewEor || actions.length ? /* @__PURE__ */
|
|
3677
|
-
viewEor && data.eors[0] ? /* @__PURE__ */
|
|
3678
|
-
actions.map((action) => /* @__PURE__ */
|
|
3823
|
+
/* @__PURE__ */ jsx8(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} })
|
|
3824
|
+
] }) : /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: /* @__PURE__ */ jsx8(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
|
|
3825
|
+
viewEor || actions.length ? /* @__PURE__ */ jsxs8("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
|
|
3826
|
+
viewEor && data.eors[0] ? /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
|
|
3827
|
+
actions.map((action) => /* @__PURE__ */ jsx8("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
|
|
3679
3828
|
const next = actionPanel(action);
|
|
3680
3829
|
if (next) setPanel(next);
|
|
3681
3830
|
}, children: action.label }, action.id))
|
|
3682
3831
|
] }) : null,
|
|
3683
|
-
panel === "resubmit" ? /* @__PURE__ */
|
|
3684
|
-
/* @__PURE__ */
|
|
3685
|
-
/* @__PURE__ */
|
|
3686
|
-
/* @__PURE__ */
|
|
3832
|
+
panel === "resubmit" ? /* @__PURE__ */ jsx8(LifecycleDialog, { title: "Correct and resubmit", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs8("section", { className: "mb-lifecycle-panel", children: [
|
|
3833
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3834
|
+
/* @__PURE__ */ jsx8("h3", { children: "Correct and resubmit" }),
|
|
3835
|
+
/* @__PURE__ */ jsx8("p", { children: "The original submission remains immutable. This records a new submission attempt after the routing issue is corrected." })
|
|
3687
3836
|
] }),
|
|
3688
|
-
/* @__PURE__ */
|
|
3689
|
-
/* @__PURE__ */
|
|
3690
|
-
/* @__PURE__ */
|
|
3837
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
3838
|
+
/* @__PURE__ */ jsx8("span", { children: "Correction note (optional)" }),
|
|
3839
|
+
/* @__PURE__ */ jsx8("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
|
|
3691
3840
|
] }),
|
|
3692
|
-
/* @__PURE__ */
|
|
3693
|
-
/* @__PURE__ */
|
|
3694
|
-
/* @__PURE__ */
|
|
3841
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-panel-actions", children: [
|
|
3842
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
|
|
3843
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void complete("Bill resubmitted.", () => lifecycle.resubmitBill({ reason })), children: lifecycle.isMutating ? "Resubmitting\u2026" : "Resubmit bill" })
|
|
3695
3844
|
] })
|
|
3696
3845
|
] }) }) : null,
|
|
3697
|
-
panel === "second_review" ? /* @__PURE__ */
|
|
3698
|
-
/* @__PURE__ */
|
|
3699
|
-
/* @__PURE__ */
|
|
3700
|
-
/* @__PURE__ */
|
|
3846
|
+
panel === "second_review" ? /* @__PURE__ */ jsx8(LifecycleDialog, { title: "Submit Second Review", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs8("section", { className: "mb-lifecycle-panel", children: [
|
|
3847
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3848
|
+
/* @__PURE__ */ jsx8("h3", { children: "Submit Second Review" }),
|
|
3849
|
+
/* @__PURE__ */ jsx8("p", { children: "Explain the dispute and include the payer control number and supporting documents." })
|
|
3701
3850
|
] }),
|
|
3702
|
-
/* @__PURE__ */
|
|
3703
|
-
/* @__PURE__ */
|
|
3704
|
-
/* @__PURE__ */
|
|
3705
|
-
/* @__PURE__ */
|
|
3851
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-fields two", children: [
|
|
3852
|
+
/* @__PURE__ */ jsxs8("label", { className: "full", children: [
|
|
3853
|
+
/* @__PURE__ */ jsx8("span", { children: "Reason" }),
|
|
3854
|
+
/* @__PURE__ */ jsx8("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
|
|
3706
3855
|
] }),
|
|
3707
|
-
/* @__PURE__ */
|
|
3708
|
-
/* @__PURE__ */
|
|
3709
|
-
/* @__PURE__ */
|
|
3856
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
3857
|
+
/* @__PURE__ */ jsx8("span", { children: "Payer claim control number" }),
|
|
3858
|
+
/* @__PURE__ */ jsx8("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
|
|
3710
3859
|
] }),
|
|
3711
|
-
/* @__PURE__ */
|
|
3712
|
-
/* @__PURE__ */
|
|
3713
|
-
/* @__PURE__ */
|
|
3860
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
3861
|
+
/* @__PURE__ */ jsx8("span", { children: "Disputed amount" }),
|
|
3862
|
+
/* @__PURE__ */ jsx8("input", { type: "number", min: "0.01", step: "0.01", value: review.disputedAmount ?? "", onChange: (event) => setReview((current) => ({ ...current, disputedAmount: event.target.value ? Number(event.target.value) : void 0 })) })
|
|
3714
3863
|
] }),
|
|
3715
|
-
/* @__PURE__ */
|
|
3716
|
-
/* @__PURE__ */
|
|
3717
|
-
/* @__PURE__ */
|
|
3718
|
-
/* @__PURE__ */
|
|
3719
|
-
/* @__PURE__ */
|
|
3720
|
-
/* @__PURE__ */
|
|
3721
|
-
/* @__PURE__ */
|
|
3864
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
3865
|
+
/* @__PURE__ */ jsx8("span", { children: "Send via" }),
|
|
3866
|
+
/* @__PURE__ */ jsxs8("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
|
|
3867
|
+
/* @__PURE__ */ jsx8("option", { value: "ebill", children: "E-bill" }),
|
|
3868
|
+
/* @__PURE__ */ jsx8("option", { value: "fax", children: "Fax" }),
|
|
3869
|
+
/* @__PURE__ */ jsx8("option", { value: "mail", children: "Mail" }),
|
|
3870
|
+
/* @__PURE__ */ jsx8("option", { value: "email", children: "Email" })
|
|
3722
3871
|
] })
|
|
3723
3872
|
] })
|
|
3724
3873
|
] }),
|
|
3725
|
-
/* @__PURE__ */
|
|
3726
|
-
/* @__PURE__ */
|
|
3727
|
-
data.bill.attachments.map((attachment) => /* @__PURE__ */
|
|
3728
|
-
/* @__PURE__ */
|
|
3729
|
-
/* @__PURE__ */
|
|
3730
|
-
/* @__PURE__ */
|
|
3731
|
-
/* @__PURE__ */
|
|
3874
|
+
/* @__PURE__ */ jsxs8("fieldset", { className: "mb-lifecycle-packet", children: [
|
|
3875
|
+
/* @__PURE__ */ jsx8("legend", { children: "Supporting packet" }),
|
|
3876
|
+
data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs8("label", { children: [
|
|
3877
|
+
/* @__PURE__ */ jsx8("input", { type: "checkbox", checked: review.attachmentIds.includes(attachment.id), onChange: (event) => setReview((current) => ({ ...current, attachmentIds: event.target.checked ? [...current.attachmentIds, attachment.id] : current.attachmentIds.filter((id) => id !== attachment.id) })) }),
|
|
3878
|
+
/* @__PURE__ */ jsxs8("span", { children: [
|
|
3879
|
+
/* @__PURE__ */ jsx8("strong", { children: attachment.filename }),
|
|
3880
|
+
/* @__PURE__ */ jsx8("small", { children: attachment.description || attachment.documentType })
|
|
3732
3881
|
] }),
|
|
3733
|
-
/* @__PURE__ */
|
|
3882
|
+
/* @__PURE__ */ jsx8("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" })
|
|
3734
3883
|
] }, attachment.id))
|
|
3735
3884
|
] }),
|
|
3736
|
-
/* @__PURE__ */
|
|
3737
|
-
/* @__PURE__ */
|
|
3738
|
-
/* @__PURE__ */
|
|
3885
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-panel-actions", children: [
|
|
3886
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
|
|
3887
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !review.reason.trim() || !review.payerClaimControlNumber.trim(), onClick: () => void complete("Second Review submitted.", () => lifecycle.submitSecondReview(review)), children: lifecycle.isMutating ? "Submitting\u2026" : "Submit Second Review" })
|
|
3739
3888
|
] })
|
|
3740
3889
|
] }) }) : null,
|
|
3741
|
-
panel === "payment" ? /* @__PURE__ */
|
|
3742
|
-
/* @__PURE__ */
|
|
3743
|
-
/* @__PURE__ */
|
|
3744
|
-
/* @__PURE__ */
|
|
3890
|
+
panel === "payment" ? /* @__PURE__ */ jsx8(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs8("section", { className: "mb-lifecycle-panel", children: [
|
|
3891
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3892
|
+
/* @__PURE__ */ jsx8("h3", { children: "Post payment" }),
|
|
3893
|
+
/* @__PURE__ */ jsx8("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
|
|
3745
3894
|
] }),
|
|
3746
|
-
/* @__PURE__ */
|
|
3747
|
-
/* @__PURE__ */
|
|
3748
|
-
/* @__PURE__ */
|
|
3749
|
-
/* @__PURE__ */
|
|
3895
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-fields two", children: [
|
|
3896
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
3897
|
+
/* @__PURE__ */ jsx8("span", { children: "Amount applied to bill" }),
|
|
3898
|
+
/* @__PURE__ */ jsx8("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
|
|
3750
3899
|
] }),
|
|
3751
|
-
/* @__PURE__ */
|
|
3752
|
-
/* @__PURE__ */
|
|
3753
|
-
/* @__PURE__ */
|
|
3900
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
3901
|
+
/* @__PURE__ */ jsx8("span", { children: "Penalty" }),
|
|
3902
|
+
/* @__PURE__ */ jsx8("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
|
|
3754
3903
|
] }),
|
|
3755
|
-
/* @__PURE__ */
|
|
3756
|
-
/* @__PURE__ */
|
|
3757
|
-
/* @__PURE__ */
|
|
3904
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
3905
|
+
/* @__PURE__ */ jsx8("span", { children: "Interest" }),
|
|
3906
|
+
/* @__PURE__ */ jsx8("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
|
|
3758
3907
|
] }),
|
|
3759
|
-
/* @__PURE__ */
|
|
3760
|
-
/* @__PURE__ */
|
|
3761
|
-
/* @__PURE__ */
|
|
3762
|
-
/* @__PURE__ */
|
|
3763
|
-
/* @__PURE__ */
|
|
3908
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
3909
|
+
/* @__PURE__ */ jsx8("span", { children: "Method" }),
|
|
3910
|
+
/* @__PURE__ */ jsxs8("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
|
|
3911
|
+
/* @__PURE__ */ jsx8("option", { value: "check", children: "Check" }),
|
|
3912
|
+
/* @__PURE__ */ jsx8("option", { value: "eft", children: "EFT" })
|
|
3764
3913
|
] })
|
|
3765
3914
|
] }),
|
|
3766
|
-
/* @__PURE__ */
|
|
3767
|
-
/* @__PURE__ */
|
|
3768
|
-
/* @__PURE__ */
|
|
3915
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
3916
|
+
/* @__PURE__ */ jsx8("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
|
|
3917
|
+
/* @__PURE__ */ jsx8("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
|
|
3769
3918
|
] }),
|
|
3770
|
-
/* @__PURE__ */
|
|
3771
|
-
/* @__PURE__ */
|
|
3772
|
-
/* @__PURE__ */
|
|
3919
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
3920
|
+
/* @__PURE__ */ jsx8("span", { children: "Deposit date" }),
|
|
3921
|
+
/* @__PURE__ */ jsx8("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
|
|
3773
3922
|
] }),
|
|
3774
|
-
/* @__PURE__ */
|
|
3775
|
-
/* @__PURE__ */
|
|
3776
|
-
/* @__PURE__ */
|
|
3923
|
+
/* @__PURE__ */ jsxs8("label", { className: "full", children: [
|
|
3924
|
+
/* @__PURE__ */ jsx8("span", { children: "Note (optional)" }),
|
|
3925
|
+
/* @__PURE__ */ jsx8("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
|
|
3777
3926
|
] })
|
|
3778
3927
|
] }),
|
|
3779
|
-
/* @__PURE__ */
|
|
3780
|
-
/* @__PURE__ */
|
|
3781
|
-
/* @__PURE__ */
|
|
3928
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-payment-total", children: [
|
|
3929
|
+
/* @__PURE__ */ jsx8("span", { children: "Total received" }),
|
|
3930
|
+
/* @__PURE__ */ jsx8("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
|
|
3782
3931
|
] }),
|
|
3783
|
-
/* @__PURE__ */
|
|
3784
|
-
/* @__PURE__ */
|
|
3785
|
-
/* @__PURE__ */
|
|
3932
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-panel-actions", children: [
|
|
3933
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
|
|
3934
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || (payment.penaltyAmount ?? 0) < 0 || (payment.interestAmount ?? 0) < 0 || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
|
|
3786
3935
|
] })
|
|
3787
3936
|
] }) }) : null,
|
|
3788
|
-
panel === "close" || panel === "reopen" ? /* @__PURE__ */
|
|
3789
|
-
/* @__PURE__ */
|
|
3790
|
-
/* @__PURE__ */
|
|
3791
|
-
/* @__PURE__ */
|
|
3937
|
+
panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx8(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs8("section", { className: "mb-lifecycle-panel", children: [
|
|
3938
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3939
|
+
/* @__PURE__ */ jsx8("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
|
|
3940
|
+
/* @__PURE__ */ jsx8("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
|
|
3792
3941
|
] }),
|
|
3793
|
-
/* @__PURE__ */
|
|
3794
|
-
/* @__PURE__ */
|
|
3795
|
-
/* @__PURE__ */
|
|
3942
|
+
/* @__PURE__ */ jsxs8("label", { children: [
|
|
3943
|
+
/* @__PURE__ */ jsx8("span", { children: "Reason" }),
|
|
3944
|
+
/* @__PURE__ */ jsx8("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
|
|
3796
3945
|
] }),
|
|
3797
|
-
/* @__PURE__ */
|
|
3798
|
-
/* @__PURE__ */
|
|
3799
|
-
/* @__PURE__ */
|
|
3946
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-panel-actions", children: [
|
|
3947
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
|
|
3948
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !reason.trim(), onClick: () => void complete(panel === "close" ? "Bill closed." : "Bill reopened.", () => panel === "close" ? lifecycle.closeBill({ reason }) : lifecycle.reopenBill({ reason })), children: lifecycle.isMutating ? "Saving\u2026" : panel === "close" ? "Close bill" : "Reopen bill" })
|
|
3800
3949
|
] })
|
|
3801
3950
|
] }) }) : null,
|
|
3802
|
-
notice ? /* @__PURE__ */
|
|
3803
|
-
lifecycle.error ? /* @__PURE__ */
|
|
3951
|
+
notice ? /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
|
|
3952
|
+
lifecycle.error ? /* @__PURE__ */ jsx8("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
|
|
3804
3953
|
] });
|
|
3805
3954
|
}
|
|
3806
3955
|
var CONNECTED_LIFECYCLE_STYLES = `
|
|
@@ -3851,6 +4000,7 @@ function MindBillBillReview(props) {
|
|
|
3851
4000
|
return widget("mindbill-bill-review", props);
|
|
3852
4001
|
}
|
|
3853
4002
|
export {
|
|
4003
|
+
BILL_STATUS_AGING_BUCKETS,
|
|
3854
4004
|
BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS,
|
|
3855
4005
|
BILL_SUBMISSION_DOCUMENT_TYPES,
|
|
3856
4006
|
BILL_SUBMISSION_REPORT_TYPES,
|
|
@@ -3867,6 +4017,7 @@ export {
|
|
|
3867
4017
|
BillRemittanceCard,
|
|
3868
4018
|
BillReviewForm,
|
|
3869
4019
|
BillSnapshotSummary,
|
|
4020
|
+
BillStatusAgingMatrix,
|
|
3870
4021
|
BillStatusSummary,
|
|
3871
4022
|
BillSubmissionActions,
|
|
3872
4023
|
BillSubmissionAttachmentsSection,
|
|
@@ -3895,6 +4046,8 @@ export {
|
|
|
3895
4046
|
billLifecycleDisplayLabel,
|
|
3896
4047
|
billLifecycleStage,
|
|
3897
4048
|
buildBillReviewSaveInput,
|
|
4049
|
+
buildBillStatusAgingCsv,
|
|
4050
|
+
buildBillStatusAgingMatrix,
|
|
3898
4051
|
buildBillingReportCsv,
|
|
3899
4052
|
buildBillingReportRows,
|
|
3900
4053
|
calculateBillSubmissionAllowedAmount,
|