@mindbill/react 0.77.44 → 0.77.46
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 +85 -50
- 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";
|
|
@@ -8156,6 +8156,15 @@ function normalizeBillSubmissionReportTypeCode(value) {
|
|
|
8156
8156
|
);
|
|
8157
8157
|
}
|
|
8158
8158
|
var isProlongedCode = (code) => /^9935[89]$/.test(code.trim());
|
|
8159
|
+
function billSubmissionProviderKindForTaxonomy(taxonomy) {
|
|
8160
|
+
const code = taxonomy?.trim().toUpperCase() ?? "";
|
|
8161
|
+
if (!/^[A-Z0-9]{10}$/.test(code)) return void 0;
|
|
8162
|
+
if (/^(20|103[GT]|111N|213E|152W|1223|1711)/.test(code)) return "physician";
|
|
8163
|
+
if (code.startsWith("363A")) return "physician_assistant";
|
|
8164
|
+
if (code.startsWith("363L")) return "nurse_practitioner";
|
|
8165
|
+
if (code.startsWith("364S")) return "clinical_nurse_specialist";
|
|
8166
|
+
return void 0;
|
|
8167
|
+
}
|
|
8159
8168
|
function billSubmissionEstimateContext(code, placeOfService, details = {}) {
|
|
8160
8169
|
if (details.basis === "adjustment") return {};
|
|
8161
8170
|
if (!isTherapyEditorCode(code) && /^[A-Z0-9]{5}$/.test(code) && !/^ML/.test(code) && details.providerKind && details.providerKind !== "physical_therapist") return {
|
|
@@ -9186,7 +9195,7 @@ function BillSubmissionForm({
|
|
|
9186
9195
|
const detailsIndex = isProlongedCode(line.code) ? prolongedLeader(index) : index;
|
|
9187
9196
|
const saved = bill.serviceLines[detailsIndex]?.feeContext;
|
|
9188
9197
|
const prolonged = saved?.prolongedServiceContext;
|
|
9189
|
-
|
|
9198
|
+
const details = feeDetails[detailsIndex] ?? {
|
|
9190
9199
|
...drugDetailsFromSaved(line.drug, saved),
|
|
9191
9200
|
...anesthesiaDetailsFromSaved(saved),
|
|
9192
9201
|
...therapyDetailsFromSaved(saved),
|
|
@@ -9201,6 +9210,8 @@ function BillSubmissionForm({
|
|
|
9201
9210
|
relatedEvaluationDate: prolonged?.relatedEvaluationDate,
|
|
9202
9211
|
prolongedTimeBasis: prolonged?.ongoingPatientManagement && prolonged.personallyPerformed && !prolonged.timeCountedInOtherServices && prolonged.completeSameDayServices ? "documented" : ""
|
|
9203
9212
|
};
|
|
9213
|
+
const impliedKind = isTherapyEditorCode(line.code) ? void 0 : billSubmissionProviderKindForTaxonomy(bill.renderingProvider?.taxonomy);
|
|
9214
|
+
return details.providerKind === void 0 && impliedKind ? { ...details, providerKind: impliedKind } : details;
|
|
9204
9215
|
};
|
|
9205
9216
|
const quoteInputs = bill.serviceLines.map((line, index) => {
|
|
9206
9217
|
if (!treatmentBilling || !line.code.trim() || isMedicalLegalCode(line.code)) return null;
|
|
@@ -10031,7 +10042,7 @@ function BillSubmissionForm({
|
|
|
10031
10042
|
import { useId as useId9, useMemo as useMemo13, useState as useState33 } from "react";
|
|
10032
10043
|
|
|
10033
10044
|
// src/rfa-dashboard.tsx
|
|
10034
|
-
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";
|
|
10035
10046
|
import { getRfaLifecycleStatus as getRfaLifecycleStatus4, RFA_LIFECYCLE_LABELS as RFA_LIFECYCLE_LABELS5, createRfaClient as createRfaClient4, createBillReferenceClient as createBillReferenceClient2, createOrganizationClient as createOrganizationClient4 } from "@mindbill/browser";
|
|
10036
10047
|
|
|
10037
10048
|
// src/rfa-display.tsx
|
|
@@ -10508,6 +10519,7 @@ function TreatmentDraftShell({ title, description, children, hideHeading = false
|
|
|
10508
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}
|
|
10509
10520
|
@media(max-width:760px){.mbtd .mbrfa-template-save{grid-template-columns:minmax(0,1fr)}}
|
|
10510
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-doc-hint{margin:0 0 12px;font-size:12px;color:var(--mb-muted)}
|
|
10511
10523
|
.mbtd .mbrfa-treatments{display:grid;gap:14px}.mbtd .mbrfa-treatment+.mbrfa-treatment{padding-top:16px;border-top:1px solid var(--mb-border)}
|
|
10512
10524
|
.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)}
|
|
10513
10525
|
.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))}
|
|
@@ -12767,7 +12779,7 @@ function RfaPracticePicker({ profile, value, onChange, managePracticeHref, manag
|
|
|
12767
12779
|
import { useEffect as useEffect22, useId as useId7, useState as useState25 } from "react";
|
|
12768
12780
|
|
|
12769
12781
|
// src/rfa-draft-fields.tsx
|
|
12770
|
-
import { useEffect as useEffect21, useId as useId6, useState as useState24 } from "react";
|
|
12782
|
+
import { useEffect as useEffect21, useId as useId6, useRef as useRef19, useState as useState24 } from "react";
|
|
12771
12783
|
import { Fragment as Fragment22, jsx as jsx39, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
12772
12784
|
function RfaContactFields({ title, value, onChange }) {
|
|
12773
12785
|
return /* @__PURE__ */ jsxs37("fieldset", { children: [
|
|
@@ -12789,7 +12801,7 @@ function RfaContactFields({ title, value, onChange }) {
|
|
|
12789
12801
|
] });
|
|
12790
12802
|
}
|
|
12791
12803
|
var diagnosisCache = /* @__PURE__ */ new WeakMap();
|
|
12792
|
-
function RfaDiagnosisFields({ code, description, onChange, search, officialForm = false }) {
|
|
12804
|
+
function RfaDiagnosisFields({ code, description, onChange, search, officialForm = false, savedCodes = [] }) {
|
|
12793
12805
|
const id = useId6();
|
|
12794
12806
|
const [query, setQuery] = useState24("");
|
|
12795
12807
|
const [results, setResults] = useState24([]);
|
|
@@ -12833,10 +12845,28 @@ function RfaDiagnosisFields({ code, description, onChange, search, officialForm
|
|
|
12833
12845
|
clearTimeout(timer);
|
|
12834
12846
|
};
|
|
12835
12847
|
}, [query, search]);
|
|
12848
|
+
const resolved = useRef19(/* @__PURE__ */ new Set());
|
|
12849
|
+
const [resolving, setResolving] = useState24(false);
|
|
12850
|
+
useEffect21(() => {
|
|
12851
|
+
if (!officialForm || !search || !code || description || manualDiagnosis || resolved.current.has(code)) return;
|
|
12852
|
+
resolved.current.add(code);
|
|
12853
|
+
let active = true;
|
|
12854
|
+
setResolving(true);
|
|
12855
|
+
void search(code).then((items) => {
|
|
12856
|
+
const match = items.find((item) => item.code.replace(".", "").toUpperCase() === code.replace(".", "").toUpperCase());
|
|
12857
|
+
if (active && match) onChange({ diagnosisCode: match.code, diagnosisDescription: match.description });
|
|
12858
|
+
}).catch(() => void 0).finally(() => {
|
|
12859
|
+
if (active) setResolving(false);
|
|
12860
|
+
});
|
|
12861
|
+
return () => {
|
|
12862
|
+
active = false;
|
|
12863
|
+
};
|
|
12864
|
+
}, [code, description, search, officialForm, manualDiagnosis]);
|
|
12836
12865
|
if (officialForm && search) {
|
|
12837
12866
|
const typed = query.trim().toUpperCase(), known = results.some((item) => item.code.toUpperCase() === typed);
|
|
12838
12867
|
const options = [
|
|
12839
12868
|
...code && !typed && !results.some((item) => item.code === code) ? [{ id: code, label: code, ...description ? { detail: description } : {} }] : [],
|
|
12869
|
+
...!typed ? savedCodes.filter((saved) => saved && saved !== code).map((saved) => ({ id: `saved:${saved}`, label: saved, detail: "Saved on this injury" })) : [],
|
|
12840
12870
|
...results.map((item) => ({ id: item.code, label: item.code, detail: item.description })),
|
|
12841
12871
|
.../^[A-Z]\d[0-9A-Z](\.?[0-9A-Z]{1,4})?$/.test(typed) && !known && typed !== code ? [{ id: `entered:${typed}`, label: `Use ${typed}`, detail: "Enter the diagnosis yourself" }] : []
|
|
12842
12872
|
];
|
|
@@ -12860,11 +12890,12 @@ function RfaDiagnosisFields({ code, description, onChange, search, officialForm
|
|
|
12860
12890
|
const item = results.find((item2) => item2.code === value);
|
|
12861
12891
|
if (item) onChange({ diagnosisCode: item.code, diagnosisDescription: item.description });
|
|
12862
12892
|
else if (value.startsWith("entered:")) onChange({ diagnosisCode: value.slice(8), diagnosisDescription: "" });
|
|
12893
|
+
else if (value.startsWith("saved:")) onChange({ diagnosisCode: value.slice(6), diagnosisDescription: "" });
|
|
12863
12894
|
setQuery("");
|
|
12864
12895
|
}
|
|
12865
12896
|
}
|
|
12866
12897
|
) }) }),
|
|
12867
|
-
code && !listed && (manualDiagnosis || !description) ? /* @__PURE__ */ jsxs37("label", { className: "mbrfa-s3", children: [
|
|
12898
|
+
code && !listed && !resolving && (manualDiagnosis || !description) ? /* @__PURE__ */ jsxs37("label", { className: "mbrfa-s3", children: [
|
|
12868
12899
|
/* @__PURE__ */ jsxs37("span", { children: [
|
|
12869
12900
|
"Diagnosis",
|
|
12870
12901
|
/* @__PURE__ */ jsx39(RfaRequired, {})
|
|
@@ -13149,12 +13180,12 @@ function RfaTemplateBar({ templates, items, renderingProviderId, physicianName,
|
|
|
13149
13180
|
}
|
|
13150
13181
|
|
|
13151
13182
|
// src/rfa-document-drop.tsx
|
|
13152
|
-
import { useRef as
|
|
13183
|
+
import { useRef as useRef20, useState as useState27 } from "react";
|
|
13153
13184
|
import { jsx as jsx42, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
13154
13185
|
var size = (bytes) => bytes >= 1048576 ? `${(bytes / 1048576).toFixed(1)} MB` : `${Math.max(1, Math.round(bytes / 1024))} KB`;
|
|
13155
13186
|
var isPdf = (file) => file.type === "application/pdf" || /\.pdf$/i.test(file.name);
|
|
13156
13187
|
function RfaDocumentDrop({ files, onChange, disabled }) {
|
|
13157
|
-
const input =
|
|
13188
|
+
const input = useRef20(null);
|
|
13158
13189
|
const [over, setOver] = useState27(false);
|
|
13159
13190
|
const [skipped, setSkipped] = useState27(0);
|
|
13160
13191
|
const add = (chosen) => {
|
|
@@ -13217,7 +13248,7 @@ function RfaDocumentDrop({ files, onChange, disabled }) {
|
|
|
13217
13248
|
}
|
|
13218
13249
|
|
|
13219
13250
|
// src/rfa-draft-form.tsx
|
|
13220
|
-
import { useEffect as useEffect23, useRef as
|
|
13251
|
+
import { useEffect as useEffect23, useRef as useRef21, useState as useState28 } from "react";
|
|
13221
13252
|
import { Fragment as Fragment23, jsx as jsx43, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
13222
13253
|
function normalizeRfaDraft(draft2) {
|
|
13223
13254
|
const copy = structuredClone(draft2);
|
|
@@ -13285,7 +13316,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13285
13316
|
useEffect23(() => {
|
|
13286
13317
|
if (officialForm && returnEmail && !physicianEmail) setDraft((current) => current.requestingPractice?.email?.trim() ? current : { ...current, requestingPractice: { ...current.requestingPractice, email: returnEmail } });
|
|
13287
13318
|
}, [officialForm, returnEmail, physicianEmail, savedDraft.requestingPractice?.email]);
|
|
13288
|
-
const filledEmail =
|
|
13319
|
+
const filledEmail = useRef21(void 0);
|
|
13289
13320
|
useEffect23(() => {
|
|
13290
13321
|
if (!officialForm || !physicianEmail) return;
|
|
13291
13322
|
const previous = filledEmail.current;
|
|
@@ -13313,7 +13344,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13313
13344
|
const practiceManual = practiceManualChoice ?? (organizationProfile ? savedPractices.length === 0 || typedPractice && !savedPractices.some((provider) => provider.name === savedDraft.requestingPractice?.name) : !profilePending);
|
|
13314
13345
|
const [administratorOverride, setAdministratorOverride] = useState28(null);
|
|
13315
13346
|
const identityKey = `${identity?.claimId ?? ""}:${identity?.claimsAdminId ?? ""}`;
|
|
13316
|
-
const previousClaim =
|
|
13347
|
+
const previousClaim = useRef21(identityKey);
|
|
13317
13348
|
useEffect23(() => {
|
|
13318
13349
|
if (previousClaim.current !== identityKey) {
|
|
13319
13350
|
setAdministratorOverride(null);
|
|
@@ -13334,7 +13365,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13334
13365
|
else delete draft2.claimsAdminId;
|
|
13335
13366
|
}
|
|
13336
13367
|
const [intent, setIntent] = useState28("save");
|
|
13337
|
-
const intentRef =
|
|
13368
|
+
const intentRef = useRef21(intent);
|
|
13338
13369
|
const chooseIntent = (value) => {
|
|
13339
13370
|
intentRef.current = value;
|
|
13340
13371
|
setIntent(value);
|
|
@@ -13363,7 +13394,11 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13363
13394
|
}) }));
|
|
13364
13395
|
};
|
|
13365
13396
|
const supportingDocumentFields = supportingDocuments && officialForm ? /* @__PURE__ */ jsxs41("fieldset", { disabled: locked, children: [
|
|
13366
|
-
/* @__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." }),
|
|
13367
13402
|
/* @__PURE__ */ jsx43(RfaDocumentDrop, { files: supportingDocuments.files, onChange: supportingDocuments.onChange, disabled: locked })
|
|
13368
13403
|
] }) : supportingDocuments ? /* @__PURE__ */ jsxs41("fieldset", { disabled: locked, children: [
|
|
13369
13404
|
/* @__PURE__ */ jsx43("legend", { children: "Supporting documents" }),
|
|
@@ -13387,7 +13422,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13387
13422
|
event.preventDefault();
|
|
13388
13423
|
if (locked) return;
|
|
13389
13424
|
const next = normalizeRfaDraft(draft2);
|
|
13390
|
-
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));
|
|
13391
13426
|
};
|
|
13392
13427
|
const saveError = action.error ? /* @__PURE__ */ jsxs41("p", { role: "alert", children: [
|
|
13393
13428
|
action.error,
|
|
@@ -13492,7 +13527,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
|
|
|
13492
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" })
|
|
13493
13528
|
] }) : null,
|
|
13494
13529
|
/* @__PURE__ */ jsxs41("div", { className: "mbrfa-form-grid", children: [
|
|
13495
|
-
/* @__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) }),
|
|
13496
13531
|
/* @__PURE__ */ jsxs41("label", { className: "mbrfa-s3 mbrfa-row-start", children: [
|
|
13497
13532
|
/* @__PURE__ */ jsxs41("span", { children: [
|
|
13498
13533
|
"Service/Good Requested",
|
|
@@ -14029,7 +14064,7 @@ function rfaDraftReplacement(draft2, expectedRevision) {
|
|
|
14029
14064
|
}
|
|
14030
14065
|
|
|
14031
14066
|
// src/rfa-lifecycle-controls.tsx
|
|
14032
|
-
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";
|
|
14033
14068
|
import { createRfaClient as createRfaClient3, createRfaLifecycleClient as createRfaLifecycleClient3 } from "@mindbill/browser";
|
|
14034
14069
|
import { Fragment as Fragment25, jsx as jsx45, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
14035
14070
|
var text2 = (form, name) => String(form.get(name) ?? "").trim();
|
|
@@ -14080,9 +14115,9 @@ function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdat
|
|
|
14080
14115
|
};
|
|
14081
14116
|
}, [records, rfa.id, responseDocument, rfa.documents, previewReload]);
|
|
14082
14117
|
const [outcomes, setOutcomes] = useState30({});
|
|
14083
|
-
const alive =
|
|
14084
|
-
const pending =
|
|
14085
|
-
const keys =
|
|
14118
|
+
const alive = useRef22(true);
|
|
14119
|
+
const pending = useRef22(false);
|
|
14120
|
+
const keys = useRef22(/* @__PURE__ */ new Map());
|
|
14086
14121
|
useEffect25(() => {
|
|
14087
14122
|
alive.current = true;
|
|
14088
14123
|
return () => {
|
|
@@ -14513,7 +14548,7 @@ function FollowUpForm({ task, selected, editable, disabled, onSave, onReview, ha
|
|
|
14513
14548
|
}
|
|
14514
14549
|
|
|
14515
14550
|
// src/rfa-provider-signature-setup.tsx
|
|
14516
|
-
import { useRef as
|
|
14551
|
+
import { useRef as useRef23, useState as useState31 } from "react";
|
|
14517
14552
|
import { jsx as jsx46, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
14518
14553
|
function RfaProviderSignatureSetup(props) {
|
|
14519
14554
|
return /* @__PURE__ */ jsx46(SignatureForm, { ...props }, props.renderingProviderId);
|
|
@@ -14524,7 +14559,7 @@ function SignatureForm({ client, renderingProviderId, providerName, disabled, on
|
|
|
14524
14559
|
const [authorized, setAuthorized] = useState31(false);
|
|
14525
14560
|
const [busy, setBusy] = useState31(false);
|
|
14526
14561
|
const [error, setError] = useState31("");
|
|
14527
|
-
const attempt =
|
|
14562
|
+
const attempt = useRef23(null);
|
|
14528
14563
|
return /* @__PURE__ */ jsx46("form", { onSubmit: async (event) => {
|
|
14529
14564
|
event.preventDefault();
|
|
14530
14565
|
if (busy || disabled || !file || !authorized || !actor.trim() || !client.saveProviderSignature) return;
|
|
@@ -14603,7 +14638,7 @@ function RfaDashboard({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOve
|
|
|
14603
14638
|
return /* @__PURE__ */ jsx47(RfaDashboardContent, { ...props, ...patientId ? { patientId } : {}, ...claimId ? { claimId } : {}, ...renderingProviderId ? { renderingProviderId } : {}, client, signatureClient, options }, `${identity.key}:${patientId ?? ""}:${claimId ?? ""}:${renderingProviderId ?? ""}`);
|
|
14604
14639
|
}
|
|
14605
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 }) {
|
|
14606
|
-
const active =
|
|
14641
|
+
const active = useRef24(true);
|
|
14607
14642
|
useEffect26(() => {
|
|
14608
14643
|
active.current = true;
|
|
14609
14644
|
return () => {
|
|
@@ -14672,7 +14707,7 @@ function RfaDashboardContent({ client, signatureClient, options, patientId, clai
|
|
|
14672
14707
|
};
|
|
14673
14708
|
}, [options, creating, selected]);
|
|
14674
14709
|
const [loading, setLoading] = useState32(true);
|
|
14675
|
-
const createKeys =
|
|
14710
|
+
const createKeys = useRef24(/* @__PURE__ */ new Map());
|
|
14676
14711
|
useEffect26(() => {
|
|
14677
14712
|
const timer = setTimeout(() => {
|
|
14678
14713
|
setSearch(searchInput.trim());
|
|
@@ -14882,17 +14917,17 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14882
14917
|
useEffect26(() => {
|
|
14883
14918
|
if (selectedItem || selectedResponseDocumentId) setDetailTab("details");
|
|
14884
14919
|
}, [selectedResponseDocumentId, selectedItem]);
|
|
14885
|
-
const responseFocused =
|
|
14920
|
+
const responseFocused = useRef24(false);
|
|
14886
14921
|
useEffect26(() => {
|
|
14887
14922
|
if (simple && rfa && selectedResponseDocumentId && !responseFocused.current) {
|
|
14888
14923
|
responseFocused.current = true;
|
|
14889
14924
|
document.getElementById(`${tabId}-review`)?.scrollIntoView?.({ block: "start" });
|
|
14890
14925
|
}
|
|
14891
14926
|
}, [simple, rfa, selectedResponseDocumentId, tabId]);
|
|
14892
|
-
const alive =
|
|
14893
|
-
const pending =
|
|
14894
|
-
const loadGeneration =
|
|
14895
|
-
const keys =
|
|
14927
|
+
const alive = useRef24(true);
|
|
14928
|
+
const pending = useRef24(false);
|
|
14929
|
+
const loadGeneration = useRef24(0);
|
|
14930
|
+
const keys = useRef24(/* @__PURE__ */ new Map());
|
|
14896
14931
|
const [descriptions2, setDescriptions] = useState32({});
|
|
14897
14932
|
const [preview, setPreview] = useState32(null);
|
|
14898
14933
|
const [previewPdf, setPreviewPdf] = useState32(null);
|
|
@@ -14935,7 +14970,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14935
14970
|
active = false;
|
|
14936
14971
|
};
|
|
14937
14972
|
}, [client, id, reload]);
|
|
14938
|
-
const currentRfa =
|
|
14973
|
+
const currentRfa = useRef24(rfa);
|
|
14939
14974
|
currentRfa.current = rfa;
|
|
14940
14975
|
useEffect26(() => {
|
|
14941
14976
|
let active = true;
|
|
@@ -14967,7 +15002,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
|
|
|
14967
15002
|
document.removeEventListener("visibilitychange", resume);
|
|
14968
15003
|
};
|
|
14969
15004
|
}, [client, id, editing]);
|
|
14970
|
-
const focusedTreatment =
|
|
15005
|
+
const focusedTreatment = useRef24(null);
|
|
14971
15006
|
useEffect26(() => {
|
|
14972
15007
|
if (!rfa || !selectedItem || focusedTreatment.current === selectedItem) return;
|
|
14973
15008
|
const element = document.getElementById(`rfa-treatment-${selectedItem}`);
|
|
@@ -17002,7 +17037,7 @@ function ConnectedPaymentReview({ initialQuery, onSelectBill, onPostPayment, app
|
|
|
17002
17037
|
}
|
|
17003
17038
|
|
|
17004
17039
|
// src/notification-settings.tsx
|
|
17005
|
-
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";
|
|
17006
17041
|
import { Fragment as Fragment31, jsx as jsx56, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
17007
17042
|
function defaultNotificationPreferences() {
|
|
17008
17043
|
return { enabled: false, statusUpdates: false, agingDays: [], quietHours: true, reportDigest: "off" };
|
|
@@ -17044,7 +17079,7 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
|
|
|
17044
17079
|
const [notice, setNotice] = useState36("");
|
|
17045
17080
|
const [failed, setFailed] = useState36(false);
|
|
17046
17081
|
const [reload, setReload] = useState36(0);
|
|
17047
|
-
const request =
|
|
17082
|
+
const request = useRef25(0);
|
|
17048
17083
|
useEffect29(() => {
|
|
17049
17084
|
const current = ++request.current;
|
|
17050
17085
|
setPhase("loading");
|
|
@@ -17188,7 +17223,7 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
|
|
|
17188
17223
|
}
|
|
17189
17224
|
|
|
17190
17225
|
// src/notification-recipients.tsx
|
|
17191
|
-
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";
|
|
17192
17227
|
import { jsx as jsx57, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
17193
17228
|
function notificationRecipientInvitation(input, requestId) {
|
|
17194
17229
|
const preferences = notificationSettingsUpdate({ ...input, enabled: false }, false);
|
|
@@ -17229,8 +17264,8 @@ function RecipientSettingsSession({ adapter, appearance, className, style }) {
|
|
|
17229
17264
|
const [notice, setNotice] = useState37("");
|
|
17230
17265
|
const [failed, setFailed] = useState37(false);
|
|
17231
17266
|
const [hasReceipt, setHasReceipt] = useState37(false);
|
|
17232
|
-
const generation =
|
|
17233
|
-
const pending =
|
|
17267
|
+
const generation = useRef26(0);
|
|
17268
|
+
const pending = useRef26(null);
|
|
17234
17269
|
useEffect30(() => {
|
|
17235
17270
|
const current = ++generation.current;
|
|
17236
17271
|
setBusy(true);
|
|
@@ -17388,7 +17423,7 @@ import {
|
|
|
17388
17423
|
useCallback as useCallback4,
|
|
17389
17424
|
useEffect as useEffect31,
|
|
17390
17425
|
useMemo as useMemo16,
|
|
17391
|
-
useRef as
|
|
17426
|
+
useRef as useRef27,
|
|
17392
17427
|
useState as useState38
|
|
17393
17428
|
} from "react";
|
|
17394
17429
|
import {
|
|
@@ -17539,11 +17574,11 @@ function useBillStatus({
|
|
|
17539
17574
|
const [error, setError] = useState38(null);
|
|
17540
17575
|
const [isLoading, setIsLoading] = useState38(enabled && !initialData);
|
|
17541
17576
|
const [isRefreshing, setIsRefreshing] = useState38(false);
|
|
17542
|
-
const dataRef =
|
|
17543
|
-
const initialDataRef =
|
|
17577
|
+
const dataRef = useRef27(initialData);
|
|
17578
|
+
const initialDataRef = useRef27(initialData);
|
|
17544
17579
|
initialDataRef.current = initialData;
|
|
17545
|
-
const activeControllerRef =
|
|
17546
|
-
const requestSequence =
|
|
17580
|
+
const activeControllerRef = useRef27(null);
|
|
17581
|
+
const requestSequence = useRef27(0);
|
|
17547
17582
|
useEffect31(() => {
|
|
17548
17583
|
const seed = initialDataRef.current;
|
|
17549
17584
|
dataRef.current = seed;
|
|
@@ -17646,7 +17681,7 @@ function ConnectedBillStatus({
|
|
|
17646
17681
|
}
|
|
17647
17682
|
|
|
17648
17683
|
// src/bill-lifecycle-surfaces.tsx
|
|
17649
|
-
import { useEffect as useEffect32, useRef as
|
|
17684
|
+
import { useEffect as useEffect32, useRef as useRef28, useState as useState39 } from "react";
|
|
17650
17685
|
import { Fragment as Fragment33, jsx as jsx59, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
17651
17686
|
function visibleBillLifecycleActions(actions2, showUnavailable = false, maxVisible) {
|
|
17652
17687
|
const visible = actions2.filter((action) => action.enabled || showUnavailable);
|
|
@@ -17724,7 +17759,7 @@ function historyDate(iso) {
|
|
|
17724
17759
|
}
|
|
17725
17760
|
function BillHistoryTable({ entries, selectedEntryId, emptyLabel = "No bill history yet.", appearance, className, style, formatDate = historyDate, documentHref, onOpenDocument }) {
|
|
17726
17761
|
const [expanded, setExpanded] = useState39({});
|
|
17727
|
-
const selectedRowRef =
|
|
17762
|
+
const selectedRowRef = useRef28(null);
|
|
17728
17763
|
useEffect32(() => {
|
|
17729
17764
|
if (!selectedEntryId) return;
|
|
17730
17765
|
const selected = entries.find((entry) => entry.id === selectedEntryId);
|
|
@@ -18286,7 +18321,7 @@ import {
|
|
|
18286
18321
|
useCallback as useCallback5,
|
|
18287
18322
|
useEffect as useEffect33,
|
|
18288
18323
|
useMemo as useMemo18,
|
|
18289
|
-
useRef as
|
|
18324
|
+
useRef as useRef29,
|
|
18290
18325
|
useState as useState41
|
|
18291
18326
|
} from "react";
|
|
18292
18327
|
import {
|
|
@@ -18678,7 +18713,7 @@ function useBillLifecycle({
|
|
|
18678
18713
|
const [isLoading, setIsLoading] = useState41(enabled);
|
|
18679
18714
|
const [isRefreshing, setIsRefreshing] = useState41(false);
|
|
18680
18715
|
const [isMutating, setIsMutating] = useState41(false);
|
|
18681
|
-
const mounted =
|
|
18716
|
+
const mounted = useRef29(true);
|
|
18682
18717
|
const client = useMemo18(() => createBillLifecycleClient({
|
|
18683
18718
|
billId: providedBillId,
|
|
18684
18719
|
sessionEndpoint,
|
|
@@ -18841,8 +18876,8 @@ function useBillLifecycle({
|
|
|
18841
18876
|
};
|
|
18842
18877
|
}
|
|
18843
18878
|
function LifecycleDialog({ children, title, wide = false, onClose }) {
|
|
18844
|
-
const dialog =
|
|
18845
|
-
const onCloseRef =
|
|
18879
|
+
const dialog = useRef29(null);
|
|
18880
|
+
const onCloseRef = useRef29(onClose);
|
|
18846
18881
|
onCloseRef.current = onClose;
|
|
18847
18882
|
useEffect33(() => {
|
|
18848
18883
|
const previous = document.activeElement;
|
|
@@ -19140,7 +19175,7 @@ function ConnectedBillLifecycle({
|
|
|
19140
19175
|
setPanel("");
|
|
19141
19176
|
}, [currentAttemptKey]);
|
|
19142
19177
|
const actor = actorName?.trim() ? { actorName: actorName.trim() } : {};
|
|
19143
|
-
const lastData =
|
|
19178
|
+
const lastData = useRef29(null);
|
|
19144
19179
|
const correctionInitialBill = useMemo18(() => data ? correctionBill(data) : null, [data]);
|
|
19145
19180
|
const correctionAttachments = useMemo18(() => data ? data.bill.attachments.map((attachment) => {
|
|
19146
19181
|
const documentType = correctionDocumentType(attachment.documentType);
|
|
@@ -19655,7 +19690,7 @@ import {
|
|
|
19655
19690
|
useId as useId12,
|
|
19656
19691
|
useLayoutEffect,
|
|
19657
19692
|
useMemo as useMemo19,
|
|
19658
|
-
useRef as
|
|
19693
|
+
useRef as useRef30,
|
|
19659
19694
|
useState as useState42
|
|
19660
19695
|
} from "react";
|
|
19661
19696
|
import { Fragment as Fragment36, jsx as jsx62, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
@@ -19711,7 +19746,7 @@ function Surface({ appearance, className = "", style, children, surfaceRef }) {
|
|
|
19711
19746
|
] });
|
|
19712
19747
|
}
|
|
19713
19748
|
function useAvailableViewportHeight() {
|
|
19714
|
-
const workspaceRef =
|
|
19749
|
+
const workspaceRef = useRef30(null);
|
|
19715
19750
|
const [availableHeight, setAvailableHeight] = useState42(null);
|
|
19716
19751
|
useLayoutEffect(() => {
|
|
19717
19752
|
const element = workspaceRef.current;
|
|
@@ -20332,7 +20367,7 @@ function DentalDraftEditor({ initialContent, onSave, disabled = false, ...appear
|
|
|
20332
20367
|
|
|
20333
20368
|
// src/index.tsx
|
|
20334
20369
|
function widget(tagName, props) {
|
|
20335
|
-
const ref =
|
|
20370
|
+
const ref = useRef31(null);
|
|
20336
20371
|
const { onMindBill, onMindBillError } = props;
|
|
20337
20372
|
useEffect35(() => {
|
|
20338
20373
|
const element = ref.current;
|