@mindbill/react 0.77.31 → 0.77.32
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.d.ts +11 -1
- package/dist/index.js +908 -858
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1077,7 +1077,7 @@ function organizationProfileOptions(profile) {
|
|
|
1077
1077
|
|
|
1078
1078
|
// src/index.tsx
|
|
1079
1079
|
import "@mindbill/embed";
|
|
1080
|
-
import { createElement, useEffect as
|
|
1080
|
+
import { createElement, useEffect as useEffect35, useRef as useRef29 } from "react";
|
|
1081
1081
|
|
|
1082
1082
|
// src/claim-form-summary.tsx
|
|
1083
1083
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
@@ -10031,7 +10031,7 @@ function BillSubmissionForm({
|
|
|
10031
10031
|
import { useId as useId9, useMemo as useMemo13, useState as useState31 } from "react";
|
|
10032
10032
|
|
|
10033
10033
|
// src/rfa-dashboard.tsx
|
|
10034
|
-
import { useEffect as
|
|
10034
|
+
import { useEffect as useEffect26, useId as useId8, useMemo as useMemo12, useRef as useRef22, useState as useState30 } from "react";
|
|
10035
10035
|
import { getRfaLifecycleStatus as getRfaLifecycleStatus4, RFA_LIFECYCLE_LABELS as RFA_LIFECYCLE_LABELS5, createRfaClient as createRfaClient4, createBillReferenceClient as createBillReferenceClient2, createOrganizationClient as createOrganizationClient4 } from "@mindbill/browser";
|
|
10036
10036
|
|
|
10037
10037
|
// src/rfa-display.tsx
|
|
@@ -10049,16 +10049,80 @@ function RfaLink({ href, children, onSelect }) {
|
|
|
10049
10049
|
}
|
|
10050
10050
|
|
|
10051
10051
|
// src/rfa-task-board.tsx
|
|
10052
|
-
import { useEffect as useEffect14, useMemo as useMemo7, useRef as
|
|
10052
|
+
import { useEffect as useEffect14, useMemo as useMemo7, useRef as useRef13, useState as useState17 } from "react";
|
|
10053
10053
|
import { createRfaClient, createRfaLifecycleClient } from "@mindbill/browser";
|
|
10054
10054
|
|
|
10055
10055
|
// src/rfa-delivery-panel.tsx
|
|
10056
|
-
import { useEffect as useEffect13, useRef as
|
|
10056
|
+
import { useEffect as useEffect13, useRef as useRef11, useState as useState15 } from "react";
|
|
10057
10057
|
|
|
10058
10058
|
// src/rfa-authorization-destination.tsx
|
|
10059
|
-
import { useEffect as useEffect12, useRef as
|
|
10060
|
-
|
|
10059
|
+
import { useEffect as useEffect12, useRef as useRef10, useState as useState14 } from "react";
|
|
10060
|
+
|
|
10061
|
+
// src/rfa-identity-select.tsx
|
|
10062
|
+
import { useId as useId5, useRef as useRef9, useState as useState13 } from "react";
|
|
10061
10063
|
import { Fragment as Fragment12, jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
10064
|
+
function RfaIdentitySelect({ label: label5, placeholder, searchPlaceholder, query, searchable, disabled = false, loading = false, error = "", value, options, onSearch, onSelect }) {
|
|
10065
|
+
const id = useId5();
|
|
10066
|
+
const trigger = useRef9(null);
|
|
10067
|
+
const [open, setOpen] = useState13(false);
|
|
10068
|
+
const [active, setActive] = useState13(0);
|
|
10069
|
+
const selected = options.find((option) => option.id === value);
|
|
10070
|
+
const choose = (option) => {
|
|
10071
|
+
onSelect(option.id);
|
|
10072
|
+
setOpen(false);
|
|
10073
|
+
trigger.current?.focus();
|
|
10074
|
+
};
|
|
10075
|
+
return /* @__PURE__ */ jsxs20("div", { className: "mbrfa-identity-select", onBlur: (event) => {
|
|
10076
|
+
if (!event.currentTarget.contains(event.relatedTarget)) setOpen(false);
|
|
10077
|
+
}, onKeyDown: (event) => {
|
|
10078
|
+
if (event.key === "Escape") {
|
|
10079
|
+
event.preventDefault();
|
|
10080
|
+
setOpen(false);
|
|
10081
|
+
trigger.current?.focus();
|
|
10082
|
+
}
|
|
10083
|
+
}, children: [
|
|
10084
|
+
/* @__PURE__ */ jsx22("style", { children: `.mbrfa-identity-select{position:relative;min-width:0}.mbrfa-identity-select>button{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:left;gap:12px;min-height:44px}.mbrfa-identity-select small{display:block;opacity:.75;font-size:12px;margin-top:3px}.mbrfa-identity-select>button{height:44px}.mbrfa-identity-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mbrfa-identity-value small{display:inline;margin:0}.mbrfa-identity-menu{position:absolute;z-index:40;top:calc(100% + 6px);left:0;right:0;padding:10px;background:var(--mbtd-surface,#fff);color:inherit;border:1px solid var(--mbtd-border,#d6d3cc);border-radius:8px;box-shadow:0 8px 24px #0002}.mbrfa-identity-menu input{width:100%;box-sizing:border-box}.mbrfa-identity-options{max-height:280px;overflow:auto;margin-top:6px}.mbrfa-identity-options button{display:block;width:100%;text-align:left;padding:10px 12px;border:0;border-radius:4px;min-height:44px}.mbrfa-identity-options button:hover,.mbrfa-identity-options button[data-active=true]{background:#1c595918}.mbrfa-identity-menu p{padding:8px;margin:0}` }),
|
|
10085
|
+
/* @__PURE__ */ jsxs20("button", { ref: trigger, type: "button", "aria-label": label5, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? `${id}-list` : void 0, disabled, onClick: () => {
|
|
10086
|
+
setOpen(!open);
|
|
10087
|
+
setActive(0);
|
|
10088
|
+
}, children: [
|
|
10089
|
+
/* @__PURE__ */ jsx22("span", { className: "mbrfa-identity-value", children: selected ? /* @__PURE__ */ jsxs20(Fragment12, { children: [
|
|
10090
|
+
selected.label,
|
|
10091
|
+
selected.detail ? /* @__PURE__ */ jsxs20("small", { children: [
|
|
10092
|
+
" \xB7 ",
|
|
10093
|
+
selected.detail
|
|
10094
|
+
] }) : null
|
|
10095
|
+
] }) : placeholder }),
|
|
10096
|
+
/* @__PURE__ */ jsx22("span", { "aria-hidden": "true", children: "\u2304" })
|
|
10097
|
+
] }),
|
|
10098
|
+
open ? /* @__PURE__ */ jsxs20("div", { className: "mbrfa-identity-menu", children: [
|
|
10099
|
+
searchable ? /* @__PURE__ */ jsx22("input", { autoFocus: true, role: "combobox", "aria-label": searchPlaceholder, "aria-autocomplete": "list", "aria-expanded": "true", "aria-controls": `${id}-list`, "aria-activedescendant": !loading && !error && options[active] ? `${id}-${active}` : void 0, type: "search", autoComplete: "off", maxLength: 200, placeholder: searchPlaceholder, value: query, onChange: (event) => {
|
|
10100
|
+
setActive(0);
|
|
10101
|
+
onSearch(event.target.value);
|
|
10102
|
+
}, onKeyDown: (event) => {
|
|
10103
|
+
if (loading || error || !options.length) return;
|
|
10104
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
10105
|
+
event.preventDefault();
|
|
10106
|
+
const next = (active + (event.key === "ArrowDown" ? 1 : -1) + options.length) % options.length;
|
|
10107
|
+
setActive(next);
|
|
10108
|
+
document.getElementById(`${id}-${next}`)?.scrollIntoView({ block: "nearest" });
|
|
10109
|
+
}
|
|
10110
|
+
if (event.key === "Enter" && options[active]) {
|
|
10111
|
+
event.preventDefault();
|
|
10112
|
+
choose(options[active]);
|
|
10113
|
+
}
|
|
10114
|
+
} }) : null,
|
|
10115
|
+
/* @__PURE__ */ jsx22("div", { className: "mbrfa-identity-options", id: `${id}-list`, role: "listbox", "aria-label": label5, "aria-busy": loading, children: loading ? /* @__PURE__ */ jsx22("p", { role: "status", children: "Searching\u2026" }) : error ? /* @__PURE__ */ jsx22("p", { role: "alert", children: error }) : options.length ? options.map((option, index) => /* @__PURE__ */ jsxs20("button", { type: "button", role: "option", id: `${id}-${index}`, "aria-selected": option.id === value, "data-active": index === active, onMouseDown: (event) => event.preventDefault(), onClick: () => choose(option), children: [
|
|
10116
|
+
option.label,
|
|
10117
|
+
option.detail ? /* @__PURE__ */ jsx22("small", { children: option.detail }) : null
|
|
10118
|
+
] }, option.id)) : /* @__PURE__ */ jsx22("p", { children: "No matches. Try another search." }) })
|
|
10119
|
+
] }) : null
|
|
10120
|
+
] });
|
|
10121
|
+
}
|
|
10122
|
+
|
|
10123
|
+
// src/rfa-authorization-destination.tsx
|
|
10124
|
+
import { normalizeRfaFax, rfaAuthorizationDestinations, rfaAuthorizationGuidance as rfaAuthorizationGuidance2 } from "@mindbill/browser";
|
|
10125
|
+
import { Fragment as Fragment13, jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
10062
10126
|
function RfaAuthorizationDestination({ contextKey, directory, savedContact, loading = false, error, disabled = false, onChange, onSelectionStart, compact = false }) {
|
|
10063
10127
|
const options = loading || error ? [] : rfaAuthorizationDestinations(directory);
|
|
10064
10128
|
const fax = savedContact?.fax ? normalizeRfaFax(savedContact.fax) : null;
|
|
@@ -10066,11 +10130,12 @@ function RfaAuthorizationDestination({ contextKey, directory, savedContact, load
|
|
|
10066
10130
|
if (fax && !options.some((option) => option.method === "fax" && option.destination === fax)) options.unshift({ method: "fax", destination: fax, label: savedLabel, ...savedContact?.contactName ? { recipientName: savedContact.contactName } : {} });
|
|
10067
10131
|
if (savedContact?.email?.trim() && !options.some((option) => option.method === "email" && option.destination === savedContact.email?.trim())) options.unshift({ method: "email", destination: savedContact.email.trim(), label: savedLabel, ...savedContact?.contactName ? { recipientName: savedContact.contactName } : {} });
|
|
10068
10132
|
const signature = JSON.stringify([contextKey, directory?.authorizationStatus, options, loading, error]);
|
|
10069
|
-
const [selection, setSelection] =
|
|
10070
|
-
const [manual, setManual] =
|
|
10071
|
-
const [
|
|
10133
|
+
const [selection, setSelection] = useState14("");
|
|
10134
|
+
const [manual, setManual] = useState14("");
|
|
10135
|
+
const [query, setQuery] = useState14("");
|
|
10136
|
+
const [contactName, setContactName] = useState14("");
|
|
10072
10137
|
const needsAdjuster = directory?.authorizationStatus === "adjuster_specific_required";
|
|
10073
|
-
const callback =
|
|
10138
|
+
const callback = useRef10(onChange);
|
|
10074
10139
|
callback.current = onChange;
|
|
10075
10140
|
useEffect12(() => {
|
|
10076
10141
|
setSelection("");
|
|
@@ -10092,104 +10157,121 @@ function RfaAuthorizationDestination({ contextKey, directory, savedContact, load
|
|
|
10092
10157
|
})() : nextSelection === "manual-email" ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value.trim()) ? { method: "email", destination: value.trim(), label: "Confirmed authorization email" } : null : nextSelection === "" ? null : options[Number(nextSelection)] ?? null;
|
|
10093
10158
|
onChange(selected ? { ...selected, ...recipientName ? { recipientName } : {} } : null);
|
|
10094
10159
|
};
|
|
10095
|
-
const
|
|
10096
|
-
|
|
10097
|
-
|
|
10160
|
+
const pick = (value) => {
|
|
10161
|
+
setSelection(value);
|
|
10162
|
+
setManual("");
|
|
10163
|
+
const name = options[Number(value)]?.recipientName ?? "";
|
|
10164
|
+
setContactName(name);
|
|
10165
|
+
emit(value, "", name);
|
|
10166
|
+
};
|
|
10167
|
+
const guidance = /* @__PURE__ */ jsxs21(Fragment13, { children: [
|
|
10168
|
+
/* @__PURE__ */ jsx23("p", { style: { margin: 0 }, children: loading ? "Loading authorization contacts\u2026" : error ? "Directory details are unavailable. Confirm a destination with the handling adjuster." : rfaAuthorizationGuidance2(directory) }),
|
|
10169
|
+
directory?.authorizationNotice ? /* @__PURE__ */ jsx23("p", { style: { margin: 0 }, children: directory.authorizationNotice }) : null
|
|
10098
10170
|
] });
|
|
10099
|
-
return /* @__PURE__ */
|
|
10100
|
-
compact ? null : /* @__PURE__ */
|
|
10101
|
-
/* @__PURE__ */
|
|
10171
|
+
return /* @__PURE__ */ jsxs21("fieldset", { className: compact ? "mb-rfa-destination mbrfa-plain" : "mb-rfa-destination", disabled: disabled || loading, style: compact ? { display: "grid", gap: 8, minWidth: 0, overflowWrap: "anywhere" } : { border: "1px solid var(--mb-border, #d7e0df)", borderRadius: 10, padding: 16, display: "grid", gap: 12, minWidth: 0, overflowWrap: "anywhere" }, children: [
|
|
10172
|
+
compact ? null : /* @__PURE__ */ jsxs21(Fragment13, { children: [
|
|
10173
|
+
/* @__PURE__ */ jsx23("legend", { children: "Authorization destination" }),
|
|
10102
10174
|
guidance
|
|
10103
10175
|
] }),
|
|
10104
|
-
/* @__PURE__ */
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
options.map((option, index) =>
|
|
10176
|
+
compact ? /* @__PURE__ */ jsx23(
|
|
10177
|
+
RfaIdentitySelect,
|
|
10178
|
+
{
|
|
10179
|
+
label: directory?.authorizationStatus === "claim_handling_location_routes" ? "Claim-handling office" : "Authorization contact",
|
|
10180
|
+
placeholder: "Choose a destination",
|
|
10181
|
+
searchPlaceholder: "Search offices, fax numbers or e-mail",
|
|
10182
|
+
query,
|
|
10183
|
+
onSearch: setQuery,
|
|
10184
|
+
searchable: true,
|
|
10185
|
+
disabled: disabled || loading,
|
|
10186
|
+
value: selection,
|
|
10187
|
+
options: [...options.map((option, index) => ({ id: String(index), label: option.label, detail: `${option.method === "fax" ? "Fax" : "E-mail"} ${option.destination}` })), { id: "manual", label: needsAdjuster ? "Enter the handling adjuster\u2019s fax" : "Enter another confirmed authorization fax" }, { id: "manual-email", label: "Enter a confirmed authorization e-mail" }].filter((option) => option.id === selection || `${option.label} ${"detail" in option ? option.detail : ""}`.toLowerCase().includes(query.trim().toLowerCase())),
|
|
10188
|
+
onSelect: (value) => {
|
|
10189
|
+
setQuery("");
|
|
10190
|
+
pick(value);
|
|
10191
|
+
}
|
|
10192
|
+
}
|
|
10193
|
+
) : /* @__PURE__ */ jsxs21("label", { style: { display: "grid", gap: 6, minWidth: 0 }, children: [
|
|
10194
|
+
directory?.authorizationStatus === "claim_handling_location_routes" ? "Claim-handling office" : "Authorization contact",
|
|
10195
|
+
/* @__PURE__ */ jsxs21("select", { value: selection, onChange: (event) => pick(event.target.value), style: { padding: 10, width: "100%", minWidth: 0, maxWidth: "100%", font: "inherit" }, children: [
|
|
10196
|
+
/* @__PURE__ */ jsx23("option", { value: "", children: "Choose a destination\u2026" }),
|
|
10197
|
+
options.map((option, index) => /* @__PURE__ */ jsxs21("option", { value: String(index), children: [
|
|
10116
10198
|
option.label,
|
|
10117
10199
|
" \xB7 ",
|
|
10118
10200
|
option.method === "fax" ? "Fax" : "Email",
|
|
10119
10201
|
": ",
|
|
10120
10202
|
option.destination
|
|
10121
10203
|
] }, `${option.method}:${option.destination}:${index}`)),
|
|
10122
|
-
/* @__PURE__ */
|
|
10123
|
-
/* @__PURE__ */
|
|
10204
|
+
/* @__PURE__ */ jsx23("option", { value: "manual", children: needsAdjuster ? "Enter the handling adjuster\u2019s fax" : "Enter another confirmed authorization fax" }),
|
|
10205
|
+
/* @__PURE__ */ jsx23("option", { value: "manual-email", children: "Enter a confirmed authorization email" })
|
|
10124
10206
|
] })
|
|
10125
10207
|
] }),
|
|
10126
|
-
selection !== "" && (needsAdjuster || selection === "manual" || selection === "manual-email") ? /* @__PURE__ */
|
|
10208
|
+
selection !== "" && (needsAdjuster || selection === "manual" || selection === "manual-email") ? /* @__PURE__ */ jsxs21("label", { style: { display: "grid", gap: 6 }, children: [
|
|
10127
10209
|
needsAdjuster ? "Handling adjuster name (required)" : "Recipient / attention (optional)",
|
|
10128
|
-
/* @__PURE__ */
|
|
10210
|
+
/* @__PURE__ */ jsx23("input", { value: contactName, maxLength: 200, required: needsAdjuster, onChange: (event) => {
|
|
10129
10211
|
setContactName(event.target.value);
|
|
10130
10212
|
emit(selection, manual, event.target.value);
|
|
10131
10213
|
} })
|
|
10132
10214
|
] }) : null,
|
|
10133
|
-
selection === "manual-email" ? /* @__PURE__ */
|
|
10215
|
+
selection === "manual-email" ? /* @__PURE__ */ jsxs21("label", { children: [
|
|
10134
10216
|
"Authorization email address",
|
|
10135
|
-
/* @__PURE__ */
|
|
10217
|
+
/* @__PURE__ */ jsx23("input", { type: "email", value: manual, onChange: (event) => {
|
|
10136
10218
|
const value = event.target.value;
|
|
10137
10219
|
setManual(value);
|
|
10138
10220
|
emit(selection, value, contactName);
|
|
10139
10221
|
} })
|
|
10140
|
-
] }) : selection === "manual" ? /* @__PURE__ */
|
|
10222
|
+
] }) : selection === "manual" ? /* @__PURE__ */ jsxs21("label", { style: { display: "grid", gap: 6, minWidth: 0 }, children: [
|
|
10141
10223
|
"Authorization fax number",
|
|
10142
|
-
/* @__PURE__ */
|
|
10224
|
+
/* @__PURE__ */ jsx23("input", { type: "tel", value: manual, onChange: (event) => {
|
|
10143
10225
|
const value = event.target.value;
|
|
10144
10226
|
setManual(value);
|
|
10145
10227
|
emit(selection, value, contactName);
|
|
10146
10228
|
}, style: { padding: 10, width: "100%", minWidth: 0, boxSizing: "border-box", font: "inherit" } })
|
|
10147
|
-
] }) : selection !== "" && chosen ? /* @__PURE__ */
|
|
10148
|
-
chosen.method === "email" ? /* @__PURE__ */
|
|
10229
|
+
] }) : selection !== "" && chosen ? /* @__PURE__ */ jsxs21(Fragment13, { children: [
|
|
10230
|
+
chosen.method === "email" ? /* @__PURE__ */ jsxs21("p", { style: { margin: 0, overflowWrap: "anywhere" }, children: [
|
|
10149
10231
|
"Email: ",
|
|
10150
10232
|
chosen.destination,
|
|
10151
10233
|
". Review this recipient before preparing and sending the packet."
|
|
10152
10234
|
] }) : null,
|
|
10153
|
-
chosen.phone ? /* @__PURE__ */
|
|
10235
|
+
chosen.phone ? /* @__PURE__ */ jsxs21("small", { children: [
|
|
10154
10236
|
"Telephone for questions: ",
|
|
10155
10237
|
chosen.phone
|
|
10156
10238
|
] }) : null
|
|
10157
10239
|
] }) : null,
|
|
10158
|
-
compact ? /* @__PURE__ */
|
|
10240
|
+
compact ? /* @__PURE__ */ jsx23("small", { className: "mbrfa-guidance", children: guidance }) : null
|
|
10159
10241
|
] });
|
|
10160
10242
|
}
|
|
10161
10243
|
|
|
10162
10244
|
// src/rfa-delivery-panel.tsx
|
|
10163
|
-
import { Fragment as
|
|
10245
|
+
import { Fragment as Fragment14, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
10164
10246
|
function RfaPdfReview({ blob, title }) {
|
|
10165
|
-
const [url, setUrl] =
|
|
10247
|
+
const [url, setUrl] = useState15("");
|
|
10166
10248
|
useEffect13(() => {
|
|
10167
10249
|
const next = URL.createObjectURL(blob);
|
|
10168
10250
|
setUrl(next);
|
|
10169
10251
|
return () => URL.revokeObjectURL(next);
|
|
10170
10252
|
}, [blob]);
|
|
10171
|
-
return /* @__PURE__ */
|
|
10172
|
-
/* @__PURE__ */
|
|
10173
|
-
/* @__PURE__ */
|
|
10253
|
+
return /* @__PURE__ */ jsx24("div", { children: url ? /* @__PURE__ */ jsxs22(Fragment14, { children: [
|
|
10254
|
+
/* @__PURE__ */ jsxs22("div", { className: "mbtd-actions", children: [
|
|
10255
|
+
/* @__PURE__ */ jsxs22("a", { href: url, target: "_blank", rel: "noopener noreferrer", children: [
|
|
10174
10256
|
"Open ",
|
|
10175
10257
|
title,
|
|
10176
10258
|
" PDF"
|
|
10177
10259
|
] }),
|
|
10178
|
-
/* @__PURE__ */
|
|
10260
|
+
/* @__PURE__ */ jsx24("a", { href: url, download: "authorization-packet.pdf", children: "Download PDF" })
|
|
10179
10261
|
] }),
|
|
10180
|
-
/* @__PURE__ */
|
|
10262
|
+
/* @__PURE__ */ jsx24("iframe", { title, src: url, style: { width: "100%", height: 420, border: "1px solid var(--mb-border)", marginTop: 10 } })
|
|
10181
10263
|
] }) : null });
|
|
10182
10264
|
}
|
|
10183
10265
|
function RfaDeliveryPanel({ rfa, client, documentIds, directory, directoryLoading, directoryError, locked, environment, canSend, run, onUpdated }) {
|
|
10184
|
-
const [mode, setMode] =
|
|
10185
|
-
const [destination, setDestination] =
|
|
10186
|
-
const [message, setMessage] =
|
|
10187
|
-
const [prepared, setPrepared] =
|
|
10188
|
-
const [reviewed, setReviewed] =
|
|
10189
|
-
const [confirmed, setConfirmed] =
|
|
10190
|
-
const keys =
|
|
10266
|
+
const [mode, setMode] = useState15("send");
|
|
10267
|
+
const [destination, setDestination] = useState15(null);
|
|
10268
|
+
const [message, setMessage] = useState15("");
|
|
10269
|
+
const [prepared, setPrepared] = useState15(null);
|
|
10270
|
+
const [reviewed, setReviewed] = useState15(false);
|
|
10271
|
+
const [confirmed, setConfirmed] = useState15(false);
|
|
10272
|
+
const keys = useRef11(/* @__PURE__ */ new Map());
|
|
10191
10273
|
const fingerprint = JSON.stringify([rfa.id, rfa.contentRevision, documentIds, mode, destination?.method, destination?.destination, destination?.recipientName, message.trim()]);
|
|
10192
|
-
const current =
|
|
10274
|
+
const current = useRef11(fingerprint);
|
|
10193
10275
|
current.current = fingerprint;
|
|
10194
10276
|
useEffect13(() => {
|
|
10195
10277
|
setPrepared(null);
|
|
@@ -10197,26 +10279,26 @@ function RfaDeliveryPanel({ rfa, client, documentIds, directory, directoryLoadin
|
|
|
10197
10279
|
setConfirmed(false);
|
|
10198
10280
|
}, [fingerprint]);
|
|
10199
10281
|
const packet = prepared?.fingerprint === fingerprint ? prepared : null;
|
|
10200
|
-
return /* @__PURE__ */
|
|
10201
|
-
/* @__PURE__ */
|
|
10202
|
-
!rfa.readiness.ready ? /* @__PURE__ */
|
|
10282
|
+
return /* @__PURE__ */ jsxs22("fieldset", { children: [
|
|
10283
|
+
/* @__PURE__ */ jsx24("legend", { children: "Review packet and send" }),
|
|
10284
|
+
!rfa.readiness.ready ? /* @__PURE__ */ jsxs22("p", { children: [
|
|
10203
10285
|
"Still needed: ",
|
|
10204
10286
|
rfa.readiness.missing.map((value) => value === "signedAt" ? "physician signature" : value.replace(/([a-z])([A-Z])/g, "$1 $2").replaceAll("_", " ").toLowerCase()).join(", ") || "Complete the request details",
|
|
10205
10287
|
"."
|
|
10206
10288
|
] }) : null,
|
|
10207
|
-
/* @__PURE__ */
|
|
10289
|
+
/* @__PURE__ */ jsxs22("label", { children: [
|
|
10208
10290
|
"Delivery method",
|
|
10209
|
-
/* @__PURE__ */
|
|
10210
|
-
/* @__PURE__ */
|
|
10211
|
-
/* @__PURE__ */
|
|
10291
|
+
/* @__PURE__ */ jsxs22("select", { disabled: locked, value: mode, onChange: (event) => setMode(event.target.value), children: [
|
|
10292
|
+
/* @__PURE__ */ jsx24("option", { value: "send", children: "Send to claims administrator" }),
|
|
10293
|
+
/* @__PURE__ */ jsx24("option", { value: "download", children: "Download for manual submission" })
|
|
10212
10294
|
] })
|
|
10213
10295
|
] }),
|
|
10214
|
-
mode === "send" ? /* @__PURE__ */
|
|
10215
|
-
/* @__PURE__ */
|
|
10296
|
+
mode === "send" ? /* @__PURE__ */ jsx24(RfaAuthorizationDestination, { contextKey: `${rfa.id}:${rfa.claimsAdminId ?? "manual"}`, directory, savedContact: rfa.authorizationContact, loading: directoryLoading, error: directoryError, disabled: locked, onChange: setDestination }) : /* @__PURE__ */ jsx24("p", { children: "Downloading does not mark this request as sent. Keep proof of any submission made outside this dashboard." }),
|
|
10297
|
+
/* @__PURE__ */ jsxs22("label", { children: [
|
|
10216
10298
|
destination?.method === "email" && mode === "send" ? "Email message (optional)" : "Fax cover sheet message (optional)",
|
|
10217
|
-
/* @__PURE__ */
|
|
10299
|
+
/* @__PURE__ */ jsx24("textarea", { disabled: locked, maxLength: 1e3, rows: 3, value: message, onChange: (event) => setMessage(event.target.value) })
|
|
10218
10300
|
] }),
|
|
10219
|
-
/* @__PURE__ */
|
|
10301
|
+
/* @__PURE__ */ jsx24("button", { type: "button", disabled: locked || !rfa.signedAt || documentIds.length < 2 || mode === "send" && !destination, onClick: () => void run(async () => {
|
|
10220
10302
|
const requestFingerprint = fingerprint;
|
|
10221
10303
|
const preview = await client.prepareDelivery(rfa.id, { documentIds, channel: mode === "download" ? "download" : destination.method, ...mode === "send" ? { to: destination.destination, ...destination.recipientName ? { recipientName: destination.recipientName } : {} } : {}, ...message.trim() ? { message: message.trim() } : {} });
|
|
10222
10304
|
const blob = await client.getPacket(rfa.id, preview.packetId);
|
|
@@ -10226,25 +10308,25 @@ function RfaDeliveryPanel({ rfa, client, documentIds, directory, directoryLoadin
|
|
|
10226
10308
|
setConfirmed(false);
|
|
10227
10309
|
}
|
|
10228
10310
|
}), children: "Prepare packet with cover sheet" }),
|
|
10229
|
-
packet ? /* @__PURE__ */
|
|
10230
|
-
/* @__PURE__ */
|
|
10231
|
-
/* @__PURE__ */
|
|
10232
|
-
/* @__PURE__ */
|
|
10311
|
+
packet ? /* @__PURE__ */ jsxs22(Fragment14, { children: [
|
|
10312
|
+
/* @__PURE__ */ jsx24(RfaPdfReview, { blob: packet.blob, title: "RFA submission packet" }),
|
|
10313
|
+
/* @__PURE__ */ jsxs22("label", { className: "mbrfa-check", children: [
|
|
10314
|
+
/* @__PURE__ */ jsx24("input", { type: "checkbox", disabled: locked, checked: reviewed, onChange: (event) => {
|
|
10233
10315
|
setReviewed(event.target.checked);
|
|
10234
10316
|
setConfirmed(false);
|
|
10235
10317
|
} }),
|
|
10236
10318
|
"I reviewed the assembled packet, including the cover sheet and clinical documents."
|
|
10237
10319
|
] })
|
|
10238
10320
|
] }) : null,
|
|
10239
|
-
mode === "send" ? environment !== "live" ? /* @__PURE__ */
|
|
10240
|
-
/* @__PURE__ */
|
|
10241
|
-
/* @__PURE__ */
|
|
10321
|
+
mode === "send" ? environment !== "live" ? /* @__PURE__ */ jsx24("p", { className: "mbtd-note", children: "Sandbox: review and prepare the packet here. External fax delivery is disabled. Email sending is also disabled." }) : !canSend ? /* @__PURE__ */ jsx24("p", { children: "Sending requires permission from your organization." }) : /* @__PURE__ */ jsxs22(Fragment14, { children: [
|
|
10322
|
+
/* @__PURE__ */ jsxs22("label", { className: "mbrfa-check", children: [
|
|
10323
|
+
/* @__PURE__ */ jsx24("input", { type: "checkbox", disabled: locked || !packet || !reviewed || !destination, checked: confirmed && !!packet, onChange: (event) => setConfirmed(event.target.checked) }),
|
|
10242
10324
|
"Send this reviewed packet to ",
|
|
10243
10325
|
destination?.recipientName ? `${destination.recipientName} at ` : "",
|
|
10244
10326
|
destination?.destination || "the selected authorization recipient",
|
|
10245
10327
|
". I verified the recipient for this claim."
|
|
10246
10328
|
] }),
|
|
10247
|
-
/* @__PURE__ */
|
|
10329
|
+
/* @__PURE__ */ jsx24("button", { type: "button", className: "mbtd-primary", disabled: locked || !confirmed || !reviewed || !packet || !destination || !rfa.readiness.ready || !!rfa.submittedAt, onClick: () => void run(async () => {
|
|
10248
10330
|
if (!packet || !destination || !confirmed || !reviewed) return;
|
|
10249
10331
|
const body = { packetId: packet.preview.packetId, sha256: packet.preview.sha256, channel: destination.method, to: destination.destination, ...destination.recipientName ? { recipientName: destination.recipientName } : {}, ...message.trim() ? { message: message.trim() } : {} };
|
|
10250
10332
|
const signature = JSON.stringify(body);
|
|
@@ -10260,13 +10342,13 @@ function RfaDeliveryPanel({ rfa, client, documentIds, directory, directoryLoadin
|
|
|
10260
10342
|
}
|
|
10261
10343
|
|
|
10262
10344
|
// src/treatment-draft-shared.tsx
|
|
10263
|
-
import { useRef as
|
|
10264
|
-
import { Fragment as
|
|
10345
|
+
import { useRef as useRef12, useState as useState16 } from "react";
|
|
10346
|
+
import { Fragment as Fragment15, jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
10265
10347
|
function useDraftSave(onSave) {
|
|
10266
|
-
const pending =
|
|
10267
|
-
const [busy, setBusy] =
|
|
10268
|
-
const [message, setMessage] =
|
|
10269
|
-
const [error, setError] =
|
|
10348
|
+
const pending = useRef12(false);
|
|
10349
|
+
const [busy, setBusy] = useState16(false);
|
|
10350
|
+
const [message, setMessage] = useState16("");
|
|
10351
|
+
const [error, setError] = useState16(null);
|
|
10270
10352
|
const clear = () => {
|
|
10271
10353
|
setMessage("");
|
|
10272
10354
|
setError(null);
|
|
@@ -10293,8 +10375,8 @@ function useDraftSave(onSave) {
|
|
|
10293
10375
|
return { busy, message, error, clear, save };
|
|
10294
10376
|
}
|
|
10295
10377
|
function TreatmentDraftShell({ title, description, children, hideHeading = false, appearance, className = "", style }) {
|
|
10296
|
-
return /* @__PURE__ */
|
|
10297
|
-
/* @__PURE__ */
|
|
10378
|
+
return /* @__PURE__ */ jsxs23("section", { className: `mbtd ${className}`.trim(), "aria-label": title, style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
|
|
10379
|
+
/* @__PURE__ */ jsx25("style", { children: `.mbtd{font:14px/1.5 ui-sans-serif,system-ui,sans-serif;color:var(--mb-text);min-width:0}.mbtd *{box-sizing:border-box}.mbtd h2{font-size:22px;margin:0 0 6px}.mbtd p{margin:6px 0 16px;color:var(--mb-muted)}.mbtd form{display:grid;gap:16px}.mbtd fieldset{margin:0;padding:16px;border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);min-width:0}.mbtd legend{font-weight:600;padding:0 6px}.mbtd .mbtd-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.mbtd label{display:grid;gap:5px;font-size:13px;min-width:0}.mbtd input,.mbtd select,.mbtd textarea,.mbtd button{font:inherit;max-width:100%;min-width:0;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);padding:9px 11px;color:var(--mb-text);background:var(--mb-input);min-height:40px}.mbtd .mbrfa-check{display:flex;align-items:flex-start;gap:8px}.mbtd .mbrfa-check input[type=checkbox]{width:16px;height:16px;min-height:16px;margin:2px 0 0;padding:0;flex-shrink:0}
|
|
10298
10380
|
.mbtd .mbrfa-request-details>.mbtd-grid{display:flex;flex-direction:column;gap:12px}
|
|
10299
10381
|
.mbtd .mbrfa-request-types{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding-bottom:12px;border-bottom:1px solid var(--mb-border)}
|
|
10300
10382
|
.mbtd .mbrfa-request-details .mbrfa-check{min-height:44px;align-items:flex-start;gap:10px;line-height:20px;cursor:pointer}
|
|
@@ -10314,16 +10396,18 @@ function TreatmentDraftShell({ title, description, children, hideHeading = false
|
|
|
10314
10396
|
.mbtd .mbrfa-form-grid .mbrfa-picker{padding-bottom:2px}
|
|
10315
10397
|
.mbtd .mbrfa-picker a,.mbtd .mbrfa-picker-links{font-size:12px}.mbtd .mbrfa-picker-links{display:flex;gap:12px;flex-wrap:wrap;align-items:center;min-height:18px}
|
|
10316
10398
|
.mbtd .mbrfa-picker p,.mbtd .mbrfa-guidance p{margin:0;font-size:12px}.mbtd .mbrfa-guidance{display:grid;gap:4px}
|
|
10317
|
-
.mbtd
|
|
10399
|
+
.mbtd .mbrfa-field-hint{font-size:12px;color:var(--mb-muted);font-weight:400}
|
|
10400
|
+
.mbtd .mbrfa-link-out{color:var(--mb-muted)!important;text-decoration:none}.mbtd .mbrfa-link-out:hover{text-decoration:underline}.mbtd .mbrfa-picker-links a{text-decoration:none}
|
|
10401
|
+
.mbtd button.mbrfa-link.mbrfa-link{border:0;background:none;padding:0;min-height:0;color:var(--mb-accent);font-size:12px;text-decoration:none}.mbtd button.mbrfa-link.mbrfa-link:hover,.mbtd .mbrfa-picker-links a:hover{text-decoration:underline}
|
|
10318
10402
|
.mbtd fieldset.mbrfa-plain.mbrfa-plain{border:0;padding:0;margin:0;background:none;border-radius:0;min-width:0}
|
|
10319
10403
|
.mbtd .mbrfa-visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
|
|
10320
10404
|
@media(max-width:760px){.mbtd .mbrfa-pickers,.mbtd .mbrfa-pickers[data-columns="2"]{grid-template-columns:minmax(0,1fr)}.mbtd .mbrfa-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.mbtd .mbrfa-form-grid>*{grid-column:1/-1}.mbtd .mbrfa-form-grid>.mbrfa-s1,.mbtd .mbrfa-form-grid>.mbrfa-s2{grid-column:span 1}}
|
|
10321
10405
|
@media(max-width:640px){.mbtd .mbrfa-request-types{grid-template-columns:1fr;gap:4px}}
|
|
10322
10406
|
@media(forced-colors:active){.mbtd .mbrfa-request-types input[type=radio]{appearance:auto}.mbtd .mbrfa-request-types input[type=radio]::after{display:none}}
|
|
10323
10407
|
.mbtd textarea{resize:vertical;min-height:76px}.mbtd button{cursor:pointer;background:var(--mb-surface)}.mbtd button:disabled{opacity:.55;cursor:default}.mbtd .mbtd-primary{background:var(--mb-accent);color:var(--mb-accent-contrast);border-color:var(--mb-accent)}.mbtd .mbtd-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:12px}.mbtd .mbtd-wide{grid-column:1/-1}.mbtd [role=alert]{color:var(--mb-danger)}.mbtd [role=status]{margin:0}.mbtd :is(input,select,textarea,button):focus-visible{outline:2px solid var(--mb-accent);outline-offset:2px}.mbtd .mbtd-note{padding:12px;background:var(--mb-soft);border-radius:var(--mb-control-radius)}.mbtd a{color:var(--mb-accent)}@media(max-width:520px){.mbtd .mbtd-grid{grid-template-columns:minmax(0,1fr)}.mbtd fieldset{padding:12px}}` }),
|
|
10324
|
-
!hideHeading ? /* @__PURE__ */
|
|
10325
|
-
/* @__PURE__ */
|
|
10326
|
-
/* @__PURE__ */
|
|
10408
|
+
!hideHeading ? /* @__PURE__ */ jsxs23(Fragment15, { children: [
|
|
10409
|
+
/* @__PURE__ */ jsx25("h2", { children: title }),
|
|
10410
|
+
/* @__PURE__ */ jsx25("p", { children: description })
|
|
10327
10411
|
] }) : null,
|
|
10328
10412
|
children
|
|
10329
10413
|
] });
|
|
@@ -10333,7 +10417,7 @@ function isDraftDate(value) {
|
|
|
10333
10417
|
}
|
|
10334
10418
|
|
|
10335
10419
|
// src/rfa-task-board.tsx
|
|
10336
|
-
import { jsx as
|
|
10420
|
+
import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
10337
10421
|
function rfaTaskState(task, now = Date.now()) {
|
|
10338
10422
|
if (task.status === "resolved" || task.resolvedAt) return "Completed";
|
|
10339
10423
|
return Date.parse(task.snoozedUntil ?? task.dueAt) > now ? "Scheduled" : "Due";
|
|
@@ -10375,30 +10459,30 @@ var date3 = (value) => new Date(value).toLocaleString();
|
|
|
10375
10459
|
function RfaTaskBoard({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride, ...props }) {
|
|
10376
10460
|
const options = useMemo7(() => ({ ...sessionEndpoint ? { sessionEndpoint } : {}, ...getSession ? { getSession } : {}, ...apiBaseUrl ? { apiBaseUrl } : {}, ...fetchOverride ? { fetch: fetchOverride } : {} }), [sessionEndpoint, getSession, apiBaseUrl, fetchOverride]);
|
|
10377
10461
|
const identity = useMemo7(() => crypto.randomUUID(), [options]);
|
|
10378
|
-
return /* @__PURE__ */
|
|
10462
|
+
return /* @__PURE__ */ jsx26(TaskBoardContent, { ...props, options }, `${identity}:${props.patientId ?? ""}:${props.claimId ?? ""}:${props.renderingProviderId ?? ""}`);
|
|
10379
10463
|
}
|
|
10380
10464
|
function TaskBoardContent({ options, patientId, claimId, renderingProviderId, permissions = [], onSelect, embedded = false, presentation = "dashboard", query, getTaskHref, onNavigate, renderTaskIdentity, ...appearance }) {
|
|
10381
10465
|
const client = useMemo7(() => createRfaLifecycleClient(options), [options]);
|
|
10382
10466
|
const requests = useMemo7(() => createRfaClient(options), [options]);
|
|
10383
|
-
const [requestIdentities, setRequestIdentities] =
|
|
10384
|
-
const [tasks, setTasks] =
|
|
10385
|
-
const [error, setError] =
|
|
10386
|
-
const [loading, setLoading] =
|
|
10387
|
-
const [now, setNow] =
|
|
10388
|
-
const [inboxCount, setInboxCount] =
|
|
10467
|
+
const [requestIdentities, setRequestIdentities] = useState17({});
|
|
10468
|
+
const [tasks, setTasks] = useState17([]);
|
|
10469
|
+
const [error, setError] = useState17("");
|
|
10470
|
+
const [loading, setLoading] = useState17(true);
|
|
10471
|
+
const [now, setNow] = useState17(Date.now);
|
|
10472
|
+
const [inboxCount, setInboxCount] = useState17(null);
|
|
10389
10473
|
useEffect14(() => {
|
|
10390
10474
|
const timer = setInterval(() => setNow(Date.now()), 6e4);
|
|
10391
10475
|
return () => clearInterval(timer);
|
|
10392
10476
|
}, []);
|
|
10393
|
-
const [view, setView] =
|
|
10394
|
-
const [selection, setSelection] =
|
|
10477
|
+
const [view, setView] = useState17(query?.state ?? "Due");
|
|
10478
|
+
const [selection, setSelection] = useState17(null);
|
|
10395
10479
|
const list3 = presentation === "list";
|
|
10396
10480
|
useEffect14(() => {
|
|
10397
10481
|
setView(query?.state ?? "Due");
|
|
10398
10482
|
setSelection(null);
|
|
10399
10483
|
}, [query]);
|
|
10400
10484
|
const activeSelection = list3 ? query ?? {} : selection;
|
|
10401
|
-
const drilldown =
|
|
10485
|
+
const drilldown = useRef13(null);
|
|
10402
10486
|
useEffect14(() => {
|
|
10403
10487
|
if (selection) {
|
|
10404
10488
|
drilldown.current?.scrollIntoView?.({ block: "nearest" });
|
|
@@ -10481,15 +10565,15 @@ function TaskBoardContent({ options, patientId, claimId, renderingProviderId, pe
|
|
|
10481
10565
|
if (renderTaskIdentity) return renderTaskIdentity(task);
|
|
10482
10566
|
if (!list3) return null;
|
|
10483
10567
|
const record2 = requestIdentities[task.rfaId];
|
|
10484
|
-
return record2 ? /* @__PURE__ */
|
|
10485
|
-
/* @__PURE__ */
|
|
10486
|
-
/* @__PURE__ */
|
|
10568
|
+
return record2 ? /* @__PURE__ */ jsxs24("div", { className: "mbrfa-task-identity", children: [
|
|
10569
|
+
/* @__PURE__ */ jsx26("span", { children: record2.employeeName }),
|
|
10570
|
+
/* @__PURE__ */ jsxs24("small", { children: [
|
|
10487
10571
|
"Claim ",
|
|
10488
10572
|
record2.claimNumber || record2.claimId,
|
|
10489
10573
|
record2.displayReference ? ` \xB7 ${record2.displayReference}` : ""
|
|
10490
10574
|
] }),
|
|
10491
|
-
/* @__PURE__ */
|
|
10492
|
-
] }) : /* @__PURE__ */
|
|
10575
|
+
/* @__PURE__ */ jsx26("small", { children: record2.items?.map((item) => item.serviceDescription).filter(Boolean).join("; ") || "Request for authorization" })
|
|
10576
|
+
] }) : /* @__PURE__ */ jsxs24("small", { children: [
|
|
10493
10577
|
"Request ",
|
|
10494
10578
|
task.rfaId,
|
|
10495
10579
|
" \xB7 Claim ",
|
|
@@ -10501,19 +10585,19 @@ function TaskBoardContent({ options, patientId, claimId, renderingProviderId, pe
|
|
|
10501
10585
|
const selectedTitle = activeSelection?.kind ? rfaTaskLabel(activeSelection.kind) : activeSelection?.title ?? (activeSelection?.kinds ? taskGroups.find((group) => group.kinds.length === activeSelection.kinds.length && group.kinds.every((kind) => activeSelection.kinds.includes(kind)))?.title ?? activeSelection.kinds.map(rfaTaskLabel).join(", ") : "All tasks");
|
|
10502
10586
|
const selectionControl = (next, text3, ariaLabel) => {
|
|
10503
10587
|
const target = { ...next, state: view };
|
|
10504
|
-
if (!getTaskHref) return /* @__PURE__ */
|
|
10588
|
+
if (!getTaskHref) return /* @__PURE__ */ jsx26("button", { type: "button", className: ariaLabel ? "mbrfa-task-count" : void 0, ...ariaLabel ? { "aria-label": ariaLabel } : {}, onClick: () => setSelection(next), children: text3 });
|
|
10505
10589
|
const href = getTaskHref(target);
|
|
10506
|
-
return /* @__PURE__ */
|
|
10590
|
+
return /* @__PURE__ */ jsx26("a", { href, className: ariaLabel ? "mbrfa-task-count" : "mbrfa-route-link", ...ariaLabel ? { "aria-label": ariaLabel } : {}, onClick: (event) => {
|
|
10507
10591
|
if (!onNavigate || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
10508
10592
|
event.preventDefault();
|
|
10509
10593
|
onNavigate(href);
|
|
10510
10594
|
}, children: text3 });
|
|
10511
10595
|
};
|
|
10512
|
-
const countCell = (items, kind, bucket) => items.length ? selectionControl({ ...kind ? { kind } : {}, ...bucket ? { bucket } : {} }, items.length, `${rfaTaskLabel(kind ?? "all_tasks")}, ${bucket ? columns.find((column) => column.key === bucket)?.label : "total"}: ${items.length} ${view.toLowerCase()} tasks`) : /* @__PURE__ */
|
|
10513
|
-
return /* @__PURE__ */
|
|
10514
|
-
/* @__PURE__ */
|
|
10515
|
-
/* @__PURE__ */
|
|
10516
|
-
/* @__PURE__ */
|
|
10596
|
+
const countCell = (items, kind, bucket) => items.length ? selectionControl({ ...kind ? { kind } : {}, ...bucket ? { bucket } : {} }, items.length, `${rfaTaskLabel(kind ?? "all_tasks")}, ${bucket ? columns.find((column) => column.key === bucket)?.label : "total"}: ${items.length} ${view.toLowerCase()} tasks`) : /* @__PURE__ */ jsx26("span", { className: "mbrfa-task-zero", children: "0" });
|
|
10597
|
+
return /* @__PURE__ */ jsxs24(TreatmentDraftShell, { ...appearance, hideHeading: embedded, title: list3 ? "RFA task list" : "RFA tasks", description: list3 ? "Follow-up tasks matching the selected status, action and age." : "Open follow-up work, grouped by next action and age.", children: [
|
|
10598
|
+
/* @__PURE__ */ jsx26("style", { children: `.mbrfa-task-tabs{display:flex;gap:8px;margin:12px 0 18px;flex-wrap:wrap}.mbtd .mbrfa-task-tabs button[aria-pressed=true]{border-color:var(--mb-accent);background:var(--mb-soft);color:var(--mb-accent);font-weight:650}.mbrfa-task-group{border:1px solid var(--mb-border);border-radius:var(--mb-radius);overflow:auto;margin:14px 0;background:var(--mb-surface)}.mbrfa-task-group table{width:100%;border-collapse:collapse;min-width:620px;table-layout:fixed}.mbrfa-task-group th,.mbrfa-task-group td{padding:8px 14px;border-bottom:1px solid var(--mb-border);text-align:center}.mbrfa-task-group th:first-child,.mbrfa-task-group td:first-child{text-align:left;width:31%}.mbrfa-task-group thead th{font-size:12px;background:var(--mb-soft)}.mbrfa-task-group thead th:first-child{font-size:14px}.mbrfa-task-group th small{display:block;font-weight:400;color:var(--mb-muted)}.mbrfa-task-group tfoot{font-weight:650;background:var(--mb-soft)}.mbrfa-task-group tfoot td,.mbrfa-task-group tfoot th{border:0}.mbtd .mbrfa-task-count{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border:0;background:transparent;color:var(--mb-accent);font-weight:650;min-height:28px;padding:2px 10px}.mbrfa-task-zero{color:var(--mb-muted)}.mbrfa-task-drilldown{margin:20px 0}.mbrfa-task-drilldown table{width:100%;border-collapse:collapse}.mbrfa-task-drilldown th,.mbrfa-task-drilldown td{text-align:left;border-bottom:1px solid var(--mb-border);padding:10px;vertical-align:top}.mbrfa-task-drilldown td small{display:block;color:var(--mb-muted);overflow-wrap:anywhere}.mbrfa-task-scroll{overflow:auto}.mbrfa-task-drilldown h3{margin:0}.mbrfa-inbox{border-top:1px solid var(--mb-border);padding-top:18px;margin-top:20px}.mbrfa-inbox h3{margin-top:0}.mbrfa-list{display:grid;gap:8px;margin:12px 0}.mbrfa-card{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:12px;border:1px solid var(--mb-border);border-radius:8px}.mbrfa-card span{display:block;margin-top:4px}.mbrfa-card p{margin:6px 0}.mbrfa-match-disclosure{margin-top:20px;border:1px solid var(--mb-border);border-radius:var(--mb-radius);padding:14px;background:var(--mb-surface)}.mbrfa-match-disclosure>summary{cursor:pointer;font-weight:650;color:var(--mb-accent)}@media(max-width:600px){.mbrfa-card{align-items:stretch;flex-direction:column}}` }),
|
|
10599
|
+
/* @__PURE__ */ jsx26("strong", { children: "Task status" }),
|
|
10600
|
+
/* @__PURE__ */ jsx26("div", { className: "mbrfa-task-tabs", role: "group", "aria-label": "Task status", children: ["Due", "Scheduled", "Completed"].map((state) => /* @__PURE__ */ jsxs24("button", { type: "button", "aria-pressed": view === state, onClick: () => {
|
|
10517
10601
|
if (list3 && getTaskHref) {
|
|
10518
10602
|
const href = getTaskHref({ ...query, state });
|
|
10519
10603
|
if (onNavigate) onNavigate(href);
|
|
@@ -10528,118 +10612,118 @@ function TaskBoardContent({ options, patientId, claimId, renderingProviderId, pe
|
|
|
10528
10612
|
tasks.filter((task) => rfaTaskState(task, now) === state).length,
|
|
10529
10613
|
")"
|
|
10530
10614
|
] }, state)) }),
|
|
10531
|
-
/* @__PURE__ */
|
|
10532
|
-
error ? /* @__PURE__ */
|
|
10533
|
-
loading ? /* @__PURE__ */
|
|
10615
|
+
/* @__PURE__ */ jsx26("p", { className: "mbtd-note", children: taskViewDescriptions[view] }),
|
|
10616
|
+
error ? /* @__PURE__ */ jsx26("p", { role: "alert", children: error }) : null,
|
|
10617
|
+
loading ? /* @__PURE__ */ jsx26("p", { role: "status", children: "Loading tasks\u2026" }) : !error && !stateTasks.length ? /* @__PURE__ */ jsxs24("p", { children: [
|
|
10534
10618
|
"No ",
|
|
10535
10619
|
view.toLowerCase(),
|
|
10536
10620
|
" tasks."
|
|
10537
10621
|
] }) : null,
|
|
10538
|
-
!list3 && !loading && stateTasks.length ? /* @__PURE__ */
|
|
10622
|
+
!list3 && !loading && stateTasks.length ? /* @__PURE__ */ jsx26("p", { children: "Calendar days since task opened. Select a count to see the tasks. Counts represent tasks, so one RFA may appear more than once." }) : null,
|
|
10539
10623
|
!list3 ? groups2.map((group) => {
|
|
10540
10624
|
const groupTasks = stateTasks.filter((task) => group.kinds.includes(task.kind));
|
|
10541
|
-
return /* @__PURE__ */
|
|
10542
|
-
/* @__PURE__ */
|
|
10543
|
-
/* @__PURE__ */
|
|
10625
|
+
return /* @__PURE__ */ jsx26("section", { className: "mbrfa-task-group", "aria-label": group.title, children: /* @__PURE__ */ jsxs24("table", { children: [
|
|
10626
|
+
/* @__PURE__ */ jsx26("thead", { children: /* @__PURE__ */ jsxs24("tr", { children: [
|
|
10627
|
+
/* @__PURE__ */ jsxs24("th", { scope: "col", children: [
|
|
10544
10628
|
group.title,
|
|
10545
|
-
/* @__PURE__ */
|
|
10629
|
+
/* @__PURE__ */ jsx26("small", { children: "By date task opened" })
|
|
10546
10630
|
] }),
|
|
10547
|
-
columns.map((column) => /* @__PURE__ */
|
|
10548
|
-
/* @__PURE__ */
|
|
10631
|
+
columns.map((column) => /* @__PURE__ */ jsx26("th", { scope: "col", children: /* @__PURE__ */ jsx26("span", { className: "mbrfa-task-age", children: column.label }) }, column.key)),
|
|
10632
|
+
/* @__PURE__ */ jsx26("th", { scope: "col", children: "Task total" })
|
|
10549
10633
|
] }) }),
|
|
10550
|
-
/* @__PURE__ */
|
|
10634
|
+
/* @__PURE__ */ jsx26("tbody", { children: group.kinds.filter((kind) => groupTasks.some((task) => task.kind === kind)).map((kind) => {
|
|
10551
10635
|
const items = groupTasks.filter((task) => task.kind === kind);
|
|
10552
|
-
return /* @__PURE__ */
|
|
10553
|
-
/* @__PURE__ */
|
|
10636
|
+
return /* @__PURE__ */ jsxs24("tr", { children: [
|
|
10637
|
+
/* @__PURE__ */ jsxs24("th", { scope: "row", children: [
|
|
10554
10638
|
rfaTaskLabel(kind),
|
|
10555
|
-
descriptions[kind] && /* @__PURE__ */
|
|
10639
|
+
descriptions[kind] && /* @__PURE__ */ jsx26("small", { children: descriptions[kind] })
|
|
10556
10640
|
] }),
|
|
10557
|
-
columns.map((column) => /* @__PURE__ */
|
|
10558
|
-
/* @__PURE__ */
|
|
10641
|
+
columns.map((column) => /* @__PURE__ */ jsx26("td", { children: countCell(items.filter((task) => rfaTaskAgeBucket(task.createdAt, now) === column.key), kind, column.key) }, column.key)),
|
|
10642
|
+
/* @__PURE__ */ jsx26("td", { children: countCell(items, kind) })
|
|
10559
10643
|
] }, kind);
|
|
10560
10644
|
}) }),
|
|
10561
|
-
/* @__PURE__ */
|
|
10562
|
-
/* @__PURE__ */
|
|
10645
|
+
/* @__PURE__ */ jsx26("tfoot", { children: /* @__PURE__ */ jsxs24("tr", { children: [
|
|
10646
|
+
/* @__PURE__ */ jsx26("th", { scope: "row", children: "Total" }),
|
|
10563
10647
|
[...columns, { key: "total", label: "Total" }].map((column) => {
|
|
10564
10648
|
const items = column.key === "total" ? groupTasks : groupTasks.filter((task) => rfaTaskAgeBucket(task.createdAt, now) === column.key);
|
|
10565
|
-
return /* @__PURE__ */
|
|
10649
|
+
return /* @__PURE__ */ jsx26("td", { children: items.length ? selectionControl({ kinds: group.kinds, title: group.title, ...column.key !== "total" ? { bucket: column.key } : {} }, items.length, `${group.title}, ${column.label}: ${items.length} ${view.toLowerCase()} tasks`) : /* @__PURE__ */ jsx26("span", { className: "mbrfa-task-zero", children: "0" }) }, column.key);
|
|
10566
10650
|
})
|
|
10567
10651
|
] }) })
|
|
10568
10652
|
] }) }, group.title);
|
|
10569
10653
|
}) : null,
|
|
10570
|
-
!list3 && stateTasks.length ? /* @__PURE__ */
|
|
10571
|
-
list3 || selection ? /* @__PURE__ */
|
|
10572
|
-
/* @__PURE__ */
|
|
10573
|
-
/* @__PURE__ */
|
|
10654
|
+
!list3 && stateTasks.length ? /* @__PURE__ */ jsx26("div", { className: "mbtd-actions", children: selectionControl({}, `View all ${view.toLowerCase()} tasks (${stateTasks.length})`) }) : null,
|
|
10655
|
+
list3 || selection ? /* @__PURE__ */ jsxs24("section", { ref: drilldown, tabIndex: -1, className: "mbrfa-task-drilldown", "aria-label": "Selected tasks", children: [
|
|
10656
|
+
/* @__PURE__ */ jsxs24("div", { className: "mbtd-actions", children: [
|
|
10657
|
+
/* @__PURE__ */ jsxs24("h3", { children: [
|
|
10574
10658
|
selectedTitle,
|
|
10575
10659
|
activeSelection?.bucket ? ` \xB7 ${[...taskAgeColumns, { key: "unknown", label: "Unknown age" }].find((column) => column.key === activeSelection.bucket)?.label}` : "",
|
|
10576
10660
|
" (",
|
|
10577
10661
|
filtered.length,
|
|
10578
10662
|
")"
|
|
10579
10663
|
] }),
|
|
10580
|
-
!list3 ? /* @__PURE__ */
|
|
10664
|
+
!list3 ? /* @__PURE__ */ jsx26("button", { type: "button", onClick: () => setSelection(null), children: "Close task list" }) : null
|
|
10581
10665
|
] }),
|
|
10582
|
-
/* @__PURE__ */
|
|
10583
|
-
/* @__PURE__ */
|
|
10584
|
-
/* @__PURE__ */
|
|
10585
|
-
/* @__PURE__ */
|
|
10586
|
-
/* @__PURE__ */
|
|
10587
|
-
/* @__PURE__ */
|
|
10666
|
+
/* @__PURE__ */ jsx26("div", { className: "mbrfa-task-scroll", children: /* @__PURE__ */ jsxs24("table", { children: [
|
|
10667
|
+
/* @__PURE__ */ jsx26("thead", { children: /* @__PURE__ */ jsxs24("tr", { children: [
|
|
10668
|
+
/* @__PURE__ */ jsx26("th", { children: "Task / request" }),
|
|
10669
|
+
/* @__PURE__ */ jsx26("th", { children: view === "Completed" ? "Completed" : "Follow up" }),
|
|
10670
|
+
/* @__PURE__ */ jsx26("th", { children: "Assigned to" }),
|
|
10671
|
+
/* @__PURE__ */ jsx26("th", { children: "Action" })
|
|
10588
10672
|
] }) }),
|
|
10589
|
-
/* @__PURE__ */
|
|
10590
|
-
/* @__PURE__ */
|
|
10591
|
-
/* @__PURE__ */
|
|
10673
|
+
/* @__PURE__ */ jsx26("tbody", { children: filtered.map((task) => /* @__PURE__ */ jsxs24("tr", { children: [
|
|
10674
|
+
/* @__PURE__ */ jsxs24("td", { children: [
|
|
10675
|
+
/* @__PURE__ */ jsx26("strong", { children: rfaTaskLabel(task.kind) }),
|
|
10592
10676
|
taskIdentity(task),
|
|
10593
|
-
task.responseFilename ? /* @__PURE__ */
|
|
10594
|
-
task.lastOutcome ? /* @__PURE__ */
|
|
10677
|
+
task.responseFilename ? /* @__PURE__ */ jsx26("small", { children: task.responseFilename }) : null,
|
|
10678
|
+
task.lastOutcome ? /* @__PURE__ */ jsxs24("small", { children: [
|
|
10595
10679
|
"Last outcome: ",
|
|
10596
10680
|
task.lastOutcome.replaceAll("_", " ")
|
|
10597
10681
|
] }) : null,
|
|
10598
|
-
task.lastNote ? /* @__PURE__ */
|
|
10682
|
+
task.lastNote ? /* @__PURE__ */ jsx26("small", { children: task.lastNote }) : null
|
|
10599
10683
|
] }),
|
|
10600
|
-
/* @__PURE__ */
|
|
10601
|
-
/* @__PURE__ */
|
|
10602
|
-
/* @__PURE__ */
|
|
10684
|
+
/* @__PURE__ */ jsx26("td", { children: date3(view === "Completed" ? task.resolvedAt ?? task.updatedAt : task.snoozedUntil ?? task.dueAt) }),
|
|
10685
|
+
/* @__PURE__ */ jsx26("td", { children: task.assigneeReference || "Unassigned" }),
|
|
10686
|
+
/* @__PURE__ */ jsx26("td", { children: /* @__PURE__ */ jsx26("button", { type: "button", onClick: () => onSelect(task.rfaId, task.responseDocumentId ?? void 0), children: task.kind === "post_ur_decision" ? "Review response" : "Open request" }) })
|
|
10603
10687
|
] }, task.id)) })
|
|
10604
10688
|
] }) }),
|
|
10605
|
-
!filtered.length ? /* @__PURE__ */
|
|
10689
|
+
!filtered.length ? /* @__PURE__ */ jsx26("p", { children: "No tasks match this selection." }) : null
|
|
10606
10690
|
] }) : null,
|
|
10607
|
-
!list3 ? !patientId && !claimId && !renderingProviderId ? /* @__PURE__ */
|
|
10608
|
-
/* @__PURE__ */
|
|
10691
|
+
!list3 ? !patientId && !claimId && !renderingProviderId ? /* @__PURE__ */ jsxs24("details", { className: "mbrfa-match-disclosure", children: [
|
|
10692
|
+
/* @__PURE__ */ jsxs24("summary", { children: [
|
|
10609
10693
|
"Match UR \xB7 Incoming responses",
|
|
10610
10694
|
inboxCount !== null ? ` (${inboxCount})` : ""
|
|
10611
10695
|
] }),
|
|
10612
|
-
/* @__PURE__ */
|
|
10613
|
-
] }) : /* @__PURE__ */
|
|
10696
|
+
/* @__PURE__ */ jsx26(InboundFaxInbox, { onCount: setInboxCount, options, editable: permissions.includes("act"), disabled: Boolean(appearance.disabled), onSelect })
|
|
10697
|
+
] }) : /* @__PURE__ */ jsx26("p", { className: "mbtd-note", children: "Open the organization-wide RFA dashboard to match incoming faxes that do not yet belong to a patient or claim." }) : null
|
|
10614
10698
|
] });
|
|
10615
10699
|
}
|
|
10616
10700
|
function InboundFaxInbox({ options, editable, disabled, onSelect, onCount }) {
|
|
10617
10701
|
const client = useMemo7(() => createRfaLifecycleClient(options), [options]);
|
|
10618
10702
|
const records = useMemo7(() => createRfaClient(options), [options]);
|
|
10619
|
-
const [faxes, setFaxes] =
|
|
10620
|
-
const [fax, setFax] =
|
|
10621
|
-
const [pdf, setPdf] =
|
|
10622
|
-
const [choices, setChoices] =
|
|
10623
|
-
const [selected, setSelected] =
|
|
10624
|
-
const [search, setSearch] =
|
|
10625
|
-
const [error, setError] =
|
|
10626
|
-
const [busy, setBusy] =
|
|
10627
|
-
const [loading, setLoading] =
|
|
10628
|
-
const [reload, setReload] =
|
|
10629
|
-
const [nextCursor, setNextCursor] =
|
|
10630
|
-
const [pages, setPages] =
|
|
10631
|
-
const [confirmed, setConfirmed] =
|
|
10632
|
-
const keys =
|
|
10633
|
-
const alive =
|
|
10634
|
-
const pending =
|
|
10635
|
-
const generation =
|
|
10703
|
+
const [faxes, setFaxes] = useState17([]);
|
|
10704
|
+
const [fax, setFax] = useState17(null);
|
|
10705
|
+
const [pdf, setPdf] = useState17(null);
|
|
10706
|
+
const [choices, setChoices] = useState17([]);
|
|
10707
|
+
const [selected, setSelected] = useState17("");
|
|
10708
|
+
const [search, setSearch] = useState17("");
|
|
10709
|
+
const [error, setError] = useState17("");
|
|
10710
|
+
const [busy, setBusy] = useState17(false);
|
|
10711
|
+
const [loading, setLoading] = useState17(true);
|
|
10712
|
+
const [reload, setReload] = useState17(0);
|
|
10713
|
+
const [nextCursor, setNextCursor] = useState17(null);
|
|
10714
|
+
const [pages, setPages] = useState17([void 0]);
|
|
10715
|
+
const [confirmed, setConfirmed] = useState17(false);
|
|
10716
|
+
const keys = useRef13(/* @__PURE__ */ new Map());
|
|
10717
|
+
const alive = useRef13(true);
|
|
10718
|
+
const pending = useRef13(false);
|
|
10719
|
+
const generation = useRef13(0);
|
|
10636
10720
|
useEffect14(() => {
|
|
10637
10721
|
alive.current = true;
|
|
10638
10722
|
return () => {
|
|
10639
10723
|
alive.current = false;
|
|
10640
10724
|
};
|
|
10641
10725
|
}, []);
|
|
10642
|
-
const reviewingFax =
|
|
10726
|
+
const reviewingFax = useRef13(false);
|
|
10643
10727
|
reviewingFax.current = Boolean(fax);
|
|
10644
10728
|
useEffect14(() => {
|
|
10645
10729
|
let active = true;
|
|
@@ -10701,35 +10785,35 @@ function InboundFaxInbox({ options, editable, disabled, onSelect, onCount }) {
|
|
|
10701
10785
|
if (alive.current) setBusy(false);
|
|
10702
10786
|
}
|
|
10703
10787
|
};
|
|
10704
|
-
return /* @__PURE__ */
|
|
10705
|
-
/* @__PURE__ */
|
|
10706
|
-
/* @__PURE__ */
|
|
10707
|
-
error ? /* @__PURE__ */
|
|
10708
|
-
loading ? /* @__PURE__ */
|
|
10709
|
-
pages.length > 1 || nextCursor ? /* @__PURE__ */
|
|
10710
|
-
/* @__PURE__ */
|
|
10711
|
-
/* @__PURE__ */
|
|
10788
|
+
return /* @__PURE__ */ jsxs24("section", { className: "mbrfa-inbox", "aria-label": "Match UR", children: [
|
|
10789
|
+
/* @__PURE__ */ jsx26("h3", { children: "Response inbox \xB7 Match UR" }),
|
|
10790
|
+
/* @__PURE__ */ jsx26("p", { children: "Review incoming response faxes, then choose the matching request. Matching adds the response document and creates a Post UR task; it does not record a treatment decision." }),
|
|
10791
|
+
error ? /* @__PURE__ */ jsx26("p", { role: "alert", children: error }) : null,
|
|
10792
|
+
loading ? /* @__PURE__ */ jsx26("p", { role: "status", children: "Loading response faxes\u2026" }) : !error && !faxes.length ? /* @__PURE__ */ jsx26("p", { children: "No unmatched response faxes." }) : null,
|
|
10793
|
+
pages.length > 1 || nextCursor ? /* @__PURE__ */ jsxs24("div", { className: "mbtd-actions", children: [
|
|
10794
|
+
/* @__PURE__ */ jsx26("button", { type: "button", disabled: loading || busy || pages.length < 2, onClick: () => setPages((value) => value.slice(0, -1)), children: "Previous fax page" }),
|
|
10795
|
+
/* @__PURE__ */ jsxs24("span", { children: [
|
|
10712
10796
|
"Page ",
|
|
10713
10797
|
pages.length
|
|
10714
10798
|
] }),
|
|
10715
|
-
/* @__PURE__ */
|
|
10799
|
+
/* @__PURE__ */ jsx26("button", { type: "button", disabled: loading || busy || !nextCursor, onClick: () => {
|
|
10716
10800
|
if (nextCursor) setPages((value) => [...value, nextCursor]);
|
|
10717
10801
|
}, children: "Next fax page" })
|
|
10718
10802
|
] }) : null,
|
|
10719
|
-
/* @__PURE__ */
|
|
10720
|
-
/* @__PURE__ */
|
|
10721
|
-
/* @__PURE__ */
|
|
10803
|
+
/* @__PURE__ */ jsx26("div", { className: "mbrfa-list", children: faxes.map((item) => /* @__PURE__ */ jsxs24("article", { className: "mbrfa-card", children: [
|
|
10804
|
+
/* @__PURE__ */ jsxs24("div", { children: [
|
|
10805
|
+
/* @__PURE__ */ jsxs24("strong", { children: [
|
|
10722
10806
|
"Response fax \xB7 ",
|
|
10723
10807
|
date3(item.receivedAt)
|
|
10724
10808
|
] }),
|
|
10725
|
-
/* @__PURE__ */
|
|
10809
|
+
/* @__PURE__ */ jsxs24("span", { children: [
|
|
10726
10810
|
item.fromName || item.fromFax || "Sender not identified",
|
|
10727
10811
|
" \xB7 ",
|
|
10728
10812
|
item.pages ?? "Unknown",
|
|
10729
10813
|
" pages"
|
|
10730
10814
|
] })
|
|
10731
10815
|
] }),
|
|
10732
|
-
/* @__PURE__ */
|
|
10816
|
+
/* @__PURE__ */ jsx26("button", { type: "button", disabled: busy || disabled, onClick: () => {
|
|
10733
10817
|
const current = ++generation.current;
|
|
10734
10818
|
setFax(item);
|
|
10735
10819
|
setPdf(null);
|
|
@@ -10746,18 +10830,18 @@ function InboundFaxInbox({ options, editable, disabled, onSelect, onCount }) {
|
|
|
10746
10830
|
});
|
|
10747
10831
|
}, children: "Review fax" })
|
|
10748
10832
|
] }, item.id)) }),
|
|
10749
|
-
fax ? /* @__PURE__ */
|
|
10750
|
-
/* @__PURE__ */
|
|
10751
|
-
/* @__PURE__ */
|
|
10752
|
-
/* @__PURE__ */
|
|
10833
|
+
fax ? /* @__PURE__ */ jsxs24("div", { style: { display: "grid", gap: 16 }, children: [
|
|
10834
|
+
/* @__PURE__ */ jsxs24("div", { className: "mbtd-actions", children: [
|
|
10835
|
+
/* @__PURE__ */ jsx26("h4", { children: "Match response fax" }),
|
|
10836
|
+
/* @__PURE__ */ jsx26("button", { type: "button", disabled: busy, onClick: () => {
|
|
10753
10837
|
generation.current += 1;
|
|
10754
10838
|
setFax(null);
|
|
10755
10839
|
setPdf(null);
|
|
10756
10840
|
setReload((value) => value + 1);
|
|
10757
10841
|
}, children: "Close review" })
|
|
10758
10842
|
] }),
|
|
10759
|
-
pdf ? /* @__PURE__ */
|
|
10760
|
-
/* @__PURE__ */
|
|
10843
|
+
pdf ? /* @__PURE__ */ jsx26(RfaPdfReview, { blob: pdf, title: "Incoming utilization review response" }) : null,
|
|
10844
|
+
/* @__PURE__ */ jsxs24("form", { onSubmit: (event) => {
|
|
10761
10845
|
event.preventDefault();
|
|
10762
10846
|
void run(async () => {
|
|
10763
10847
|
const result = await records.list({ search: search.trim(), limit: 50 });
|
|
@@ -10767,20 +10851,20 @@ function InboundFaxInbox({ options, editable, disabled, onSelect, onCount }) {
|
|
|
10767
10851
|
}
|
|
10768
10852
|
});
|
|
10769
10853
|
}, children: [
|
|
10770
|
-
/* @__PURE__ */
|
|
10854
|
+
/* @__PURE__ */ jsxs24("label", { children: [
|
|
10771
10855
|
"Find patient, claim or RFA",
|
|
10772
|
-
/* @__PURE__ */
|
|
10856
|
+
/* @__PURE__ */ jsx26("input", { value: search, maxLength: 200, required: true, onChange: (event) => setSearch(event.target.value) })
|
|
10773
10857
|
] }),
|
|
10774
|
-
/* @__PURE__ */
|
|
10858
|
+
/* @__PURE__ */ jsx26("button", { type: "submit", disabled: busy || disabled, children: "Find requests" })
|
|
10775
10859
|
] }),
|
|
10776
|
-
/* @__PURE__ */
|
|
10860
|
+
/* @__PURE__ */ jsxs24("label", { children: [
|
|
10777
10861
|
"Matching request",
|
|
10778
|
-
/* @__PURE__ */
|
|
10862
|
+
/* @__PURE__ */ jsxs24("select", { value: selected, disabled: busy || disabled, onChange: (event) => {
|
|
10779
10863
|
setSelected(event.target.value);
|
|
10780
10864
|
setConfirmed(false);
|
|
10781
10865
|
}, children: [
|
|
10782
|
-
/* @__PURE__ */
|
|
10783
|
-
choices.map((record2) => /* @__PURE__ */
|
|
10866
|
+
/* @__PURE__ */ jsx26("option", { value: "", children: "Choose after reviewing the response" }),
|
|
10867
|
+
choices.map((record2) => /* @__PURE__ */ jsxs24("option", { value: record2.id, disabled: !canMatchResponse(record2), children: [
|
|
10784
10868
|
record2.employeeName,
|
|
10785
10869
|
" \xB7 ",
|
|
10786
10870
|
record2.claimNumber || "Claim not recorded",
|
|
@@ -10792,8 +10876,8 @@ function InboundFaxInbox({ options, editable, disabled, onSelect, onCount }) {
|
|
|
10792
10876
|
] }, record2.id))
|
|
10793
10877
|
] })
|
|
10794
10878
|
] }),
|
|
10795
|
-
selected ? /* @__PURE__ */
|
|
10796
|
-
editable ? /* @__PURE__ */
|
|
10879
|
+
selected ? /* @__PURE__ */ jsx26("button", { type: "button", disabled: busy || disabled, onClick: () => onSelect(selected), children: "Review selected request" }) : null,
|
|
10880
|
+
editable ? /* @__PURE__ */ jsxs24("form", { onSubmit: (event) => {
|
|
10797
10881
|
event.preventDefault();
|
|
10798
10882
|
if (!selected || !pdf || !confirmed || !editable || !choices.some((record2) => record2.id === selected && canMatchResponse(record2))) return;
|
|
10799
10883
|
void run(async () => {
|
|
@@ -10812,18 +10896,18 @@ function InboundFaxInbox({ options, editable, disabled, onSelect, onCount }) {
|
|
|
10812
10896
|
}
|
|
10813
10897
|
});
|
|
10814
10898
|
}, children: [
|
|
10815
|
-
/* @__PURE__ */
|
|
10816
|
-
/* @__PURE__ */
|
|
10899
|
+
/* @__PURE__ */ jsxs24("label", { children: [
|
|
10900
|
+
/* @__PURE__ */ jsx26("input", { type: "checkbox", required: true, checked: confirmed, onChange: (event) => setConfirmed(event.target.checked), disabled: busy || disabled }),
|
|
10817
10901
|
" I reviewed the response and confirmed its patient, claim, and requested treatment match this request."
|
|
10818
10902
|
] }),
|
|
10819
|
-
/* @__PURE__ */
|
|
10820
|
-
] }) : /* @__PURE__ */
|
|
10903
|
+
/* @__PURE__ */ jsx26("button", { type: "submit", disabled: busy || disabled || !selected || !pdf || !confirmed, children: "Match response and open Post UR" })
|
|
10904
|
+
] }) : /* @__PURE__ */ jsx26("p", { children: "Matching responses requires authorization from your administrator." })
|
|
10821
10905
|
] }) : null
|
|
10822
10906
|
] });
|
|
10823
10907
|
}
|
|
10824
10908
|
|
|
10825
10909
|
// src/rfa-tracking-panel.tsx
|
|
10826
|
-
import { Fragment as
|
|
10910
|
+
import { Fragment as Fragment17, useEffect as useEffect15, useMemo as useMemo8, useRef as useRef14, useState as useState18 } from "react";
|
|
10827
10911
|
import { createRfaClient as createRfaClient2, createRfaLifecycleClient as createRfaLifecycleClient2 } from "@mindbill/browser";
|
|
10828
10912
|
|
|
10829
10913
|
// src/rfa-detail-header.tsx
|
|
@@ -10846,43 +10930,43 @@ function rfaDecisionDueText(rfa) {
|
|
|
10846
10930
|
}
|
|
10847
10931
|
|
|
10848
10932
|
// src/rfa-detail-header.tsx
|
|
10849
|
-
import { Fragment as
|
|
10933
|
+
import { Fragment as Fragment16, jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
10850
10934
|
function RfaDetailHeader({ rfa, getPatientHref, getClaimHref, getProviderHref, compact = false }) {
|
|
10851
10935
|
const status = getRfaLifecycleStatus(rfa);
|
|
10852
10936
|
const stages = ["Incomplete", "Sent", "Received", "Closed"];
|
|
10853
10937
|
const current = status === "closed" ? 3 : status === "received" || rfa.receivedAt ? 2 : status === "sent" || rfa.submittedAt ? 1 : 0;
|
|
10854
|
-
return /* @__PURE__ */
|
|
10855
|
-
/* @__PURE__ */
|
|
10856
|
-
/* @__PURE__ */
|
|
10857
|
-
/* @__PURE__ */
|
|
10858
|
-
/* @__PURE__ */
|
|
10938
|
+
return /* @__PURE__ */ jsxs25(Fragment16, { children: [
|
|
10939
|
+
/* @__PURE__ */ jsxs25("div", { className: "mbrfa-context", children: [
|
|
10940
|
+
/* @__PURE__ */ jsxs25("div", { children: [
|
|
10941
|
+
/* @__PURE__ */ jsx27("strong", { children: /* @__PURE__ */ jsx27(RfaLink, { href: getPatientHref?.(rfa), children: rfa.employeeName }) }),
|
|
10942
|
+
/* @__PURE__ */ jsx27("span", { children: /* @__PURE__ */ jsxs25(RfaLink, { href: getClaimHref?.(rfa), children: [
|
|
10859
10943
|
"Claim ",
|
|
10860
10944
|
rfa.claimNumber || "Not recorded"
|
|
10861
10945
|
] }) })
|
|
10862
10946
|
] }),
|
|
10863
|
-
/* @__PURE__ */
|
|
10864
|
-
/* @__PURE__ */
|
|
10865
|
-
/* @__PURE__ */
|
|
10947
|
+
/* @__PURE__ */ jsxs25("div", { children: [
|
|
10948
|
+
/* @__PURE__ */ jsx27("strong", { children: /* @__PURE__ */ jsx27(RfaLink, { href: getProviderHref?.(rfa), children: rfa.providerName }) }),
|
|
10949
|
+
/* @__PURE__ */ jsx27("span", { children: "Requesting physician" })
|
|
10866
10950
|
] }),
|
|
10867
|
-
/* @__PURE__ */
|
|
10868
|
-
/* @__PURE__ */
|
|
10869
|
-
/* @__PURE__ */
|
|
10951
|
+
/* @__PURE__ */ jsxs25("div", { children: [
|
|
10952
|
+
/* @__PURE__ */ jsx27("strong", { children: rfa.expedited ? "Expedited review" : `${rfa.reviewType.charAt(0).toUpperCase()}${rfa.reviewType.slice(1)} review` }),
|
|
10953
|
+
/* @__PURE__ */ jsx27("span", { className: "mbrfa-update-note", children: "Updates automatically" })
|
|
10870
10954
|
] })
|
|
10871
10955
|
] }),
|
|
10872
|
-
!compact ? /* @__PURE__ */
|
|
10873
|
-
/* @__PURE__ */
|
|
10874
|
-
/* @__PURE__ */
|
|
10875
|
-
/* @__PURE__ */
|
|
10876
|
-
/* @__PURE__ */
|
|
10956
|
+
!compact ? /* @__PURE__ */ jsxs25("section", { className: "mbrfa-progress", "aria-label": "Request status", children: [
|
|
10957
|
+
/* @__PURE__ */ jsxs25("div", { className: "mbrfa-progress-heading", children: [
|
|
10958
|
+
/* @__PURE__ */ jsxs25("div", { children: [
|
|
10959
|
+
/* @__PURE__ */ jsx27("h3", { children: RFA_LIFECYCLE_LABELS[status] }),
|
|
10960
|
+
/* @__PURE__ */ jsx27("p", { children: status === "failed" ? "Delivery needs attention. Review the delivery evidence before retrying." : status === "canceled" ? "This request was canceled." : rfa.submittedAt ? `Submitted ${new Date(rfa.submittedAt).toLocaleDateString()}` : "Not yet submitted" })
|
|
10877
10961
|
] }),
|
|
10878
|
-
/* @__PURE__ */
|
|
10879
|
-
/* @__PURE__ */
|
|
10880
|
-
/* @__PURE__ */
|
|
10962
|
+
/* @__PURE__ */ jsxs25("div", { className: "mbrfa-deadline", children: [
|
|
10963
|
+
/* @__PURE__ */ jsx27("span", { children: "Decision due" }),
|
|
10964
|
+
/* @__PURE__ */ jsx27("strong", { children: rfaDecisionDueText(rfa) })
|
|
10881
10965
|
] })
|
|
10882
10966
|
] }),
|
|
10883
|
-
/* @__PURE__ */
|
|
10884
|
-
/* @__PURE__ */
|
|
10885
|
-
/* @__PURE__ */
|
|
10967
|
+
/* @__PURE__ */ jsx27("ol", { "aria-label": "Authorization progress", children: stages.map((stage, index) => /* @__PURE__ */ jsxs25("li", { className: index <= current ? "is-complete" : "", "aria-current": index === current ? "step" : void 0, children: [
|
|
10968
|
+
/* @__PURE__ */ jsx27("span", { children: index < current ? "\u2713" : index + 1 }),
|
|
10969
|
+
/* @__PURE__ */ jsx27("strong", { children: stage })
|
|
10886
10970
|
] }, stage)) })
|
|
10887
10971
|
] }) : null
|
|
10888
10972
|
] });
|
|
@@ -10896,7 +10980,7 @@ var rfaPolishCss = `
|
|
|
10896
10980
|
var rfaSimpleCss = `.mbrfa-simple .mbrfa-detail-tabs{display:flex;overflow-x:auto;gap:4px}.mbrfa-simple .mbrfa-detail-tabs button{flex:1;white-space:nowrap}.mbrfa-simple [hidden]{display:none!important}.mbrfa-next-action{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-soft)}.mbrfa-next-action p{margin:5px 0 0}.mbrfa-simple .mbrfa-bottom-actions{position:static}.mbrfa-simple .mbrfa-bottom-actions>.mbrfa-badge{display:none}@media(max-width:600px){.mbrfa-next-action{align-items:flex-start;flex-direction:column}.mbrfa-simple .mbrfa-detail-tabs button{padding:8px}}`;
|
|
10897
10981
|
|
|
10898
10982
|
// src/rfa-history-entry.tsx
|
|
10899
|
-
import { jsx as
|
|
10983
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
10900
10984
|
var object = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
10901
10985
|
var string = (value) => typeof value === "string" && value.trim() ? value : void 0;
|
|
10902
10986
|
var words = (value) => value.replace(/^rfa\./, "").replaceAll("_", " ");
|
|
@@ -10970,9 +11054,9 @@ function rows2(value, omit = []) {
|
|
|
10970
11054
|
});
|
|
10971
11055
|
}
|
|
10972
11056
|
function DefinitionList({ entries }) {
|
|
10973
|
-
return /* @__PURE__ */
|
|
10974
|
-
/* @__PURE__ */
|
|
10975
|
-
/* @__PURE__ */
|
|
11057
|
+
return /* @__PURE__ */ jsx28("dl", { children: entries.map(([label5, value]) => /* @__PURE__ */ jsxs26("div", { children: [
|
|
11058
|
+
/* @__PURE__ */ jsx28("dt", { children: label5 }),
|
|
11059
|
+
/* @__PURE__ */ jsx28("dd", { style: { whiteSpace: "pre-wrap" }, children: value })
|
|
10976
11060
|
] }, label5)) });
|
|
10977
11061
|
}
|
|
10978
11062
|
function RfaHistoryEntry({ event, rfa, disabled, onDownload }) {
|
|
@@ -10997,12 +11081,12 @@ function RfaHistoryEntry({ event, rfa, disabled, onDownload }) {
|
|
|
10997
11081
|
}
|
|
10998
11082
|
const treatment = (id) => {
|
|
10999
11083
|
const index = rfa.items.findIndex((value) => value.id === id);
|
|
11000
|
-
return index >= 0 ? /* @__PURE__ */
|
|
11084
|
+
return index >= 0 ? /* @__PURE__ */ jsxs26("a", { href: `#rfa-treatment-${id}`, children: [
|
|
11001
11085
|
"Treatment ",
|
|
11002
11086
|
index + 1,
|
|
11003
11087
|
": ",
|
|
11004
11088
|
rfa.items[index].serviceDescription
|
|
11005
|
-
] }) : /* @__PURE__ */
|
|
11089
|
+
] }) : /* @__PURE__ */ jsxs26("span", { children: [
|
|
11006
11090
|
"Treatment reference: ",
|
|
11007
11091
|
id
|
|
11008
11092
|
] });
|
|
@@ -11029,50 +11113,50 @@ function RfaHistoryEntry({ event, rfa, disabled, onDownload }) {
|
|
|
11029
11113
|
const hasDetails = entries.length || appointment.length || decisionSections.length || evidence.length || changed.length;
|
|
11030
11114
|
const actor = /^(system:|system$)/.test(event.actor) ? "System" : /^(native-user:|user:)/.test(event.actor) || /^partner:[^:]+:browser:/.test(event.actor) ? "Team member" : /^partner:/.test(event.actor) ? "Integration" : /^(developer:|integration:|api:)/.test(event.actor) ? "Integration" : event.actor;
|
|
11031
11115
|
const action = string(payload.action) ?? event.eventType.replace(/^rfa\./, "");
|
|
11032
|
-
return /* @__PURE__ */
|
|
11033
|
-
/* @__PURE__ */
|
|
11034
|
-
/* @__PURE__ */
|
|
11035
|
-
/* @__PURE__ */
|
|
11036
|
-
/* @__PURE__ */
|
|
11116
|
+
return /* @__PURE__ */ jsxs26("tr", { children: [
|
|
11117
|
+
/* @__PURE__ */ jsx28("td", { children: /* @__PURE__ */ jsx28("time", { dateTime: event.occurredAt ?? void 0, children: date4(event.occurredAt) }) }),
|
|
11118
|
+
/* @__PURE__ */ jsx28("td", { className: "mbrfa-history-action", children: actions[action] ?? words(action) }),
|
|
11119
|
+
/* @__PURE__ */ jsxs26("td", { children: [
|
|
11120
|
+
/* @__PURE__ */ jsx28("span", { className: "mbrfa-sr-only", children: "Recorded by " }),
|
|
11037
11121
|
actor
|
|
11038
11122
|
] }),
|
|
11039
|
-
/* @__PURE__ */
|
|
11040
|
-
["text", "reason", "requestText", "note"].map((key2) => string(payload[key2]) ? /* @__PURE__ */
|
|
11041
|
-
ids.size ? /* @__PURE__ */
|
|
11042
|
-
hasDetails ? /* @__PURE__ */
|
|
11043
|
-
/* @__PURE__ */
|
|
11044
|
-
entries.length ? /* @__PURE__ */
|
|
11045
|
-
changed.length ? /* @__PURE__ */
|
|
11123
|
+
/* @__PURE__ */ jsxs26("td", { children: [
|
|
11124
|
+
["text", "reason", "requestText", "note"].map((key2) => string(payload[key2]) ? /* @__PURE__ */ jsx28("p", { style: { whiteSpace: "pre-wrap" }, children: String(payload[key2]) }, key2) : null),
|
|
11125
|
+
ids.size ? /* @__PURE__ */ jsx28("ul", { "aria-label": "Related treatments", children: [...ids].map((id) => /* @__PURE__ */ jsx28("li", { children: treatment(id) }, id)) }) : null,
|
|
11126
|
+
hasDetails ? /* @__PURE__ */ jsxs26("details", { children: [
|
|
11127
|
+
/* @__PURE__ */ jsx28("summary", { children: "Event details" }),
|
|
11128
|
+
entries.length ? /* @__PURE__ */ jsx28(DefinitionList, { entries }) : null,
|
|
11129
|
+
changed.length ? /* @__PURE__ */ jsxs26("p", { children: [
|
|
11046
11130
|
"Changed fields: ",
|
|
11047
11131
|
changed.join(", ")
|
|
11048
11132
|
] }) : null,
|
|
11049
|
-
appointment.length ? /* @__PURE__ */
|
|
11050
|
-
/* @__PURE__ */
|
|
11051
|
-
/* @__PURE__ */
|
|
11133
|
+
appointment.length ? /* @__PURE__ */ jsxs26("section", { children: [
|
|
11134
|
+
/* @__PURE__ */ jsx28("h4", { children: "Appointment details" }),
|
|
11135
|
+
/* @__PURE__ */ jsx28(DefinitionList, { entries: appointment })
|
|
11052
11136
|
] }) : null,
|
|
11053
|
-
decisionSections.map((group) => /* @__PURE__ */
|
|
11054
|
-
/* @__PURE__ */
|
|
11055
|
-
group.value !== payload ? /* @__PURE__ */
|
|
11056
|
-
group.decisions.map((value, index) => /* @__PURE__ */
|
|
11137
|
+
decisionSections.map((group) => /* @__PURE__ */ jsxs26("section", { children: [
|
|
11138
|
+
/* @__PURE__ */ jsx28("h4", { children: group.title }),
|
|
11139
|
+
group.value !== payload ? /* @__PURE__ */ jsx28(DefinitionList, { entries: rows2(group.value, ["reason"]) }) : null,
|
|
11140
|
+
group.decisions.map((value, index) => /* @__PURE__ */ jsxs26("div", { children: [
|
|
11057
11141
|
string(value.itemId) ? treatment(String(value.itemId)) : null,
|
|
11058
|
-
/* @__PURE__ */
|
|
11142
|
+
/* @__PURE__ */ jsx28(DefinitionList, { entries: rows2(value) })
|
|
11059
11143
|
] }, index))
|
|
11060
11144
|
] }, group.title)),
|
|
11061
|
-
evidence.length ? /* @__PURE__ */
|
|
11145
|
+
evidence.length ? /* @__PURE__ */ jsx28("ul", { "aria-label": "Event documents", children: evidence.map((value) => {
|
|
11062
11146
|
const filename = rfa.documents.find((document2) => document2.id === value.id)?.filename;
|
|
11063
|
-
return /* @__PURE__ */
|
|
11147
|
+
return /* @__PURE__ */ jsx28("li", { children: /* @__PURE__ */ jsxs26("button", { type: "button", disabled, onClick: () => onDownload(value.kind, value.id, filename ?? (value.kind === "packet" ? "RFA submission.pdf" : "RFA evidence.pdf")), children: [
|
|
11064
11148
|
value.label,
|
|
11065
11149
|
filename ? `: ${filename}` : ""
|
|
11066
11150
|
] }) }, `${value.kind}:${value.id}`);
|
|
11067
11151
|
}) }) : null
|
|
11068
|
-
] }) : !["text", "reason", "requestText", "note"].some((key2) => string(payload[key2])) && !ids.size ? /* @__PURE__ */
|
|
11152
|
+
] }) : !["text", "reason", "requestText", "note"].some((key2) => string(payload[key2])) && !ids.size ? /* @__PURE__ */ jsx28("span", { children: "\u2014" }) : null
|
|
11069
11153
|
] })
|
|
11070
11154
|
] });
|
|
11071
11155
|
}
|
|
11072
11156
|
|
|
11073
11157
|
// src/rfa-detail-cards.tsx
|
|
11074
11158
|
import { getRfaLifecycleStatus as getRfaLifecycleStatus2, RFA_LIFECYCLE_LABELS as RFA_LIFECYCLE_LABELS2 } from "@mindbill/browser";
|
|
11075
|
-
import { jsx as
|
|
11159
|
+
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
11076
11160
|
var DECIDED = ["approved", "modified", "denied", "mixed", "closed"];
|
|
11077
11161
|
var rfaShortDate = (value) => value && Number.isFinite(Date.parse(value)) ? new Date(value).toLocaleString(void 0, { dateStyle: "short", timeStyle: "short" }) : "\u2014";
|
|
11078
11162
|
var rfaCalendarDate = (value) => {
|
|
@@ -11091,7 +11175,7 @@ function rfaOutcome(item) {
|
|
|
11091
11175
|
return { label: sentence(item.outcome || "pending"), tone: "muted" };
|
|
11092
11176
|
}
|
|
11093
11177
|
function RfaPill({ tone = "muted", children }) {
|
|
11094
|
-
return /* @__PURE__ */
|
|
11178
|
+
return /* @__PURE__ */ jsx29("span", { className: "mbrfa-pill", "data-tone": tone, children });
|
|
11095
11179
|
}
|
|
11096
11180
|
function rfaLifecycleTone(rfa) {
|
|
11097
11181
|
const status = getRfaLifecycleStatus2(rfa);
|
|
@@ -11108,41 +11192,41 @@ function RfaStatusCard({ rfa }) {
|
|
|
11108
11192
|
const current = rfa.submittedAt && decided ? 4 : rfa.receivedAt ? 3 : rfa.submittedAt ? 2 : rfa.signedAt ? 1 : 0;
|
|
11109
11193
|
const stopped = status === "canceled" || status === "failed";
|
|
11110
11194
|
const detail = status === "canceled" ? "This request was canceled" : status === "failed" ? "Delivery needs attention" : rfa.submittedAt ? `Sent ${rfaShortDate(rfa.submittedAt)}` : rfa.signedAt ? "Signed, not yet sent" : "Not yet signed";
|
|
11111
|
-
return /* @__PURE__ */
|
|
11112
|
-
/* @__PURE__ */
|
|
11113
|
-
/* @__PURE__ */
|
|
11114
|
-
/* @__PURE__ */
|
|
11115
|
-
/* @__PURE__ */
|
|
11195
|
+
return /* @__PURE__ */ jsxs27("section", { className: "mbrfa-status", "aria-label": "Request status", "data-stopped": stopped || void 0, children: [
|
|
11196
|
+
/* @__PURE__ */ jsxs27("div", { className: "mbrfa-status-heading", children: [
|
|
11197
|
+
/* @__PURE__ */ jsxs27("div", { children: [
|
|
11198
|
+
/* @__PURE__ */ jsx29("h3", { children: RFA_LIFECYCLE_LABELS2[status] }),
|
|
11199
|
+
/* @__PURE__ */ jsx29("p", { children: detail })
|
|
11116
11200
|
] }),
|
|
11117
|
-
rfa.submittedAt && !stopped ? /* @__PURE__ */
|
|
11118
|
-
/* @__PURE__ */
|
|
11119
|
-
/* @__PURE__ */
|
|
11201
|
+
rfa.submittedAt && !stopped ? /* @__PURE__ */ jsxs27("div", { className: "mbrfa-status-due", children: [
|
|
11202
|
+
/* @__PURE__ */ jsx29("span", { children: "Decision due" }),
|
|
11203
|
+
/* @__PURE__ */ jsx29("strong", { children: rfaDecisionDueText(rfa) })
|
|
11120
11204
|
] }) : null
|
|
11121
11205
|
] }),
|
|
11122
|
-
/* @__PURE__ */
|
|
11123
|
-
/* @__PURE__ */
|
|
11124
|
-
/* @__PURE__ */
|
|
11206
|
+
/* @__PURE__ */ jsx29("ol", { "aria-label": "Authorization progress", children: stages.map((stage, index) => /* @__PURE__ */ jsxs27("li", { "data-state": index < current ? "done" : index === current ? "current" : "todo", "aria-current": index === current ? "step" : void 0, children: [
|
|
11207
|
+
/* @__PURE__ */ jsx29("span", { children: index < current ? "\u2713" : index + 1 }),
|
|
11208
|
+
/* @__PURE__ */ jsx29("strong", { children: stage })
|
|
11125
11209
|
] }, stage)) })
|
|
11126
11210
|
] });
|
|
11127
11211
|
}
|
|
11128
11212
|
function RfaCard({ title, count, action, children, id, flush = false }) {
|
|
11129
|
-
return /* @__PURE__ */
|
|
11130
|
-
/* @__PURE__ */
|
|
11131
|
-
/* @__PURE__ */
|
|
11213
|
+
return /* @__PURE__ */ jsxs27("section", { className: "mbrfa-sheet", id, "aria-label": title, children: [
|
|
11214
|
+
/* @__PURE__ */ jsxs27("header", { children: [
|
|
11215
|
+
/* @__PURE__ */ jsxs27("h3", { children: [
|
|
11132
11216
|
title,
|
|
11133
|
-
count !== void 0 ? /* @__PURE__ */
|
|
11217
|
+
count !== void 0 ? /* @__PURE__ */ jsx29("span", { className: "mbrfa-count", children: count }) : null
|
|
11134
11218
|
] }),
|
|
11135
|
-
action ? /* @__PURE__ */
|
|
11219
|
+
action ? /* @__PURE__ */ jsx29("div", { className: "mbrfa-sheet-action", children: action }) : null
|
|
11136
11220
|
] }),
|
|
11137
|
-
/* @__PURE__ */
|
|
11221
|
+
/* @__PURE__ */ jsx29("div", { className: flush ? "mbrfa-sheet-flush" : "mbrfa-sheet-body", children })
|
|
11138
11222
|
] });
|
|
11139
11223
|
}
|
|
11140
11224
|
function RfaFacts({ entries }) {
|
|
11141
11225
|
const shown = entries.filter(([, value]) => value !== null && value !== void 0 && value !== "" && value !== false);
|
|
11142
|
-
return shown.length ? /* @__PURE__ */
|
|
11143
|
-
/* @__PURE__ */
|
|
11144
|
-
/* @__PURE__ */
|
|
11145
|
-
] }, name)) }) : /* @__PURE__ */
|
|
11226
|
+
return shown.length ? /* @__PURE__ */ jsx29("dl", { className: "mbrfa-facts", children: shown.map(([name, value]) => /* @__PURE__ */ jsxs27("div", { children: [
|
|
11227
|
+
/* @__PURE__ */ jsx29("dt", { children: name }),
|
|
11228
|
+
/* @__PURE__ */ jsx29("dd", { children: value })
|
|
11229
|
+
] }, name)) }) : /* @__PURE__ */ jsx29("p", { className: "mbrfa-empty", children: "Not recorded." });
|
|
11146
11230
|
}
|
|
11147
11231
|
var rfaAddress = (contact) => [contact?.address, [contact?.city, [contact?.state, contact?.zip].filter(Boolean).join(" ")].filter(Boolean).join(", ")].filter(Boolean).join(", ");
|
|
11148
11232
|
var rfaRequestTypeLabel = (rfa) => rfa.requestType === "resubmission_material_change" ? "Resubmission \u2013 Change in Material Facts" : "New Request";
|
|
@@ -11228,7 +11312,7 @@ var rfaCardsCss = `
|
|
|
11228
11312
|
`;
|
|
11229
11313
|
|
|
11230
11314
|
// src/rfa-tracking-panel.tsx
|
|
11231
|
-
import { Fragment as
|
|
11315
|
+
import { Fragment as Fragment18, jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
11232
11316
|
var words2 = (value) => value.replace(/^rfa\./, "").replaceAll("_", " ");
|
|
11233
11317
|
var capital = (value) => value.charAt(0).toUpperCase() + value.slice(1);
|
|
11234
11318
|
var date5 = (value) => value ? new Date(value).toLocaleString() : "Not recorded";
|
|
@@ -11250,25 +11334,25 @@ var localTime = (value) => {
|
|
|
11250
11334
|
};
|
|
11251
11335
|
function RfaTrackingPanel(props) {
|
|
11252
11336
|
const identity = useMemo8(() => crypto.randomUUID(), [props.options]);
|
|
11253
|
-
return /* @__PURE__ */
|
|
11337
|
+
return /* @__PURE__ */ jsx30(RfaTrackingContent, { ...props }, `${identity}:${props.rfa.id}`);
|
|
11254
11338
|
}
|
|
11255
11339
|
function RfaTrackingContent({ rfa: provided, options, permissions = [], onUpdated, view = "all", embedded = false, cards = false, ...appearance }) {
|
|
11256
|
-
const [rfa, setRfa] =
|
|
11340
|
+
const [rfa, setRfa] = useState18(provided);
|
|
11257
11341
|
useEffect15(() => setRfa(provided), [provided]);
|
|
11258
11342
|
const client = useMemo8(() => createRfaLifecycleClient2(options), [options]);
|
|
11259
11343
|
const records = useMemo8(() => createRfaClient2(options), [options]);
|
|
11260
|
-
const [scheduling, setScheduling] =
|
|
11261
|
-
const [history, setHistory] =
|
|
11262
|
-
const [loadErrors, setLoadErrors] =
|
|
11263
|
-
const [loading, setLoading] =
|
|
11264
|
-
const [reload, setReload] =
|
|
11265
|
-
const [busy, setBusy] =
|
|
11266
|
-
const [error, setError] =
|
|
11267
|
-
const [message, setMessage] =
|
|
11268
|
-
const [noteOpen, setNoteOpen] =
|
|
11269
|
-
const alive =
|
|
11270
|
-
const pending =
|
|
11271
|
-
const keys =
|
|
11344
|
+
const [scheduling, setScheduling] = useState18([]);
|
|
11345
|
+
const [history, setHistory] = useState18([]);
|
|
11346
|
+
const [loadErrors, setLoadErrors] = useState18([]);
|
|
11347
|
+
const [loading, setLoading] = useState18(true);
|
|
11348
|
+
const [reload, setReload] = useState18(0);
|
|
11349
|
+
const [busy, setBusy] = useState18(false);
|
|
11350
|
+
const [error, setError] = useState18("");
|
|
11351
|
+
const [message, setMessage] = useState18("");
|
|
11352
|
+
const [noteOpen, setNoteOpen] = useState18(false);
|
|
11353
|
+
const alive = useRef14(true);
|
|
11354
|
+
const pending = useRef14(false);
|
|
11355
|
+
const keys = useRef14(/* @__PURE__ */ new Map());
|
|
11272
11356
|
useEffect15(() => {
|
|
11273
11357
|
alive.current = true;
|
|
11274
11358
|
return () => {
|
|
@@ -11351,11 +11435,11 @@ function RfaTrackingContent({ rfa: provided, options, permissions = [], onUpdate
|
|
|
11351
11435
|
if (alive.current) setError(reason instanceof Error ? reason.message : "The evidence could not be opened.");
|
|
11352
11436
|
}
|
|
11353
11437
|
};
|
|
11354
|
-
const evidence = (id, title) => id ? /* @__PURE__ */
|
|
11438
|
+
const evidence = (id, title) => id ? /* @__PURE__ */ jsx30("button", { type: "button", disabled, onClick: () => void download(id, rfa.documents.find((document2) => document2.id === id)?.filename ?? `${title}.pdf`), children: title }) : null;
|
|
11355
11439
|
const canCorrect = permissions.includes("act") && ["received", "under_review", "information_requested", "approved", "modified", "denied", "mixed"].includes(rfa.status);
|
|
11356
11440
|
const canClose = permissions.includes("edit") && ["submitted", "received", "under_review", "information_requested", "incomplete", "deferred"].includes(rfa.status);
|
|
11357
11441
|
const otherInformation = (item) => typeof item.metadata?.otherInformation === "string" && item.metadata.otherInformation.trim() ? item.metadata.otherInformation : [item.quantity != null ? `Quantity: ${item.quantity}` : "", item.units != null ? `Units: ${item.units}` : "", item.frequency, item.duration, item.requestedFrom ? `From: ${rfaCalendarDate(item.requestedFrom)}` : "", item.requestedTo ? `Through: ${rfaCalendarDate(item.requestedTo)}` : ""].filter(Boolean).join("; ");
|
|
11358
|
-
const noteForm = /* @__PURE__ */
|
|
11442
|
+
const noteForm = /* @__PURE__ */ jsxs28("form", { className: "mbrfa-row", onSubmit: (event) => {
|
|
11359
11443
|
event.preventDefault();
|
|
11360
11444
|
const form = event.currentTarget;
|
|
11361
11445
|
try {
|
|
@@ -11373,77 +11457,77 @@ function RfaTrackingContent({ rfa: provided, options, permissions = [], onUpdate
|
|
|
11373
11457
|
setError(reason instanceof Error ? reason.message : "Enter a note.");
|
|
11374
11458
|
}
|
|
11375
11459
|
}, children: [
|
|
11376
|
-
/* @__PURE__ */
|
|
11460
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11377
11461
|
"Note",
|
|
11378
|
-
/* @__PURE__ */
|
|
11462
|
+
/* @__PURE__ */ jsx30("textarea", { name: "note", required: true, maxLength: 1e4, autoFocus: true, disabled })
|
|
11379
11463
|
] }),
|
|
11380
|
-
/* @__PURE__ */
|
|
11381
|
-
/* @__PURE__ */
|
|
11382
|
-
/* @__PURE__ */
|
|
11464
|
+
/* @__PURE__ */ jsxs28("div", { className: "mbtd-actions", children: [
|
|
11465
|
+
/* @__PURE__ */ jsx30("button", { type: "submit", className: "mbtd-primary", disabled, children: "Save note" }),
|
|
11466
|
+
/* @__PURE__ */ jsx30("button", { type: "button", onClick: () => setNoteOpen(false), children: "Cancel" })
|
|
11383
11467
|
] })
|
|
11384
11468
|
] });
|
|
11385
|
-
const cardContent = /* @__PURE__ */
|
|
11386
|
-
error ? /* @__PURE__ */
|
|
11387
|
-
message ? /* @__PURE__ */
|
|
11388
|
-
loadErrors.map((value) => /* @__PURE__ */
|
|
11389
|
-
view !== "history" ? /* @__PURE__ */
|
|
11390
|
-
/* @__PURE__ */
|
|
11391
|
-
/* @__PURE__ */
|
|
11392
|
-
/* @__PURE__ */
|
|
11393
|
-
/* @__PURE__ */
|
|
11394
|
-
/* @__PURE__ */
|
|
11395
|
-
/* @__PURE__ */
|
|
11396
|
-
/* @__PURE__ */
|
|
11469
|
+
const cardContent = /* @__PURE__ */ jsxs28("div", { className: "mbrfa-stack", children: [
|
|
11470
|
+
error ? /* @__PURE__ */ jsx30("p", { role: "alert", children: error }) : null,
|
|
11471
|
+
message ? /* @__PURE__ */ jsx30("p", { role: "status", children: message }) : null,
|
|
11472
|
+
loadErrors.map((value) => /* @__PURE__ */ jsx30("p", { role: "alert", children: value }, value)),
|
|
11473
|
+
view !== "history" ? /* @__PURE__ */ jsx30(RfaCard, { title: "Requested Treatment", count: rfa.items.length, flush: true, children: rfa.items.length ? /* @__PURE__ */ jsx30("div", { className: "mbrfa-table-scroll", children: /* @__PURE__ */ jsxs28("table", { className: "mbrfa-grid-table mbrfa-treatment-table", children: [
|
|
11474
|
+
/* @__PURE__ */ jsx30("thead", { children: /* @__PURE__ */ jsxs28("tr", { children: [
|
|
11475
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "#" }),
|
|
11476
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Service/Good Requested" }),
|
|
11477
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Diagnosis" }),
|
|
11478
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "CPT/HCPCS" }),
|
|
11479
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Other Information" }),
|
|
11480
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Decision" })
|
|
11397
11481
|
] }) }),
|
|
11398
|
-
/* @__PURE__ */
|
|
11482
|
+
/* @__PURE__ */ jsx30("tbody", { children: rfa.items.map((item, index) => {
|
|
11399
11483
|
const appointment = scheduling.find((value) => value.itemId === item.id);
|
|
11400
11484
|
const outcome = rfaOutcome(item);
|
|
11401
11485
|
const showAppointment = !!appointment && (appointment.eligible || appointment.version > 0);
|
|
11402
11486
|
const closable = canClose && item.outcome === "pending" && !item.decidedAt;
|
|
11403
11487
|
const correctable = canCorrect && !!item.currentDecisionEventId && item.outcome !== "pending";
|
|
11404
|
-
return /* @__PURE__ */
|
|
11405
|
-
/* @__PURE__ */
|
|
11406
|
-
/* @__PURE__ */
|
|
11407
|
-
/* @__PURE__ */
|
|
11408
|
-
/* @__PURE__ */
|
|
11409
|
-
/* @__PURE__ */
|
|
11410
|
-
item.diagnosisDescription ? /* @__PURE__ */
|
|
11488
|
+
return /* @__PURE__ */ jsxs28(Fragment17, { children: [
|
|
11489
|
+
/* @__PURE__ */ jsxs28("tr", { id: `rfa-treatment-${item.id}`, tabIndex: -1, children: [
|
|
11490
|
+
/* @__PURE__ */ jsx30("td", { children: index + 1 }),
|
|
11491
|
+
/* @__PURE__ */ jsx30("td", { children: /* @__PURE__ */ jsx30("strong", { children: item.serviceDescription }) }),
|
|
11492
|
+
/* @__PURE__ */ jsxs28("td", { children: [
|
|
11493
|
+
/* @__PURE__ */ jsx30("span", { className: "mbrfa-code", children: item.diagnosisCode }),
|
|
11494
|
+
item.diagnosisDescription ? /* @__PURE__ */ jsx30("small", { children: item.diagnosisDescription }) : null
|
|
11411
11495
|
] }),
|
|
11412
|
-
/* @__PURE__ */
|
|
11413
|
-
/* @__PURE__ */
|
|
11414
|
-
/* @__PURE__ */
|
|
11415
|
-
/* @__PURE__ */
|
|
11416
|
-
item.outcome !== "pending" ? /* @__PURE__ */
|
|
11417
|
-
item.authorizationNumber ? /* @__PURE__ */
|
|
11496
|
+
/* @__PURE__ */ jsx30("td", { children: /* @__PURE__ */ jsx30("span", { className: "mbrfa-code", children: item.procedureCode || "\u2014" }) }),
|
|
11497
|
+
/* @__PURE__ */ jsx30("td", { children: otherInformation(item) || "\u2014" }),
|
|
11498
|
+
/* @__PURE__ */ jsxs28("td", { children: [
|
|
11499
|
+
/* @__PURE__ */ jsx30(RfaPill, { tone: outcome.tone, children: outcome.label }),
|
|
11500
|
+
item.outcome !== "pending" ? /* @__PURE__ */ jsxs28(Fragment18, { children: [
|
|
11501
|
+
item.authorizationNumber ? /* @__PURE__ */ jsxs28("small", { children: [
|
|
11418
11502
|
"Authorization ",
|
|
11419
11503
|
item.authorizationNumber
|
|
11420
11504
|
] }) : null,
|
|
11421
|
-
item.authorizedProcedureCode || item.authorizedQuantity != null || item.authorizedUnits != null ? /* @__PURE__ */
|
|
11505
|
+
item.authorizedProcedureCode || item.authorizedQuantity != null || item.authorizedUnits != null ? /* @__PURE__ */ jsxs28("small", { children: [
|
|
11422
11506
|
"Authorized ",
|
|
11423
11507
|
[item.authorizedProcedureCode || item.procedureCode, item.authorizedQuantity != null ? `quantity ${item.authorizedQuantity}` : "", item.authorizedUnits != null ? `units ${item.authorizedUnits}` : ""].filter(Boolean).join(" \xB7 ")
|
|
11424
11508
|
] }) : null,
|
|
11425
|
-
item.effectiveFrom || item.effectiveTo ? /* @__PURE__ */
|
|
11509
|
+
item.effectiveFrom || item.effectiveTo ? /* @__PURE__ */ jsxs28("small", { children: [
|
|
11426
11510
|
rfaCalendarDate(item.effectiveFrom) || "Not specified",
|
|
11427
11511
|
" \u2013 ",
|
|
11428
11512
|
rfaCalendarDate(item.effectiveTo) || "Not specified"
|
|
11429
11513
|
] }) : null,
|
|
11430
|
-
/* @__PURE__ */
|
|
11514
|
+
/* @__PURE__ */ jsxs28("small", { children: [
|
|
11431
11515
|
"Decided ",
|
|
11432
11516
|
rfaShortDate(item.decidedAt)
|
|
11433
11517
|
] })
|
|
11434
11518
|
] }) : null
|
|
11435
11519
|
] })
|
|
11436
11520
|
] }),
|
|
11437
|
-
item.decisionReason || item.reviewerName || item.decisionClosure || closable || showAppointment || correctable || item.currentResponseDocumentId || item.currentImrDocumentId ? /* @__PURE__ */
|
|
11438
|
-
/* @__PURE__ */
|
|
11439
|
-
/* @__PURE__ */
|
|
11440
|
-
item.decisionReason ? /* @__PURE__ */
|
|
11441
|
-
item.reviewerName ? /* @__PURE__ */
|
|
11521
|
+
item.decisionReason || item.reviewerName || item.decisionClosure || closable || showAppointment || correctable || item.currentResponseDocumentId || item.currentImrDocumentId ? /* @__PURE__ */ jsxs28("tr", { className: "mbrfa-subrow", children: [
|
|
11522
|
+
/* @__PURE__ */ jsx30("td", {}),
|
|
11523
|
+
/* @__PURE__ */ jsx30("td", { colSpan: 5, children: /* @__PURE__ */ jsxs28("div", { className: "mbrfa-manage", children: [
|
|
11524
|
+
item.decisionReason ? /* @__PURE__ */ jsx30("p", { children: item.decisionReason }) : null,
|
|
11525
|
+
item.reviewerName ? /* @__PURE__ */ jsxs28("p", { children: [
|
|
11442
11526
|
"Reviewer: ",
|
|
11443
11527
|
item.reviewerName,
|
|
11444
11528
|
item.reviewerPhone ? ` \xB7 ${item.reviewerPhone}` : ""
|
|
11445
11529
|
] }) : null,
|
|
11446
|
-
item.decisionClosure ? /* @__PURE__ */
|
|
11530
|
+
item.decisionClosure ? /* @__PURE__ */ jsxs28("p", { children: [
|
|
11447
11531
|
item.decisionClosure.closed ? "Closed" : "Reopened",
|
|
11448
11532
|
" by ",
|
|
11449
11533
|
item.decisionClosure.updatedBy,
|
|
@@ -11452,125 +11536,125 @@ function RfaTrackingContent({ rfa: provided, options, permissions = [], onUpdate
|
|
|
11452
11536
|
" \u2014 ",
|
|
11453
11537
|
item.decisionClosure.reason
|
|
11454
11538
|
] }) : null,
|
|
11455
|
-
item.currentResponseDocumentId || item.currentImrDocumentId ? /* @__PURE__ */
|
|
11539
|
+
item.currentResponseDocumentId || item.currentImrDocumentId ? /* @__PURE__ */ jsxs28("div", { className: "mbtd-actions", children: [
|
|
11456
11540
|
evidence(item.currentResponseDocumentId, "View decision evidence"),
|
|
11457
11541
|
evidence(item.currentImrDocumentId, "View independent medical review form")
|
|
11458
11542
|
] }) : null,
|
|
11459
|
-
showAppointment ? /* @__PURE__ */
|
|
11543
|
+
showAppointment ? /* @__PURE__ */ jsx30(AppointmentForm, { appointment, editable: permissions.includes("edit"), disabled: disabled || loadErrors.some((value) => value.startsWith("Appointments")), onError: setError, onSave: (input) => run(`appointment:${item.id}`, input, async (key2) => {
|
|
11460
11544
|
await client.updateScheduling(rfa.id, item.id, input, key2);
|
|
11461
11545
|
return records.get(rfa.id);
|
|
11462
11546
|
}) }, `${item.id}:${appointment.version}:${appointment.authorizationToken}`) : null,
|
|
11463
|
-
closable ? /* @__PURE__ */
|
|
11464
|
-
correctable ? /* @__PURE__ */
|
|
11465
|
-
/* @__PURE__ */
|
|
11466
|
-
/* @__PURE__ */
|
|
11467
|
-
/* @__PURE__ */
|
|
11547
|
+
closable ? /* @__PURE__ */ jsx30(TreatmentClosureForm, { item, disabled, onError: setError, onSave: (input) => run(`closure:${item.id}`, input, (key2) => client.updateTreatmentClosure(rfa.id, item.id, input, key2)) }, `${item.id}:${item.decisionClosure?.version ?? 0}`) : null,
|
|
11548
|
+
correctable ? /* @__PURE__ */ jsxs28("details", { children: [
|
|
11549
|
+
/* @__PURE__ */ jsx30("summary", { children: "Correct this decision" }),
|
|
11550
|
+
/* @__PURE__ */ jsx30("p", { children: "The original decision and its evidence remain in history. Corrections require a reason and response evidence. Requests already used for a bill or a scheduled appointment cannot be corrected." }),
|
|
11551
|
+
/* @__PURE__ */ jsx30(CorrectionForm, { item, documents: rfa.documents, disabled: disabled || loading || loadErrors.length > 0 || scheduling.some((value) => value.disposition === "scheduled"), onError: setError, onSave: (input) => run(`correction:${item.id}`, input, (key2) => client.correctDecision(rfa.id, input, key2)) }, `${item.id}:${item.currentDecisionEventId}`)
|
|
11468
11552
|
] }) : null
|
|
11469
11553
|
] }) })
|
|
11470
11554
|
] }) : null
|
|
11471
11555
|
] }, item.id);
|
|
11472
11556
|
}) })
|
|
11473
|
-
] }) }) : /* @__PURE__ */
|
|
11474
|
-
view !== "treatments" ? /* @__PURE__ */
|
|
11475
|
-
/* @__PURE__ */
|
|
11476
|
-
/* @__PURE__ */
|
|
11477
|
-
loading ? /* @__PURE__ */
|
|
11478
|
-
/* @__PURE__ */
|
|
11479
|
-
/* @__PURE__ */
|
|
11480
|
-
/* @__PURE__ */
|
|
11481
|
-
/* @__PURE__ */
|
|
11482
|
-
/* @__PURE__ */
|
|
11557
|
+
] }) }) : /* @__PURE__ */ jsx30("p", { className: "mbrfa-sheet-body mbrfa-empty", children: "No treatments recorded." }) }) : null,
|
|
11558
|
+
view !== "treatments" ? /* @__PURE__ */ jsxs28(Fragment18, { children: [
|
|
11559
|
+
/* @__PURE__ */ jsxs28(RfaCard, { title: "History", action: permissions.includes("edit") && !noteOpen ? /* @__PURE__ */ jsx30("button", { type: "button", disabled, onClick: () => setNoteOpen(true), children: "Add note" }) : null, flush: true, children: [
|
|
11560
|
+
/* @__PURE__ */ jsx30("div", { className: "mbrfa-rows", children: noteOpen ? noteForm : null }),
|
|
11561
|
+
loading ? /* @__PURE__ */ jsx30("p", { className: "mbrfa-sheet-body", children: "Loading history\u2026" }) : history.length ? /* @__PURE__ */ jsx30("div", { className: "mbrfa-table-scroll", children: /* @__PURE__ */ jsxs28("table", { className: "mbrfa-history-table", children: [
|
|
11562
|
+
/* @__PURE__ */ jsx30("thead", { children: /* @__PURE__ */ jsxs28("tr", { children: [
|
|
11563
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Date" }),
|
|
11564
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Action" }),
|
|
11565
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "User" }),
|
|
11566
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Details" })
|
|
11483
11567
|
] }) }),
|
|
11484
|
-
/* @__PURE__ */
|
|
11485
|
-
] }) }) : !loadErrors.some((value) => value.startsWith("History")) ? /* @__PURE__ */
|
|
11568
|
+
/* @__PURE__ */ jsx30("tbody", { children: history.map((event) => /* @__PURE__ */ jsx30(RfaHistoryEntry, { event, rfa, disabled, onDownload: (kind, id, filename) => void download(id, filename, kind) }, event.id)) })
|
|
11569
|
+
] }) }) : !loadErrors.some((value) => value.startsWith("History")) ? /* @__PURE__ */ jsx30("p", { className: "mbrfa-sheet-body mbrfa-empty", children: "No history entries have been recorded." }) : null
|
|
11486
11570
|
] }),
|
|
11487
|
-
rfa.transmissions.length ? /* @__PURE__ */
|
|
11488
|
-
/* @__PURE__ */
|
|
11489
|
-
/* @__PURE__ */
|
|
11490
|
-
/* @__PURE__ */
|
|
11491
|
-
/* @__PURE__ */
|
|
11492
|
-
/* @__PURE__ */
|
|
11493
|
-
/* @__PURE__ */
|
|
11494
|
-
/* @__PURE__ */
|
|
11571
|
+
rfa.transmissions.length ? /* @__PURE__ */ jsx30(RfaCard, { title: "Delivery", count: rfa.transmissions.length, flush: true, children: /* @__PURE__ */ jsx30("div", { className: "mbrfa-table-scroll", children: /* @__PURE__ */ jsxs28("table", { className: "mbrfa-grid-table", children: [
|
|
11572
|
+
/* @__PURE__ */ jsx30("thead", { children: /* @__PURE__ */ jsxs28("tr", { children: [
|
|
11573
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Date" }),
|
|
11574
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Method" }),
|
|
11575
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Status" }),
|
|
11576
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Recipient" }),
|
|
11577
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Confirmed receipt" }),
|
|
11578
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: /* @__PURE__ */ jsx30("span", { className: "mbrfa-sr-only", children: "Receipt" }) })
|
|
11495
11579
|
] }) }),
|
|
11496
|
-
/* @__PURE__ */
|
|
11497
|
-
/* @__PURE__ */
|
|
11498
|
-
/* @__PURE__ */
|
|
11580
|
+
/* @__PURE__ */ jsx30("tbody", { children: rfa.transmissions.map((transmission) => /* @__PURE__ */ jsxs28("tr", { children: [
|
|
11581
|
+
/* @__PURE__ */ jsx30("td", { children: rfaShortDate(transmission.occurredAt) }),
|
|
11582
|
+
/* @__PURE__ */ jsxs28("td", { children: [
|
|
11499
11583
|
capital(words2(transmission.channel)),
|
|
11500
|
-
/* @__PURE__ */
|
|
11584
|
+
/* @__PURE__ */ jsxs28("small", { children: [
|
|
11501
11585
|
capital(words2(transmission.direction)),
|
|
11502
11586
|
transmission.purpose ? ` \xB7 ${words2(transmission.purpose)}` : ""
|
|
11503
11587
|
] })
|
|
11504
11588
|
] }),
|
|
11505
|
-
/* @__PURE__ */
|
|
11506
|
-
/* @__PURE__ */
|
|
11589
|
+
/* @__PURE__ */ jsx30("td", { children: /* @__PURE__ */ jsx30(RfaPill, { tone: ["delivered", "received", "sent"].includes(transmission.status) ? "ok" : transmission.status === "failed" ? "bad" : "muted", children: capital(words2(transmission.status)) }) }),
|
|
11590
|
+
/* @__PURE__ */ jsxs28("td", { children: [
|
|
11507
11591
|
transmission.destination || "\u2014",
|
|
11508
|
-
transmission.providerMessageId ? /* @__PURE__ */
|
|
11592
|
+
transmission.providerMessageId ? /* @__PURE__ */ jsxs28("small", { children: [
|
|
11509
11593
|
"Reference ",
|
|
11510
11594
|
transmission.providerMessageId
|
|
11511
11595
|
] }) : null
|
|
11512
11596
|
] }),
|
|
11513
|
-
/* @__PURE__ */
|
|
11514
|
-
/* @__PURE__ */
|
|
11597
|
+
/* @__PURE__ */ jsx30("td", { children: rfaShortDate(transmission.receivedAt) }),
|
|
11598
|
+
/* @__PURE__ */ jsx30("td", { className: "mbrfa-row-actions", children: evidence(transmission.proofDocumentId, "Receipt") })
|
|
11515
11599
|
] }, transmission.id)) })
|
|
11516
11600
|
] }) }) }) : null
|
|
11517
11601
|
] }) : null
|
|
11518
11602
|
] });
|
|
11519
|
-
const content = /* @__PURE__ */
|
|
11520
|
-
error ? /* @__PURE__ */
|
|
11521
|
-
message ? /* @__PURE__ */
|
|
11522
|
-
loadErrors.map((value) => /* @__PURE__ */
|
|
11523
|
-
/* @__PURE__ */
|
|
11524
|
-
/* @__PURE__ */
|
|
11603
|
+
const content = /* @__PURE__ */ jsx30(Fragment18, { children: /* @__PURE__ */ jsxs28("div", { style: { display: "grid", gap: 16 }, children: [
|
|
11604
|
+
error ? /* @__PURE__ */ jsx30("p", { role: "alert", children: error }) : null,
|
|
11605
|
+
message ? /* @__PURE__ */ jsx30("p", { role: "status", children: message }) : null,
|
|
11606
|
+
loadErrors.map((value) => /* @__PURE__ */ jsx30("p", { role: "alert", children: value }, value)),
|
|
11607
|
+
/* @__PURE__ */ jsxs28("div", { hidden: view === "history", className: "mbrfa-treatment-list", children: [
|
|
11608
|
+
/* @__PURE__ */ jsx30("h3", { children: "Requested treatments" }),
|
|
11525
11609
|
rfa.items.map((item, index) => {
|
|
11526
11610
|
const appointment = scheduling.find((value) => value.itemId === item.id);
|
|
11527
|
-
return /* @__PURE__ */
|
|
11528
|
-
/* @__PURE__ */
|
|
11611
|
+
return /* @__PURE__ */ jsxs28("fieldset", { id: `rfa-treatment-${item.id}`, tabIndex: -1, children: [
|
|
11612
|
+
/* @__PURE__ */ jsxs28("legend", { children: [
|
|
11529
11613
|
index + 1,
|
|
11530
11614
|
". ",
|
|
11531
11615
|
item.serviceDescription
|
|
11532
11616
|
] }),
|
|
11533
|
-
/* @__PURE__ */
|
|
11617
|
+
/* @__PURE__ */ jsxs28("p", { children: [
|
|
11534
11618
|
item.procedureCode || "No procedure code",
|
|
11535
11619
|
" \xB7 Diagnosis ",
|
|
11536
11620
|
item.diagnosisCode,
|
|
11537
11621
|
" \xB7 ",
|
|
11538
11622
|
item.decisionClosure?.closed ? "Decision no longer required" : words2(item.outcome)
|
|
11539
11623
|
] }),
|
|
11540
|
-
/* @__PURE__ */
|
|
11541
|
-
/* @__PURE__ */
|
|
11542
|
-
/* @__PURE__ */
|
|
11624
|
+
/* @__PURE__ */ jsx30("dl", { className: "mbrfa-request-details", children: [["Diagnosis description", item.diagnosisDescription], ["Quantity", item.quantity], ["Units", item.units], ["Frequency", item.frequency], ["Duration", item.duration], ["Requested from", item.requestedFrom], ["Requested through", item.requestedTo]].filter(([, value]) => value !== null && value !== void 0 && value !== "").map(([title, value]) => /* @__PURE__ */ jsxs28("div", { children: [
|
|
11625
|
+
/* @__PURE__ */ jsx30("dt", { children: title }),
|
|
11626
|
+
/* @__PURE__ */ jsx30("dd", { children: value })
|
|
11543
11627
|
] }, title)) }),
|
|
11544
|
-
item.decisionClosure ? /* @__PURE__ */
|
|
11628
|
+
item.decisionClosure ? /* @__PURE__ */ jsxs28("p", { children: [
|
|
11545
11629
|
item.decisionClosure.closed ? "Closed" : "Reopened",
|
|
11546
11630
|
" by ",
|
|
11547
11631
|
item.decisionClosure.updatedBy,
|
|
11548
11632
|
" \xB7 ",
|
|
11549
11633
|
date5(item.decisionClosure.updatedAt),
|
|
11550
|
-
/* @__PURE__ */
|
|
11634
|
+
/* @__PURE__ */ jsx30("br", {}),
|
|
11551
11635
|
item.decisionClosure.reason
|
|
11552
11636
|
] }) : null,
|
|
11553
|
-
canClose && item.outcome === "pending" && !item.decidedAt ? /* @__PURE__ */
|
|
11554
|
-
item.outcome !== "pending" ? /* @__PURE__ */
|
|
11555
|
-
/* @__PURE__ */
|
|
11637
|
+
canClose && item.outcome === "pending" && !item.decidedAt ? /* @__PURE__ */ jsx30(TreatmentClosureForm, { item, disabled, onError: setError, onSave: (input) => run(`closure:${item.id}`, input, (key2) => client.updateTreatmentClosure(rfa.id, item.id, input, key2)) }, `${item.id}:${item.decisionClosure?.version ?? 0}`) : null,
|
|
11638
|
+
item.outcome !== "pending" ? /* @__PURE__ */ jsxs28(Fragment18, { children: [
|
|
11639
|
+
/* @__PURE__ */ jsxs28("p", { children: [
|
|
11556
11640
|
"Decision: ",
|
|
11557
11641
|
date5(item.decidedAt),
|
|
11558
11642
|
item.authorizationNumber ? ` \xB7 Authorization ${item.authorizationNumber}` : ""
|
|
11559
11643
|
] }),
|
|
11560
|
-
item.authorizedProcedureCode || item.authorizedQuantity || item.authorizedUnits ? /* @__PURE__ */
|
|
11644
|
+
item.authorizedProcedureCode || item.authorizedQuantity || item.authorizedUnits ? /* @__PURE__ */ jsxs28("p", { children: [
|
|
11561
11645
|
"Authorized: ",
|
|
11562
11646
|
item.authorizedProcedureCode || item.procedureCode || "Treatment",
|
|
11563
11647
|
item.authorizedQuantity != null ? ` \xB7 Quantity ${item.authorizedQuantity}` : "",
|
|
11564
11648
|
item.authorizedUnits != null ? ` \xB7 Units ${item.authorizedUnits}` : ""
|
|
11565
11649
|
] }) : null,
|
|
11566
|
-
item.effectiveFrom || item.effectiveTo ? /* @__PURE__ */
|
|
11650
|
+
item.effectiveFrom || item.effectiveTo ? /* @__PURE__ */ jsxs28("p", { children: [
|
|
11567
11651
|
"Authorization dates: ",
|
|
11568
11652
|
item.effectiveFrom ?? "Not specified",
|
|
11569
11653
|
" through ",
|
|
11570
11654
|
item.effectiveTo ?? "Not specified"
|
|
11571
11655
|
] }) : null,
|
|
11572
|
-
item.decisionReason ? /* @__PURE__ */
|
|
11573
|
-
item.reviewerName ? /* @__PURE__ */
|
|
11656
|
+
item.decisionReason ? /* @__PURE__ */ jsx30("p", { children: item.decisionReason }) : null,
|
|
11657
|
+
item.reviewerName ? /* @__PURE__ */ jsxs28("p", { children: [
|
|
11574
11658
|
"Reviewer: ",
|
|
11575
11659
|
item.reviewerName,
|
|
11576
11660
|
item.reviewerPhone ? ` \xB7 ${item.reviewerPhone}` : ""
|
|
@@ -11579,57 +11663,57 @@ function RfaTrackingContent({ rfa: provided, options, permissions = [], onUpdate
|
|
|
11579
11663
|
" ",
|
|
11580
11664
|
evidence(item.currentImrDocumentId, "View independent medical review form")
|
|
11581
11665
|
] }) : null,
|
|
11582
|
-
loading ? /* @__PURE__ */
|
|
11666
|
+
loading ? /* @__PURE__ */ jsx30("p", { children: "Loading appointment\u2026" }) : appointment ? /* @__PURE__ */ jsx30(AppointmentForm, { appointment, editable: permissions.includes("edit"), disabled: disabled || loadErrors.some((value) => value.startsWith("Appointments")), onError: setError, onSave: (input) => run(`appointment:${item.id}`, input, async (key2) => {
|
|
11583
11667
|
await client.updateScheduling(rfa.id, item.id, input, key2);
|
|
11584
11668
|
return records.get(rfa.id);
|
|
11585
11669
|
}) }, `${item.id}:${appointment.version}:${appointment.authorizationToken}`) : null,
|
|
11586
|
-
canCorrect && item.currentDecisionEventId && item.outcome !== "pending" ? /* @__PURE__ */
|
|
11587
|
-
/* @__PURE__ */
|
|
11588
|
-
/* @__PURE__ */
|
|
11589
|
-
/* @__PURE__ */
|
|
11670
|
+
canCorrect && item.currentDecisionEventId && item.outcome !== "pending" ? /* @__PURE__ */ jsxs28("details", { children: [
|
|
11671
|
+
/* @__PURE__ */ jsx30("summary", { children: "Correct this decision" }),
|
|
11672
|
+
/* @__PURE__ */ jsx30("p", { children: "The original decision and its evidence remain in history. Corrections require a reason and response evidence. Requests already used for a bill or a scheduled appointment cannot be corrected." }),
|
|
11673
|
+
/* @__PURE__ */ jsx30(CorrectionForm, { item, documents: rfa.documents, disabled: disabled || loading || loadErrors.length > 0 || scheduling.some((value) => value.disposition === "scheduled"), onError: setError, onSave: (input) => run(`correction:${item.id}`, input, (key2) => client.correctDecision(rfa.id, input, key2)) }, `${item.id}:${item.currentDecisionEventId}`)
|
|
11590
11674
|
] }) : null
|
|
11591
11675
|
] }, item.id);
|
|
11592
11676
|
})
|
|
11593
11677
|
] }),
|
|
11594
|
-
/* @__PURE__ */
|
|
11595
|
-
/* @__PURE__ */
|
|
11596
|
-
/* @__PURE__ */
|
|
11678
|
+
/* @__PURE__ */ jsxs28("div", { hidden: view === "treatments", className: "mbrfa-history-content", children: [
|
|
11679
|
+
/* @__PURE__ */ jsxs28("details", { className: "mbrfa-delivery-evidence", children: [
|
|
11680
|
+
/* @__PURE__ */ jsxs28("summary", { children: [
|
|
11597
11681
|
"Delivery evidence (",
|
|
11598
11682
|
rfa.transmissions.length,
|
|
11599
11683
|
")"
|
|
11600
11684
|
] }),
|
|
11601
|
-
rfa.transmissions.length ? rfa.transmissions.map((transmission) => /* @__PURE__ */
|
|
11602
|
-
/* @__PURE__ */
|
|
11685
|
+
rfa.transmissions.length ? rfa.transmissions.map((transmission) => /* @__PURE__ */ jsxs28("article", { style: { paddingBlock: 8 }, children: [
|
|
11686
|
+
/* @__PURE__ */ jsxs28("strong", { children: [
|
|
11603
11687
|
words2(transmission.channel),
|
|
11604
11688
|
" \xB7 ",
|
|
11605
11689
|
words2(transmission.status)
|
|
11606
11690
|
] }),
|
|
11607
|
-
/* @__PURE__ */
|
|
11691
|
+
/* @__PURE__ */ jsxs28("p", { children: [
|
|
11608
11692
|
words2(transmission.direction),
|
|
11609
11693
|
transmission.purpose ? ` \xB7 ${words2(transmission.purpose)}` : "",
|
|
11610
11694
|
" \xB7 ",
|
|
11611
11695
|
date5(transmission.occurredAt)
|
|
11612
11696
|
] }),
|
|
11613
|
-
transmission.destination ? /* @__PURE__ */
|
|
11697
|
+
transmission.destination ? /* @__PURE__ */ jsxs28("p", { children: [
|
|
11614
11698
|
"Recipient: ",
|
|
11615
11699
|
transmission.destination
|
|
11616
11700
|
] }) : null,
|
|
11617
|
-
transmission.providerMessageId ? /* @__PURE__ */
|
|
11701
|
+
transmission.providerMessageId ? /* @__PURE__ */ jsxs28("p", { children: [
|
|
11618
11702
|
"Delivery reference: ",
|
|
11619
11703
|
transmission.providerMessageId
|
|
11620
11704
|
] }) : null,
|
|
11621
|
-
transmission.receivedAt ? /* @__PURE__ */
|
|
11705
|
+
transmission.receivedAt ? /* @__PURE__ */ jsxs28("p", { children: [
|
|
11622
11706
|
"Confirmed receipt: ",
|
|
11623
11707
|
date5(transmission.receivedAt)
|
|
11624
11708
|
] }) : null,
|
|
11625
11709
|
evidence(transmission.proofDocumentId, "Download transmission receipt")
|
|
11626
|
-
] }, transmission.id)) : /* @__PURE__ */
|
|
11710
|
+
] }, transmission.id)) : /* @__PURE__ */ jsx30("p", { children: "No transmission evidence has been recorded." })
|
|
11627
11711
|
] }),
|
|
11628
|
-
/* @__PURE__ */
|
|
11629
|
-
/* @__PURE__ */
|
|
11630
|
-
permissions.includes("edit") ? /* @__PURE__ */
|
|
11631
|
-
/* @__PURE__ */
|
|
11632
|
-
/* @__PURE__ */
|
|
11712
|
+
/* @__PURE__ */ jsxs28("section", { className: "mbrfa-history-card", "aria-label": "History and notes", children: [
|
|
11713
|
+
/* @__PURE__ */ jsx30("h3", { children: "History and notes" }),
|
|
11714
|
+
permissions.includes("edit") ? /* @__PURE__ */ jsxs28("details", { className: "mbrfa-note-form", children: [
|
|
11715
|
+
/* @__PURE__ */ jsx30("summary", { children: "Add a note" }),
|
|
11716
|
+
/* @__PURE__ */ jsx30("form", { onSubmit: (event) => {
|
|
11633
11717
|
event.preventDefault();
|
|
11634
11718
|
const form = event.currentTarget;
|
|
11635
11719
|
try {
|
|
@@ -11643,51 +11727,51 @@ function RfaTrackingContent({ rfa: provided, options, permissions = [], onUpdate
|
|
|
11643
11727
|
} catch (reason) {
|
|
11644
11728
|
setError(reason instanceof Error ? reason.message : "Enter a note.");
|
|
11645
11729
|
}
|
|
11646
|
-
}, children: /* @__PURE__ */
|
|
11647
|
-
/* @__PURE__ */
|
|
11648
|
-
/* @__PURE__ */
|
|
11730
|
+
}, children: /* @__PURE__ */ jsxs28("fieldset", { disabled, children: [
|
|
11731
|
+
/* @__PURE__ */ jsx30("legend", { children: "Add a note" }),
|
|
11732
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11649
11733
|
"Note",
|
|
11650
|
-
/* @__PURE__ */
|
|
11734
|
+
/* @__PURE__ */ jsx30("textarea", { name: "note", required: true, maxLength: 1e4 })
|
|
11651
11735
|
] }),
|
|
11652
|
-
/* @__PURE__ */
|
|
11736
|
+
/* @__PURE__ */ jsx30("button", { type: "submit", children: "Save note" })
|
|
11653
11737
|
] }) })
|
|
11654
11738
|
] }) : null,
|
|
11655
|
-
loading ? /* @__PURE__ */
|
|
11656
|
-
/* @__PURE__ */
|
|
11657
|
-
/* @__PURE__ */
|
|
11658
|
-
/* @__PURE__ */
|
|
11659
|
-
/* @__PURE__ */
|
|
11660
|
-
/* @__PURE__ */
|
|
11739
|
+
loading ? /* @__PURE__ */ jsx30("p", { children: "Loading history\u2026" }) : history.length ? /* @__PURE__ */ jsx30("div", { className: "mbrfa-table-scroll", children: /* @__PURE__ */ jsxs28("table", { className: "mbrfa-history-table", children: [
|
|
11740
|
+
/* @__PURE__ */ jsx30("thead", { children: /* @__PURE__ */ jsxs28("tr", { children: [
|
|
11741
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Date" }),
|
|
11742
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Action" }),
|
|
11743
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "User" }),
|
|
11744
|
+
/* @__PURE__ */ jsx30("th", { scope: "col", children: "Details" })
|
|
11661
11745
|
] }) }),
|
|
11662
|
-
/* @__PURE__ */
|
|
11663
|
-
] }) }) : !loadErrors.some((value) => value.startsWith("History")) ? /* @__PURE__ */
|
|
11746
|
+
/* @__PURE__ */ jsx30("tbody", { children: history.map((event) => /* @__PURE__ */ jsx30(RfaHistoryEntry, { event, rfa, disabled, onDownload: (kind, id, filename) => void download(id, filename, kind) }, event.id)) })
|
|
11747
|
+
] }) }) : !loadErrors.some((value) => value.startsWith("History")) ? /* @__PURE__ */ jsx30("p", { children: "No history entries have been recorded." }) : null
|
|
11664
11748
|
] })
|
|
11665
11749
|
] })
|
|
11666
11750
|
] }) });
|
|
11667
|
-
if (cards) return /* @__PURE__ */
|
|
11668
|
-
return embedded ? /* @__PURE__ */
|
|
11669
|
-
/* @__PURE__ */
|
|
11751
|
+
if (cards) return /* @__PURE__ */ jsx30("div", { className: "mbrfa-tracking", children: cardContent });
|
|
11752
|
+
return embedded ? /* @__PURE__ */ jsx30("div", { className: "mbrfa-tracking", children: content }) : /* @__PURE__ */ jsxs28(TreatmentDraftShell, { ...appearance, title: "Treatments and history", description: "Review each treatment's authorization, appointments, delivery evidence, and notes.", children: [
|
|
11753
|
+
/* @__PURE__ */ jsx30("style", { children: rfaDetailCss }),
|
|
11670
11754
|
content
|
|
11671
11755
|
] });
|
|
11672
11756
|
}
|
|
11673
11757
|
function AppointmentForm({ appointment, editable, disabled, onError, onSave }) {
|
|
11674
|
-
const [disposition, setDisposition] =
|
|
11675
|
-
return /* @__PURE__ */
|
|
11676
|
-
/* @__PURE__ */
|
|
11677
|
-
/* @__PURE__ */
|
|
11758
|
+
const [disposition, setDisposition] = useState18(appointment.disposition === "canceled" && appointment.version > 0 ? "canceled" : appointment.eligible && appointment.disposition === "no_appointment" ? "no_appointment" : appointment.eligible ? "scheduled" : "canceled");
|
|
11759
|
+
return /* @__PURE__ */ jsxs28("section", { children: [
|
|
11760
|
+
/* @__PURE__ */ jsx30("h4", { children: "Appointment" }),
|
|
11761
|
+
/* @__PURE__ */ jsxs28("p", { children: [
|
|
11678
11762
|
words2(appointment.disposition),
|
|
11679
11763
|
appointment.appointmentAt ? ` \xB7 ${date5(appointment.appointmentAt)}` : ""
|
|
11680
11764
|
] }),
|
|
11681
|
-
appointment.providerName ? /* @__PURE__ */
|
|
11765
|
+
appointment.providerName ? /* @__PURE__ */ jsxs28("p", { children: [
|
|
11682
11766
|
appointment.providerName,
|
|
11683
11767
|
" \xB7 ",
|
|
11684
11768
|
appointment.location
|
|
11685
11769
|
] }) : null,
|
|
11686
|
-
appointment.reason ? /* @__PURE__ */
|
|
11687
|
-
appointment.version > 0 && !appointment.current ? /* @__PURE__ */
|
|
11688
|
-
editable && (appointment.eligible || appointment.version > 0) ? /* @__PURE__ */
|
|
11689
|
-
/* @__PURE__ */
|
|
11690
|
-
/* @__PURE__ */
|
|
11770
|
+
appointment.reason ? /* @__PURE__ */ jsx30("p", { children: appointment.reason }) : null,
|
|
11771
|
+
appointment.version > 0 && !appointment.current ? /* @__PURE__ */ jsx30("p", { role: "status", children: "Authorization has changed. Review the current decision before updating this appointment." }) : null,
|
|
11772
|
+
editable && (appointment.eligible || appointment.version > 0) ? /* @__PURE__ */ jsxs28("details", { children: [
|
|
11773
|
+
/* @__PURE__ */ jsx30("summary", { children: "Update appointment" }),
|
|
11774
|
+
/* @__PURE__ */ jsx30("form", { onSubmit: (event) => {
|
|
11691
11775
|
event.preventDefault();
|
|
11692
11776
|
if (disabled) return;
|
|
11693
11777
|
try {
|
|
@@ -11698,42 +11782,42 @@ function AppointmentForm({ appointment, editable, disabled, onError, onSave }) {
|
|
|
11698
11782
|
} catch (reason) {
|
|
11699
11783
|
onError(reason instanceof Error ? reason.message : "Review the appointment details.");
|
|
11700
11784
|
}
|
|
11701
|
-
}, children: /* @__PURE__ */
|
|
11702
|
-
/* @__PURE__ */
|
|
11703
|
-
/* @__PURE__ */
|
|
11785
|
+
}, children: /* @__PURE__ */ jsxs28("fieldset", { disabled, children: [
|
|
11786
|
+
/* @__PURE__ */ jsx30("legend", { children: "Appointment details" }),
|
|
11787
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11704
11788
|
"Disposition",
|
|
11705
|
-
/* @__PURE__ */
|
|
11706
|
-
appointment.eligible ? /* @__PURE__ */
|
|
11707
|
-
/* @__PURE__ */
|
|
11708
|
-
/* @__PURE__ */
|
|
11789
|
+
/* @__PURE__ */ jsxs28("select", { value: disposition, onChange: (event) => setDisposition(event.target.value), children: [
|
|
11790
|
+
appointment.eligible ? /* @__PURE__ */ jsxs28(Fragment18, { children: [
|
|
11791
|
+
/* @__PURE__ */ jsx30("option", { value: "scheduled", children: "Scheduled" }),
|
|
11792
|
+
/* @__PURE__ */ jsx30("option", { value: "no_appointment", children: "No appointment needed" })
|
|
11709
11793
|
] }) : null,
|
|
11710
|
-
appointment.version > 0 ? /* @__PURE__ */
|
|
11794
|
+
appointment.version > 0 ? /* @__PURE__ */ jsx30("option", { value: "canceled", children: "Canceled" }) : null
|
|
11711
11795
|
] })
|
|
11712
11796
|
] }),
|
|
11713
|
-
disposition === "scheduled" ? /* @__PURE__ */
|
|
11714
|
-
/* @__PURE__ */
|
|
11797
|
+
disposition === "scheduled" ? /* @__PURE__ */ jsxs28("div", { className: "mbtd-grid", children: [
|
|
11798
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11715
11799
|
"Date and time (your local time)",
|
|
11716
|
-
/* @__PURE__ */
|
|
11800
|
+
/* @__PURE__ */ jsx30("input", { name: "appointmentAt", type: "datetime-local", required: true, defaultValue: localTime(appointment.appointmentAt) })
|
|
11717
11801
|
] }),
|
|
11718
|
-
/* @__PURE__ */
|
|
11802
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11719
11803
|
"Provider name",
|
|
11720
|
-
/* @__PURE__ */
|
|
11804
|
+
/* @__PURE__ */ jsx30("input", { name: "providerName", required: true, maxLength: 200, defaultValue: appointment.providerName ?? "" })
|
|
11721
11805
|
] }),
|
|
11722
|
-
/* @__PURE__ */
|
|
11806
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11723
11807
|
"Location",
|
|
11724
|
-
/* @__PURE__ */
|
|
11808
|
+
/* @__PURE__ */ jsx30("input", { name: "location", required: true, maxLength: 500, defaultValue: appointment.location ?? "" })
|
|
11725
11809
|
] })
|
|
11726
|
-
] }) : /* @__PURE__ */
|
|
11810
|
+
] }) : /* @__PURE__ */ jsxs28("label", { children: [
|
|
11727
11811
|
"Reason",
|
|
11728
|
-
/* @__PURE__ */
|
|
11812
|
+
/* @__PURE__ */ jsx30("textarea", { name: "reason", required: true, maxLength: 2e3, defaultValue: appointment.reason ?? "" })
|
|
11729
11813
|
] }),
|
|
11730
|
-
/* @__PURE__ */
|
|
11814
|
+
/* @__PURE__ */ jsx30("button", { type: "submit", children: "Save appointment" })
|
|
11731
11815
|
] }) })
|
|
11732
|
-
] }) : !appointment.eligible && appointment.disposition === "pending" ? /* @__PURE__ */
|
|
11816
|
+
] }) : !appointment.eligible && appointment.disposition === "pending" ? /* @__PURE__ */ jsx30("p", { children: "Appointments become available after treatment is authorized." }) : null
|
|
11733
11817
|
] });
|
|
11734
11818
|
}
|
|
11735
11819
|
function CorrectionForm({ item, documents, disabled, onError, onSave }) {
|
|
11736
|
-
const [outcome, setOutcome] =
|
|
11820
|
+
const [outcome, setOutcome] = useState18(item.outcome);
|
|
11737
11821
|
const submit = (event) => {
|
|
11738
11822
|
event.preventDefault();
|
|
11739
11823
|
if (disabled) return;
|
|
@@ -11757,90 +11841,90 @@ function CorrectionForm({ item, documents, disabled, onError, onSave }) {
|
|
|
11757
11841
|
onError(reason instanceof Error ? reason.message : "Review the correction details.");
|
|
11758
11842
|
}
|
|
11759
11843
|
};
|
|
11760
|
-
return /* @__PURE__ */
|
|
11761
|
-
/* @__PURE__ */
|
|
11762
|
-
/* @__PURE__ */
|
|
11763
|
-
/* @__PURE__ */
|
|
11844
|
+
return /* @__PURE__ */ jsx30("form", { onSubmit: submit, children: /* @__PURE__ */ jsxs28("fieldset", { disabled, children: [
|
|
11845
|
+
/* @__PURE__ */ jsx30("legend", { children: "Decision correction" }),
|
|
11846
|
+
/* @__PURE__ */ jsxs28("div", { className: "mbtd-grid", children: [
|
|
11847
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11764
11848
|
"Correction reason",
|
|
11765
|
-
/* @__PURE__ */
|
|
11849
|
+
/* @__PURE__ */ jsx30("textarea", { name: "reason", required: true, maxLength: 2e4 })
|
|
11766
11850
|
] }),
|
|
11767
|
-
/* @__PURE__ */
|
|
11851
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11768
11852
|
"Corrected decision",
|
|
11769
|
-
/* @__PURE__ */
|
|
11770
|
-
/* @__PURE__ */
|
|
11771
|
-
/* @__PURE__ */
|
|
11772
|
-
/* @__PURE__ */
|
|
11853
|
+
/* @__PURE__ */ jsxs28("select", { value: outcome, onChange: (event) => setOutcome(event.target.value), children: [
|
|
11854
|
+
/* @__PURE__ */ jsx30("option", { value: "approved", children: "Approved" }),
|
|
11855
|
+
/* @__PURE__ */ jsx30("option", { value: "modified", children: "Modified" }),
|
|
11856
|
+
/* @__PURE__ */ jsx30("option", { value: "denied", children: "Denied" })
|
|
11773
11857
|
] })
|
|
11774
11858
|
] }),
|
|
11775
|
-
/* @__PURE__ */
|
|
11859
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11776
11860
|
"Decision time",
|
|
11777
|
-
/* @__PURE__ */
|
|
11861
|
+
/* @__PURE__ */ jsx30("input", { name: "decidedAt", type: "datetime-local", required: true, defaultValue: localTime(item.decidedAt) })
|
|
11778
11862
|
] }),
|
|
11779
|
-
/* @__PURE__ */
|
|
11863
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11780
11864
|
"Decision response evidence",
|
|
11781
|
-
/* @__PURE__ */
|
|
11782
|
-
/* @__PURE__ */
|
|
11783
|
-
documents.filter((document2) => document2.documentType === "ur_response").map((document2) => /* @__PURE__ */
|
|
11865
|
+
/* @__PURE__ */ jsxs28("select", { name: "responseDocumentId", required: true, defaultValue: item.currentResponseDocumentId ?? "", children: [
|
|
11866
|
+
/* @__PURE__ */ jsx30("option", { value: "", children: "Choose evidence" }),
|
|
11867
|
+
documents.filter((document2) => document2.documentType === "ur_response").map((document2) => /* @__PURE__ */ jsx30("option", { value: document2.id, children: document2.filename }, document2.id))
|
|
11784
11868
|
] })
|
|
11785
11869
|
] }),
|
|
11786
|
-
outcome !== "approved" ? /* @__PURE__ */
|
|
11787
|
-
/* @__PURE__ */
|
|
11870
|
+
outcome !== "approved" ? /* @__PURE__ */ jsxs28(Fragment18, { children: [
|
|
11871
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11788
11872
|
"Independent medical review form",
|
|
11789
|
-
/* @__PURE__ */
|
|
11790
|
-
/* @__PURE__ */
|
|
11791
|
-
documents.filter((document2) => document2.documentType === "imr_form").map((document2) => /* @__PURE__ */
|
|
11873
|
+
/* @__PURE__ */ jsxs28("select", { name: "imrDocumentId", required: true, defaultValue: item.currentImrDocumentId ?? "", children: [
|
|
11874
|
+
/* @__PURE__ */ jsx30("option", { value: "", children: "Choose a form" }),
|
|
11875
|
+
documents.filter((document2) => document2.documentType === "imr_form").map((document2) => /* @__PURE__ */ jsx30("option", { value: document2.id, children: document2.filename }, document2.id))
|
|
11792
11876
|
] })
|
|
11793
11877
|
] }),
|
|
11794
|
-
/* @__PURE__ */
|
|
11878
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11795
11879
|
"Decision reason",
|
|
11796
|
-
/* @__PURE__ */
|
|
11880
|
+
/* @__PURE__ */ jsx30("textarea", { name: "decisionReason", required: true, defaultValue: item.decisionReason ?? "" })
|
|
11797
11881
|
] }),
|
|
11798
|
-
/* @__PURE__ */
|
|
11882
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11799
11883
|
"Reviewer name",
|
|
11800
|
-
/* @__PURE__ */
|
|
11884
|
+
/* @__PURE__ */ jsx30("input", { name: "reviewerName", required: true, defaultValue: item.reviewerName ?? "" })
|
|
11801
11885
|
] }),
|
|
11802
|
-
/* @__PURE__ */
|
|
11886
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11803
11887
|
"Reviewer phone",
|
|
11804
|
-
/* @__PURE__ */
|
|
11888
|
+
/* @__PURE__ */ jsx30("input", { name: "reviewerPhone", required: true, defaultValue: item.reviewerPhone ?? "" })
|
|
11805
11889
|
] })
|
|
11806
11890
|
] }) : null,
|
|
11807
|
-
outcome !== "denied" ? /* @__PURE__ */
|
|
11808
|
-
/* @__PURE__ */
|
|
11891
|
+
outcome !== "denied" ? /* @__PURE__ */ jsxs28(Fragment18, { children: [
|
|
11892
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11809
11893
|
"Authorization number",
|
|
11810
|
-
/* @__PURE__ */
|
|
11894
|
+
/* @__PURE__ */ jsx30("input", { name: "authorizationNumber", required: true, defaultValue: item.authorizationNumber ?? "" })
|
|
11811
11895
|
] }),
|
|
11812
|
-
/* @__PURE__ */
|
|
11896
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11813
11897
|
"Authorized procedure code",
|
|
11814
|
-
/* @__PURE__ */
|
|
11898
|
+
/* @__PURE__ */ jsx30("input", { name: "authorizedProcedureCode", defaultValue: item.authorizedProcedureCode ?? "" })
|
|
11815
11899
|
] }),
|
|
11816
|
-
/* @__PURE__ */
|
|
11900
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11817
11901
|
"Authorized quantity",
|
|
11818
|
-
/* @__PURE__ */
|
|
11902
|
+
/* @__PURE__ */ jsx30("input", { name: "authorizedQuantity", type: "number", min: "0.001", step: "any", defaultValue: item.authorizedQuantity ?? "" })
|
|
11819
11903
|
] }),
|
|
11820
|
-
/* @__PURE__ */
|
|
11904
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11821
11905
|
"Authorized units",
|
|
11822
|
-
/* @__PURE__ */
|
|
11906
|
+
/* @__PURE__ */ jsx30("input", { name: "authorizedUnits", type: "number", min: "1", defaultValue: item.authorizedUnits ?? "" })
|
|
11823
11907
|
] }),
|
|
11824
|
-
/* @__PURE__ */
|
|
11908
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11825
11909
|
"Effective from",
|
|
11826
|
-
/* @__PURE__ */
|
|
11910
|
+
/* @__PURE__ */ jsx30("input", { name: "effectiveFrom", type: "date", defaultValue: item.effectiveFrom?.slice(0, 10) ?? "" })
|
|
11827
11911
|
] }),
|
|
11828
|
-
/* @__PURE__ */
|
|
11912
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11829
11913
|
"Effective through",
|
|
11830
|
-
/* @__PURE__ */
|
|
11914
|
+
/* @__PURE__ */ jsx30("input", { name: "effectiveTo", type: "date", defaultValue: item.effectiveTo?.slice(0, 10) ?? "" })
|
|
11831
11915
|
] })
|
|
11832
11916
|
] }) : null
|
|
11833
11917
|
] }),
|
|
11834
|
-
/* @__PURE__ */
|
|
11918
|
+
/* @__PURE__ */ jsx30("button", { type: "submit", children: "Save decision correction" })
|
|
11835
11919
|
] }) });
|
|
11836
11920
|
}
|
|
11837
11921
|
function TreatmentClosureForm({ item, disabled, onError, onSave }) {
|
|
11838
11922
|
const closed = Boolean(item.decisionClosure?.closed);
|
|
11839
11923
|
const title = closed ? "Reopen treatment follow-up" : "Decision no longer required";
|
|
11840
|
-
return /* @__PURE__ */
|
|
11841
|
-
/* @__PURE__ */
|
|
11842
|
-
/* @__PURE__ */
|
|
11843
|
-
/* @__PURE__ */
|
|
11924
|
+
return /* @__PURE__ */ jsxs28("details", { children: [
|
|
11925
|
+
/* @__PURE__ */ jsx30("summary", { children: title }),
|
|
11926
|
+
/* @__PURE__ */ jsx30("p", { children: closed ? "Resume waiting for a decision on this treatment. Its original review deadline still applies." : "Close follow-up for this treatment without recording an approval or denial. Other treatments remain active. This does not withdraw the request with the claims administrator." }),
|
|
11927
|
+
/* @__PURE__ */ jsx30("form", { onSubmit: (event) => {
|
|
11844
11928
|
event.preventDefault();
|
|
11845
11929
|
if (disabled) return;
|
|
11846
11930
|
try {
|
|
@@ -11849,104 +11933,104 @@ function TreatmentClosureForm({ item, disabled, onError, onSave }) {
|
|
|
11849
11933
|
} catch (reason) {
|
|
11850
11934
|
onError(reason instanceof Error ? reason.message : "Enter a reason.");
|
|
11851
11935
|
}
|
|
11852
|
-
}, children: /* @__PURE__ */
|
|
11853
|
-
/* @__PURE__ */
|
|
11854
|
-
/* @__PURE__ */
|
|
11936
|
+
}, children: /* @__PURE__ */ jsxs28("fieldset", { disabled, children: [
|
|
11937
|
+
/* @__PURE__ */ jsx30("legend", { children: closed ? "Reopen this treatment" : "Close this treatment" }),
|
|
11938
|
+
/* @__PURE__ */ jsxs28("label", { children: [
|
|
11855
11939
|
closed ? "Reason for reopening" : "Reason a decision is no longer required",
|
|
11856
|
-
/* @__PURE__ */
|
|
11940
|
+
/* @__PURE__ */ jsx30("textarea", { name: "closureReason", required: true, maxLength: 2e3 })
|
|
11857
11941
|
] }),
|
|
11858
|
-
/* @__PURE__ */
|
|
11942
|
+
/* @__PURE__ */ jsx30("div", { className: "mbtd-actions", children: /* @__PURE__ */ jsx30("button", { type: "submit", children: closed ? "Reopen treatment" : "Close treatment" }) })
|
|
11859
11943
|
] }) })
|
|
11860
11944
|
] });
|
|
11861
11945
|
}
|
|
11862
11946
|
|
|
11863
11947
|
// src/rfa-request-summary.tsx
|
|
11864
|
-
import { jsx as
|
|
11948
|
+
import { jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
11865
11949
|
var readable = (value) => value.replaceAll("_", " ");
|
|
11866
11950
|
var calendarDate = (value) => value?.match(/^\d{4}-\d{2}-\d{2}/)?.[0] ?? value;
|
|
11867
11951
|
function Details({ entries }) {
|
|
11868
|
-
return /* @__PURE__ */
|
|
11869
|
-
/* @__PURE__ */
|
|
11870
|
-
/* @__PURE__ */
|
|
11952
|
+
return /* @__PURE__ */ jsx31("dl", { className: "mbrfa-request-details", children: entries.filter(([, value]) => value !== null && value !== void 0 && value !== "").map(([name, value]) => /* @__PURE__ */ jsxs29("div", { children: [
|
|
11953
|
+
/* @__PURE__ */ jsx31("dt", { children: name }),
|
|
11954
|
+
/* @__PURE__ */ jsx31("dd", { children: value })
|
|
11871
11955
|
] }, name)) });
|
|
11872
11956
|
}
|
|
11873
11957
|
function Contact({ title, contact }) {
|
|
11874
11958
|
const entries = [["Name", contact?.name], ["Contact", contact?.contactName], ["Address", contact?.address], ["City", contact?.city], ["State", contact?.state], ["ZIP", contact?.zip], ["Phone", contact?.phone], ["Fax", contact?.fax], ["Email", contact?.email]];
|
|
11875
|
-
return /* @__PURE__ */
|
|
11876
|
-
/* @__PURE__ */
|
|
11877
|
-
/* @__PURE__ */
|
|
11959
|
+
return /* @__PURE__ */ jsxs29("section", { className: "mbrfa-info-card", children: [
|
|
11960
|
+
/* @__PURE__ */ jsx31("h3", { children: title }),
|
|
11961
|
+
/* @__PURE__ */ jsx31("div", { className: "mbrfa-info-body", children: entries.some(([, value]) => value) ? /* @__PURE__ */ jsx31(Details, { entries }) : /* @__PURE__ */ jsx31("p", { children: "Not recorded." }) })
|
|
11878
11962
|
] });
|
|
11879
11963
|
}
|
|
11880
11964
|
function RfaRequestSummary({ rfa, onViewClaimsAdministrator, getPatientHref, getClaimHref, getProviderHref, hideTreatments = false, collapseContacts = false }) {
|
|
11881
|
-
const contacts2 = /* @__PURE__ */
|
|
11882
|
-
/* @__PURE__ */
|
|
11883
|
-
/* @__PURE__ */
|
|
11884
|
-
/* @__PURE__ */
|
|
11965
|
+
const contacts2 = /* @__PURE__ */ jsxs29("div", { className: "mbtd-grid", children: [
|
|
11966
|
+
/* @__PURE__ */ jsxs29("section", { className: "mbrfa-info-card", children: [
|
|
11967
|
+
/* @__PURE__ */ jsx31("h3", { children: "Patient and injury" }),
|
|
11968
|
+
/* @__PURE__ */ jsx31("div", { className: "mbrfa-info-body", children: /* @__PURE__ */ jsx31(Details, { entries: [["Patient", /* @__PURE__ */ jsx31(RfaLink, { href: getPatientHref?.(rfa), children: rfa.employeeName })], ["Claim number", /* @__PURE__ */ jsx31(RfaLink, { href: getClaimHref?.(rfa), children: rfa.claimNumber || "Not recorded" })], ["Injury", rfa.injuryDescription ? /* @__PURE__ */ jsx31(RfaLink, { href: getClaimHref?.(rfa), children: rfa.injuryDescription }) : null], ["Date of injury", calendarDate(rfa.dateOfInjury) || "Not recorded"]] }) })
|
|
11885
11969
|
] }),
|
|
11886
|
-
/* @__PURE__ */
|
|
11887
|
-
/* @__PURE__ */
|
|
11888
|
-
/* @__PURE__ */
|
|
11970
|
+
/* @__PURE__ */ jsxs29("section", { className: "mbrfa-info-card", children: [
|
|
11971
|
+
/* @__PURE__ */ jsx31("h3", { children: "Requesting physician" }),
|
|
11972
|
+
/* @__PURE__ */ jsx31("div", { className: "mbrfa-info-body", children: /* @__PURE__ */ jsx31(Details, { entries: [["Name", /* @__PURE__ */ jsx31(RfaLink, { href: getProviderHref?.(rfa), children: rfa.providerName })], ["NPI", rfa.providerNpi], ["Phone", rfa.providerPhone], ["Fax", rfa.providerFax]] }) })
|
|
11889
11973
|
] }),
|
|
11890
|
-
/* @__PURE__ */
|
|
11891
|
-
/* @__PURE__ */
|
|
11892
|
-
/* @__PURE__ */
|
|
11893
|
-
/* @__PURE__ */
|
|
11974
|
+
/* @__PURE__ */ jsx31(Contact, { title: "Requesting practice", contact: rfa.requestingPractice }),
|
|
11975
|
+
/* @__PURE__ */ jsxs29("section", { className: "mbrfa-info-card", children: [
|
|
11976
|
+
/* @__PURE__ */ jsx31("h3", { children: "Claims administrator" }),
|
|
11977
|
+
/* @__PURE__ */ jsx31("div", { className: "mbrfa-info-body", children: /* @__PURE__ */ jsx31(Details, { entries: [["Name", /* @__PURE__ */ jsx31(RfaLink, { onSelect: onViewClaimsAdministrator, children: rfa.claimsAdminName || rfa.authorizationContact?.name || "Not recorded" })], ["Contact", rfa.authorizationContact?.contactName], ["Phone", rfa.authorizationContact?.phone], ["Fax", rfa.authorizationContact?.fax], ["Email", rfa.authorizationContact?.email], ["Address", [rfa.authorizationContact?.address, rfa.authorizationContact?.city, rfa.authorizationContact?.state, rfa.authorizationContact?.zip].filter(Boolean).join(", ")]] }) })
|
|
11894
11978
|
] })
|
|
11895
11979
|
] });
|
|
11896
|
-
return /* @__PURE__ */
|
|
11897
|
-
/* @__PURE__ */
|
|
11980
|
+
return /* @__PURE__ */ jsxs29("section", { className: "mbrfa-stack mbrfa-request", "aria-label": "Saved request details", children: [
|
|
11981
|
+
/* @__PURE__ */ jsx31("style", { children: `.mbrfa-request-details{display:grid;gap:9px;margin:0}.mbrfa-request-details>div{min-width:0}.mbrfa-request-details dt{font-size:12px;color:var(--mb-muted)}.mbrfa-request-details dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.mbrfa-request h3{font-size:16px;margin:0}.mbrfa-request-treatments{display:grid;gap:14px}.mbrfa-request-treatments article{border-top:1px solid var(--mb-border);padding-top:12px}.mbrfa-request-treatments article:first-child{border-top:0;padding-top:0}.mbrfa-request-treatments h4{margin:0 0 10px;overflow-wrap:anywhere}.mbrfa-request-treatments dl{grid-template-columns:repeat(2,minmax(0,1fr))}@media(max-width:520px){.mbrfa-request-treatments dl{grid-template-columns:minmax(0,1fr)}}` }),
|
|
11898
11982
|
!collapseContacts ? contacts2 : null,
|
|
11899
|
-
/* @__PURE__ */
|
|
11900
|
-
/* @__PURE__ */
|
|
11901
|
-
/* @__PURE__ */
|
|
11983
|
+
/* @__PURE__ */ jsxs29("section", { className: "mbrfa-info-card", children: [
|
|
11984
|
+
/* @__PURE__ */ jsx31("h3", { children: "Request information" }),
|
|
11985
|
+
/* @__PURE__ */ jsx31("div", { className: "mbrfa-info-body", children: /* @__PURE__ */ jsx31(Details, { entries: [["Request", rfa.requestType ? readable(rfa.requestType) : "Not recorded"], ["Review type", readable(rfa.reviewType)], ["Expedited review", rfa.expedited ? "Yes" : "No"], ["Written confirmation of prior oral request", rfa.writtenConfirmation || rfa.requestType === "oral_authorization_confirmation" ? "Yes" : "No"], ["Place of service", rfa.placeOfServiceCode], ["Clinical rationale", rfa.rationale], ["Change in material facts", rfa.materialChange]] }) })
|
|
11902
11986
|
] }),
|
|
11903
|
-
collapseContacts ? /* @__PURE__ */
|
|
11904
|
-
/* @__PURE__ */
|
|
11987
|
+
collapseContacts ? /* @__PURE__ */ jsxs29("details", { className: "mbrfa-detail-card", children: [
|
|
11988
|
+
/* @__PURE__ */ jsx31("summary", { children: "Patient, physician & claim details" }),
|
|
11905
11989
|
contacts2
|
|
11906
11990
|
] }) : null,
|
|
11907
|
-
!hideTreatments ? /* @__PURE__ */
|
|
11908
|
-
/* @__PURE__ */
|
|
11909
|
-
/* @__PURE__ */
|
|
11910
|
-
/* @__PURE__ */
|
|
11991
|
+
!hideTreatments ? /* @__PURE__ */ jsxs29("fieldset", { children: [
|
|
11992
|
+
/* @__PURE__ */ jsx31("legend", { children: "Requested services" }),
|
|
11993
|
+
/* @__PURE__ */ jsx31("div", { className: "mbrfa-request-treatments", children: rfa.items.map((item, index) => /* @__PURE__ */ jsxs29("article", { children: [
|
|
11994
|
+
/* @__PURE__ */ jsxs29("h4", { children: [
|
|
11911
11995
|
index + 1,
|
|
11912
11996
|
". ",
|
|
11913
11997
|
item.serviceDescription
|
|
11914
11998
|
] }),
|
|
11915
|
-
/* @__PURE__ */
|
|
11999
|
+
/* @__PURE__ */ jsx31(Details, { entries: [["Diagnosis", item.diagnosisCode], ["Diagnosis description", item.diagnosisDescription], ["CPT / HCPCS", item.procedureCode || "Not specified"], ["Quantity", item.quantity], ["Units", item.units], ["Frequency", item.frequency], ["Duration", item.duration], ["Requested from", calendarDate(item.requestedFrom)], ["Requested through", calendarDate(item.requestedTo)]] })
|
|
11916
12000
|
] }, item.id)) }),
|
|
11917
|
-
rfa.items.length === 0 ? /* @__PURE__ */
|
|
12001
|
+
rfa.items.length === 0 ? /* @__PURE__ */ jsx31("p", { children: "No services recorded." }) : null
|
|
11918
12002
|
] }) : null
|
|
11919
12003
|
] });
|
|
11920
12004
|
}
|
|
11921
12005
|
|
|
11922
12006
|
// src/rfa-packets.tsx
|
|
11923
|
-
import { useEffect as useEffect16, useMemo as useMemo9, useRef as
|
|
12007
|
+
import { useEffect as useEffect16, useMemo as useMemo9, useRef as useRef15, useState as useState19 } from "react";
|
|
11924
12008
|
import { createRfaPacketsClient } from "@mindbill/browser";
|
|
11925
|
-
import { Fragment as
|
|
12009
|
+
import { Fragment as Fragment19, jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
11926
12010
|
function RfaPacketsPanel({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride, ...props }) {
|
|
11927
12011
|
const options = useMemo9(() => ({ ...sessionEndpoint ? { sessionEndpoint } : {}, ...getSession ? { getSession } : {}, ...apiBaseUrl ? { apiBaseUrl } : {}, ...fetchOverride ? { fetch: fetchOverride } : {} }), [sessionEndpoint, getSession, apiBaseUrl, fetchOverride]);
|
|
11928
12012
|
const identity = useMemo9(() => crypto.randomUUID(), [options]);
|
|
11929
|
-
return /* @__PURE__ */
|
|
12013
|
+
return /* @__PURE__ */ jsx32(PacketsContent, { options, ...props }, `${identity}:${props.rfa.id}:${props.rfa.contentRevision}:${props.rfa.status}:${props.environment}:${props.permissions?.join(",")}`);
|
|
11930
12014
|
}
|
|
11931
12015
|
function PacketsContent({ rfa, options, permissions = [], environment = "sandbox", disabled = false, onForwarded }) {
|
|
11932
12016
|
const client = useMemo9(() => createRfaPacketsClient(options), [options]);
|
|
11933
|
-
const [history, setHistory] =
|
|
11934
|
-
const [selected, setSelected] =
|
|
11935
|
-
const [prepared, setPrepared] =
|
|
11936
|
-
const [channel, setChannel] =
|
|
11937
|
-
const [recipient, setRecipient] =
|
|
11938
|
-
const [reviewed, setReviewed] =
|
|
11939
|
-
const [confirmed, setConfirmed] =
|
|
11940
|
-
const [loading, setLoading] =
|
|
11941
|
-
const [busy, setBusy] =
|
|
11942
|
-
const [error, setError] =
|
|
11943
|
-
const [notice, setNotice] =
|
|
11944
|
-
const [reload, setReload] =
|
|
11945
|
-
const pending =
|
|
11946
|
-
const keys =
|
|
11947
|
-
const completed =
|
|
11948
|
-
const alive =
|
|
11949
|
-
const currentSelection =
|
|
12017
|
+
const [history, setHistory] = useState19(null);
|
|
12018
|
+
const [selected, setSelected] = useState19("");
|
|
12019
|
+
const [prepared, setPrepared] = useState19(null);
|
|
12020
|
+
const [channel, setChannel] = useState19("fax");
|
|
12021
|
+
const [recipient, setRecipient] = useState19("");
|
|
12022
|
+
const [reviewed, setReviewed] = useState19(false);
|
|
12023
|
+
const [confirmed, setConfirmed] = useState19(false);
|
|
12024
|
+
const [loading, setLoading] = useState19(true);
|
|
12025
|
+
const [busy, setBusy] = useState19(false);
|
|
12026
|
+
const [error, setError] = useState19("");
|
|
12027
|
+
const [notice, setNotice] = useState19("");
|
|
12028
|
+
const [reload, setReload] = useState19(0);
|
|
12029
|
+
const pending = useRef15(false);
|
|
12030
|
+
const keys = useRef15(/* @__PURE__ */ new Map());
|
|
12031
|
+
const completed = useRef15(/* @__PURE__ */ new Set());
|
|
12032
|
+
const alive = useRef15(true);
|
|
12033
|
+
const currentSelection = useRef15(selected);
|
|
11950
12034
|
currentSelection.current = selected;
|
|
11951
12035
|
useEffect16(() => {
|
|
11952
12036
|
alive.current = true;
|
|
@@ -12030,23 +12114,23 @@ function PacketsContent({ rfa, options, permissions = [], environment = "sandbox
|
|
|
12030
12114
|
if (alive.current) setBusy(false);
|
|
12031
12115
|
}
|
|
12032
12116
|
};
|
|
12033
|
-
return /* @__PURE__ */
|
|
12034
|
-
/* @__PURE__ */
|
|
12035
|
-
/* @__PURE__ */
|
|
12036
|
-
error ? /* @__PURE__ */
|
|
12037
|
-
notice ? /* @__PURE__ */
|
|
12038
|
-
loading ? /* @__PURE__ */
|
|
12039
|
-
!loading && !history ? /* @__PURE__ */
|
|
12040
|
-
history?.packets.length === 0 ? /* @__PURE__ */
|
|
12041
|
-
/* @__PURE__ */
|
|
12117
|
+
return /* @__PURE__ */ jsxs30("section", { "aria-label": "Saved RFA packets", children: [
|
|
12118
|
+
/* @__PURE__ */ jsx32("h3", { children: "Saved packets" }),
|
|
12119
|
+
/* @__PURE__ */ jsx32("p", { children: "Open the exact PDF retained for a download or submission. Forwarding preserves the original request and review deadline." }),
|
|
12120
|
+
error ? /* @__PURE__ */ jsx32("p", { role: "alert", children: error }) : null,
|
|
12121
|
+
notice ? /* @__PURE__ */ jsx32("p", { role: "status", children: notice }) : null,
|
|
12122
|
+
loading ? /* @__PURE__ */ jsx32("p", { role: "status", children: "Loading saved packets\u2026" }) : null,
|
|
12123
|
+
!loading && !history ? /* @__PURE__ */ jsx32("button", { type: "button", onClick: () => setReload((value) => value + 1), children: "Retry loading packets" }) : null,
|
|
12124
|
+
history?.packets.length === 0 ? /* @__PURE__ */ jsx32("p", { children: "No saved packets yet." }) : history ? /* @__PURE__ */ jsxs30(Fragment19, { children: [
|
|
12125
|
+
/* @__PURE__ */ jsxs30("label", { children: [
|
|
12042
12126
|
"Saved packet",
|
|
12043
|
-
/* @__PURE__ */
|
|
12127
|
+
/* @__PURE__ */ jsxs30("select", { disabled: locked, value: selected, onChange: (event) => {
|
|
12044
12128
|
setSelected(event.target.value);
|
|
12045
12129
|
setPrepared(null);
|
|
12046
12130
|
resetReview();
|
|
12047
12131
|
}, children: [
|
|
12048
|
-
/* @__PURE__ */
|
|
12049
|
-
history.packets.map((value) => /* @__PURE__ */
|
|
12132
|
+
/* @__PURE__ */ jsx32("option", { value: "", children: "Choose a saved packet" }),
|
|
12133
|
+
history.packets.map((value) => /* @__PURE__ */ jsxs30("option", { value: value.id, children: [
|
|
12050
12134
|
value.source === "submission" ? "Submission" : "Download",
|
|
12051
12135
|
" \xB7 revision ",
|
|
12052
12136
|
value.contentRevision,
|
|
@@ -12055,67 +12139,67 @@ function PacketsContent({ rfa, options, permissions = [], environment = "sandbox
|
|
|
12055
12139
|
] }, value.id))
|
|
12056
12140
|
] })
|
|
12057
12141
|
] }),
|
|
12058
|
-
/* @__PURE__ */
|
|
12059
|
-
blob ? /* @__PURE__ */
|
|
12060
|
-
!canForward ? /* @__PURE__ */
|
|
12061
|
-
/* @__PURE__ */
|
|
12062
|
-
/* @__PURE__ */
|
|
12063
|
-
/* @__PURE__ */
|
|
12142
|
+
/* @__PURE__ */ jsx32("button", { type: "button", disabled: locked || !packet, onClick: () => void view(), children: "View saved PDF" }),
|
|
12143
|
+
blob ? /* @__PURE__ */ jsx32(RfaPdfReview, { blob, title: "Saved RFA packet" }) : null,
|
|
12144
|
+
!canForward ? /* @__PURE__ */ jsx32("p", { children: environment !== "live" ? "Sandbox: saved PDFs are available for review. External forwarding is disabled." : "Forwarding requires permission from your organization." }) : selected && !eligible ? /* @__PURE__ */ jsx32("p", { children: "This packet is not eligible for forwarding. Submission packets require a successful original dispatch." }) : /* @__PURE__ */ jsxs30("fieldset", { disabled: locked, children: [
|
|
12145
|
+
/* @__PURE__ */ jsx32("legend", { children: "Forward saved packet" }),
|
|
12146
|
+
/* @__PURE__ */ jsx32("p", { children: "The saved packet may contain the original recipient\u2019s cover sheet. Review all pages before forwarding." }),
|
|
12147
|
+
/* @__PURE__ */ jsxs30("label", { children: [
|
|
12064
12148
|
"Forward by",
|
|
12065
|
-
/* @__PURE__ */
|
|
12149
|
+
/* @__PURE__ */ jsxs30("select", { value: channel, onChange: (event) => {
|
|
12066
12150
|
setChannel(event.target.value);
|
|
12067
12151
|
resetReview();
|
|
12068
12152
|
}, children: [
|
|
12069
|
-
/* @__PURE__ */
|
|
12070
|
-
/* @__PURE__ */
|
|
12153
|
+
/* @__PURE__ */ jsx32("option", { value: "fax", children: "Fax" }),
|
|
12154
|
+
/* @__PURE__ */ jsx32("option", { value: "email", children: "Email" })
|
|
12071
12155
|
] })
|
|
12072
12156
|
] }),
|
|
12073
|
-
channel === "email" ? /* @__PURE__ */
|
|
12074
|
-
/* @__PURE__ */
|
|
12157
|
+
channel === "email" ? /* @__PURE__ */ jsx32("p", { children: "Email forwarding requires email delivery to be enabled for your organization. The server will reject requests when it is unavailable." }) : null,
|
|
12158
|
+
/* @__PURE__ */ jsxs30("label", { children: [
|
|
12075
12159
|
channel === "fax" ? "Recipient fax (with country code)" : "Recipient email",
|
|
12076
|
-
/* @__PURE__ */
|
|
12160
|
+
/* @__PURE__ */ jsx32("input", { type: channel === "fax" ? "tel" : "email", value: recipient, onChange: (event) => {
|
|
12077
12161
|
setRecipient(event.target.value);
|
|
12078
12162
|
resetReview();
|
|
12079
12163
|
} })
|
|
12080
12164
|
] }),
|
|
12081
|
-
/* @__PURE__ */
|
|
12082
|
-
/* @__PURE__ */
|
|
12165
|
+
/* @__PURE__ */ jsxs30("label", { className: "mbrfa-check", children: [
|
|
12166
|
+
/* @__PURE__ */ jsx32("input", { type: "checkbox", disabled: !blob || !eligible, checked: reviewed, onChange: (event) => {
|
|
12083
12167
|
setReviewed(event.target.checked);
|
|
12084
12168
|
setConfirmed(false);
|
|
12085
12169
|
} }),
|
|
12086
12170
|
"I reviewed this saved packet and its attachments."
|
|
12087
12171
|
] }),
|
|
12088
|
-
/* @__PURE__ */
|
|
12089
|
-
/* @__PURE__ */
|
|
12172
|
+
/* @__PURE__ */ jsxs30("label", { className: "mbrfa-check", children: [
|
|
12173
|
+
/* @__PURE__ */ jsx32("input", { type: "checkbox", disabled: !reviewed || !validRecipient || !eligible, checked: confirmed, onChange: (event) => setConfirmed(event.target.checked) }),
|
|
12090
12174
|
"I verified that ",
|
|
12091
12175
|
destination || "this recipient",
|
|
12092
12176
|
" is authorized to receive this patient\u2019s packet."
|
|
12093
12177
|
] }),
|
|
12094
|
-
alreadyForwarded ? /* @__PURE__ */
|
|
12095
|
-
/* @__PURE__ */
|
|
12178
|
+
alreadyForwarded ? /* @__PURE__ */ jsx32("p", { children: "A forward to this recipient is already recorded or pending. Check delivery history." }) : null,
|
|
12179
|
+
/* @__PURE__ */ jsx32("button", { type: "button", disabled: !canForward || !eligible || !blob || !reviewed || !confirmed || !validRecipient || alreadyForwarded, onClick: () => void forward(), children: busy ? "Working\u2026" : `Forward packet by ${channel}` })
|
|
12096
12180
|
] })
|
|
12097
12181
|
] }) : null
|
|
12098
12182
|
] });
|
|
12099
12183
|
}
|
|
12100
12184
|
|
|
12101
12185
|
// src/rfa-draft-actions.tsx
|
|
12102
|
-
import { useEffect as useEffect17, useMemo as useMemo10, useRef as
|
|
12186
|
+
import { useEffect as useEffect17, useMemo as useMemo10, useRef as useRef16, useState as useState20 } from "react";
|
|
12103
12187
|
import { createRfaDraftActionsClient } from "@mindbill/browser";
|
|
12104
|
-
import { Fragment as
|
|
12188
|
+
import { Fragment as Fragment20, jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
12105
12189
|
function RfaDraftActions({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride, ...props }) {
|
|
12106
12190
|
const options = useMemo10(() => ({ ...sessionEndpoint ? { sessionEndpoint } : {}, ...getSession ? { getSession } : {}, ...apiBaseUrl ? { apiBaseUrl } : {}, ...fetchOverride ? { fetch: fetchOverride } : {} }), [sessionEndpoint, getSession, apiBaseUrl, fetchOverride]);
|
|
12107
12191
|
const identity = useMemo10(() => crypto.randomUUID(), [options]);
|
|
12108
|
-
return /* @__PURE__ */
|
|
12192
|
+
return /* @__PURE__ */ jsx33(DraftActionsContent, { options, ...props }, `${identity}:${props.rfa.id}:${props.rfa.contentRevision}:${props.rfa.status}:${props.rfa.signedAt}:${props.rfa.submittedAt}`);
|
|
12109
12193
|
}
|
|
12110
12194
|
function DraftActionsContent({ rfa, options, permissions = [], disabled = false, onCopied, onCanceled }) {
|
|
12111
12195
|
const client = useMemo10(() => createRfaDraftActionsClient(options), [options]);
|
|
12112
|
-
const [confirming, setConfirming] =
|
|
12113
|
-
const [busy, setBusy] =
|
|
12114
|
-
const [error, setError] =
|
|
12115
|
-
const [completed, setCompleted] =
|
|
12116
|
-
const pending =
|
|
12117
|
-
const keys =
|
|
12118
|
-
const alive =
|
|
12196
|
+
const [confirming, setConfirming] = useState20(null);
|
|
12197
|
+
const [busy, setBusy] = useState20(false);
|
|
12198
|
+
const [error, setError] = useState20("");
|
|
12199
|
+
const [completed, setCompleted] = useState20(null);
|
|
12200
|
+
const pending = useRef16(false);
|
|
12201
|
+
const keys = useRef16({});
|
|
12202
|
+
const alive = useRef16(true);
|
|
12119
12203
|
useEffect17(() => {
|
|
12120
12204
|
alive.current = true;
|
|
12121
12205
|
return () => {
|
|
@@ -12145,112 +12229,112 @@ function DraftActionsContent({ rfa, options, permissions = [], disabled = false,
|
|
|
12145
12229
|
if (alive.current) setBusy(false);
|
|
12146
12230
|
}
|
|
12147
12231
|
};
|
|
12148
|
-
return /* @__PURE__ */
|
|
12149
|
-
error ? /* @__PURE__ */
|
|
12150
|
-
completed ? /* @__PURE__ */
|
|
12151
|
-
confirming === "copy" ? /* @__PURE__ */
|
|
12152
|
-
/* @__PURE__ */
|
|
12153
|
-
/* @__PURE__ */
|
|
12154
|
-
] }) : /* @__PURE__ */
|
|
12155
|
-
/* @__PURE__ */
|
|
12156
|
-
/* @__PURE__ */
|
|
12232
|
+
return /* @__PURE__ */ jsxs31("section", { "aria-label": "RFA draft actions", children: [
|
|
12233
|
+
error ? /* @__PURE__ */ jsx33("p", { role: "alert", children: error }) : null,
|
|
12234
|
+
completed ? /* @__PURE__ */ jsx33("p", { role: "status", children: completed === "copy" ? "A new unsigned draft was created." : "The draft was canceled. Its audit history is retained." }) : confirming && (confirming === "copy" ? canCopy : canCancel) ? /* @__PURE__ */ jsxs31("div", { className: "mbtd-note", children: [
|
|
12235
|
+
confirming === "copy" ? /* @__PURE__ */ jsxs31(Fragment20, { children: [
|
|
12236
|
+
/* @__PURE__ */ jsx33("p", { children: "Create a new draft with this patient, injury, physician, and requested treatments? Review the new draft and attach supporting documents before signing it." }),
|
|
12237
|
+
/* @__PURE__ */ jsx33("p", { children: "Signatures, supporting documents, decisions, and delivery history remain on the original request." })
|
|
12238
|
+
] }) : /* @__PURE__ */ jsx33("p", { children: "Cancel this unsigned draft? It will no longer be available for submission. The request and its audit history will be retained." }),
|
|
12239
|
+
/* @__PURE__ */ jsxs31("div", { className: "mbtd-actions", children: [
|
|
12240
|
+
/* @__PURE__ */ jsx33("button", { type: "button", disabled: disabled || busy, onClick: () => {
|
|
12157
12241
|
void mutate(confirming);
|
|
12158
12242
|
}, children: busy ? "Saving\u2026" : confirming === "copy" ? "Create draft copy" : "Confirm cancellation" }),
|
|
12159
|
-
/* @__PURE__ */
|
|
12243
|
+
/* @__PURE__ */ jsx33("button", { type: "button", disabled: busy, onClick: () => {
|
|
12160
12244
|
setConfirming(null);
|
|
12161
12245
|
setError("");
|
|
12162
12246
|
}, children: "Keep current request" })
|
|
12163
12247
|
] })
|
|
12164
|
-
] }) : /* @__PURE__ */
|
|
12165
|
-
canCopy ? /* @__PURE__ */
|
|
12166
|
-
canCancel ? /* @__PURE__ */
|
|
12248
|
+
] }) : /* @__PURE__ */ jsxs31("div", { className: "mbtd-actions", children: [
|
|
12249
|
+
canCopy ? /* @__PURE__ */ jsx33("button", { type: "button", disabled: disabled || busy, onClick: () => setConfirming("copy"), children: "Copy to new draft" }) : null,
|
|
12250
|
+
canCancel ? /* @__PURE__ */ jsx33("button", { type: "button", disabled: disabled || busy, onClick: () => setConfirming("cancel"), children: "Cancel draft" }) : null
|
|
12167
12251
|
] })
|
|
12168
12252
|
] });
|
|
12169
12253
|
}
|
|
12170
12254
|
|
|
12171
12255
|
// src/rfa-list-view.tsx
|
|
12172
12256
|
import { getRfaLifecycleStatus as getRfaLifecycleStatus3, RFA_LIFECYCLE_LABELS as RFA_LIFECYCLE_LABELS3 } from "@mindbill/browser";
|
|
12173
|
-
import { jsx as
|
|
12257
|
+
import { jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
12174
12258
|
var date6 = (value) => value ? new Date(value).toLocaleDateString() : "\u2014";
|
|
12175
12259
|
var label2 = (value) => value.replaceAll("_", " ");
|
|
12176
12260
|
function RfaListView({ records, view, onViewChange, sortBy, sortDirection, onSort, onSelect, lifecycleAvailable = true, hideViewSwitch = false, getRfaHref, getPatientHref, getClaimHref, getProviderHref }) {
|
|
12177
|
-
const heading = (field, title) => /* @__PURE__ */
|
|
12261
|
+
const heading = (field, title) => /* @__PURE__ */ jsx34("th", { scope: "col", "aria-sort": sortBy === field ? sortDirection === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ jsxs32("button", { type: "button", onClick: () => onSort(field), children: [
|
|
12178
12262
|
title,
|
|
12179
12263
|
sortBy === field ? sortDirection === "asc" ? " \u2191" : " \u2193" : " \u2195"
|
|
12180
12264
|
] }) });
|
|
12181
|
-
return /* @__PURE__ */
|
|
12182
|
-
/* @__PURE__ */
|
|
12183
|
-
!hideViewSwitch ? /* @__PURE__ */
|
|
12184
|
-
/* @__PURE__ */
|
|
12265
|
+
return /* @__PURE__ */ jsxs32("div", { className: "mbrfa-list", children: [
|
|
12266
|
+
/* @__PURE__ */ jsx34("style", { children: `.mbrfa-table-scroll{overflow-x:auto;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius)}.mbrfa-table{width:100%;border-collapse:collapse;text-align:left;font-size:13px}.mbrfa-table th,.mbrfa-table td{padding:12px;border-bottom:1px solid var(--mb-border);vertical-align:top;min-width:110px}.mbrfa-table th{background:var(--mb-soft)}.mbrfa-table td small{display:block;color:var(--mb-muted);margin-top:4px}.mbrfa-table tr:last-child td{border-bottom:0}.mbtd .mbrfa-table th button{white-space:nowrap;border:0;background:transparent;padding:0;min-height:28px;font-size:12px;font-weight:650;color:var(--mb-muted)}.mbrfa-table th{font-size:12px;font-weight:650;color:var(--mb-muted)}.mbrfa-table tbody tr:hover{background:var(--mb-soft)}.mbrfa-table td{overflow-wrap:anywhere}.mbrfa-table td:first-child button{color:var(--mb-accent);font-weight:600;background:transparent;border-color:var(--mb-border)}.mbtd .mbrfa-text-link{border:0;background:transparent;padding:0;min-height:0;color:var(--mb-accent);font-weight:600;text-decoration:none;text-align:left;line-height:1.5}.mbtd .mbrfa-text-link:hover{text-decoration:underline}.mbrfa-view button[aria-pressed=true]{background:var(--mb-soft);font-weight:600}` }),
|
|
12267
|
+
!hideViewSwitch ? /* @__PURE__ */ jsxs32("div", { className: "mbrfa-list-mode", children: [
|
|
12268
|
+
/* @__PURE__ */ jsxs32("label", { children: [
|
|
12185
12269
|
"Show",
|
|
12186
|
-
/* @__PURE__ */
|
|
12187
|
-
/* @__PURE__ */
|
|
12188
|
-
/* @__PURE__ */
|
|
12270
|
+
/* @__PURE__ */ jsxs32("select", { value: view, onChange: (event) => onViewChange(event.target.value), children: [
|
|
12271
|
+
/* @__PURE__ */ jsx34("option", { value: "rfas", children: "RFAs \u2014 one row per request" }),
|
|
12272
|
+
/* @__PURE__ */ jsx34("option", { value: "treatments", children: "Treatments \u2014 one row per service" })
|
|
12189
12273
|
] })
|
|
12190
12274
|
] }),
|
|
12191
|
-
/* @__PURE__ */
|
|
12275
|
+
/* @__PURE__ */ jsx34("p", { children: view === "rfas" ? "One RFA can request several treatments. Open a request to review its treatments and decisions." : "Each treatment belongs to an RFA and can receive its own decision. Page controls move between requests." })
|
|
12192
12276
|
] }) : null,
|
|
12193
|
-
!records.length ? /* @__PURE__ */
|
|
12194
|
-
/* @__PURE__ */
|
|
12195
|
-
/* @__PURE__ */
|
|
12277
|
+
!records.length ? /* @__PURE__ */ jsx34("p", { children: "No requests match this view." }) : /* @__PURE__ */ jsx34("div", { className: "mbrfa-table-scroll", tabIndex: 0, role: "region", "aria-label": view === "rfas" ? "RFA table" : "Requested treatments table", children: /* @__PURE__ */ jsxs32("table", { className: "mbrfa-table", children: [
|
|
12278
|
+
/* @__PURE__ */ jsx34("thead", { children: /* @__PURE__ */ jsxs32("tr", { children: [
|
|
12279
|
+
/* @__PURE__ */ jsx34("th", { scope: "col", children: view === "rfas" ? "Request" : "Request / treatment" }),
|
|
12196
12280
|
heading("employeeName", "Patient"),
|
|
12197
12281
|
heading("providerName", "Requesting physician"),
|
|
12198
|
-
/* @__PURE__ */
|
|
12282
|
+
/* @__PURE__ */ jsx34("th", { scope: "col", children: view === "rfas" ? "Claims administrator" : "Service / diagnosis" }),
|
|
12199
12283
|
heading("submittedAt", "Sent"),
|
|
12200
|
-
/* @__PURE__ */
|
|
12201
|
-
view === "rfas" ? heading(lifecycleAvailable ? "lifecycleStatus" : "status", lifecycleAvailable ? "Status" : "Clinical status") : /* @__PURE__ */
|
|
12284
|
+
/* @__PURE__ */ jsx34("th", { scope: "col", children: "Decision due" }),
|
|
12285
|
+
view === "rfas" ? heading(lifecycleAvailable ? "lifecycleStatus" : "status", lifecycleAvailable ? "Status" : "Clinical status") : /* @__PURE__ */ jsx34("th", { scope: "col", children: "Treatment decision" }),
|
|
12202
12286
|
heading("createdAt", "Created")
|
|
12203
12287
|
] }) }),
|
|
12204
|
-
/* @__PURE__ */
|
|
12205
|
-
/* @__PURE__ */
|
|
12206
|
-
/* @__PURE__ */
|
|
12207
|
-
rfa.displayReference ? /* @__PURE__ */
|
|
12288
|
+
/* @__PURE__ */ jsx34("tbody", { children: records.flatMap((rfa) => view === "rfas" ? [/* @__PURE__ */ jsxs32("tr", { children: [
|
|
12289
|
+
/* @__PURE__ */ jsxs32("td", { children: [
|
|
12290
|
+
/* @__PURE__ */ jsx34(RfaLink, { href: getRfaHref?.(rfa.id), onSelect: () => onSelect(rfa.id), children: rfaTitle(rfa) }),
|
|
12291
|
+
rfa.displayReference ? /* @__PURE__ */ jsx34("small", { children: rfa.displayReference }) : null
|
|
12208
12292
|
] }),
|
|
12209
|
-
/* @__PURE__ */
|
|
12210
|
-
/* @__PURE__ */
|
|
12211
|
-
/* @__PURE__ */
|
|
12293
|
+
/* @__PURE__ */ jsxs32("td", { children: [
|
|
12294
|
+
/* @__PURE__ */ jsx34(RfaLink, { href: getPatientHref?.(rfa), children: rfa.employeeName }),
|
|
12295
|
+
/* @__PURE__ */ jsx34("small", { children: /* @__PURE__ */ jsxs32(RfaLink, { href: getClaimHref?.(rfa), children: [
|
|
12212
12296
|
"Claim ",
|
|
12213
12297
|
rfa.claimNumber || "not recorded"
|
|
12214
12298
|
] }) })
|
|
12215
12299
|
] }),
|
|
12216
|
-
/* @__PURE__ */
|
|
12217
|
-
/* @__PURE__ */
|
|
12218
|
-
/* @__PURE__ */
|
|
12219
|
-
/* @__PURE__ */
|
|
12220
|
-
/* @__PURE__ */
|
|
12221
|
-
/* @__PURE__ */
|
|
12222
|
-
] }, rfa.id)] : rfa.items.map((item) => /* @__PURE__ */
|
|
12223
|
-
/* @__PURE__ */
|
|
12224
|
-
/* @__PURE__ */
|
|
12225
|
-
rfa.displayReference ? /* @__PURE__ */
|
|
12300
|
+
/* @__PURE__ */ jsx34("td", { children: /* @__PURE__ */ jsx34(RfaLink, { href: getProviderHref?.(rfa), children: rfa.providerName }) }),
|
|
12301
|
+
/* @__PURE__ */ jsx34("td", { children: rfa.claimsAdminName || rfa.authorizationContact?.name || "Not recorded" }),
|
|
12302
|
+
/* @__PURE__ */ jsx34("td", { children: date6(rfa.submittedAt) }),
|
|
12303
|
+
/* @__PURE__ */ jsx34("td", { children: rfaDecisionDueText(rfa) }),
|
|
12304
|
+
/* @__PURE__ */ jsx34("td", { children: RFA_LIFECYCLE_LABELS3[getRfaLifecycleStatus3(rfa)] }),
|
|
12305
|
+
/* @__PURE__ */ jsx34("td", { children: date6(rfa.createdAt) })
|
|
12306
|
+
] }, rfa.id)] : rfa.items.map((item) => /* @__PURE__ */ jsxs32("tr", { children: [
|
|
12307
|
+
/* @__PURE__ */ jsxs32("td", { children: [
|
|
12308
|
+
/* @__PURE__ */ jsx34(RfaLink, { href: getRfaHref?.(rfa.id, { treatmentId: item.id }), onSelect: () => onSelect(rfa.id, item.id), children: item.serviceDescription }),
|
|
12309
|
+
rfa.displayReference ? /* @__PURE__ */ jsx34("small", { children: rfa.displayReference }) : null
|
|
12226
12310
|
] }),
|
|
12227
|
-
/* @__PURE__ */
|
|
12228
|
-
/* @__PURE__ */
|
|
12229
|
-
/* @__PURE__ */
|
|
12311
|
+
/* @__PURE__ */ jsxs32("td", { children: [
|
|
12312
|
+
/* @__PURE__ */ jsx34(RfaLink, { href: getPatientHref?.(rfa), children: rfa.employeeName }),
|
|
12313
|
+
/* @__PURE__ */ jsx34("small", { children: /* @__PURE__ */ jsxs32(RfaLink, { href: getClaimHref?.(rfa), children: [
|
|
12230
12314
|
"Claim ",
|
|
12231
12315
|
rfa.claimNumber || "not recorded"
|
|
12232
12316
|
] }) })
|
|
12233
12317
|
] }),
|
|
12234
|
-
/* @__PURE__ */
|
|
12235
|
-
/* @__PURE__ */
|
|
12318
|
+
/* @__PURE__ */ jsx34("td", { children: /* @__PURE__ */ jsx34(RfaLink, { href: getProviderHref?.(rfa), children: rfa.providerName }) }),
|
|
12319
|
+
/* @__PURE__ */ jsxs32("td", { children: [
|
|
12236
12320
|
item.serviceDescription,
|
|
12237
|
-
/* @__PURE__ */
|
|
12321
|
+
/* @__PURE__ */ jsxs32("small", { children: [
|
|
12238
12322
|
item.procedureCode || "No procedure code",
|
|
12239
12323
|
" \xB7 ",
|
|
12240
12324
|
item.diagnosisCode
|
|
12241
12325
|
] })
|
|
12242
12326
|
] }),
|
|
12243
|
-
/* @__PURE__ */
|
|
12244
|
-
/* @__PURE__ */
|
|
12245
|
-
/* @__PURE__ */
|
|
12327
|
+
/* @__PURE__ */ jsx34("td", { children: date6(rfa.submittedAt) }),
|
|
12328
|
+
/* @__PURE__ */ jsx34("td", { children: item.decisionClosure?.closed ? "\u2014" : rfaDecisionDueText(rfa) }),
|
|
12329
|
+
/* @__PURE__ */ jsxs32("td", { children: [
|
|
12246
12330
|
item.decisionClosure?.closed ? "Decision no longer required" : label2(item.outcome),
|
|
12247
|
-
/* @__PURE__ */
|
|
12248
|
-
item.authorizationNumber ? /* @__PURE__ */
|
|
12331
|
+
/* @__PURE__ */ jsx34("small", { children: date6(item.decidedAt) }),
|
|
12332
|
+
item.authorizationNumber ? /* @__PURE__ */ jsxs32("small", { children: [
|
|
12249
12333
|
"Authorization ",
|
|
12250
12334
|
item.authorizationNumber
|
|
12251
12335
|
] }) : null
|
|
12252
12336
|
] }),
|
|
12253
|
-
/* @__PURE__ */
|
|
12337
|
+
/* @__PURE__ */ jsx34("td", { children: date6(rfa.createdAt) })
|
|
12254
12338
|
] }, `${rfa.id}:${item.id}`))) })
|
|
12255
12339
|
] }) })
|
|
12256
12340
|
] });
|
|
@@ -12258,58 +12342,58 @@ function RfaListView({ records, view, onViewChange, sortBy, sortDirection, onSor
|
|
|
12258
12342
|
|
|
12259
12343
|
// src/rfa-overview.tsx
|
|
12260
12344
|
import { RFA_LIFECYCLE_LABELS as RFA_LIFECYCLE_LABELS4 } from "@mindbill/browser";
|
|
12261
|
-
import { jsx as
|
|
12345
|
+
import { jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
12262
12346
|
var buckets = [{ id: "0_5", label: "0\u20135 days" }, { id: "6_14", label: "6\u201314 days" }, { id: "15_30", label: "15\u201330 days" }, { id: "31_plus", label: "31+ days" }];
|
|
12263
12347
|
var groups = [{ title: "Needs attention", tone: "attention", states: ["incomplete", "failed"] }, { title: "Awaiting decision", tone: "waiting", states: ["sent", "received"] }, { title: "Finished", tone: "finished", states: ["closed", "canceled"] }];
|
|
12264
12348
|
function RfaOverview({ summary, onSelect, combined = false }) {
|
|
12265
12349
|
const aging = summary.aging;
|
|
12266
|
-
const countButton = (count, title, status, bucket) => count ? /* @__PURE__ */
|
|
12267
|
-
if (!summary.byLifecycleStatus) return /* @__PURE__ */
|
|
12268
|
-
/* @__PURE__ */
|
|
12269
|
-
/* @__PURE__ */
|
|
12270
|
-
/* @__PURE__ */
|
|
12271
|
-
/* @__PURE__ */
|
|
12350
|
+
const countButton = (count, title, status, bucket) => count ? /* @__PURE__ */ jsx35("button", { type: "button", className: "mbrfa-count", "aria-label": `${title}: ${count} requests`, onClick: () => onSelect(status, bucket), children: count.toLocaleString() }) : /* @__PURE__ */ jsx35("span", { className: "mbrfa-zero", children: "0" });
|
|
12351
|
+
if (!summary.byLifecycleStatus) return /* @__PURE__ */ jsxs33("section", { className: "mbrfa-overview", "aria-label": "Clinical review overview", children: [
|
|
12352
|
+
/* @__PURE__ */ jsx35("h3", { children: "Clinical review counts" }),
|
|
12353
|
+
/* @__PURE__ */ jsx35("div", { className: "mbrfa-legacy-grid", children: Object.entries(summary.byStatus).map(([status, count]) => /* @__PURE__ */ jsxs33("button", { type: "button", onClick: () => onSelect(status), children: [
|
|
12354
|
+
/* @__PURE__ */ jsx35("span", { children: status.replaceAll("_", " ") }),
|
|
12355
|
+
/* @__PURE__ */ jsx35("strong", { children: count })
|
|
12272
12356
|
] }, status)) })
|
|
12273
12357
|
] });
|
|
12274
|
-
return /* @__PURE__ */
|
|
12275
|
-
/* @__PURE__ */
|
|
12276
|
-
/* @__PURE__ */
|
|
12277
|
-
/* @__PURE__ */
|
|
12278
|
-
/* @__PURE__ */
|
|
12358
|
+
return /* @__PURE__ */ jsxs33("div", { className: "mbrfa-overview", children: [
|
|
12359
|
+
/* @__PURE__ */ jsxs33("div", { className: "mbrfa-overview-title", children: [
|
|
12360
|
+
/* @__PURE__ */ jsxs33("div", { children: [
|
|
12361
|
+
/* @__PURE__ */ jsx35("h3", { children: combined ? "Requests awaiting a decision" : "Status and aging" }),
|
|
12362
|
+
/* @__PURE__ */ jsx35("p", { className: "mbrfa-aging-basis", children: "Calendar days since submission" })
|
|
12279
12363
|
] }),
|
|
12280
|
-
/* @__PURE__ */
|
|
12364
|
+
/* @__PURE__ */ jsxs33("span", { children: [
|
|
12281
12365
|
summary.total.toLocaleString(),
|
|
12282
12366
|
" total requests"
|
|
12283
12367
|
] })
|
|
12284
12368
|
] }),
|
|
12285
|
-
groups.filter((group) => !combined || group.tone === "waiting").map((group) => /* @__PURE__ */
|
|
12286
|
-
/* @__PURE__ */
|
|
12287
|
-
/* @__PURE__ */
|
|
12288
|
-
/* @__PURE__ */
|
|
12369
|
+
groups.filter((group) => !combined || group.tone === "waiting").map((group) => /* @__PURE__ */ jsxs33("section", { className: `mbrfa-status-group mbrfa-${group.tone}`, "aria-label": group.title, children: [
|
|
12370
|
+
/* @__PURE__ */ jsxs33("div", { className: "mbrfa-aging-grid mbrfa-group-heading", children: [
|
|
12371
|
+
/* @__PURE__ */ jsxs33("h4", { children: [
|
|
12372
|
+
/* @__PURE__ */ jsx35("i", { "aria-hidden": "true" }),
|
|
12289
12373
|
group.title
|
|
12290
12374
|
] }),
|
|
12291
|
-
buckets.map((bucket) => /* @__PURE__ */
|
|
12292
|
-
/* @__PURE__ */
|
|
12375
|
+
buckets.map((bucket) => /* @__PURE__ */ jsx35("span", { className: "mbrfa-age-heading", children: bucket.label }, bucket.id)),
|
|
12376
|
+
/* @__PURE__ */ jsx35("span", { className: "mbrfa-total-heading", children: "Total" })
|
|
12293
12377
|
] }),
|
|
12294
|
-
group.states.map((status) => /* @__PURE__ */
|
|
12295
|
-
/* @__PURE__ */
|
|
12296
|
-
buckets.map((bucket) => /* @__PURE__ */
|
|
12297
|
-
/* @__PURE__ */
|
|
12298
|
-
group.tone === "waiting" && aging ? countButton(aging.byLifecycleStatus[status]?.[bucket.id] ?? 0, `${RFA_LIFECYCLE_LABELS4[status]} \xB7 ${bucket.label} since submission`, status, bucket.id) : /* @__PURE__ */
|
|
12378
|
+
group.states.map((status) => /* @__PURE__ */ jsxs33("div", { className: "mbrfa-aging-grid mbrfa-aging-row", children: [
|
|
12379
|
+
/* @__PURE__ */ jsx35("strong", { children: RFA_LIFECYCLE_LABELS4[status] }),
|
|
12380
|
+
buckets.map((bucket) => /* @__PURE__ */ jsxs33("span", { className: "mbrfa-age-cell", children: [
|
|
12381
|
+
/* @__PURE__ */ jsx35("span", { className: "mbrfa-mobile-age", children: bucket.label }),
|
|
12382
|
+
group.tone === "waiting" && aging ? countButton(aging.byLifecycleStatus[status]?.[bucket.id] ?? 0, `${RFA_LIFECYCLE_LABELS4[status]} \xB7 ${bucket.label} since submission`, status, bucket.id) : /* @__PURE__ */ jsx35("span", { className: "mbrfa-zero", "aria-label": "Not applicable", children: "\u2014" })
|
|
12299
12383
|
] }, bucket.id)),
|
|
12300
|
-
/* @__PURE__ */
|
|
12384
|
+
/* @__PURE__ */ jsx35("span", { className: "mbrfa-row-total", children: countButton(summary.byLifecycleStatus?.[status] ?? 0, RFA_LIFECYCLE_LABELS4[status], status) })
|
|
12301
12385
|
] }, status))
|
|
12302
12386
|
] }, group.title)),
|
|
12303
|
-
/* @__PURE__ */
|
|
12387
|
+
/* @__PURE__ */ jsxs33("p", { className: "mbrfa-overview-footnote", children: [
|
|
12304
12388
|
"Aging counts calendar days since submission, separately from the decision deadline. Only requests awaiting a treatment decision are aged.",
|
|
12305
12389
|
!aging ? " Aging is unavailable from this server." : ""
|
|
12306
12390
|
] }),
|
|
12307
|
-
/* @__PURE__ */
|
|
12308
|
-
/* @__PURE__ */
|
|
12309
|
-
/* @__PURE__ */
|
|
12391
|
+
/* @__PURE__ */ jsxs33("button", { type: "button", className: "mbrfa-all-requests", onClick: () => onSelect(""), children: [
|
|
12392
|
+
/* @__PURE__ */ jsx35("strong", { children: "All requests" }),
|
|
12393
|
+
/* @__PURE__ */ jsxs33("span", { children: [
|
|
12310
12394
|
summary.total.toLocaleString(),
|
|
12311
12395
|
" ",
|
|
12312
|
-
/* @__PURE__ */
|
|
12396
|
+
/* @__PURE__ */ jsx35("span", { "aria-hidden": "true", children: "\u2192" })
|
|
12313
12397
|
] })
|
|
12314
12398
|
] })
|
|
12315
12399
|
] });
|
|
@@ -12326,69 +12410,7 @@ var rfaDashboardCss = `
|
|
|
12326
12410
|
`;
|
|
12327
12411
|
|
|
12328
12412
|
// src/rfa-create-form.tsx
|
|
12329
|
-
import { useCallback as useCallback3, useEffect as
|
|
12330
|
-
|
|
12331
|
-
// src/rfa-identity-select.tsx
|
|
12332
|
-
import { useId as useId5, useRef as useRef16, useState as useState20 } from "react";
|
|
12333
|
-
import { Fragment as Fragment20, jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
12334
|
-
function RfaIdentitySelect({ label: label5, placeholder, searchPlaceholder, query, searchable, disabled = false, loading = false, error = "", value, options, onSearch, onSelect }) {
|
|
12335
|
-
const id = useId5();
|
|
12336
|
-
const trigger = useRef16(null);
|
|
12337
|
-
const [open, setOpen] = useState20(false);
|
|
12338
|
-
const [active, setActive] = useState20(0);
|
|
12339
|
-
const selected = options.find((option) => option.id === value);
|
|
12340
|
-
const choose = (option) => {
|
|
12341
|
-
onSelect(option.id);
|
|
12342
|
-
setOpen(false);
|
|
12343
|
-
trigger.current?.focus();
|
|
12344
|
-
};
|
|
12345
|
-
return /* @__PURE__ */ jsxs33("div", { className: "mbrfa-identity-select", onBlur: (event) => {
|
|
12346
|
-
if (!event.currentTarget.contains(event.relatedTarget)) setOpen(false);
|
|
12347
|
-
}, onKeyDown: (event) => {
|
|
12348
|
-
if (event.key === "Escape") {
|
|
12349
|
-
event.preventDefault();
|
|
12350
|
-
setOpen(false);
|
|
12351
|
-
trigger.current?.focus();
|
|
12352
|
-
}
|
|
12353
|
-
}, children: [
|
|
12354
|
-
/* @__PURE__ */ jsx35("style", { children: `.mbrfa-identity-select{position:relative;min-width:0}.mbrfa-identity-select>button{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:left;gap:12px;min-height:44px}.mbrfa-identity-select small{display:block;opacity:.75;font-size:12px;margin-top:3px}.mbrfa-identity-select>button{height:44px}.mbrfa-identity-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mbrfa-identity-value small{display:inline;margin:0}.mbrfa-identity-menu{position:absolute;z-index:40;top:calc(100% + 6px);left:0;right:0;padding:10px;background:var(--mbtd-surface,#fff);color:inherit;border:1px solid var(--mbtd-border,#d6d3cc);border-radius:8px;box-shadow:0 8px 24px #0002}.mbrfa-identity-menu input{width:100%;box-sizing:border-box}.mbrfa-identity-options{max-height:280px;overflow:auto;margin-top:6px}.mbrfa-identity-options button{display:block;width:100%;text-align:left;padding:10px 12px;border:0;border-radius:4px;min-height:44px}.mbrfa-identity-options button:hover,.mbrfa-identity-options button[data-active=true]{background:#1c595918}.mbrfa-identity-menu p{padding:8px;margin:0}` }),
|
|
12355
|
-
/* @__PURE__ */ jsxs33("button", { ref: trigger, type: "button", "aria-label": label5, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? `${id}-list` : void 0, disabled, onClick: () => {
|
|
12356
|
-
setOpen(!open);
|
|
12357
|
-
setActive(0);
|
|
12358
|
-
}, children: [
|
|
12359
|
-
/* @__PURE__ */ jsx35("span", { className: "mbrfa-identity-value", children: selected ? /* @__PURE__ */ jsxs33(Fragment20, { children: [
|
|
12360
|
-
selected.label,
|
|
12361
|
-
selected.detail ? /* @__PURE__ */ jsxs33("small", { children: [
|
|
12362
|
-
" \xB7 ",
|
|
12363
|
-
selected.detail
|
|
12364
|
-
] }) : null
|
|
12365
|
-
] }) : placeholder }),
|
|
12366
|
-
/* @__PURE__ */ jsx35("span", { "aria-hidden": "true", children: "\u2304" })
|
|
12367
|
-
] }),
|
|
12368
|
-
open ? /* @__PURE__ */ jsxs33("div", { className: "mbrfa-identity-menu", children: [
|
|
12369
|
-
searchable ? /* @__PURE__ */ jsx35("input", { autoFocus: true, role: "combobox", "aria-label": searchPlaceholder, "aria-autocomplete": "list", "aria-expanded": "true", "aria-controls": `${id}-list`, "aria-activedescendant": !loading && !error && options[active] ? `${id}-${active}` : void 0, type: "search", autoComplete: "off", maxLength: 200, placeholder: searchPlaceholder, value: query, onChange: (event) => {
|
|
12370
|
-
setActive(0);
|
|
12371
|
-
onSearch(event.target.value);
|
|
12372
|
-
}, onKeyDown: (event) => {
|
|
12373
|
-
if (loading || error || !options.length) return;
|
|
12374
|
-
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
12375
|
-
event.preventDefault();
|
|
12376
|
-
const next = (active + (event.key === "ArrowDown" ? 1 : -1) + options.length) % options.length;
|
|
12377
|
-
setActive(next);
|
|
12378
|
-
document.getElementById(`${id}-${next}`)?.scrollIntoView({ block: "nearest" });
|
|
12379
|
-
}
|
|
12380
|
-
if (event.key === "Enter" && options[active]) {
|
|
12381
|
-
event.preventDefault();
|
|
12382
|
-
choose(options[active]);
|
|
12383
|
-
}
|
|
12384
|
-
} }) : null,
|
|
12385
|
-
/* @__PURE__ */ jsx35("div", { className: "mbrfa-identity-options", id: `${id}-list`, role: "listbox", "aria-label": label5, "aria-busy": loading, children: loading ? /* @__PURE__ */ jsx35("p", { role: "status", children: "Searching\u2026" }) : error ? /* @__PURE__ */ jsx35("p", { role: "alert", children: error }) : options.length ? options.map((option, index) => /* @__PURE__ */ jsxs33("button", { type: "button", role: "option", id: `${id}-${index}`, "aria-selected": option.id === value, "data-active": index === active, onMouseDown: (event) => event.preventDefault(), onClick: () => choose(option), children: [
|
|
12386
|
-
option.label,
|
|
12387
|
-
option.detail ? /* @__PURE__ */ jsx35("small", { children: option.detail }) : null
|
|
12388
|
-
] }, option.id)) : /* @__PURE__ */ jsx35("p", { children: "No matches. Try another search." }) })
|
|
12389
|
-
] }) : null
|
|
12390
|
-
] });
|
|
12391
|
-
}
|
|
12413
|
+
import { useCallback as useCallback3, useEffect as useEffect24, useState as useState27 } from "react";
|
|
12392
12414
|
|
|
12393
12415
|
// src/rfa-claim-setup.tsx
|
|
12394
12416
|
import { useEffect as useEffect18, useRef as useRef17, useState as useState21 } from "react";
|
|
@@ -12519,7 +12541,7 @@ function RfaClaimSetup({ client, disabled, onCreated, onCancel }) {
|
|
|
12519
12541
|
}
|
|
12520
12542
|
|
|
12521
12543
|
// src/rfa-practice-picker.tsx
|
|
12522
|
-
import { useState as useState23 } from "react";
|
|
12544
|
+
import { useEffect as useEffect20, useRef as useRef18, useState as useState23 } from "react";
|
|
12523
12545
|
|
|
12524
12546
|
// src/rfa-official-fields.tsx
|
|
12525
12547
|
import { useEffect as useEffect19, useState as useState22 } from "react";
|
|
@@ -12557,10 +12579,11 @@ var contactRows = [
|
|
|
12557
12579
|
["phone", "Phone", 30, 2],
|
|
12558
12580
|
["fax", "Fax Number", 30, 2]
|
|
12559
12581
|
];
|
|
12560
|
-
function RfaOfficialContactFields({ nameLabel, value, onChange, before, beforeEmail }) {
|
|
12582
|
+
function RfaOfficialContactFields({ nameLabel, value, onChange, before, beforeEmail, faxHint }) {
|
|
12561
12583
|
const field = (key2, label5, max, span) => /* @__PURE__ */ jsxs35("label", { className: `mbrfa-s${span}`, children: [
|
|
12562
12584
|
label5,
|
|
12563
|
-
/* @__PURE__ */ jsx37("input", { type: key2 === "email" ? "email" : key2 === "phone" || key2 === "fax" ? "tel" : "text", maxLength: max, value: value?.[key2] ?? "", onChange: (event) => onChange({ ...value, [key2]: event.target.value }) })
|
|
12585
|
+
/* @__PURE__ */ jsx37("input", { type: key2 === "email" ? "email" : key2 === "phone" || key2 === "fax" ? "tel" : "text", maxLength: max, value: value?.[key2] ?? "", onChange: (event) => onChange({ ...value, [key2]: event.target.value }) }),
|
|
12586
|
+
key2 === "fax" && faxHint && !value?.fax?.trim() ? /* @__PURE__ */ jsx37("small", { className: "mbrfa-field-hint", children: faxHint }) : null
|
|
12564
12587
|
] }, key2);
|
|
12565
12588
|
return /* @__PURE__ */ jsxs35("div", { className: "mbrfa-form-grid", children: [
|
|
12566
12589
|
before,
|
|
@@ -12580,7 +12603,7 @@ function useRfaFormDetails(client, claimId, renderingProviderId, enabled) {
|
|
|
12580
12603
|
void client.getCreationContext({ claimId, renderingProviderId, limit: 1 }).then((context) => {
|
|
12581
12604
|
if (!active) return;
|
|
12582
12605
|
const claim = context.claims.find((value) => value.claimId === claimId), provider = context.renderingProviders.find((value) => value.id === renderingProviderId);
|
|
12583
|
-
setDetails({ ...claim ? { employee: { formName: claim.employeeFormName, dateOfBirth: claim.dateOfBirth, employer: claim.employer } } : {}, ...provider ? { physician: { specialty: provider.specialty } } : {} });
|
|
12606
|
+
setDetails({ ...context.returnFax ? { returnFax: context.returnFax } : {}, ...context.returnEmail ? { returnEmail: context.returnEmail } : {}, ...claim ? { employee: { formName: claim.employeeFormName, dateOfBirth: claim.dateOfBirth, employer: claim.employer } } : {}, ...provider ? { physician: { specialty: provider.specialty } } : {} });
|
|
12584
12607
|
}).catch(() => void 0);
|
|
12585
12608
|
return () => {
|
|
12586
12609
|
active = false;
|
|
@@ -12591,11 +12614,20 @@ function useRfaFormDetails(client, claimId, renderingProviderId, enabled) {
|
|
|
12591
12614
|
|
|
12592
12615
|
// src/rfa-practice-picker.tsx
|
|
12593
12616
|
import { Fragment as Fragment21, jsx as jsx38, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
12594
|
-
function RfaPracticePicker({ profile, value, onChange, managePracticeHref, manageLocationsHref }) {
|
|
12617
|
+
function RfaPracticePicker({ profile, value, onChange, managePracticeHref, manageLocationsHref, onEditPractice, onEditLocation }) {
|
|
12595
12618
|
const practices = profile?.billingProviders ?? [];
|
|
12596
12619
|
const [practice, setPractice] = useState23(() => practices.find((item) => item.name === value?.name)?.id ?? "");
|
|
12597
12620
|
const [location, setLocation] = useState23(() => practice ? (profile?.locations ?? []).find((item) => item.active !== false && item.street === value?.address && (!item.billingProviderId || item.billingProviderId === practice))?.id ?? "" : "");
|
|
12598
12621
|
const located = (chosen, phone) => ({ address: chosen.street, city: chosen.city, state: chosen.state, zip: chosen.zip, ...chosen.contact?.name ? { contactName: chosen.contact.name } : {}, ...chosen.contact?.phone || phone ? { phone: chosen.contact?.phone || phone } : {}, ...chosen.contact?.fax ? { fax: chosen.contact.fax } : {}, ...chosen.contact?.email ? { email: chosen.contact.email } : {} });
|
|
12622
|
+
const savedPractice = practices.find((item) => item.id === practice), savedLocation = (profile?.locations ?? []).find((item) => item.id === location);
|
|
12623
|
+
const savedKey = JSON.stringify([savedPractice?.name, savedPractice?.phone, savedPractice?.billingStreet, savedPractice?.billingCity, savedPractice?.billingState, savedPractice?.billingZip, savedLocation?.street, savedLocation?.city, savedLocation?.state, savedLocation?.zip, savedLocation?.contact]);
|
|
12624
|
+
const appliedKey = useRef18(savedKey);
|
|
12625
|
+
useEffect20(() => {
|
|
12626
|
+
if (appliedKey.current === savedKey) return;
|
|
12627
|
+
appliedKey.current = savedKey;
|
|
12628
|
+
if (!savedPractice) return;
|
|
12629
|
+
onChange({ ...value, name: savedPractice.name, phone: savedPractice.phone ?? "", address: savedPractice.billingStreet ?? "", city: savedPractice.billingCity ?? "", state: savedPractice.billingState ?? "", zip: savedPractice.billingZip ?? "", ...savedLocation ? located(savedLocation, savedPractice.phone) : {} });
|
|
12630
|
+
}, [savedKey]);
|
|
12599
12631
|
const [practiceQuery, setPracticeQuery] = useState23("");
|
|
12600
12632
|
const [locationQuery, setLocationQuery] = useState23("");
|
|
12601
12633
|
const locations = (profile?.locations ?? []).filter((item) => item.active !== false && (item.billingProviderId ? item.billingProviderId === practice : practices.length <= 1));
|
|
@@ -12612,7 +12644,10 @@ function RfaPracticePicker({ profile, value, onChange, managePracticeHref, manag
|
|
|
12612
12644
|
setLocation(chosen?.id ?? "");
|
|
12613
12645
|
onChange({ ...value, name: provider.name, phone: provider.phone ?? "", address: provider.billingStreet ?? "", city: provider.billingCity ?? "", state: provider.billingState ?? "", zip: provider.billingZip ?? "", ...chosen ? located(chosen, provider.phone) : {} });
|
|
12614
12646
|
} }),
|
|
12615
|
-
/* @__PURE__ */
|
|
12647
|
+
/* @__PURE__ */ jsxs36("span", { className: "mbrfa-picker-links", children: [
|
|
12648
|
+
onEditPractice && practice ? /* @__PURE__ */ jsx38("button", { type: "button", className: "mbrfa-link", onClick: () => onEditPractice(practice), children: "Edit practice" }) : null,
|
|
12649
|
+
managePracticeHref ? /* @__PURE__ */ jsx38("a", { className: "mbrfa-link-out", href: managePracticeHref, target: "_blank", rel: "noopener noreferrer", children: onEditPractice ? "Manage practices \u2197" : "Add / manage practices" }) : null
|
|
12650
|
+
] })
|
|
12616
12651
|
] }),
|
|
12617
12652
|
/* @__PURE__ */ jsxs36(RfaPicker, { label: "Practice location", children: [
|
|
12618
12653
|
/* @__PURE__ */ jsx38(RfaIdentitySelect, { label: "Practice location", placeholder: practice ? "Choose a location" : "Choose a practice first", searchPlaceholder: "Search locations", query: locationQuery, onSearch: setLocationQuery, searchable: true, disabled: !practice, value: location, options: locations.filter((item) => item.id === location || item.name.toLowerCase().includes(locationQuery.toLowerCase())).map((item) => ({ id: item.id, label: item.name, detail: `${item.street}, ${item.city}` })), onSelect: (id) => {
|
|
@@ -12622,16 +12657,20 @@ function RfaPracticePicker({ profile, value, onChange, managePracticeHref, manag
|
|
|
12622
12657
|
setLocationQuery("");
|
|
12623
12658
|
onChange({ ...value, ...located(chosen, practices.find((item) => item.id === practice)?.phone) });
|
|
12624
12659
|
} }),
|
|
12625
|
-
/* @__PURE__ */
|
|
12660
|
+
/* @__PURE__ */ jsxs36("span", { className: "mbrfa-picker-links", children: [
|
|
12661
|
+
onEditLocation && practice && location ? /* @__PURE__ */ jsx38("button", { type: "button", className: "mbrfa-link", onClick: () => onEditLocation(location, practice), children: "Edit location" }) : null,
|
|
12662
|
+
onEditLocation && practice ? /* @__PURE__ */ jsx38("button", { type: "button", className: "mbrfa-link", onClick: () => onEditLocation(null, practice), children: "Add location" }) : null,
|
|
12663
|
+
manageLocationsHref ? /* @__PURE__ */ jsx38("a", { className: "mbrfa-link-out", href: manageLocationsHref, target: "_blank", rel: "noopener noreferrer", children: onEditLocation ? "Manage locations \u2197" : "Add / manage locations" }) : null
|
|
12664
|
+
] })
|
|
12626
12665
|
] })
|
|
12627
12666
|
] });
|
|
12628
12667
|
}
|
|
12629
12668
|
|
|
12630
12669
|
// src/rfa-contact-picker.tsx
|
|
12631
|
-
import { useEffect as
|
|
12670
|
+
import { useEffect as useEffect22, useId as useId7, useState as useState25 } from "react";
|
|
12632
12671
|
|
|
12633
12672
|
// src/rfa-draft-fields.tsx
|
|
12634
|
-
import { useEffect as
|
|
12673
|
+
import { useEffect as useEffect21, useId as useId6, useState as useState24 } from "react";
|
|
12635
12674
|
import { Fragment as Fragment22, jsx as jsx39, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
12636
12675
|
function RfaContactFields({ title, value, onChange }) {
|
|
12637
12676
|
return /* @__PURE__ */ jsxs37("fieldset", { children: [
|
|
@@ -12657,7 +12696,7 @@ function RfaDiagnosisFields({ code, description, onChange, search, officialForm
|
|
|
12657
12696
|
const [query, setQuery] = useState24("");
|
|
12658
12697
|
const [results, setResults] = useState24([]);
|
|
12659
12698
|
const [error, setError] = useState24("");
|
|
12660
|
-
|
|
12699
|
+
useEffect21(() => {
|
|
12661
12700
|
let active = true;
|
|
12662
12701
|
setResults([]);
|
|
12663
12702
|
setError("");
|
|
@@ -12732,7 +12771,7 @@ function RfaContactPicker({ administratorId, claimNumber, contextKey, value, onC
|
|
|
12732
12771
|
setActiveIndex(-1);
|
|
12733
12772
|
if (option.id !== administratorId) onChange(option.id, null);
|
|
12734
12773
|
};
|
|
12735
|
-
|
|
12774
|
+
useEffect22(() => {
|
|
12736
12775
|
let active = true;
|
|
12737
12776
|
setDirectory(null);
|
|
12738
12777
|
setError("");
|
|
@@ -12753,7 +12792,7 @@ function RfaContactPicker({ administratorId, claimNumber, contextKey, value, onC
|
|
|
12753
12792
|
active = false;
|
|
12754
12793
|
};
|
|
12755
12794
|
}, [administratorId, contextKey, getClaimsAdministratorDirectory]);
|
|
12756
|
-
|
|
12795
|
+
useEffect22(() => {
|
|
12757
12796
|
let active = true;
|
|
12758
12797
|
setOptions([]);
|
|
12759
12798
|
setSearchError("");
|
|
@@ -12834,7 +12873,7 @@ function RfaContactPicker({ administratorId, claimNumber, contextKey, value, onC
|
|
|
12834
12873
|
}
|
|
12835
12874
|
|
|
12836
12875
|
// src/rfa-draft-form.tsx
|
|
12837
|
-
import { useEffect as
|
|
12876
|
+
import { useEffect as useEffect23, useRef as useRef19, useState as useState26 } from "react";
|
|
12838
12877
|
import { Fragment as Fragment23, jsx as jsx41, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
12839
12878
|
function normalizeRfaDraft(draft2) {
|
|
12840
12879
|
const copy = structuredClone(draft2);
|
|
@@ -12882,9 +12921,9 @@ function validateRfaDraft(draft2) {
|
|
|
12882
12921
|
}
|
|
12883
12922
|
return null;
|
|
12884
12923
|
}
|
|
12885
|
-
function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetails, selectors, managePracticeHref, manageLocationsHref, onRefreshProfile, onReview, onPreview, searchClaimsAdministrators, getClaimsAdministratorDirectory, embedded = false, onSave, onBack, mode = "create", searchDiagnosisCodes, organizationProfile, savedDiagnosisCodes = [], supportingDocuments, disabled = false, ...appearance }) {
|
|
12924
|
+
function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetails, selectors, onEditPractice, onEditLocation, managePracticeHref, manageLocationsHref, onRefreshProfile, onReview, onPreview, searchClaimsAdministrators, getClaimsAdministratorDirectory, embedded = false, onSave, onBack, mode = "create", searchDiagnosisCodes, organizationProfile, savedDiagnosisCodes = [], supportingDocuments, disabled = false, ...appearance }) {
|
|
12886
12925
|
const [savedDraft, setDraft] = useState26(() => normalizeRfaDraft(initialDraft));
|
|
12887
|
-
|
|
12926
|
+
useEffect23(() => {
|
|
12888
12927
|
if (identity) setDraft((current) => {
|
|
12889
12928
|
const next = { ...current };
|
|
12890
12929
|
delete next.providerPhone;
|
|
@@ -12894,14 +12933,22 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
12894
12933
|
}, [identity?.renderingProviderId]);
|
|
12895
12934
|
const savedPhysician = organizationProfile?.renderingProviders?.find((provider) => provider.id === (identity?.renderingProviderId ?? savedDraft.renderingProviderId));
|
|
12896
12935
|
const physicianEmail = savedPhysician?.email;
|
|
12897
|
-
const
|
|
12898
|
-
|
|
12936
|
+
const returnFax = formDetails?.returnFax;
|
|
12937
|
+
useEffect23(() => {
|
|
12938
|
+
if (officialForm && returnFax) setDraft((current) => current.requestingPractice?.fax?.trim() ? current : { ...current, requestingPractice: { ...current.requestingPractice, fax: returnFax } });
|
|
12939
|
+
}, [officialForm, returnFax, savedDraft.requestingPractice?.fax]);
|
|
12940
|
+
const returnEmail = formDetails?.returnEmail;
|
|
12941
|
+
useEffect23(() => {
|
|
12942
|
+
if (officialForm && returnEmail && !physicianEmail) setDraft((current) => current.requestingPractice?.email?.trim() ? current : { ...current, requestingPractice: { ...current.requestingPractice, email: returnEmail } });
|
|
12943
|
+
}, [officialForm, returnEmail, physicianEmail, savedDraft.requestingPractice?.email]);
|
|
12944
|
+
const filledEmail = useRef19(void 0);
|
|
12945
|
+
useEffect23(() => {
|
|
12899
12946
|
if (!officialForm || !physicianEmail) return;
|
|
12900
12947
|
const previous = filledEmail.current;
|
|
12901
12948
|
filledEmail.current = physicianEmail;
|
|
12902
12949
|
setDraft((current) => current.requestingPractice?.email && current.requestingPractice.email !== previous ? current : { ...current, requestingPractice: { ...current.requestingPractice, email: physicianEmail } });
|
|
12903
12950
|
}, [officialForm, physicianEmail]);
|
|
12904
|
-
|
|
12951
|
+
useEffect23(() => {
|
|
12905
12952
|
if (!officialForm || !onRefreshProfile) return;
|
|
12906
12953
|
let last = Date.now();
|
|
12907
12954
|
const refresh = () => {
|
|
@@ -12918,8 +12965,8 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
12918
12965
|
}, [officialForm, onRefreshProfile]);
|
|
12919
12966
|
const [administratorOverride, setAdministratorOverride] = useState26(null);
|
|
12920
12967
|
const identityKey = `${identity?.claimId ?? ""}:${identity?.claimsAdminId ?? ""}`;
|
|
12921
|
-
const previousClaim =
|
|
12922
|
-
|
|
12968
|
+
const previousClaim = useRef19(identityKey);
|
|
12969
|
+
useEffect23(() => {
|
|
12923
12970
|
if (previousClaim.current !== identityKey) {
|
|
12924
12971
|
setAdministratorOverride(null);
|
|
12925
12972
|
setDraft((current) => ({ ...current, authorizationContact: null, ...officialForm ? { items: [{ diagnosisCode: savedDiagnosisCodes[0] ?? "", serviceDescription: "" }] } : {} }));
|
|
@@ -12939,7 +12986,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
12939
12986
|
else delete draft2.claimsAdminId;
|
|
12940
12987
|
}
|
|
12941
12988
|
const [intent, setIntent] = useState26("save");
|
|
12942
|
-
const intentRef =
|
|
12989
|
+
const intentRef = useRef19(intent);
|
|
12943
12990
|
const chooseIntent = (value) => {
|
|
12944
12991
|
intentRef.current = value;
|
|
12945
12992
|
setIntent(value);
|
|
@@ -12989,7 +13036,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
12989
13036
|
event.preventDefault();
|
|
12990
13037
|
if (locked) return;
|
|
12991
13038
|
const next = normalizeRfaDraft(draft2);
|
|
12992
|
-
void action.save(next, validateRfaDraft(next));
|
|
13039
|
+
void action.save(next, validateRfaDraft(next) ?? (officialForm && intentRef.current === "review" && !next.requestingPractice?.fax?.trim() ? "Enter the Requesting Physician fax number. The claims administrator faxes the decision back to it." : null));
|
|
12993
13040
|
};
|
|
12994
13041
|
const saveError = action.error ? /* @__PURE__ */ jsxs39("p", { role: "alert", children: [
|
|
12995
13042
|
action.error,
|
|
@@ -13034,7 +13081,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13034
13081
|
/* @__PURE__ */ jsx41("legend", { children: "Requesting Physician Information" }),
|
|
13035
13082
|
/* @__PURE__ */ jsxs39("div", { className: "mbrfa-pickers", "data-columns": selectors?.physician ? 3 : 2, children: [
|
|
13036
13083
|
selectors?.physician ? /* @__PURE__ */ jsx41(RfaPicker, { label: "Requesting physician", children: selectors.physician }) : null,
|
|
13037
|
-
/* @__PURE__ */ jsx41(RfaPracticePicker, { profile: organizationProfile, value: draft2.requestingPractice, onChange: (requestingPractice) => update({ requestingPractice }), ...managePracticeHref ? { managePracticeHref } : {}, ...manageLocationsHref ? { manageLocationsHref } : {} })
|
|
13084
|
+
/* @__PURE__ */ jsx41(RfaPracticePicker, { profile: organizationProfile, value: draft2.requestingPractice, onChange: (requestingPractice) => update({ requestingPractice }), ...managePracticeHref ? { managePracticeHref } : {}, ...manageLocationsHref ? { manageLocationsHref } : {}, onEditPractice, onEditLocation })
|
|
13038
13085
|
] }),
|
|
13039
13086
|
/* @__PURE__ */ jsx41("fieldset", { className: "mbrfa-plain", disabled: locked, children: /* @__PURE__ */ jsx41(
|
|
13040
13087
|
RfaOfficialContactFields,
|
|
@@ -13042,7 +13089,8 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13042
13089
|
nameLabel: "Practice Name",
|
|
13043
13090
|
value: draft2.requestingPractice,
|
|
13044
13091
|
onChange: (requestingPractice) => update({ requestingPractice }),
|
|
13045
|
-
|
|
13092
|
+
faxHint: "Required to send. The decision is faxed back here. Save it on the practice location to fill it automatically.",
|
|
13093
|
+
before: /* @__PURE__ */ jsx41(RfaSavedField, { span: 6, label: "Physician Name", value: draft2.providerName }),
|
|
13046
13094
|
beforeEmail: /* @__PURE__ */ jsxs39(Fragment23, { children: [
|
|
13047
13095
|
/* @__PURE__ */ jsx41(RfaSavedField, { span: 3, label: "Specialty", value: formDetails?.physician?.specialty ?? savedPhysician?.specialty }),
|
|
13048
13096
|
/* @__PURE__ */ jsx41(RfaSavedField, { span: 3, label: "NPI Number", value: draft2.providerNpi })
|
|
@@ -13281,7 +13329,7 @@ function SavedIdentityForm({ client, claimId, renderingProviderId, onSave, canCr
|
|
|
13281
13329
|
const [loading, setLoading] = useState27(true);
|
|
13282
13330
|
const [error, setError] = useState27("");
|
|
13283
13331
|
const [reload, setReload] = useState27(0);
|
|
13284
|
-
|
|
13332
|
+
useEffect24(() => {
|
|
13285
13333
|
let active = true;
|
|
13286
13334
|
setLoading(true);
|
|
13287
13335
|
setError("");
|
|
@@ -13321,7 +13369,7 @@ function SavedIdentityForm({ client, claimId, renderingProviderId, onSave, canCr
|
|
|
13321
13369
|
};
|
|
13322
13370
|
}, [client, query, effectiveClaimId, effectiveProviderId, renderingProviderId, reload]);
|
|
13323
13371
|
const refreshOnReturn = !!draftFormProps?.officialForm;
|
|
13324
|
-
|
|
13372
|
+
useEffect24(() => {
|
|
13325
13373
|
if (!refreshOnReturn) return;
|
|
13326
13374
|
let last = Date.now();
|
|
13327
13375
|
const refresh = () => {
|
|
@@ -13339,11 +13387,11 @@ function SavedIdentityForm({ client, claimId, renderingProviderId, onSave, canCr
|
|
|
13339
13387
|
const claim = context?.claims.find((value) => value.claimId === selectedClaim);
|
|
13340
13388
|
const provider = context?.renderingProviders.find((value) => value.id === selectedProvider);
|
|
13341
13389
|
const locked = disabled || loading;
|
|
13342
|
-
|
|
13390
|
+
useEffect24(() => {
|
|
13343
13391
|
const timer = setTimeout(() => setQuery((value) => value.search === searchInput.trim() ? value : { ...value, search: searchInput.trim(), cursor: "" }), 300);
|
|
13344
13392
|
return () => clearTimeout(timer);
|
|
13345
13393
|
}, [searchInput]);
|
|
13346
|
-
|
|
13394
|
+
useEffect24(() => {
|
|
13347
13395
|
const timer = setTimeout(() => setQuery((value) => value.providerSearch === providerSearchInput.trim() ? value : { ...value, providerSearch: providerSearchInput.trim(), providerCursor: "" }), 300);
|
|
13348
13396
|
return () => clearTimeout(timer);
|
|
13349
13397
|
}, [providerSearchInput]);
|
|
@@ -13485,7 +13533,9 @@ function SavedIdentityForm({ client, claimId, renderingProviderId, onSave, canCr
|
|
|
13485
13533
|
const selectedDetails = useRfaFormDetails(client, claim?.claimId ?? "", provider?.id ?? "", official && !!claim && !effectiveClaimId);
|
|
13486
13534
|
const formDetails = {
|
|
13487
13535
|
...claim ? { employee: selectedDetails?.employee ?? { formName: claim.employeeFormName, dateOfBirth: claim.dateOfBirth, employer: claim.employer } } : {},
|
|
13488
|
-
...provider ? { physician: { specialty: provider.specialty } } : {}
|
|
13536
|
+
...provider ? { physician: { specialty: provider.specialty } } : {},
|
|
13537
|
+
...context?.returnFax ? { returnFax: context.returnFax } : {},
|
|
13538
|
+
...context?.returnEmail ? { returnEmail: context.returnEmail } : {}
|
|
13489
13539
|
};
|
|
13490
13540
|
return /* @__PURE__ */ jsxs40(TreatmentDraftShell, { ...appearance, title: "New authorization request", description: official ? "DWC Form RFA" : renderClaimSelector ? "Choose a patient, then select their injury / claim. Complete the treatment and attach supporting documents below." : "Choose an existing claim or add a new patient and injury here. Complete the treatment and attach supporting documents below.", children: [
|
|
13491
13541
|
addingClaim ? /* @__PURE__ */ jsx42(RfaClaimSetup, { client, disabled, onCancel: () => setAddingClaim(false), onCreated: (result) => {
|
|
@@ -13596,7 +13646,7 @@ function rfaDraftReplacement(draft2, expectedRevision) {
|
|
|
13596
13646
|
}
|
|
13597
13647
|
|
|
13598
13648
|
// src/rfa-lifecycle-controls.tsx
|
|
13599
|
-
import { useEffect as
|
|
13649
|
+
import { useEffect as useEffect25, useMemo as useMemo11, useRef as useRef20, useState as useState28 } from "react";
|
|
13600
13650
|
import { createRfaClient as createRfaClient3, createRfaLifecycleClient as createRfaLifecycleClient3 } from "@mindbill/browser";
|
|
13601
13651
|
import { Fragment as Fragment25, jsx as jsx43, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
13602
13652
|
var text2 = (form, name) => String(form.get(name) ?? "").trim();
|
|
@@ -13615,7 +13665,7 @@ function RfaLifecycleControls({ sessionEndpoint, getSession, apiBaseUrl, fetch:
|
|
|
13615
13665
|
}
|
|
13616
13666
|
function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdated, selectedResponseDocumentId, rows: rows3 = false, ...appearance }) {
|
|
13617
13667
|
const [rfa, setRfa] = useState28(providedRfa);
|
|
13618
|
-
|
|
13668
|
+
useEffect25(() => {
|
|
13619
13669
|
setRfa(providedRfa);
|
|
13620
13670
|
}, [providedRfa]);
|
|
13621
13671
|
const client = useMemo11(() => createRfaLifecycleClient3(options), [options]);
|
|
@@ -13631,7 +13681,7 @@ function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdat
|
|
|
13631
13681
|
const [responsePdf, setResponsePdf] = useState28(null);
|
|
13632
13682
|
const [previewError, setPreviewError] = useState28("");
|
|
13633
13683
|
const [previewReload, setPreviewReload] = useState28(0);
|
|
13634
|
-
|
|
13684
|
+
useEffect25(() => {
|
|
13635
13685
|
let active = true;
|
|
13636
13686
|
setResponsePdf(null);
|
|
13637
13687
|
setPreviewError("");
|
|
@@ -13647,16 +13697,16 @@ function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdat
|
|
|
13647
13697
|
};
|
|
13648
13698
|
}, [records, rfa.id, responseDocument, rfa.documents, previewReload]);
|
|
13649
13699
|
const [outcomes, setOutcomes] = useState28({});
|
|
13650
|
-
const alive =
|
|
13651
|
-
const pending =
|
|
13652
|
-
const keys =
|
|
13653
|
-
|
|
13700
|
+
const alive = useRef20(true);
|
|
13701
|
+
const pending = useRef20(false);
|
|
13702
|
+
const keys = useRef20(/* @__PURE__ */ new Map());
|
|
13703
|
+
useEffect25(() => {
|
|
13654
13704
|
alive.current = true;
|
|
13655
13705
|
return () => {
|
|
13656
13706
|
alive.current = false;
|
|
13657
13707
|
};
|
|
13658
13708
|
}, []);
|
|
13659
|
-
|
|
13709
|
+
useEffect25(() => {
|
|
13660
13710
|
let active = true;
|
|
13661
13711
|
(async () => {
|
|
13662
13712
|
const found = [];
|
|
@@ -13682,7 +13732,7 @@ function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdat
|
|
|
13682
13732
|
active = false;
|
|
13683
13733
|
};
|
|
13684
13734
|
}, [client, rfa.claimId, rfa.id, rfa.updatedAt, reload]);
|
|
13685
|
-
|
|
13735
|
+
useEffect25(() => {
|
|
13686
13736
|
const refresh = () => {
|
|
13687
13737
|
if (!pending.current && document.visibilityState !== "hidden" && !document.activeElement?.closest("form")) setReload((value) => value + 1);
|
|
13688
13738
|
};
|
|
@@ -14080,7 +14130,7 @@ function FollowUpForm({ task, selected, editable, disabled, onSave, onReview, ha
|
|
|
14080
14130
|
}
|
|
14081
14131
|
|
|
14082
14132
|
// src/rfa-provider-signature-setup.tsx
|
|
14083
|
-
import { useRef as
|
|
14133
|
+
import { useRef as useRef21, useState as useState29 } from "react";
|
|
14084
14134
|
import { jsx as jsx44, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
14085
14135
|
function RfaProviderSignatureSetup(props) {
|
|
14086
14136
|
return /* @__PURE__ */ jsx44(SignatureForm, { ...props }, props.renderingProviderId);
|
|
@@ -14091,7 +14141,7 @@ function SignatureForm({ client, renderingProviderId, providerName, disabled, on
|
|
|
14091
14141
|
const [authorized, setAuthorized] = useState29(false);
|
|
14092
14142
|
const [busy, setBusy] = useState29(false);
|
|
14093
14143
|
const [error, setError] = useState29("");
|
|
14094
|
-
const attempt =
|
|
14144
|
+
const attempt = useRef21(null);
|
|
14095
14145
|
return /* @__PURE__ */ jsx44("form", { onSubmit: async (event) => {
|
|
14096
14146
|
event.preventDefault();
|
|
14097
14147
|
if (busy || disabled || !file || !authorized || !actor.trim() || !client.saveProviderSignature) return;
|
|
@@ -14169,9 +14219,9 @@ function RfaDashboard({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOve
|
|
|
14169
14219
|
const identity = useMemo12(() => ({ client, signatureClient, key: key() }), [client, signatureClient]);
|
|
14170
14220
|
return /* @__PURE__ */ jsx45(RfaDashboardContent, { ...props, ...patientId ? { patientId } : {}, ...claimId ? { claimId } : {}, ...renderingProviderId ? { renderingProviderId } : {}, client, signatureClient, options }, `${identity.key}:${patientId ?? ""}:${claimId ?? ""}:${renderingProviderId ?? ""}`);
|
|
14171
14221
|
}
|
|
14172
|
-
function RfaDashboardContent({ client, signatureClient, options, patientId, claimId, renderingProviderId, initialDraft, initialView = "overview", initialOverviewView, initialStatus = "", initialAgingBucket = "", taskPresentation, taskQuery: taskQuery2, renderTaskIdentity, navigation, permissions = [], canCreateClaim = false, renderClaimSelector, renderProviderSelector, officialForm = false, managePracticeHref, manageLocationsHref, onPreviewRequest, canManageProviderSignatures = false, environment = "sandbox", actorReference, onCreated, onContinue, selectedRfaId, selectedTreatmentId, selectedResponseDocumentId: controlledResponseDocumentId, onSelectRfa, getRfaHref, getPatientHref, getClaimHref, getProviderHref, formPreviewUrl, hideBackButton = false, hideHeading = false, layout = "classic", ...appearance }) {
|
|
14173
|
-
const active =
|
|
14174
|
-
|
|
14222
|
+
function RfaDashboardContent({ client, signatureClient, options, patientId, claimId, renderingProviderId, initialDraft, initialView = "overview", initialOverviewView, initialStatus = "", initialAgingBucket = "", taskPresentation, taskQuery: taskQuery2, renderTaskIdentity, navigation, permissions = [], canCreateClaim = false, renderClaimSelector, renderProviderSelector, officialForm = false, managePracticeHref, onEditPractice, onEditLocation, manageLocationsHref, onPreviewRequest, canManageProviderSignatures = false, environment = "sandbox", actorReference, onCreated, onContinue, selectedRfaId, selectedTreatmentId, selectedResponseDocumentId: controlledResponseDocumentId, onSelectRfa, getRfaHref, getPatientHref, getClaimHref, getProviderHref, formPreviewUrl, hideBackButton = false, hideHeading = false, layout = "classic", ...appearance }) {
|
|
14223
|
+
const active = useRef22(true);
|
|
14224
|
+
useEffect26(() => {
|
|
14175
14225
|
active.current = true;
|
|
14176
14226
|
return () => {
|
|
14177
14227
|
active.current = false;
|
|
@@ -14179,7 +14229,7 @@ function RfaDashboardContent({ client, signatureClient, options, patientId, clai
|
|
|
14179
14229
|
}, []);
|
|
14180
14230
|
const references = useMemo12(() => createBillReferenceClient2(options), [options]);
|
|
14181
14231
|
const [profile, setProfile] = useState30();
|
|
14182
|
-
const draftFormProps = { officialForm, ...managePracticeHref ? { managePracticeHref } : {}, ...manageLocationsHref ? { manageLocationsHref } : {}, onRefreshProfile: async () => {
|
|
14232
|
+
const draftFormProps = { officialForm, ...onEditPractice ? { onEditPractice } : {}, ...onEditLocation ? { onEditLocation } : {}, ...managePracticeHref ? { managePracticeHref } : {}, ...manageLocationsHref ? { manageLocationsHref } : {}, onRefreshProfile: async () => {
|
|
14183
14233
|
const next = await createOrganizationClient4(options).getBillingProfile();
|
|
14184
14234
|
if (active.current) setProfile(next);
|
|
14185
14235
|
}, ...client.searchClaimsAdministrators ? { searchClaimsAdministrators: client.searchClaimsAdministrators } : {}, ...client.getClaimsAdministratorDirectory ? { getClaimsAdministratorDirectory: client.getClaimsAdministratorDirectory } : {}, searchDiagnosisCodes: references.searchDiagnosisCodes, ...profile ? { organizationProfile: profile } : {} };
|
|
@@ -14219,7 +14269,7 @@ function RfaDashboardContent({ client, signatureClient, options, patientId, clai
|
|
|
14219
14269
|
setSelectedResponseDocumentId(context?.responseDocumentId);
|
|
14220
14270
|
setSelected(id);
|
|
14221
14271
|
};
|
|
14222
|
-
|
|
14272
|
+
useEffect26(() => {
|
|
14223
14273
|
if (!creating && !selected) return;
|
|
14224
14274
|
let active2 = true;
|
|
14225
14275
|
createOrganizationClient4(options).getBillingProfile().then((value) => {
|
|
@@ -14231,8 +14281,8 @@ function RfaDashboardContent({ client, signatureClient, options, patientId, clai
|
|
|
14231
14281
|
};
|
|
14232
14282
|
}, [options, creating, selected]);
|
|
14233
14283
|
const [loading, setLoading] = useState30(true);
|
|
14234
|
-
const createKeys =
|
|
14235
|
-
|
|
14284
|
+
const createKeys = useRef22(/* @__PURE__ */ new Map());
|
|
14285
|
+
useEffect26(() => {
|
|
14236
14286
|
const timer = setTimeout(() => {
|
|
14237
14287
|
setSearch(searchInput.trim());
|
|
14238
14288
|
setCursor(void 0);
|
|
@@ -14240,7 +14290,7 @@ function RfaDashboardContent({ client, signatureClient, options, patientId, clai
|
|
|
14240
14290
|
}, 300);
|
|
14241
14291
|
return () => clearTimeout(timer);
|
|
14242
14292
|
}, [searchInput]);
|
|
14243
|
-
|
|
14293
|
+
useEffect26(() => {
|
|
14244
14294
|
if (selected || creating) return;
|
|
14245
14295
|
let alive = true;
|
|
14246
14296
|
let pending = false;
|
|
@@ -14438,20 +14488,20 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14438
14488
|
setDetailTab("details");
|
|
14439
14489
|
setTimeout(() => document.getElementById(`${tabId}-${suffix}`)?.scrollIntoView?.({ block: "start", behavior: "smooth" }), 0);
|
|
14440
14490
|
};
|
|
14441
|
-
|
|
14491
|
+
useEffect26(() => {
|
|
14442
14492
|
if (selectedItem || selectedResponseDocumentId) setDetailTab("details");
|
|
14443
14493
|
}, [selectedResponseDocumentId, selectedItem]);
|
|
14444
|
-
const responseFocused =
|
|
14445
|
-
|
|
14494
|
+
const responseFocused = useRef22(false);
|
|
14495
|
+
useEffect26(() => {
|
|
14446
14496
|
if (simple && rfa && selectedResponseDocumentId && !responseFocused.current) {
|
|
14447
14497
|
responseFocused.current = true;
|
|
14448
14498
|
document.getElementById(`${tabId}-review`)?.scrollIntoView?.({ block: "start" });
|
|
14449
14499
|
}
|
|
14450
14500
|
}, [simple, rfa, selectedResponseDocumentId, tabId]);
|
|
14451
|
-
const alive =
|
|
14452
|
-
const pending =
|
|
14453
|
-
const loadGeneration =
|
|
14454
|
-
const keys =
|
|
14501
|
+
const alive = useRef22(true);
|
|
14502
|
+
const pending = useRef22(false);
|
|
14503
|
+
const loadGeneration = useRef22(0);
|
|
14504
|
+
const keys = useRef22(/* @__PURE__ */ new Map());
|
|
14455
14505
|
const [descriptions2, setDescriptions] = useState30({});
|
|
14456
14506
|
const [preview, setPreview] = useState30(null);
|
|
14457
14507
|
const [previewPdf, setPreviewPdf] = useState30(null);
|
|
@@ -14463,7 +14513,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14463
14513
|
const [directoryError, setDirectoryError] = useState30(null);
|
|
14464
14514
|
const [directoryOpen, setDirectoryOpen] = useState30(false);
|
|
14465
14515
|
const [openedDocument, setOpenedDocument] = useState30(null);
|
|
14466
|
-
|
|
14516
|
+
useEffect26(() => {
|
|
14467
14517
|
alive.current = true;
|
|
14468
14518
|
return () => {
|
|
14469
14519
|
alive.current = false;
|
|
@@ -14481,7 +14531,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14481
14531
|
const currentForm = forms.sort((a, b) => (b.createdAt ?? "").localeCompare(a.createdAt ?? ""))[0];
|
|
14482
14532
|
setDocumentIds(value.documents.filter((document2) => document2.id === currentForm?.id || ["clinical_report", "supporting_record"].includes(document2.documentType)).map((document2) => document2.id));
|
|
14483
14533
|
};
|
|
14484
|
-
|
|
14534
|
+
useEffect26(() => {
|
|
14485
14535
|
let active = true;
|
|
14486
14536
|
const generation = ++loadGeneration.current;
|
|
14487
14537
|
setError("");
|
|
@@ -14494,9 +14544,9 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14494
14544
|
active = false;
|
|
14495
14545
|
};
|
|
14496
14546
|
}, [client, id, reload]);
|
|
14497
|
-
const currentRfa =
|
|
14547
|
+
const currentRfa = useRef22(rfa);
|
|
14498
14548
|
currentRfa.current = rfa;
|
|
14499
|
-
|
|
14549
|
+
useEffect26(() => {
|
|
14500
14550
|
let active = true;
|
|
14501
14551
|
let reading = false;
|
|
14502
14552
|
const refresh = async () => {
|
|
@@ -14526,8 +14576,8 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14526
14576
|
document.removeEventListener("visibilitychange", resume);
|
|
14527
14577
|
};
|
|
14528
14578
|
}, [client, id, editing]);
|
|
14529
|
-
const focusedTreatment =
|
|
14530
|
-
|
|
14579
|
+
const focusedTreatment = useRef22(null);
|
|
14580
|
+
useEffect26(() => {
|
|
14531
14581
|
if (!rfa || !selectedItem || focusedTreatment.current === selectedItem) return;
|
|
14532
14582
|
const element = document.getElementById(`rfa-treatment-${selectedItem}`);
|
|
14533
14583
|
if (element) {
|
|
@@ -14537,7 +14587,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14537
14587
|
}
|
|
14538
14588
|
}, [rfa, selectedItem, detailTab]);
|
|
14539
14589
|
const claimsAdminId = rfa?.claimsAdminId;
|
|
14540
|
-
|
|
14590
|
+
useEffect26(() => {
|
|
14541
14591
|
let active = true;
|
|
14542
14592
|
setDirectory(null);
|
|
14543
14593
|
setDirectoryError(null);
|
|
@@ -15903,7 +15953,7 @@ function BillSubmissionsRibbon({
|
|
|
15903
15953
|
}
|
|
15904
15954
|
|
|
15905
15955
|
// src/report-bill-status-dialog.tsx
|
|
15906
|
-
import { useEffect as
|
|
15956
|
+
import { useEffect as useEffect27, useState as useState32 } from "react";
|
|
15907
15957
|
import {
|
|
15908
15958
|
REPORT_BILL_STATUS_OPTIONS
|
|
15909
15959
|
} from "@mindbill/browser";
|
|
@@ -16124,7 +16174,7 @@ function ReportBillStatusDialog({
|
|
|
16124
16174
|
const [phone, setPhone] = useState32("");
|
|
16125
16175
|
const [callReference, setCallReference] = useState32("");
|
|
16126
16176
|
const [note, setNote] = useState32("");
|
|
16127
|
-
|
|
16177
|
+
useEffect27(() => {
|
|
16128
16178
|
const onKey = (event) => {
|
|
16129
16179
|
if (event.key === "Escape" && !submitting) onCancel();
|
|
16130
16180
|
};
|
|
@@ -16259,7 +16309,7 @@ function ReportBillStatusDialog({
|
|
|
16259
16309
|
}
|
|
16260
16310
|
|
|
16261
16311
|
// src/payment-review.tsx
|
|
16262
|
-
import { useEffect as
|
|
16312
|
+
import { useEffect as useEffect28, useMemo as useMemo15, useState as useState33 } from "react";
|
|
16263
16313
|
|
|
16264
16314
|
// src/billing-operations-client.ts
|
|
16265
16315
|
import {
|
|
@@ -16434,7 +16484,7 @@ function ConnectedPaymentReview({ initialQuery, onSelectBill, onPostPayment, app
|
|
|
16434
16484
|
const [error, setError] = useState33(false);
|
|
16435
16485
|
const [retry, setRetry] = useState33(0);
|
|
16436
16486
|
const invalidRange = Boolean(query.receivedFrom && query.receivedTo && query.receivedFrom > query.receivedTo);
|
|
16437
|
-
|
|
16487
|
+
useEffect28(() => {
|
|
16438
16488
|
const controller = new AbortController();
|
|
16439
16489
|
setResult(null);
|
|
16440
16490
|
setError(false);
|
|
@@ -16561,7 +16611,7 @@ function ConnectedPaymentReview({ initialQuery, onSelectBill, onPostPayment, app
|
|
|
16561
16611
|
}
|
|
16562
16612
|
|
|
16563
16613
|
// src/notification-settings.tsx
|
|
16564
|
-
import { useEffect as
|
|
16614
|
+
import { useEffect as useEffect29, useId as useId10, useRef as useRef23, useState as useState34 } from "react";
|
|
16565
16615
|
import { Fragment as Fragment31, jsx as jsx54, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
16566
16616
|
function defaultNotificationPreferences() {
|
|
16567
16617
|
return { enabled: false, statusUpdates: false, agingDays: [], quietHours: true, reportDigest: "off" };
|
|
@@ -16603,8 +16653,8 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
|
|
|
16603
16653
|
const [notice, setNotice] = useState34("");
|
|
16604
16654
|
const [failed, setFailed] = useState34(false);
|
|
16605
16655
|
const [reload, setReload] = useState34(0);
|
|
16606
|
-
const request =
|
|
16607
|
-
|
|
16656
|
+
const request = useRef23(0);
|
|
16657
|
+
useEffect29(() => {
|
|
16608
16658
|
const current = ++request.current;
|
|
16609
16659
|
setPhase("loading");
|
|
16610
16660
|
setSnapshot(null);
|
|
@@ -16747,7 +16797,7 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
|
|
|
16747
16797
|
}
|
|
16748
16798
|
|
|
16749
16799
|
// src/notification-recipients.tsx
|
|
16750
|
-
import { useEffect as
|
|
16800
|
+
import { useEffect as useEffect30, useId as useId11, useRef as useRef24, useState as useState35 } from "react";
|
|
16751
16801
|
import { jsx as jsx55, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
16752
16802
|
function notificationRecipientInvitation(input, requestId) {
|
|
16753
16803
|
const preferences = notificationSettingsUpdate({ ...input, enabled: false }, false);
|
|
@@ -16788,9 +16838,9 @@ function RecipientSettingsSession({ adapter, appearance, className, style }) {
|
|
|
16788
16838
|
const [notice, setNotice] = useState35("");
|
|
16789
16839
|
const [failed, setFailed] = useState35(false);
|
|
16790
16840
|
const [hasReceipt, setHasReceipt] = useState35(false);
|
|
16791
|
-
const generation =
|
|
16792
|
-
const pending =
|
|
16793
|
-
|
|
16841
|
+
const generation = useRef24(0);
|
|
16842
|
+
const pending = useRef24(null);
|
|
16843
|
+
useEffect30(() => {
|
|
16794
16844
|
const current = ++generation.current;
|
|
16795
16845
|
setBusy(true);
|
|
16796
16846
|
setSnapshot(null);
|
|
@@ -16945,9 +16995,9 @@ function RecipientSettingsSession({ adapter, appearance, className, style }) {
|
|
|
16945
16995
|
// src/connected-bill-status.tsx
|
|
16946
16996
|
import {
|
|
16947
16997
|
useCallback as useCallback4,
|
|
16948
|
-
useEffect as
|
|
16998
|
+
useEffect as useEffect31,
|
|
16949
16999
|
useMemo as useMemo16,
|
|
16950
|
-
useRef as
|
|
17000
|
+
useRef as useRef25,
|
|
16951
17001
|
useState as useState36
|
|
16952
17002
|
} from "react";
|
|
16953
17003
|
import {
|
|
@@ -17098,12 +17148,12 @@ function useBillStatus({
|
|
|
17098
17148
|
const [error, setError] = useState36(null);
|
|
17099
17149
|
const [isLoading, setIsLoading] = useState36(enabled && !initialData);
|
|
17100
17150
|
const [isRefreshing, setIsRefreshing] = useState36(false);
|
|
17101
|
-
const dataRef =
|
|
17102
|
-
const initialDataRef =
|
|
17151
|
+
const dataRef = useRef25(initialData);
|
|
17152
|
+
const initialDataRef = useRef25(initialData);
|
|
17103
17153
|
initialDataRef.current = initialData;
|
|
17104
|
-
const activeControllerRef =
|
|
17105
|
-
const requestSequence =
|
|
17106
|
-
|
|
17154
|
+
const activeControllerRef = useRef25(null);
|
|
17155
|
+
const requestSequence = useRef25(0);
|
|
17156
|
+
useEffect31(() => {
|
|
17107
17157
|
const seed = initialDataRef.current;
|
|
17108
17158
|
dataRef.current = seed;
|
|
17109
17159
|
setData(seed);
|
|
@@ -17144,10 +17194,10 @@ function useBillStatus({
|
|
|
17144
17194
|
}
|
|
17145
17195
|
}
|
|
17146
17196
|
}, [billId, client, enabled]);
|
|
17147
|
-
|
|
17197
|
+
useEffect31(() => {
|
|
17148
17198
|
if (enabled) void load();
|
|
17149
17199
|
}, [enabled, load]);
|
|
17150
|
-
|
|
17200
|
+
useEffect31(() => {
|
|
17151
17201
|
if (!enabled || refreshInterval <= 0) return;
|
|
17152
17202
|
const timer = window.setInterval(() => void load(), refreshInterval);
|
|
17153
17203
|
const onFocus = () => void load();
|
|
@@ -17205,7 +17255,7 @@ function ConnectedBillStatus({
|
|
|
17205
17255
|
}
|
|
17206
17256
|
|
|
17207
17257
|
// src/bill-lifecycle-surfaces.tsx
|
|
17208
|
-
import { useEffect as
|
|
17258
|
+
import { useEffect as useEffect32, useRef as useRef26, useState as useState37 } from "react";
|
|
17209
17259
|
import { Fragment as Fragment33, jsx as jsx57, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
17210
17260
|
function visibleBillLifecycleActions(actions2, showUnavailable = false, maxVisible) {
|
|
17211
17261
|
const visible = actions2.filter((action) => action.enabled || showUnavailable);
|
|
@@ -17283,8 +17333,8 @@ function historyDate(iso) {
|
|
|
17283
17333
|
}
|
|
17284
17334
|
function BillHistoryTable({ entries, selectedEntryId, emptyLabel = "No bill history yet.", appearance, className, style, formatDate = historyDate, documentHref, onOpenDocument }) {
|
|
17285
17335
|
const [expanded, setExpanded] = useState37({});
|
|
17286
|
-
const selectedRowRef =
|
|
17287
|
-
|
|
17336
|
+
const selectedRowRef = useRef26(null);
|
|
17337
|
+
useEffect32(() => {
|
|
17288
17338
|
if (!selectedEntryId) return;
|
|
17289
17339
|
const selected = entries.find((entry) => entry.id === selectedEntryId);
|
|
17290
17340
|
if (selected?.details) setExpanded((current) => current[selectedEntryId] ? current : { ...current, [selectedEntryId]: true });
|
|
@@ -17843,9 +17893,9 @@ var lifecycleSurfaceStyles = `
|
|
|
17843
17893
|
// src/connected-bill-lifecycle.tsx
|
|
17844
17894
|
import {
|
|
17845
17895
|
useCallback as useCallback5,
|
|
17846
|
-
useEffect as
|
|
17896
|
+
useEffect as useEffect33,
|
|
17847
17897
|
useMemo as useMemo18,
|
|
17848
|
-
useRef as
|
|
17898
|
+
useRef as useRef27,
|
|
17849
17899
|
useState as useState39
|
|
17850
17900
|
} from "react";
|
|
17851
17901
|
import {
|
|
@@ -18237,7 +18287,7 @@ function useBillLifecycle({
|
|
|
18237
18287
|
const [isLoading, setIsLoading] = useState39(enabled);
|
|
18238
18288
|
const [isRefreshing, setIsRefreshing] = useState39(false);
|
|
18239
18289
|
const [isMutating, setIsMutating] = useState39(false);
|
|
18240
|
-
const mounted =
|
|
18290
|
+
const mounted = useRef27(true);
|
|
18241
18291
|
const client = useMemo18(() => createBillLifecycleClient({
|
|
18242
18292
|
billId: providedBillId,
|
|
18243
18293
|
sessionEndpoint,
|
|
@@ -18245,12 +18295,12 @@ function useBillLifecycle({
|
|
|
18245
18295
|
apiBaseUrl,
|
|
18246
18296
|
fetch: fetchOverride
|
|
18247
18297
|
}), [apiBaseUrl, fetchOverride, getSession, providedBillId, sessionEndpoint]);
|
|
18248
|
-
|
|
18298
|
+
useEffect33(() => {
|
|
18249
18299
|
setData(null);
|
|
18250
18300
|
setError(null);
|
|
18251
18301
|
setIsLoading(enabled);
|
|
18252
18302
|
}, [enabled, providedBillId]);
|
|
18253
|
-
|
|
18303
|
+
useEffect33(() => {
|
|
18254
18304
|
mounted.current = true;
|
|
18255
18305
|
return () => {
|
|
18256
18306
|
mounted.current = false;
|
|
@@ -18274,7 +18324,7 @@ function useBillLifecycle({
|
|
|
18274
18324
|
}
|
|
18275
18325
|
}
|
|
18276
18326
|
}, [client, enabled]);
|
|
18277
|
-
|
|
18327
|
+
useEffect33(() => {
|
|
18278
18328
|
if (!enabled) return;
|
|
18279
18329
|
void refresh();
|
|
18280
18330
|
const interval2 = refreshInterval > 0 ? window.setInterval(() => void refresh(), refreshInterval) : null;
|
|
@@ -18400,10 +18450,10 @@ function useBillLifecycle({
|
|
|
18400
18450
|
};
|
|
18401
18451
|
}
|
|
18402
18452
|
function LifecycleDialog({ children, title, wide = false, onClose }) {
|
|
18403
|
-
const dialog =
|
|
18404
|
-
const onCloseRef =
|
|
18453
|
+
const dialog = useRef27(null);
|
|
18454
|
+
const onCloseRef = useRef27(onClose);
|
|
18405
18455
|
onCloseRef.current = onClose;
|
|
18406
|
-
|
|
18456
|
+
useEffect33(() => {
|
|
18407
18457
|
const previous = document.activeElement;
|
|
18408
18458
|
dialog.current?.focus();
|
|
18409
18459
|
const onKeyDown = (event) => event.key === "Escape" && onCloseRef.current();
|
|
@@ -18695,11 +18745,11 @@ function ConnectedBillLifecycle({
|
|
|
18695
18745
|
const [payment, setPayment] = useState39({ amount: 0, penaltyAmount: 0, interestAmount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
|
|
18696
18746
|
const [duplicateError, setDuplicateError] = useState39("");
|
|
18697
18747
|
const currentAttemptKey = data?.attempts?.find((attempt) => attempt.isCurrent)?.id ?? data?.history?.filter((entry) => entry.kind === "submission").at(-1)?.id ?? data?.bill.id;
|
|
18698
|
-
|
|
18748
|
+
useEffect33(() => {
|
|
18699
18749
|
setPanel("");
|
|
18700
18750
|
}, [currentAttemptKey]);
|
|
18701
18751
|
const actor = actorName?.trim() ? { actorName: actorName.trim() } : {};
|
|
18702
|
-
const lastData =
|
|
18752
|
+
const lastData = useRef27(null);
|
|
18703
18753
|
const correctionInitialBill = useMemo18(() => data ? correctionBill(data) : null, [data]);
|
|
18704
18754
|
const correctionAttachments = useMemo18(() => data ? data.bill.attachments.map((attachment) => {
|
|
18705
18755
|
const documentType = correctionDocumentType(attachment.documentType);
|
|
@@ -18716,7 +18766,7 @@ function ConnectedBillLifecycle({
|
|
|
18716
18766
|
};
|
|
18717
18767
|
}) : [], [data, lifecycle]);
|
|
18718
18768
|
const correctionAttentionFields = useMemo18(() => data?.rejection?.issues?.flatMap((issue) => issue.fieldPaths || []).filter((path, index, fields2) => fields2.indexOf(path) === index) || [], [data]);
|
|
18719
|
-
|
|
18769
|
+
useEffect33(() => {
|
|
18720
18770
|
if (!data || data === lastData.current) return;
|
|
18721
18771
|
lastData.current = data;
|
|
18722
18772
|
onChanged?.(data);
|
|
@@ -19210,11 +19260,11 @@ var CONNECTED_LIFECYCLE_STYLES = `
|
|
|
19210
19260
|
// src/connected-billing-workspace.tsx
|
|
19211
19261
|
import {
|
|
19212
19262
|
useCallback as useCallback6,
|
|
19213
|
-
useEffect as
|
|
19263
|
+
useEffect as useEffect34,
|
|
19214
19264
|
useId as useId12,
|
|
19215
19265
|
useLayoutEffect,
|
|
19216
19266
|
useMemo as useMemo19,
|
|
19217
|
-
useRef as
|
|
19267
|
+
useRef as useRef28,
|
|
19218
19268
|
useState as useState40
|
|
19219
19269
|
} from "react";
|
|
19220
19270
|
import { Fragment as Fragment36, jsx as jsx60, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
@@ -19270,7 +19320,7 @@ function Surface({ appearance, className = "", style, children, surfaceRef }) {
|
|
|
19270
19320
|
] });
|
|
19271
19321
|
}
|
|
19272
19322
|
function useAvailableViewportHeight() {
|
|
19273
|
-
const workspaceRef =
|
|
19323
|
+
const workspaceRef = useRef28(null);
|
|
19274
19324
|
const [availableHeight, setAvailableHeight] = useState40(null);
|
|
19275
19325
|
useLayoutEffect(() => {
|
|
19276
19326
|
const element = workspaceRef.current;
|
|
@@ -19327,7 +19377,7 @@ function BillSearchContent({
|
|
|
19327
19377
|
if (!signal?.aborted) setLoading(false);
|
|
19328
19378
|
}
|
|
19329
19379
|
}, [client, query]);
|
|
19330
|
-
|
|
19380
|
+
useEffect34(() => {
|
|
19331
19381
|
const controller = new AbortController();
|
|
19332
19382
|
void load(controller.signal);
|
|
19333
19383
|
return () => controller.abort();
|
|
@@ -19458,7 +19508,7 @@ function BillTasksContent({ client, onDrillDown, appearance }) {
|
|
|
19458
19508
|
if (!signal?.aborted) setLoading(false);
|
|
19459
19509
|
}
|
|
19460
19510
|
}, [claimsAdminId, renderingProviderId, client]);
|
|
19461
|
-
|
|
19511
|
+
useEffect34(() => {
|
|
19462
19512
|
const controller = new AbortController();
|
|
19463
19513
|
void load(controller.signal);
|
|
19464
19514
|
return () => controller.abort();
|
|
@@ -19522,7 +19572,7 @@ function ConnectedServiceLineItemsReport({ appearance, className, style, initial
|
|
|
19522
19572
|
const [to, setTo] = useState40(initialTo ?? defaults.to);
|
|
19523
19573
|
const [data, setData] = useState40(null);
|
|
19524
19574
|
const [error, setError] = useState40(null);
|
|
19525
|
-
|
|
19575
|
+
useEffect34(() => {
|
|
19526
19576
|
const controller = new AbortController();
|
|
19527
19577
|
setError(null);
|
|
19528
19578
|
void client.getServiceLineItems({ from, to }, controller.signal).then(setData).catch((cause) => {
|
|
@@ -19607,7 +19657,7 @@ function ConnectedProductivityReport({ appearance, className, style, initialFrom
|
|
|
19607
19657
|
const [to, setTo] = useState40(initialTo ?? defaults.to);
|
|
19608
19658
|
const [data, setData] = useState40(null);
|
|
19609
19659
|
const [error, setError] = useState40(null);
|
|
19610
|
-
|
|
19660
|
+
useEffect34(() => {
|
|
19611
19661
|
const controller = new AbortController();
|
|
19612
19662
|
setError(null);
|
|
19613
19663
|
void client.getProductivity({ from, to }, controller.signal).then(setData).catch((cause) => {
|
|
@@ -19891,9 +19941,9 @@ function DentalDraftEditor({ initialContent, onSave, disabled = false, ...appear
|
|
|
19891
19941
|
|
|
19892
19942
|
// src/index.tsx
|
|
19893
19943
|
function widget(tagName, props) {
|
|
19894
|
-
const ref =
|
|
19944
|
+
const ref = useRef29(null);
|
|
19895
19945
|
const { onMindBill, onMindBillError } = props;
|
|
19896
|
-
|
|
19946
|
+
useEffect35(() => {
|
|
19897
19947
|
const element = ref.current;
|
|
19898
19948
|
if (!element) return;
|
|
19899
19949
|
const handleEvent = (event) => onMindBill?.(event);
|