@mindbill/react 0.77.45 → 0.77.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +111 -87
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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 useEffect35, useRef as
|
|
1080
|
+
import { createElement, useEffect as useEffect35, useRef as useRef31 } from "react";
|
|
1081
1081
|
|
|
1082
1082
|
// src/claim-form-summary.tsx
|
|
1083
1083
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
@@ -10042,7 +10042,7 @@ function BillSubmissionForm({
|
|
|
10042
10042
|
import { useId as useId9, useMemo as useMemo13, useState as useState33 } from "react";
|
|
10043
10043
|
|
|
10044
10044
|
// src/rfa-dashboard.tsx
|
|
10045
|
-
import { useEffect as useEffect26, useId as useId8, useMemo as useMemo12, useRef as
|
|
10045
|
+
import { useEffect as useEffect26, useId as useId8, useMemo as useMemo12, useRef as useRef24, useState as useState32 } from "react";
|
|
10046
10046
|
import { getRfaLifecycleStatus as getRfaLifecycleStatus4, RFA_LIFECYCLE_LABELS as RFA_LIFECYCLE_LABELS5, createRfaClient as createRfaClient4, createBillReferenceClient as createBillReferenceClient2, createOrganizationClient as createOrganizationClient4 } from "@mindbill/browser";
|
|
10047
10047
|
|
|
10048
10048
|
// src/rfa-display.tsx
|
|
@@ -10519,6 +10519,8 @@ function TreatmentDraftShell({ title, description, children, hideHeading = false
|
|
|
10519
10519
|
.mbtd .mbrfa-template-save{display:grid;grid-template-columns:minmax(0,420px);gap:10px 16px;margin-top:10px}.mbtd .mbrfa-template-save>label{display:grid;gap:4px;font-size:12px;color:var(--mb-muted)}.mbtd .mbrfa-template-save>.mbrfa-check{display:flex;flex-direction:row;align-items:center;gap:8px;cursor:pointer}.mbtd .mbrfa-template-save>.mbrfa-check>input{width:16px;height:16px;min-height:16px;margin:0;padding:0;flex:0 0 16px;accent-color:var(--mb-accent)}.mbtd .mbrfa-template-save>:is(.mbrfa-check,.mbrfa-section-actions){grid-column:1/-1;margin-top:0;padding-top:0;border-top:0}
|
|
10520
10520
|
@media(max-width:760px){.mbtd .mbrfa-template-save{grid-template-columns:minmax(0,1fr)}}
|
|
10521
10521
|
.mbtd .mbrfa-form-grid>.mbrfa-row-start{grid-column:1/span 3}.mbtd .mbrfa-form-grid textarea[rows="2"]{min-height:44px}
|
|
10522
|
+
.mbtd .mbrfa-dx-list{list-style:none;margin:0 0 8px;padding:0;display:grid;gap:6px}.mbtd .mbrfa-dx-list>li{display:flex;align-items:center;gap:10px;min-height:36px;padding:4px 6px 4px 12px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 5%,var(--mb-surface));font-size:13px}.mbtd .mbrfa-dx-list>li>strong{font-weight:600;white-space:nowrap}.mbtd .mbrfa-dx-list>li>span{flex:1;min-width:0;color:var(--mb-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mbtd .mbrfa-dx-list>li>input{flex:1;min-width:0;min-height:30px;padding:4px 8px}.mbtd .mbrfa-dx-list>li>button{flex:none;width:28px;height:28px;min-height:28px;padding:0;border:0;background:none;color:var(--mb-muted);font-size:18px;line-height:1;cursor:pointer}.mbtd .mbrfa-dx-list>li>button:hover{color:var(--mb-danger,#b42318)}
|
|
10523
|
+
.mbtd .mbrfa-doc-hint{margin:0 0 12px;font-size:12px;color:var(--mb-muted)}
|
|
10522
10524
|
.mbtd .mbrfa-treatments{display:grid;gap:14px}.mbtd .mbrfa-treatment+.mbrfa-treatment{padding-top:16px;border-top:1px solid var(--mb-border)}
|
|
10523
10525
|
.mbtd .mbrfa-treatment-head{display:flex;align-items:center;gap:14px;margin-bottom:10px;font-size:13px}.mbtd .mbrfa-treatment-head>strong{font-weight:600;margin-right:auto}.mbtd button.mbrfa-link.mbrfa-link.mbrfa-treatment-remove{color:var(--mb-danger,#b42318)}
|
|
10524
10526
|
.mbtd .mbrfa-add-treatment{display:block;width:100%;min-height:44px;border:1px dashed color-mix(in srgb,var(--mb-accent) 55%,var(--mb-border));background:color-mix(in srgb,var(--mb-accent) 5%,var(--mb-surface));color:var(--mb-accent);font-weight:600;text-align:center;cursor:pointer}.mbtd .mbrfa-add-treatment:hover:not(:disabled){background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface))}
|
|
@@ -12778,7 +12780,7 @@ function RfaPracticePicker({ profile, value, onChange, managePracticeHref, manag
|
|
|
12778
12780
|
import { useEffect as useEffect22, useId as useId7, useState as useState25 } from "react";
|
|
12779
12781
|
|
|
12780
12782
|
// src/rfa-draft-fields.tsx
|
|
12781
|
-
import { useEffect as useEffect21, useId as useId6, useState as useState24 } from "react";
|
|
12783
|
+
import { useEffect as useEffect21, useId as useId6, useRef as useRef19, useState as useState24 } from "react";
|
|
12782
12784
|
import { Fragment as Fragment22, jsx as jsx39, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
12783
12785
|
function RfaContactFields({ title, value, onChange }) {
|
|
12784
12786
|
return /* @__PURE__ */ jsxs37("fieldset", { children: [
|
|
@@ -12800,12 +12802,11 @@ function RfaContactFields({ title, value, onChange }) {
|
|
|
12800
12802
|
] });
|
|
12801
12803
|
}
|
|
12802
12804
|
var diagnosisCache = /* @__PURE__ */ new WeakMap();
|
|
12803
|
-
function RfaDiagnosisFields({ code, description, onChange, search, officialForm = false }) {
|
|
12805
|
+
function RfaDiagnosisFields({ code, description, onChange, search, officialForm = false, savedCodes = [] }) {
|
|
12804
12806
|
const id = useId6();
|
|
12805
12807
|
const [query, setQuery] = useState24("");
|
|
12806
12808
|
const [results, setResults] = useState24([]);
|
|
12807
12809
|
const [error, setError] = useState24("");
|
|
12808
|
-
const [manualDiagnosis, setManualDiagnosis] = useState24(false);
|
|
12809
12810
|
const [searching, setSearching] = useState24(false);
|
|
12810
12811
|
useEffect21(() => {
|
|
12811
12812
|
let active = true;
|
|
@@ -12844,45 +12845,64 @@ function RfaDiagnosisFields({ code, description, onChange, search, officialForm
|
|
|
12844
12845
|
clearTimeout(timer);
|
|
12845
12846
|
};
|
|
12846
12847
|
}, [query, search]);
|
|
12848
|
+
const codes2 = code.split(",").map((part) => part.trim()).filter(Boolean);
|
|
12849
|
+
const parts = (description ?? "").split(";").map((part) => part.trim());
|
|
12850
|
+
const descriptions2 = codes2.map((_, index) => parts.length === codes2.length ? parts[index] : codes2.length === 1 ? (description ?? "").trim() : "");
|
|
12851
|
+
const emit = (nextCodes, nextDescriptions) => onChange({
|
|
12852
|
+
diagnosisCode: nextCodes.join(", "),
|
|
12853
|
+
diagnosisDescription: nextDescriptions.some(Boolean) ? nextDescriptions.map((text3) => text3.replace(/;/g, ",").trim()).join("; ") : ""
|
|
12854
|
+
});
|
|
12855
|
+
const resolved = useRef19(/* @__PURE__ */ new Set());
|
|
12856
|
+
const [resolving, setResolving] = useState24("");
|
|
12857
|
+
const pending = officialForm && search ? codes2.find((item, index) => !descriptions2[index] && !resolved.current.has(item)) ?? "" : "";
|
|
12858
|
+
const latest = useRef19({ codes: codes2, descriptions: descriptions2, emit });
|
|
12859
|
+
latest.current = { codes: codes2, descriptions: descriptions2, emit };
|
|
12860
|
+
useEffect21(() => {
|
|
12861
|
+
if (!pending || !search) return;
|
|
12862
|
+
resolved.current.add(pending);
|
|
12863
|
+
let active = true;
|
|
12864
|
+
setResolving(pending);
|
|
12865
|
+
const same = (left, right) => left.replace(".", "").toUpperCase() === right.replace(".", "").toUpperCase();
|
|
12866
|
+
void search(pending).then((items) => {
|
|
12867
|
+
const match = items.find((item) => same(item.code, pending));
|
|
12868
|
+
if (!active || !match) return;
|
|
12869
|
+
const now = latest.current, at = now.codes.indexOf(pending);
|
|
12870
|
+
if (at < 0) return;
|
|
12871
|
+
now.emit(now.codes.map((item, index) => index === at ? match.code : item), now.descriptions.map((text3, index) => index === at ? match.description : text3));
|
|
12872
|
+
}).catch(() => void 0).finally(() => {
|
|
12873
|
+
if (active) setResolving("");
|
|
12874
|
+
});
|
|
12875
|
+
return () => {
|
|
12876
|
+
active = false;
|
|
12877
|
+
};
|
|
12878
|
+
}, [pending, search]);
|
|
12847
12879
|
if (officialForm && search) {
|
|
12848
12880
|
const typed = query.trim().toUpperCase(), known = results.some((item) => item.code.toUpperCase() === typed);
|
|
12881
|
+
const chosen = (value) => codes2.includes(value);
|
|
12849
12882
|
const options = [
|
|
12850
|
-
|
|
12851
|
-
...results.map((item) => ({ id: item.code, label: item.code, detail: item.description })),
|
|
12852
|
-
.../^[A-Z]\d[0-9A-Z](\.?[0-9A-Z]{1,4})?$/.test(typed) && !known && typed
|
|
12883
|
+
...!typed ? savedCodes.filter((saved) => saved && !chosen(saved)).map((saved) => ({ id: `saved:${saved}`, label: saved, detail: "Saved on this injury" })) : [],
|
|
12884
|
+
...results.filter((item) => !chosen(item.code)).map((item) => ({ id: item.code, label: item.code, detail: item.description })),
|
|
12885
|
+
.../^[A-Z]\d[0-9A-Z](\.?[0-9A-Z]{1,4})?$/.test(typed) && !known && !chosen(typed) ? [{ id: `entered:${typed}`, label: `Use ${typed}`, detail: "Enter the diagnosis yourself" }] : []
|
|
12853
12886
|
];
|
|
12854
|
-
const
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
12861
|
-
|
|
12862
|
-
|
|
12863
|
-
|
|
12864
|
-
|
|
12865
|
-
|
|
12866
|
-
|
|
12867
|
-
|
|
12868
|
-
|
|
12869
|
-
|
|
12870
|
-
|
|
12871
|
-
|
|
12872
|
-
|
|
12873
|
-
else if (value.startsWith("entered:")) onChange({ diagnosisCode: value.slice(8), diagnosisDescription: "" });
|
|
12874
|
-
setQuery("");
|
|
12875
|
-
}
|
|
12876
|
-
}
|
|
12877
|
-
) }) }),
|
|
12878
|
-
code && !listed && (manualDiagnosis || !description) ? /* @__PURE__ */ jsxs37("label", { className: "mbrfa-s3", children: [
|
|
12879
|
-
/* @__PURE__ */ jsxs37("span", { children: [
|
|
12880
|
-
"Diagnosis",
|
|
12881
|
-
/* @__PURE__ */ jsx39(RfaRequired, {})
|
|
12882
|
-
] }),
|
|
12883
|
-
/* @__PURE__ */ jsx39("input", { required: true, autoFocus: manualDiagnosis, maxLength: 1e3, placeholder: "Diagnosis for this code", value: description ?? "", onFocus: () => setManualDiagnosis(true), onChange: (event) => onChange({ diagnosisCode: code, diagnosisDescription: event.target.value }) })
|
|
12884
|
-
] }) : null
|
|
12885
|
-
] });
|
|
12887
|
+
const add = (value) => {
|
|
12888
|
+
const item = results.find((item2) => item2.code === value);
|
|
12889
|
+
if (item) emit([...codes2, item.code], [...descriptions2, item.description]);
|
|
12890
|
+
else if (value.startsWith("entered:")) {
|
|
12891
|
+
resolved.current.add(value.slice(8));
|
|
12892
|
+
emit([...codes2, value.slice(8)], [...descriptions2, ""]);
|
|
12893
|
+
} else if (value.startsWith("saved:")) emit([...codes2, value.slice(6)], [...descriptions2, ""]);
|
|
12894
|
+
setQuery("");
|
|
12895
|
+
};
|
|
12896
|
+
return /* @__PURE__ */ jsx39("div", { className: "mbrfa-s6", children: /* @__PURE__ */ jsxs37(RfaPicker, { required: true, label: "ICD-10 Code", children: [
|
|
12897
|
+
codes2.length ? /* @__PURE__ */ jsx39("ul", { className: "mbrfa-dx-list", "aria-label": "Selected ICD-10 codes", children: codes2.map((item, index) => /* @__PURE__ */ jsxs37("li", { children: [
|
|
12898
|
+
/* @__PURE__ */ jsx39("strong", { children: item }),
|
|
12899
|
+
descriptions2[index] || resolving === item || !resolved.current.has(item) ? /* @__PURE__ */ jsx39("span", { children: descriptions2[index] || "Looking up\u2026" }) : /* @__PURE__ */ jsx39("input", { required: true, "aria-label": `Diagnosis for ${item}`, maxLength: 400, placeholder: "Type the diagnosis for this code", defaultValue: "", onBlur: (event) => {
|
|
12900
|
+
if (event.target.value.trim()) emit(codes2, descriptions2.map((text3, position) => position === index ? event.target.value : text3));
|
|
12901
|
+
} }),
|
|
12902
|
+
/* @__PURE__ */ jsx39("button", { type: "button", "aria-label": `Remove ${item}`, onClick: () => emit(codes2.filter((_, position) => position !== index), descriptions2.filter((_, position) => position !== index)), children: "\xD7" })
|
|
12903
|
+
] }, item)) }) : null,
|
|
12904
|
+
codes2.length < 12 ? /* @__PURE__ */ jsx39(RfaIdentitySelect, { label: "ICD-10 Code", placeholder: codes2.length ? "Add another ICD-10 code" : "Enter code", searchPlaceholder: "Search by code or diagnosis", query, onSearch: setQuery, searchable: true, loading: searching && !options.length, error, value: "", options, onSelect: add }) : null
|
|
12905
|
+
] }) });
|
|
12886
12906
|
}
|
|
12887
12907
|
if (officialForm) return /* @__PURE__ */ jsxs37(Fragment22, { children: [
|
|
12888
12908
|
/* @__PURE__ */ jsxs37("label", { className: "mbrfa-s2", children: [
|
|
@@ -13160,12 +13180,12 @@ function RfaTemplateBar({ templates, items, renderingProviderId, physicianName,
|
|
|
13160
13180
|
}
|
|
13161
13181
|
|
|
13162
13182
|
// src/rfa-document-drop.tsx
|
|
13163
|
-
import { useRef as
|
|
13183
|
+
import { useRef as useRef20, useState as useState27 } from "react";
|
|
13164
13184
|
import { jsx as jsx42, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
13165
13185
|
var size = (bytes) => bytes >= 1048576 ? `${(bytes / 1048576).toFixed(1)} MB` : `${Math.max(1, Math.round(bytes / 1024))} KB`;
|
|
13166
13186
|
var isPdf = (file) => file.type === "application/pdf" || /\.pdf$/i.test(file.name);
|
|
13167
13187
|
function RfaDocumentDrop({ files, onChange, disabled }) {
|
|
13168
|
-
const input =
|
|
13188
|
+
const input = useRef20(null);
|
|
13169
13189
|
const [over, setOver] = useState27(false);
|
|
13170
13190
|
const [skipped, setSkipped] = useState27(0);
|
|
13171
13191
|
const add = (chosen) => {
|
|
@@ -13228,7 +13248,7 @@ function RfaDocumentDrop({ files, onChange, disabled }) {
|
|
|
13228
13248
|
}
|
|
13229
13249
|
|
|
13230
13250
|
// src/rfa-draft-form.tsx
|
|
13231
|
-
import { useEffect as useEffect23, useRef as
|
|
13251
|
+
import { useEffect as useEffect23, useRef as useRef21, useState as useState28 } from "react";
|
|
13232
13252
|
import { Fragment as Fragment23, jsx as jsx43, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
13233
13253
|
function normalizeRfaDraft(draft2) {
|
|
13234
13254
|
const copy = structuredClone(draft2);
|
|
@@ -13268,7 +13288,7 @@ function validateRfaDraft(draft2) {
|
|
|
13268
13288
|
if ((item.diagnosisDescription?.length ?? 0) > 1e3) return "Diagnosis descriptions must be at most 1,000 characters.";
|
|
13269
13289
|
const prefix = `Service ${index + 1}: `;
|
|
13270
13290
|
if (item.metadata?.otherInformation !== void 0 && (typeof item.metadata.otherInformation !== "string" || item.metadata.otherInformation.length > 2e3)) return prefix + "Other Information must be text up to 2,000 characters.";
|
|
13271
|
-
if (!item.diagnosisCode.trim() || item.diagnosisCode.length >
|
|
13291
|
+
if (!item.diagnosisCode.trim() || item.diagnosisCode.length > 200 || !item.serviceDescription.trim() || item.serviceDescription.length > 1e3) return prefix + "a diagnosis code and service description are required.";
|
|
13272
13292
|
for (const [value, max] of [[item.externalId, 255], [item.procedureCode, 16], [item.frequency, 200], [item.duration, 200]]) if (value !== void 0 && (!value.trim() || value.length > max)) return prefix + `optional text must contain 1 to ${max} characters.`;
|
|
13273
13293
|
if (item.units !== void 0 && (!Number.isInteger(item.units) || item.units < 1 || item.units > 1e5)) return prefix + "units must be a whole number between 1 and 100,000.";
|
|
13274
13294
|
if (item.quantity !== void 0 && (!Number.isFinite(item.quantity) || item.quantity <= 0 || item.quantity > 1e5)) return prefix + "quantity must be positive and at most 100,000.";
|
|
@@ -13296,7 +13316,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13296
13316
|
useEffect23(() => {
|
|
13297
13317
|
if (officialForm && returnEmail && !physicianEmail) setDraft((current) => current.requestingPractice?.email?.trim() ? current : { ...current, requestingPractice: { ...current.requestingPractice, email: returnEmail } });
|
|
13298
13318
|
}, [officialForm, returnEmail, physicianEmail, savedDraft.requestingPractice?.email]);
|
|
13299
|
-
const filledEmail =
|
|
13319
|
+
const filledEmail = useRef21(void 0);
|
|
13300
13320
|
useEffect23(() => {
|
|
13301
13321
|
if (!officialForm || !physicianEmail) return;
|
|
13302
13322
|
const previous = filledEmail.current;
|
|
@@ -13324,11 +13344,11 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13324
13344
|
const practiceManual = practiceManualChoice ?? (organizationProfile ? savedPractices.length === 0 || typedPractice && !savedPractices.some((provider) => provider.name === savedDraft.requestingPractice?.name) : !profilePending);
|
|
13325
13345
|
const [administratorOverride, setAdministratorOverride] = useState28(null);
|
|
13326
13346
|
const identityKey = `${identity?.claimId ?? ""}:${identity?.claimsAdminId ?? ""}`;
|
|
13327
|
-
const previousClaim =
|
|
13347
|
+
const previousClaim = useRef21(identityKey);
|
|
13328
13348
|
useEffect23(() => {
|
|
13329
13349
|
if (previousClaim.current !== identityKey) {
|
|
13330
13350
|
setAdministratorOverride(null);
|
|
13331
|
-
setDraft((current) => ({ ...current, authorizationContact: null, ...officialForm ? { items: [{ diagnosisCode: savedDiagnosisCodes
|
|
13351
|
+
setDraft((current) => ({ ...current, authorizationContact: null, ...officialForm ? { items: [{ diagnosisCode: savedDiagnosisCodes.slice(0, 12).join(", "), serviceDescription: "" }] } : {} }));
|
|
13332
13352
|
previousClaim.current = identityKey;
|
|
13333
13353
|
}
|
|
13334
13354
|
}, [identityKey]);
|
|
@@ -13345,7 +13365,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13345
13365
|
else delete draft2.claimsAdminId;
|
|
13346
13366
|
}
|
|
13347
13367
|
const [intent, setIntent] = useState28("save");
|
|
13348
|
-
const intentRef =
|
|
13368
|
+
const intentRef = useRef21(intent);
|
|
13349
13369
|
const chooseIntent = (value) => {
|
|
13350
13370
|
intentRef.current = value;
|
|
13351
13371
|
setIntent(value);
|
|
@@ -13374,7 +13394,11 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13374
13394
|
}) }));
|
|
13375
13395
|
};
|
|
13376
13396
|
const supportingDocumentFields = supportingDocuments && officialForm ? /* @__PURE__ */ jsxs41("fieldset", { disabled: locked, children: [
|
|
13377
|
-
/* @__PURE__ */
|
|
13397
|
+
/* @__PURE__ */ jsxs41("legend", { children: [
|
|
13398
|
+
"Supporting documents",
|
|
13399
|
+
/* @__PURE__ */ jsx43(RfaRequired, {})
|
|
13400
|
+
] }),
|
|
13401
|
+
/* @__PURE__ */ jsx43("p", { className: "mbrfa-doc-hint", children: "A request must be sent with the report that supports it: a PR-2, Doctor\\u2019s First Report, or narrative report." }),
|
|
13378
13402
|
/* @__PURE__ */ jsx43(RfaDocumentDrop, { files: supportingDocuments.files, onChange: supportingDocuments.onChange, disabled: locked })
|
|
13379
13403
|
] }) : supportingDocuments ? /* @__PURE__ */ jsxs41("fieldset", { disabled: locked, children: [
|
|
13380
13404
|
/* @__PURE__ */ jsx43("legend", { children: "Supporting documents" }),
|
|
@@ -13398,7 +13422,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13398
13422
|
event.preventDefault();
|
|
13399
13423
|
if (locked) return;
|
|
13400
13424
|
const next = normalizeRfaDraft(draft2);
|
|
13401
|
-
void action.save(next, validateRfaDraft(next) ?? (officialForm && intentRef.current === "review" && !next.requestingPractice?.fax?.trim() ? "Requesting Physician fax number is required." : null));
|
|
13425
|
+
void action.save(next, validateRfaDraft(next) ?? (officialForm && intentRef.current === "review" && !next.requestingPractice?.fax?.trim() ? "Requesting Physician fax number is required." : officialForm && intentRef.current === "review" && supportingDocuments && !supportingDocuments.files.length ? "Attach the report that supports this request before submitting." : null));
|
|
13402
13426
|
};
|
|
13403
13427
|
const saveError = action.error ? /* @__PURE__ */ jsxs41("p", { role: "alert", children: [
|
|
13404
13428
|
action.error,
|
|
@@ -13503,7 +13527,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13503
13527
|
/* @__PURE__ */ jsx43("button", { type: "button", className: "mbrfa-link mbrfa-treatment-remove", "aria-label": `Remove treatment ${index + 1}`, onClick: () => update({ items: draft2.items.filter((_, position) => position !== index) }), children: "Remove" })
|
|
13504
13528
|
] }) : null,
|
|
13505
13529
|
/* @__PURE__ */ jsxs41("div", { className: "mbrfa-form-grid", children: [
|
|
13506
|
-
/* @__PURE__ */ jsx43(RfaDiagnosisFields, { officialForm: true, code: item.diagnosisCode, ...item.diagnosisDescription !== void 0 ? { description: item.diagnosisDescription } : {}, ...searchDiagnosisCodes ? { search: searchDiagnosisCodes } : {}, onChange: (value) => updateItem(index, value) }),
|
|
13530
|
+
/* @__PURE__ */ jsx43(RfaDiagnosisFields, { officialForm: true, savedCodes: savedDiagnosisCodes, code: item.diagnosisCode, ...item.diagnosisDescription !== void 0 ? { description: item.diagnosisDescription } : {}, ...searchDiagnosisCodes ? { search: searchDiagnosisCodes } : {}, onChange: (value) => updateItem(index, value) }),
|
|
13507
13531
|
/* @__PURE__ */ jsxs41("label", { className: "mbrfa-s3 mbrfa-row-start", children: [
|
|
13508
13532
|
/* @__PURE__ */ jsxs41("span", { children: [
|
|
13509
13533
|
"Service/Good Requested",
|
|
@@ -13969,7 +13993,7 @@ function SavedIdentityForm({ client, claimId, renderingProviderId, onSave, canCr
|
|
|
13969
13993
|
...appearance,
|
|
13970
13994
|
...draftFormProps,
|
|
13971
13995
|
disabled: official ? disabled || addingClaim : disabled || loading || addingClaim || !claim || !provider || !!error,
|
|
13972
|
-
initialDraft: { claimId: "", patientId: "", renderingProviderId: "", employeeName: "", providerName: "", requestType: "new", reviewType: "prospective", items: [{ diagnosisCode: claim?.diagnosisCodes?.[0] ?? "", serviceDescription: "" }] },
|
|
13996
|
+
initialDraft: { claimId: "", patientId: "", renderingProviderId: "", employeeName: "", providerName: "", requestType: "new", reviewType: "prospective", items: [{ diagnosisCode: (draftFormProps?.officialForm ? claim?.diagnosisCodes?.slice(0, 12).join(", ") : claim?.diagnosisCodes?.[0]) ?? "", serviceDescription: "" }] },
|
|
13973
13997
|
...official ? { formDetails, selectors: { claim: /* @__PURE__ */ jsx44("fieldset", { className: "mbrfa-plain", disabled, children: renderClaimSelector ? claimFields : /* @__PURE__ */ jsx44(RfaPicker, { label: "Patient and claim", children: claimFields }) }), physician: /* @__PURE__ */ jsx44("fieldset", { className: "mbrfa-plain", disabled, children: providerFields }) } } : {},
|
|
13974
13998
|
identity,
|
|
13975
13999
|
supportingDocuments,
|
|
@@ -14040,7 +14064,7 @@ function rfaDraftReplacement(draft2, expectedRevision) {
|
|
|
14040
14064
|
}
|
|
14041
14065
|
|
|
14042
14066
|
// src/rfa-lifecycle-controls.tsx
|
|
14043
|
-
import { useEffect as useEffect25, useMemo as useMemo11, useRef as
|
|
14067
|
+
import { useEffect as useEffect25, useMemo as useMemo11, useRef as useRef22, useState as useState30 } from "react";
|
|
14044
14068
|
import { createRfaClient as createRfaClient3, createRfaLifecycleClient as createRfaLifecycleClient3 } from "@mindbill/browser";
|
|
14045
14069
|
import { Fragment as Fragment25, jsx as jsx45, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
14046
14070
|
var text2 = (form, name) => String(form.get(name) ?? "").trim();
|
|
@@ -14091,9 +14115,9 @@ function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdat
|
|
|
14091
14115
|
};
|
|
14092
14116
|
}, [records, rfa.id, responseDocument, rfa.documents, previewReload]);
|
|
14093
14117
|
const [outcomes, setOutcomes] = useState30({});
|
|
14094
|
-
const alive =
|
|
14095
|
-
const pending =
|
|
14096
|
-
const keys =
|
|
14118
|
+
const alive = useRef22(true);
|
|
14119
|
+
const pending = useRef22(false);
|
|
14120
|
+
const keys = useRef22(/* @__PURE__ */ new Map());
|
|
14097
14121
|
useEffect25(() => {
|
|
14098
14122
|
alive.current = true;
|
|
14099
14123
|
return () => {
|
|
@@ -14524,7 +14548,7 @@ function FollowUpForm({ task, selected, editable, disabled, onSave, onReview, ha
|
|
|
14524
14548
|
}
|
|
14525
14549
|
|
|
14526
14550
|
// src/rfa-provider-signature-setup.tsx
|
|
14527
|
-
import { useRef as
|
|
14551
|
+
import { useRef as useRef23, useState as useState31 } from "react";
|
|
14528
14552
|
import { jsx as jsx46, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
14529
14553
|
function RfaProviderSignatureSetup(props) {
|
|
14530
14554
|
return /* @__PURE__ */ jsx46(SignatureForm, { ...props }, props.renderingProviderId);
|
|
@@ -14535,7 +14559,7 @@ function SignatureForm({ client, renderingProviderId, providerName, disabled, on
|
|
|
14535
14559
|
const [authorized, setAuthorized] = useState31(false);
|
|
14536
14560
|
const [busy, setBusy] = useState31(false);
|
|
14537
14561
|
const [error, setError] = useState31("");
|
|
14538
|
-
const attempt =
|
|
14562
|
+
const attempt = useRef23(null);
|
|
14539
14563
|
return /* @__PURE__ */ jsx46("form", { onSubmit: async (event) => {
|
|
14540
14564
|
event.preventDefault();
|
|
14541
14565
|
if (busy || disabled || !file || !authorized || !actor.trim() || !client.saveProviderSignature) return;
|
|
@@ -14614,7 +14638,7 @@ function RfaDashboard({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOve
|
|
|
14614
14638
|
return /* @__PURE__ */ jsx47(RfaDashboardContent, { ...props, ...patientId ? { patientId } : {}, ...claimId ? { claimId } : {}, ...renderingProviderId ? { renderingProviderId } : {}, client, signatureClient, options }, `${identity.key}:${patientId ?? ""}:${claimId ?? ""}:${renderingProviderId ?? ""}`);
|
|
14615
14639
|
}
|
|
14616
14640
|
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, onAddPractice, onEditLocation, treatmentTemplates, onSaveTreatmentTemplate, onManageTreatmentTemplates, savedProfileChanges, 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 }) {
|
|
14617
|
-
const active =
|
|
14641
|
+
const active = useRef24(true);
|
|
14618
14642
|
useEffect26(() => {
|
|
14619
14643
|
active.current = true;
|
|
14620
14644
|
return () => {
|
|
@@ -14683,7 +14707,7 @@ function RfaDashboardContent({ client, signatureClient, options, patientId, clai
|
|
|
14683
14707
|
};
|
|
14684
14708
|
}, [options, creating, selected]);
|
|
14685
14709
|
const [loading, setLoading] = useState32(true);
|
|
14686
|
-
const createKeys =
|
|
14710
|
+
const createKeys = useRef24(/* @__PURE__ */ new Map());
|
|
14687
14711
|
useEffect26(() => {
|
|
14688
14712
|
const timer = setTimeout(() => {
|
|
14689
14713
|
setSearch(searchInput.trim());
|
|
@@ -14893,17 +14917,17 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14893
14917
|
useEffect26(() => {
|
|
14894
14918
|
if (selectedItem || selectedResponseDocumentId) setDetailTab("details");
|
|
14895
14919
|
}, [selectedResponseDocumentId, selectedItem]);
|
|
14896
|
-
const responseFocused =
|
|
14920
|
+
const responseFocused = useRef24(false);
|
|
14897
14921
|
useEffect26(() => {
|
|
14898
14922
|
if (simple && rfa && selectedResponseDocumentId && !responseFocused.current) {
|
|
14899
14923
|
responseFocused.current = true;
|
|
14900
14924
|
document.getElementById(`${tabId}-review`)?.scrollIntoView?.({ block: "start" });
|
|
14901
14925
|
}
|
|
14902
14926
|
}, [simple, rfa, selectedResponseDocumentId, tabId]);
|
|
14903
|
-
const alive =
|
|
14904
|
-
const pending =
|
|
14905
|
-
const loadGeneration =
|
|
14906
|
-
const keys =
|
|
14927
|
+
const alive = useRef24(true);
|
|
14928
|
+
const pending = useRef24(false);
|
|
14929
|
+
const loadGeneration = useRef24(0);
|
|
14930
|
+
const keys = useRef24(/* @__PURE__ */ new Map());
|
|
14907
14931
|
const [descriptions2, setDescriptions] = useState32({});
|
|
14908
14932
|
const [preview, setPreview] = useState32(null);
|
|
14909
14933
|
const [previewPdf, setPreviewPdf] = useState32(null);
|
|
@@ -14946,7 +14970,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14946
14970
|
active = false;
|
|
14947
14971
|
};
|
|
14948
14972
|
}, [client, id, reload]);
|
|
14949
|
-
const currentRfa =
|
|
14973
|
+
const currentRfa = useRef24(rfa);
|
|
14950
14974
|
currentRfa.current = rfa;
|
|
14951
14975
|
useEffect26(() => {
|
|
14952
14976
|
let active = true;
|
|
@@ -14978,7 +15002,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14978
15002
|
document.removeEventListener("visibilitychange", resume);
|
|
14979
15003
|
};
|
|
14980
15004
|
}, [client, id, editing]);
|
|
14981
|
-
const focusedTreatment =
|
|
15005
|
+
const focusedTreatment = useRef24(null);
|
|
14982
15006
|
useEffect26(() => {
|
|
14983
15007
|
if (!rfa || !selectedItem || focusedTreatment.current === selectedItem) return;
|
|
14984
15008
|
const element = document.getElementById(`rfa-treatment-${selectedItem}`);
|
|
@@ -17013,7 +17037,7 @@ function ConnectedPaymentReview({ initialQuery, onSelectBill, onPostPayment, app
|
|
|
17013
17037
|
}
|
|
17014
17038
|
|
|
17015
17039
|
// src/notification-settings.tsx
|
|
17016
|
-
import { useEffect as useEffect29, useId as useId10, useRef as
|
|
17040
|
+
import { useEffect as useEffect29, useId as useId10, useRef as useRef25, useState as useState36 } from "react";
|
|
17017
17041
|
import { Fragment as Fragment31, jsx as jsx56, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
17018
17042
|
function defaultNotificationPreferences() {
|
|
17019
17043
|
return { enabled: false, statusUpdates: false, agingDays: [], quietHours: true, reportDigest: "off" };
|
|
@@ -17055,7 +17079,7 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
|
|
|
17055
17079
|
const [notice, setNotice] = useState36("");
|
|
17056
17080
|
const [failed, setFailed] = useState36(false);
|
|
17057
17081
|
const [reload, setReload] = useState36(0);
|
|
17058
|
-
const request =
|
|
17082
|
+
const request = useRef25(0);
|
|
17059
17083
|
useEffect29(() => {
|
|
17060
17084
|
const current = ++request.current;
|
|
17061
17085
|
setPhase("loading");
|
|
@@ -17199,7 +17223,7 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
|
|
|
17199
17223
|
}
|
|
17200
17224
|
|
|
17201
17225
|
// src/notification-recipients.tsx
|
|
17202
|
-
import { useEffect as useEffect30, useId as useId11, useRef as
|
|
17226
|
+
import { useEffect as useEffect30, useId as useId11, useRef as useRef26, useState as useState37 } from "react";
|
|
17203
17227
|
import { jsx as jsx57, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
17204
17228
|
function notificationRecipientInvitation(input, requestId) {
|
|
17205
17229
|
const preferences = notificationSettingsUpdate({ ...input, enabled: false }, false);
|
|
@@ -17240,8 +17264,8 @@ function RecipientSettingsSession({ adapter, appearance, className, style }) {
|
|
|
17240
17264
|
const [notice, setNotice] = useState37("");
|
|
17241
17265
|
const [failed, setFailed] = useState37(false);
|
|
17242
17266
|
const [hasReceipt, setHasReceipt] = useState37(false);
|
|
17243
|
-
const generation =
|
|
17244
|
-
const pending =
|
|
17267
|
+
const generation = useRef26(0);
|
|
17268
|
+
const pending = useRef26(null);
|
|
17245
17269
|
useEffect30(() => {
|
|
17246
17270
|
const current = ++generation.current;
|
|
17247
17271
|
setBusy(true);
|
|
@@ -17399,7 +17423,7 @@ import {
|
|
|
17399
17423
|
useCallback as useCallback4,
|
|
17400
17424
|
useEffect as useEffect31,
|
|
17401
17425
|
useMemo as useMemo16,
|
|
17402
|
-
useRef as
|
|
17426
|
+
useRef as useRef27,
|
|
17403
17427
|
useState as useState38
|
|
17404
17428
|
} from "react";
|
|
17405
17429
|
import {
|
|
@@ -17550,11 +17574,11 @@ function useBillStatus({
|
|
|
17550
17574
|
const [error, setError] = useState38(null);
|
|
17551
17575
|
const [isLoading, setIsLoading] = useState38(enabled && !initialData);
|
|
17552
17576
|
const [isRefreshing, setIsRefreshing] = useState38(false);
|
|
17553
|
-
const dataRef =
|
|
17554
|
-
const initialDataRef =
|
|
17577
|
+
const dataRef = useRef27(initialData);
|
|
17578
|
+
const initialDataRef = useRef27(initialData);
|
|
17555
17579
|
initialDataRef.current = initialData;
|
|
17556
|
-
const activeControllerRef =
|
|
17557
|
-
const requestSequence =
|
|
17580
|
+
const activeControllerRef = useRef27(null);
|
|
17581
|
+
const requestSequence = useRef27(0);
|
|
17558
17582
|
useEffect31(() => {
|
|
17559
17583
|
const seed = initialDataRef.current;
|
|
17560
17584
|
dataRef.current = seed;
|
|
@@ -17657,7 +17681,7 @@ function ConnectedBillStatus({
|
|
|
17657
17681
|
}
|
|
17658
17682
|
|
|
17659
17683
|
// src/bill-lifecycle-surfaces.tsx
|
|
17660
|
-
import { useEffect as useEffect32, useRef as
|
|
17684
|
+
import { useEffect as useEffect32, useRef as useRef28, useState as useState39 } from "react";
|
|
17661
17685
|
import { Fragment as Fragment33, jsx as jsx59, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
17662
17686
|
function visibleBillLifecycleActions(actions2, showUnavailable = false, maxVisible) {
|
|
17663
17687
|
const visible = actions2.filter((action) => action.enabled || showUnavailable);
|
|
@@ -17735,7 +17759,7 @@ function historyDate(iso) {
|
|
|
17735
17759
|
}
|
|
17736
17760
|
function BillHistoryTable({ entries, selectedEntryId, emptyLabel = "No bill history yet.", appearance, className, style, formatDate = historyDate, documentHref, onOpenDocument }) {
|
|
17737
17761
|
const [expanded, setExpanded] = useState39({});
|
|
17738
|
-
const selectedRowRef =
|
|
17762
|
+
const selectedRowRef = useRef28(null);
|
|
17739
17763
|
useEffect32(() => {
|
|
17740
17764
|
if (!selectedEntryId) return;
|
|
17741
17765
|
const selected = entries.find((entry) => entry.id === selectedEntryId);
|
|
@@ -18297,7 +18321,7 @@ import {
|
|
|
18297
18321
|
useCallback as useCallback5,
|
|
18298
18322
|
useEffect as useEffect33,
|
|
18299
18323
|
useMemo as useMemo18,
|
|
18300
|
-
useRef as
|
|
18324
|
+
useRef as useRef29,
|
|
18301
18325
|
useState as useState41
|
|
18302
18326
|
} from "react";
|
|
18303
18327
|
import {
|
|
@@ -18689,7 +18713,7 @@ function useBillLifecycle({
|
|
|
18689
18713
|
const [isLoading, setIsLoading] = useState41(enabled);
|
|
18690
18714
|
const [isRefreshing, setIsRefreshing] = useState41(false);
|
|
18691
18715
|
const [isMutating, setIsMutating] = useState41(false);
|
|
18692
|
-
const mounted =
|
|
18716
|
+
const mounted = useRef29(true);
|
|
18693
18717
|
const client = useMemo18(() => createBillLifecycleClient({
|
|
18694
18718
|
billId: providedBillId,
|
|
18695
18719
|
sessionEndpoint,
|
|
@@ -18852,8 +18876,8 @@ function useBillLifecycle({
|
|
|
18852
18876
|
};
|
|
18853
18877
|
}
|
|
18854
18878
|
function LifecycleDialog({ children, title, wide = false, onClose }) {
|
|
18855
|
-
const dialog =
|
|
18856
|
-
const onCloseRef =
|
|
18879
|
+
const dialog = useRef29(null);
|
|
18880
|
+
const onCloseRef = useRef29(onClose);
|
|
18857
18881
|
onCloseRef.current = onClose;
|
|
18858
18882
|
useEffect33(() => {
|
|
18859
18883
|
const previous = document.activeElement;
|
|
@@ -19151,7 +19175,7 @@ function ConnectedBillLifecycle({
|
|
|
19151
19175
|
setPanel("");
|
|
19152
19176
|
}, [currentAttemptKey]);
|
|
19153
19177
|
const actor = actorName?.trim() ? { actorName: actorName.trim() } : {};
|
|
19154
|
-
const lastData =
|
|
19178
|
+
const lastData = useRef29(null);
|
|
19155
19179
|
const correctionInitialBill = useMemo18(() => data ? correctionBill(data) : null, [data]);
|
|
19156
19180
|
const correctionAttachments = useMemo18(() => data ? data.bill.attachments.map((attachment) => {
|
|
19157
19181
|
const documentType = correctionDocumentType(attachment.documentType);
|
|
@@ -19666,7 +19690,7 @@ import {
|
|
|
19666
19690
|
useId as useId12,
|
|
19667
19691
|
useLayoutEffect,
|
|
19668
19692
|
useMemo as useMemo19,
|
|
19669
|
-
useRef as
|
|
19693
|
+
useRef as useRef30,
|
|
19670
19694
|
useState as useState42
|
|
19671
19695
|
} from "react";
|
|
19672
19696
|
import { Fragment as Fragment36, jsx as jsx62, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
@@ -19722,7 +19746,7 @@ function Surface({ appearance, className = "", style, children, surfaceRef }) {
|
|
|
19722
19746
|
] });
|
|
19723
19747
|
}
|
|
19724
19748
|
function useAvailableViewportHeight() {
|
|
19725
|
-
const workspaceRef =
|
|
19749
|
+
const workspaceRef = useRef30(null);
|
|
19726
19750
|
const [availableHeight, setAvailableHeight] = useState42(null);
|
|
19727
19751
|
useLayoutEffect(() => {
|
|
19728
19752
|
const element = workspaceRef.current;
|
|
@@ -20343,7 +20367,7 @@ function DentalDraftEditor({ initialContent, onSave, disabled = false, ...appear
|
|
|
20343
20367
|
|
|
20344
20368
|
// src/index.tsx
|
|
20345
20369
|
function widget(tagName, props) {
|
|
20346
|
-
const ref =
|
|
20370
|
+
const ref = useRef31(null);
|
|
20347
20371
|
const { onMindBill, onMindBillError } = props;
|
|
20348
20372
|
useEffect35(() => {
|
|
20349
20373
|
const element = ref.current;
|