@mindbill/react 0.77.57 → 0.77.59
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/dist/index.js +53 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10598,22 +10598,29 @@ var taskViewDescriptions = {
|
|
|
10598
10598
|
Scheduled: "Open tasks with a future follow-up date. This does not mean a treatment appointment is scheduled.",
|
|
10599
10599
|
Completed: "Tasks that have been resolved. Completing a task does not necessarily close its RFA."
|
|
10600
10600
|
};
|
|
10601
|
-
var names = { send_rfa: "Send RFA", no_response: "Decision overdue", transmission_failed: "Submission failed", information_requested: "Respond to information request", clock_review: "Deadline needs review", schedule_treatment: "Schedule treatment", post_ur_decision: "Post UR", document_required: "Add supporting documents" };
|
|
10601
|
+
var names = { send_rfa: "Send RFA", no_response: "Decision overdue", transmission_failed: "Submission failed", information_requested: "Respond to information request", clock_review: "Deadline needs review", schedule_treatment: "Schedule treatment", post_ur_decision: "Post UR", post_ur_approved: "Approved \u2014 confirm and bill", post_ur_denied: "Denied or modified \u2014 review", document_required: "Add supporting documents" };
|
|
10602
10602
|
var descriptions = {
|
|
10603
10603
|
transmission_failed: "Delivery failed. Correct the issue before sending again.",
|
|
10604
10604
|
no_response: "The decision deadline passed without a recorded decision.",
|
|
10605
10605
|
clock_review: "The deadline cannot yet be calculated confidently. Review receipt and timing details.",
|
|
10606
|
-
post_ur_decision: "
|
|
10606
|
+
post_ur_decision: "A response arrived and its decisions are not recorded yet. Check what was read from it and save.",
|
|
10607
|
+
post_ur_approved: "Every treatment in this response was approved. Confirm the review, then bill the authorized care.",
|
|
10608
|
+
post_ur_denied: "This response denied or modified treatment. Confirm the review and decide on an appeal or independent medical review.",
|
|
10607
10609
|
information_requested: "Provide the additional information requested by the reviewer.",
|
|
10608
10610
|
schedule_treatment: "Arrange treatment after approval."
|
|
10609
10611
|
};
|
|
10612
|
+
function rfaTaskByResponseOutcome(task) {
|
|
10613
|
+
const outcome = task.responseOutcome;
|
|
10614
|
+
if (task.kind !== "post_ur_decision" || !outcome) return task;
|
|
10615
|
+
return { ...task, kind: outcome === "approved" ? "post_ur_approved" : "post_ur_denied" };
|
|
10616
|
+
}
|
|
10610
10617
|
var rfaTaskLabel = (kind) => names[kind] ?? kind.replaceAll("_", " ");
|
|
10611
10618
|
var taskAgeColumns = [{ key: "0-5", label: "0\u20135 days" }, { key: "6-14", label: "6\u201314 days" }, { key: "15-30", label: "15\u201330 days" }, { key: "31+", label: "31+ days" }];
|
|
10612
10619
|
var taskGroups = [
|
|
10613
10620
|
{ title: "Incomplete RFAs", kinds: ["document_required", "send_rfa"] },
|
|
10614
10621
|
{ title: "Delivery issues", kinds: ["transmission_failed"] },
|
|
10615
10622
|
{ title: "Decision deadlines", kinds: ["no_response", "clock_review"] },
|
|
10616
|
-
{ title: "Responses to process", kinds: ["post_ur_decision", "information_requested"] },
|
|
10623
|
+
{ title: "Responses to process", kinds: ["post_ur_decision", "post_ur_approved", "post_ur_denied", "information_requested"] },
|
|
10617
10624
|
{ title: "Treatment scheduling", kinds: ["schedule_treatment"] }
|
|
10618
10625
|
];
|
|
10619
10626
|
function rfaTaskAgeBucket(createdAt, now = Date.now()) {
|
|
@@ -10675,7 +10682,7 @@ function TaskBoardContent({ options, patientId, claimId, renderingProviderId, pe
|
|
|
10675
10682
|
let cursor;
|
|
10676
10683
|
do {
|
|
10677
10684
|
const result = await client.listFollowUps({ ...patientId ? { patientId } : {}, ...claimId ? { claimId } : {}, ...renderingProviderId ? { renderingProviderId } : {}, includeResolved: true, limit: 200, ...cursor ? { cursor } : {} });
|
|
10678
|
-
found.push(...result.data);
|
|
10685
|
+
found.push(...result.data.map(rfaTaskByResponseOutcome));
|
|
10679
10686
|
cursor = result.nextCursor ?? void 0;
|
|
10680
10687
|
if (cursor && seen.has(cursor)) throw new Error("Task pagination could not be completed. Retrying automatically.");
|
|
10681
10688
|
if (cursor) seen.add(cursor);
|
|
@@ -11400,6 +11407,21 @@ function rfaOutcome(item) {
|
|
|
11400
11407
|
if (item.outcome === "denied") return { label: "Denied", tone: "bad" };
|
|
11401
11408
|
return { label: sentence(item.outcome || "pending"), tone: "muted" };
|
|
11402
11409
|
}
|
|
11410
|
+
function rfaDecisionSummary(rfa) {
|
|
11411
|
+
const items = rfa.items.filter((item) => !item.decisionClosure?.closed);
|
|
11412
|
+
const decided = items.filter((item) => item.outcome !== "pending");
|
|
11413
|
+
if (!decided.length) return null;
|
|
11414
|
+
if (decided.length < items.length) return { label: "Partially decided", tone: "warn" };
|
|
11415
|
+
if (decided.every((item) => item.outcome === "approved")) return { label: "Approved", tone: "ok" };
|
|
11416
|
+
if (decided.every((item) => item.outcome === "denied")) return { label: "Denied", tone: "bad" };
|
|
11417
|
+
if (decided.every((item) => item.outcome === "modified")) return { label: "Modified", tone: "warn" };
|
|
11418
|
+
return { label: "Partially approved", tone: "warn" };
|
|
11419
|
+
}
|
|
11420
|
+
var FAX_FAILURES = { busy: "The line was busy", no_answer: "No answer", not_a_fax_machine: "The number did not answer as a fax machine", invalid_number: "The number is not in service", rejected: "The call was rejected", carrier_error: "The fax carrier could not complete the call" };
|
|
11421
|
+
function rfaFailureReason(transmission) {
|
|
11422
|
+
const reason = transmission.metadata?.failureReason;
|
|
11423
|
+
return transmission.status === "failed" && typeof reason === "string" ? FAX_FAILURES[reason] ?? "" : "";
|
|
11424
|
+
}
|
|
11403
11425
|
function RfaPill({ tone = "muted", children }) {
|
|
11404
11426
|
return /* @__PURE__ */ jsx30("span", { className: "mbrfa-pill", "data-tone": tone, children });
|
|
11405
11427
|
}
|
|
@@ -11417,11 +11439,12 @@ function RfaStatusCard({ rfa }) {
|
|
|
11417
11439
|
const stages = ["Draft", "Sent", "Received", "Decided"];
|
|
11418
11440
|
const current = rfa.submittedAt && decided ? 3 : rfa.receivedAt ? 2 : rfa.submittedAt ? 1 : 0;
|
|
11419
11441
|
const stopped = status === "canceled" || status === "failed";
|
|
11420
|
-
const
|
|
11442
|
+
const failure = status === "failed" ? rfa.transmissions.map(rfaFailureReason).filter(Boolean).at(-1) : "";
|
|
11443
|
+
const detail = status === "canceled" ? "This request was canceled" : status === "failed" ? `Delivery needs attention${failure ? `: ${failure.charAt(0).toLowerCase()}${failure.slice(1)}` : ""}` : rfa.submittedAt ? `Sent ${rfaShortDate(rfa.submittedAt)}` : "Not sent yet";
|
|
11421
11444
|
return /* @__PURE__ */ jsxs28("section", { className: "mbrfa-status", "aria-label": "Request status", "data-stopped": stopped || void 0, children: [
|
|
11422
11445
|
/* @__PURE__ */ jsxs28("div", { className: "mbrfa-status-heading", children: [
|
|
11423
11446
|
/* @__PURE__ */ jsxs28("div", { children: [
|
|
11424
|
-
/* @__PURE__ */ jsx30("h3", { children: !rfa.submittedAt && !stopped ? "Draft" : RFA_LIFECYCLE_LABELS2[status] }),
|
|
11447
|
+
/* @__PURE__ */ jsx30("h3", { children: !rfa.submittedAt && !stopped ? "Draft" : !stopped && rfaDecisionSummary(rfa) ? rfaDecisionSummary(rfa).label : RFA_LIFECYCLE_LABELS2[status] }),
|
|
11425
11448
|
/* @__PURE__ */ jsx30("p", { children: detail })
|
|
11426
11449
|
] }),
|
|
11427
11450
|
rfa.submittedAt && !stopped ? /* @__PURE__ */ jsxs28("div", { className: "mbrfa-status-due", children: [
|
|
@@ -11732,7 +11755,8 @@ function RfaTrackingContent({ rfa: provided, options, permissions = [], onUpdate
|
|
|
11732
11755
|
] }) }),
|
|
11733
11756
|
/* @__PURE__ */ jsx31("tbody", { children: rfa.items.map((item, index) => {
|
|
11734
11757
|
const appointment = scheduling.find((value) => value.itemId === item.id);
|
|
11735
|
-
const
|
|
11758
|
+
const awaiting = item.outcome === "pending" && !item.decisionClosure?.closed && rfa.items.some((other) => other.outcome !== "pending");
|
|
11759
|
+
const outcome = awaiting ? { label: "Awaiting decision", tone: "warn" } : rfaOutcome(item);
|
|
11736
11760
|
const showAppointment = !!appointment && (appointment.eligible || appointment.version > 0);
|
|
11737
11761
|
const closable = canClose && item.outcome === "pending" && !item.decidedAt;
|
|
11738
11762
|
const correctable = canCorrect && !!item.currentDecisionEventId && item.outcome !== "pending";
|
|
@@ -11844,7 +11868,8 @@ function RfaTrackingContent({ rfa: provided, options, permissions = [], onUpdate
|
|
|
11844
11868
|
transmission.providerMessageId ? /* @__PURE__ */ jsxs29("small", { children: [
|
|
11845
11869
|
"Reference ",
|
|
11846
11870
|
transmission.providerMessageId
|
|
11847
|
-
] }) : null
|
|
11871
|
+
] }) : null,
|
|
11872
|
+
rfaFailureReason(transmission) ? /* @__PURE__ */ jsx31("small", { children: rfaFailureReason(transmission) }) : null
|
|
11848
11873
|
] }),
|
|
11849
11874
|
/* @__PURE__ */ jsx31("td", { children: rfaShortDate(transmission.receivedAt) }),
|
|
11850
11875
|
/* @__PURE__ */ jsx31("td", { className: "mbrfa-row-actions", children: evidence(transmission.proofDocumentId, "Receipt") })
|
|
@@ -14154,7 +14179,7 @@ var rfaSendDialogCss = `.mbrfa-send-backdrop{position:fixed;z-index:1000;inset:0
|
|
|
14154
14179
|
.mbrfa-send [role=alert]{color:var(--mb-danger,#b42318);font-size:13px}
|
|
14155
14180
|
@media(max-width:640px){.mbrfa-send-backdrop{place-items:end stretch;padding:0}.mbrfa-send{width:100%;max-height:92vh;border-radius:var(--mb-radius) var(--mb-radius) 0 0}.mbrfa-send>footer{flex-direction:column}.mbrfa-send>footer>a{margin:0;align-self:center}}`;
|
|
14156
14181
|
var treatmentDetail = (item) => [item.procedureCode ? `CPT/HCPCS ${item.procedureCode}` : "", item.quantity ? `Qty ${item.quantity}` : "", item.frequency ?? "", item.duration ?? "", `Dx ${item.diagnosisCode}`].filter(Boolean).join(" \xB7 ");
|
|
14157
|
-
function RfaSendDialog({ rfa, client, documentIds, diagnosisDescriptions, directory, directoryLoading, directoryError, environment, canSend, canSign, actorReference, previewUrl, signatureSetup, signatureMissing, onUpdated, onSent, onClose }) {
|
|
14182
|
+
function RfaSendDialog({ rfa, client, documentIds, diagnosisDescriptions, directory, directoryLoading, directoryError, environment, canSend, canSign, actorReference, previewUrl, signatureSetup, signatureMissing, resend, onUpdated, onSent, onClose }) {
|
|
14158
14183
|
const [method, setMethod] = useState30(() => !rfa.authorizationContact?.fax?.trim() && rfa.authorizationContact?.email?.trim() ? "email" : "fax");
|
|
14159
14184
|
const [destination, setDestination] = useState30(null);
|
|
14160
14185
|
const [message, setMessage] = useState30("");
|
|
@@ -14191,6 +14216,7 @@ function RfaSendDialog({ rfa, client, documentIds, diagnosisDescriptions, direct
|
|
|
14191
14216
|
const supporting = rfa.documents.filter((document2) => ["clinical_report", "supporting_record"].includes(document2.documentType) && documentIds.includes(document2.id));
|
|
14192
14217
|
const missingDiagnosis = rfa.items.find((item) => !(diagnosisDescriptions[item.id] ?? item.diagnosisDescription ?? "").trim());
|
|
14193
14218
|
const live = environment === "live";
|
|
14219
|
+
const lastFailure = rfa.transmissions.map(rfaFailureReason).filter(Boolean).at(-1) ?? "";
|
|
14194
14220
|
const needsSignature = !rfa.signedAt && (signatureMissing ?? signatureRefused);
|
|
14195
14221
|
useEffect25(() => {
|
|
14196
14222
|
if (signatureMissing === false) setSignatureRefused(false);
|
|
@@ -14266,6 +14292,11 @@ function RfaSendDialog({ rfa, client, documentIds, diagnosisDescriptions, direct
|
|
|
14266
14292
|
supporting.length ? /* @__PURE__ */ jsx45("ul", { children: supporting.map((document2) => /* @__PURE__ */ jsx45("li", { children: document2.filename }, document2.id)) }) : /* @__PURE__ */ jsx45("p", { children: "None attached yet." })
|
|
14267
14293
|
] })
|
|
14268
14294
|
] }),
|
|
14295
|
+
resend ? /* @__PURE__ */ jsxs43("p", { className: "mbrfa-send-signature", role: "status", children: [
|
|
14296
|
+
"The last attempt did not go through",
|
|
14297
|
+
lastFailure ? `: ${lastFailure.charAt(0).toLowerCase()}${lastFailure.slice(1)}` : "",
|
|
14298
|
+
". Check the destination with the claims administrator, or choose another way to send, then send again."
|
|
14299
|
+
] }) : null,
|
|
14269
14300
|
/* @__PURE__ */ jsxs43("div", { className: "mbrfa-send-methods", role: "radiogroup", "aria-label": "Send by", children: [
|
|
14270
14301
|
/* @__PURE__ */ jsx45("span", { children: "Send by" }),
|
|
14271
14302
|
/* @__PURE__ */ jsxs43("label", { children: [
|
|
@@ -15164,6 +15195,10 @@ var sentence2 = (value) => {
|
|
|
15164
15195
|
var documentTypeLabel = (type) => ({ rfa_form: "DWC Form RFA", clinical_report: "Clinical report", supporting_record: "Supporting record", ur_response: "Utilization review response", imr_form: "Independent medical review form", fax_cover: "Fax cover sheet" })[type] ?? sentence2(type);
|
|
15165
15196
|
var date7 = (value) => value ? new Date(value).toLocaleString() : "Not recorded";
|
|
15166
15197
|
var key = () => `rfa-widget-${globalThis.crypto.randomUUID()}`;
|
|
15198
|
+
function rfaCanResend(rfa) {
|
|
15199
|
+
const attempts = rfa.transmissions.filter((sent) => sent.direction === "outbound" && (sent.purpose ?? "submission") === "submission");
|
|
15200
|
+
return rfa.status === "submitted" && !rfa.receivedAt && attempts.length > 0 && attempts.every((sent) => sent.status === "failed");
|
|
15201
|
+
}
|
|
15167
15202
|
function RfaDashboard({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride, patientId, claimId, renderingProviderId, signatureSession, ...props }) {
|
|
15168
15203
|
const options = useMemo13(() => ({ ...sessionEndpoint ? { sessionEndpoint } : {}, ...getSession ? { getSession } : {}, ...apiBaseUrl ? { apiBaseUrl } : {}, ...fetchOverride ? { fetch: fetchOverride } : {} }), [sessionEndpoint, getSession, apiBaseUrl, fetchOverride]);
|
|
15169
15204
|
const client = useMemo13(() => createRfaClient4(options), [options]);
|
|
@@ -15622,6 +15657,9 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
15622
15657
|
const locked = busy || disabled;
|
|
15623
15658
|
const canSign = permissions.includes("sign") && !!actorReference?.trim();
|
|
15624
15659
|
const unsent = rfa && !rfa.submittedAt && ["draft", "ready", "incomplete", "deferred"].includes(rfa.status);
|
|
15660
|
+
const resendable = !!rfa && rfaCanResend(rfa);
|
|
15661
|
+
const decision = rfa && !unsent && !["failed", "canceled"].includes(getRfaLifecycleStatus4(rfa)) ? rfaDecisionSummary(rfa) : null;
|
|
15662
|
+
const statusPill = rfa ? /* @__PURE__ */ jsx49(RfaPill, { tone: decision ? decision.tone : rfaLifecycleTone(rfa), children: unsent ? "Draft" : decision ? decision.label : RFA_LIFECYCLE_LABELS5[getRfaLifecycleStatus4(rfa)] }) : null;
|
|
15625
15663
|
const reviewable = !!rfa && (!!rfa.submittedAt || ["submitted", "received", "under_review", "information_requested", "approved", "modified", "denied", "mixed", "incomplete", "deferred"].includes(rfa.status));
|
|
15626
15664
|
const openDocument = (documentId, title) => run(async () => {
|
|
15627
15665
|
const blob = await client.getDocument(id, documentId);
|
|
@@ -15639,7 +15677,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
15639
15677
|
/* @__PURE__ */ jsxs47("div", { className: "mbrfa-detail-toolbar", children: [
|
|
15640
15678
|
/* @__PURE__ */ jsx49("div", { children: simple ? /* @__PURE__ */ jsxs47(Fragment28, { children: [
|
|
15641
15679
|
/* @__PURE__ */ jsx49("h2", { children: rfa.displayReference || "Request for Authorization" }),
|
|
15642
|
-
|
|
15680
|
+
statusPill,
|
|
15643
15681
|
/* @__PURE__ */ jsx49(RfaPill, { children: rfa.expedited ? "Expedited" : sentence2(rfa.reviewType) }),
|
|
15644
15682
|
rfa.claimNumber ? /* @__PURE__ */ jsxs47(RfaPill, { tone: "mono", children: [
|
|
15645
15683
|
"Claim ",
|
|
@@ -15935,7 +15973,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
15935
15973
|
] })
|
|
15936
15974
|
] }),
|
|
15937
15975
|
!editing || !simple ? /* @__PURE__ */ jsxs47("div", { className: "mbrfa-bottom-actions", children: [
|
|
15938
|
-
simple ?
|
|
15976
|
+
simple ? statusPill : /* @__PURE__ */ jsx49("span", { className: "mbrfa-badge", children: RFA_LIFECYCLE_LABELS5[getRfaLifecycleStatus4(rfa)] }),
|
|
15939
15977
|
/* @__PURE__ */ jsxs47("div", { className: "mbtd-actions", children: [
|
|
15940
15978
|
!simple && permissions.includes("edit") && canEditRfaDraft(rfa) && !editing ? /* @__PURE__ */ jsx49("button", { type: "button", className: "mbtd-primary", disabled: locked, onClick: () => {
|
|
15941
15979
|
setDetailTab("details");
|
|
@@ -15946,8 +15984,8 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
15946
15984
|
/* @__PURE__ */ jsx49("summary", { children: "More" }),
|
|
15947
15985
|
/* @__PURE__ */ jsx49("div", { children: /* @__PURE__ */ jsx49(RfaDraftActions, { deleteWording: true, ...options, rfa, disabled: !!locked, permissions: permissions.filter((permission) => permission === "create" || permission === "edit"), onCopied, onCanceled: adopt }) })
|
|
15948
15986
|
] }) : /* @__PURE__ */ jsx49(RfaDraftActions, { ...options, rfa, disabled: !!locked, permissions: permissions.filter((permission) => permission === "create" || permission === "edit"), onCopied, onCanceled: adopt }),
|
|
15949
|
-
simple && !unsent && !!rfa.submittedAt && rfa.status !== "canceled" && permissions.includes("act") ? /* @__PURE__ */ jsx49("button", { type: "button", disabled: locked, onClick: () => setDuplicating(true), children: "Send duplicate" }) : null,
|
|
15950
|
-
simple && unsent ? /* @__PURE__ */ jsx49("button", { type: "button", className: "mbtd-primary", disabled: locked, onClick: () => setSending(true), children: "Send" }) : simple && reviewable && detailTab === "details" ? /* @__PURE__ */ jsx49("button", { type: "button", disabled: locked, onClick: () => reveal("review"), children: "Record response" }) : null
|
|
15987
|
+
simple && !unsent && !resendable && !!rfa.submittedAt && rfa.status !== "canceled" && permissions.includes("act") ? /* @__PURE__ */ jsx49("button", { type: "button", disabled: locked, onClick: () => setDuplicating(true), children: "Send duplicate" }) : null,
|
|
15988
|
+
simple && (unsent || resendable) ? /* @__PURE__ */ jsx49("button", { type: "button", className: "mbtd-primary", disabled: locked, onClick: () => setSending(true), children: resendable ? "Send again" : "Send" }) : simple && reviewable && detailTab === "details" ? /* @__PURE__ */ jsx49("button", { type: "button", disabled: locked, onClick: () => reveal("review"), children: "Record response" }) : null
|
|
15951
15989
|
] })
|
|
15952
15990
|
] }) : null,
|
|
15953
15991
|
simple && duplicating && !unsent ? /* @__PURE__ */ jsx49(
|
|
@@ -15966,11 +16004,12 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
15966
16004
|
onClose: () => setDuplicating(false)
|
|
15967
16005
|
}
|
|
15968
16006
|
) : null,
|
|
15969
|
-
simple && sending && unsent ? (() => {
|
|
16007
|
+
simple && sending && (unsent || resendable) ? (() => {
|
|
15970
16008
|
const hostSignature = renderSendSignatureSetup?.({ renderingProviderId: rfa.renderingProviderId, providerName: rfa.providerName });
|
|
15971
16009
|
return /* @__PURE__ */ jsx49(
|
|
15972
16010
|
RfaSendDialog,
|
|
15973
16011
|
{
|
|
16012
|
+
resend: resendable,
|
|
15974
16013
|
rfa,
|
|
15975
16014
|
client,
|
|
15976
16015
|
documentIds,
|