@mindbill/react 0.77.56 → 0.77.58

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactElement, CSSProperties, ReactNode } from 'react';
3
3
  import * as _mindbill_browser from '@mindbill/browser';
4
- import { MedicalProviderNetwork, BillReferenceClient, CaClaimFeeQuoteInput, CaClaimFeeQuoteResult, BillCourtesyCopyInput, BillCourtesyCopyPreview, BillCourtesyCopyResult, SubmitBillInput, BillDeliveryOptions as BillDeliveryOptions$1, BillFeeContext, ClaimForm, BillFormData, BillReviewPayerOption, BilledDrug, BillLineFormData, OrganizationClientOptions, BrowserBillSubmissionResult, BillLifecycleSessionProvider, BillReviewPayerListInput, BillReviewPayerPage, BillReviewPayer as BillReviewPayer$1, BillClaimsAdministratorDirectory, BillClaimsAdministratorSource, BillProcedureCodeSearchInput, BillProcedureCodePage, BillFeeQuoteInput, BillFeeQuote, BrowserBillSubmissionDocument, OrganizationProfileData, HistoricalBillReviewData, BillReviewClinician as BillReviewClinician$1, BillLifecycleDelivery, BillReviewAttachment as BillReviewAttachment$1, RfaFollowUp, RfaContact, BillDiagnosisCode, RfaRecord, RfaListQuery, BillTasksDashboardData, BillTasksAgingBucket, BillHistoryEntry, BillAttemptSummary, ReportBillStatusInput, BillEorDocument, BillPaymentRecord, BillRemittanceSummary, BillLifecycleAction, BillRejection, BillLifecycleData, BillLifecycleClientOptions, BillLifecycleClient, SubmitSecondReviewInput, RfaAuthorizationDestinationOption, ReportAutofillResult, RfaForwardResult } from '@mindbill/browser';
4
+ import { MedicalProviderNetwork, BillReferenceClient, CaClaimFeeQuoteInput, CaClaimFeeQuoteResult, BillCourtesyCopyInput, BillCourtesyCopyPreview, BillCourtesyCopyResult, SubmitBillInput, BillDeliveryOptions as BillDeliveryOptions$1, BillFeeContext, ClaimForm, BillFormData, BillReviewPayerOption, BilledDrug, BillLineFormData, OrganizationClientOptions, BrowserBillSubmissionResult, BillLifecycleSessionProvider, BillReviewPayerListInput, BillReviewPayerPage, BillReviewPayer as BillReviewPayer$1, BillClaimsAdministratorDirectory, BillClaimsAdministratorSource, BillProcedureCodeSearchInput, BillProcedureCodePage, BillFeeQuoteInput, BillFeeQuote, BrowserBillSubmissionDocument, OrganizationProfileData, HistoricalBillReviewData, BillReviewClinician as BillReviewClinician$1, BillLifecycleDelivery, BillReviewAttachment as BillReviewAttachment$1, RfaRecord, RfaFollowUp, RfaContact, BillDiagnosisCode, RfaListQuery, BillTasksDashboardData, BillTasksAgingBucket, BillHistoryEntry, BillAttemptSummary, ReportBillStatusInput, BillEorDocument, BillPaymentRecord, BillRemittanceSummary, BillLifecycleAction, BillRejection, BillLifecycleData, BillLifecycleClientOptions, BillLifecycleClient, SubmitSecondReviewInput, RfaAuthorizationDestinationOption, ReportAutofillResult, RfaForwardResult } from '@mindbill/browser';
5
5
  export { BILL_TASKS_AGING_BUCKETS, BillActivityRecord, BillClaimsAdministratorAuthorizationStatus, BillClaimsAdministratorContact, BillClaimsAdministratorDirectory, BillClaimsAdministratorMailingAddress, BillClaimsAdministratorPattern, BillClaimsAdministratorPayer, BillClaimsAdministratorSource, BillCourtesyCopyInput, BillCourtesyCopyPreview, BillCourtesyCopyResult, BillEorDocument, BillFeeContext, BillFormData, BillFormValue, BillLifecycleAction, BillLifecycleActionId, BillLifecycleClient, BillLifecycleClientOptions, BillLifecycleData, BillLifecycleDelivery, BillLifecycleSession, BillLifecycleSessionProvider, BillLifecycleSessionRequest, BillLineFormData, BillPaymentRecord, BillRejection, BillRemittanceSummary, BillReviewPayerOption, BillReviewPayerSuggestion, BillSubmissionDetail, BillTasksAgingBucket, BillTasksDashboardData, BillTasksDashboardItem, BillTasksDashboardRow, BillTasksDashboardSection, BillTasksDashboardSectionInput, BillTasksDashboardTone, BillTeamNote, BilledDrug, BrowserBillSubmissionResult, CaClaimFeeQuoteInput, CaClaimFeeQuoteResult, ClaimForm, CloseBillInput, HistoricalBillReviewData, MedicalProviderNetwork, PostBillPaymentInput, REPORT_BILL_STATUS_OPTIONS, ReopenBillInput, ReportBillStatusContacts, ReportBillStatusId, ReportBillStatusInput, RfaAuthorizationDestinationOption, RfaCreateDraftInput, RfaRecord, RfaSigningPreview, SECOND_REVIEW_REASON_TEMPLATE, SECOND_REVIEW_WINDOW_DAYS, SecondReviewDeadline, SendDuplicateBillInput, SubmitSecondReviewInput, billTasksAgingBucketIndex, buildBillTasksDashboard, createBillLifecycleClient, reportBillStatusContacts, secondReviewDeadline } from '@mindbill/browser';
6
6
  import { MindBillAppearance, MindBillEventDetail, MindBillErrorDetail } from '@mindbill/embed';
7
7
  export { MindBillAppearance, MindBillErrorDetail, MindBillEventDetail } from '@mindbill/embed';
@@ -901,6 +901,39 @@ type TreatmentDraftAppearance = {
901
901
  disabled?: boolean;
902
902
  };
903
903
 
904
+ type RfaLifecycleControlsProps = OrganizationClientOptions & TreatmentDraftAppearance & {
905
+ rfa: RfaRecord;
906
+ selectedResponseDocumentId?: string;
907
+ /** Opt in only when your server grants rfas:act or rfas:edit, respectively. */
908
+ permissions?: readonly ("act" | "edit")[];
909
+ onUpdated?: (rfa: RfaRecord) => void;
910
+ /** Render as rows inside a host card, without the panel heading or summary notes. */
911
+ rows?: boolean;
912
+ /** Host-provided reading of a response document (for example OCR plus a model). When given, choosing a response
913
+ * prefills its treatment decisions for a person to check. Failures leave the form empty; nothing is saved automatically. */
914
+ readResponse?: (rfaId: string, documentId: string) => Promise<RfaResponseReading>;
915
+ };
916
+ /** What was read from a utilization review response, for a person to check. Nothing here is saved until they confirm. */
917
+ type RfaResponseReading = {
918
+ status: "read" | "unreadable";
919
+ decidedAt?: string;
920
+ items: Array<{
921
+ itemId: string;
922
+ outcome: "approved" | "modified" | "denied" | "not_addressed";
923
+ confident: boolean;
924
+ authorizationNumber?: string;
925
+ authorizedProcedureCode?: string;
926
+ authorizedQuantity?: number;
927
+ authorizedUnits?: number;
928
+ effectiveFrom?: string;
929
+ effectiveTo?: string;
930
+ decisionReason?: string;
931
+ reviewerName?: string;
932
+ reviewerPhone?: string;
933
+ }>;
934
+ };
935
+ declare function RfaLifecycleControls({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride, ...props }: RfaLifecycleControlsProps): ReactElement;
936
+
904
937
  type RfaTaskState = "Due" | "Scheduled" | "Completed";
905
938
  type RfaTaskAge = "0-5" | "6-14" | "15-30" | "31+" | "unknown";
906
939
  /** Staff task filters, independent from RFA lifecycle/clinical status. */
@@ -1178,6 +1211,8 @@ type RfaDashboardProps = OrganizationClientOptions & TreatmentDraftAppearance &
1178
1211
  renderClaimSelector?: (props: RfaClaimSelectorProps) => ReactNode;
1179
1212
  /** Host-owned saved provider selection and provider creation. Newly selected providers are resolved through creation context. */
1180
1213
  renderProviderSelector?: (props: RfaProviderSelectorProps) => ReactNode;
1214
+ /** Reads a utilization review response so its treatment decisions open prefilled for a person to check. See RfaLifecycleControls. */
1215
+ readRfaResponse?: RfaLifecycleControlsProps["readResponse"];
1181
1216
  canManageProviderSignatures?: boolean;
1182
1217
  /** Host-owned physician signature setup inside the send dialog (for example draw or upload buttons). `missing` holds the send until
1183
1218
  * the host reports a saved signature; leave it undefined when the host cannot tell. Replaces the built-in PNG upload there. */
@@ -2259,17 +2294,6 @@ type RfaAuthorizationDestinationProps = {
2259
2294
  /** Choose a destination without sending an RFA or treating email as fax. */
2260
2295
  declare function RfaAuthorizationDestination({ contextKey, directory, savedContact, loading, error, disabled, onChange, onSelectionStart, compact, onManualEntry, autoSelectSingle, method, preselectSaved }: RfaAuthorizationDestinationProps): ReactElement;
2261
2296
 
2262
- type RfaLifecycleControlsProps = OrganizationClientOptions & TreatmentDraftAppearance & {
2263
- rfa: RfaRecord;
2264
- selectedResponseDocumentId?: string;
2265
- /** Opt in only when your server grants rfas:act or rfas:edit, respectively. */
2266
- permissions?: readonly ("act" | "edit")[];
2267
- onUpdated?: (rfa: RfaRecord) => void;
2268
- /** Render as rows inside a host card, without the panel heading or summary notes. */
2269
- rows?: boolean;
2270
- };
2271
- declare function RfaLifecycleControls({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride, ...props }: RfaLifecycleControlsProps): ReactElement;
2272
-
2273
2297
  type ReportAutofillProps = OrganizationClientOptions & {
2274
2298
  /** Use an authenticated host endpoint instead of a MindBill browser session. */
2275
2299
  analyzeReport?(file: File): Promise<ReportAutofillResult>;
package/dist/index.js CHANGED
@@ -10531,6 +10531,7 @@ function TreatmentDraftShell({ title, description, children, hideHeading = false
10531
10531
  .mbtd .mbrfa-section-actions{display:flex;gap:12px;align-items:center;margin-top:14px;font-size:12px;color:var(--mb-muted)}
10532
10532
  .mbtd .mbrfa-field-hint{font-size:12px;color:var(--mb-muted);font-weight:400}
10533
10533
  .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}
10534
+ .mbtd .mbrfa-reading{margin:0 0 10px;padding:8px 12px;border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 7%,var(--mb-surface));color:var(--mb-text);font-size:13px}.mbtd .mbrfa-reading[data-flag=true]{background:#fff4e5;color:#7a4a00}.mbtd fieldset[data-flag=true]{border-color:#f0a23b;box-shadow:inset 3px 0 0 #f0a23b}
10534
10535
  .mbtd .mbrfa-template-save>.mbrfa-section-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.mbtd .mbrfa-template-save>.mbrfa-section-actions>button{flex:0 0 auto;white-space:nowrap}.mbtd .mbrfa-template-save>.mbrfa-section-actions>span{flex:1 0 100%;font-size:12px;color:var(--mb-muted)}
10535
10536
  @media(max-width:760px){.mbtd .mbrfa-template-save{grid-template-columns:minmax(0,1fr)}}
10536
10537
  .mbtd .mbrfa-form-grid>.mbrfa-row-start{grid-column:1/span 3}.mbtd .mbrfa-form-grid textarea[rows="2"]{min-height:44px}
@@ -10597,22 +10598,29 @@ var taskViewDescriptions = {
10597
10598
  Scheduled: "Open tasks with a future follow-up date. This does not mean a treatment appointment is scheduled.",
10598
10599
  Completed: "Tasks that have been resolved. Completing a task does not necessarily close its RFA."
10599
10600
  };
10600
- var names = { send_rfa: "Send RFA", no_response: "Decision overdue", transmission_failed: "Submission failed", information_requested: "Respond to information request", clock_review: "Deadline needs review", schedule_treatment: "Schedule treatment", post_ur_decision: "Post UR", document_required: "Add supporting documents" };
10601
+ var names = { send_rfa: "Send RFA", no_response: "Decision overdue", transmission_failed: "Submission failed", information_requested: "Respond to information request", clock_review: "Deadline needs review", schedule_treatment: "Schedule treatment", post_ur_decision: "Post UR", post_ur_approved: "Approved \u2014 confirm and bill", post_ur_denied: "Denied or modified \u2014 review", document_required: "Add supporting documents" };
10601
10602
  var descriptions = {
10602
10603
  transmission_failed: "Delivery failed. Correct the issue before sending again.",
10603
10604
  no_response: "The decision deadline passed without a recorded decision.",
10604
10605
  clock_review: "The deadline cannot yet be calculated confidently. Review receipt and timing details.",
10605
- post_ur_decision: "Record the treatment decisions in a received utilization review response.",
10606
+ post_ur_decision: "A response arrived and its decisions are not recorded yet. Check what was read from it and save.",
10607
+ post_ur_approved: "Every treatment in this response was approved. Confirm the review, then bill the authorized care.",
10608
+ post_ur_denied: "This response denied or modified treatment. Confirm the review and decide on an appeal or independent medical review.",
10606
10609
  information_requested: "Provide the additional information requested by the reviewer.",
10607
10610
  schedule_treatment: "Arrange treatment after approval."
10608
10611
  };
10612
+ function rfaTaskByResponseOutcome(task) {
10613
+ const outcome = task.responseOutcome;
10614
+ if (task.kind !== "post_ur_decision" || !outcome) return task;
10615
+ return { ...task, kind: outcome === "approved" ? "post_ur_approved" : "post_ur_denied" };
10616
+ }
10609
10617
  var rfaTaskLabel = (kind) => names[kind] ?? kind.replaceAll("_", " ");
10610
10618
  var taskAgeColumns = [{ key: "0-5", label: "0\u20135 days" }, { key: "6-14", label: "6\u201314 days" }, { key: "15-30", label: "15\u201330 days" }, { key: "31+", label: "31+ days" }];
10611
10619
  var taskGroups = [
10612
10620
  { title: "Incomplete RFAs", kinds: ["document_required", "send_rfa"] },
10613
10621
  { title: "Delivery issues", kinds: ["transmission_failed"] },
10614
10622
  { title: "Decision deadlines", kinds: ["no_response", "clock_review"] },
10615
- { title: "Responses to process", kinds: ["post_ur_decision", "information_requested"] },
10623
+ { title: "Responses to process", kinds: ["post_ur_decision", "post_ur_approved", "post_ur_denied", "information_requested"] },
10616
10624
  { title: "Treatment scheduling", kinds: ["schedule_treatment"] }
10617
10625
  ];
10618
10626
  function rfaTaskAgeBucket(createdAt, now = Date.now()) {
@@ -10674,7 +10682,7 @@ function TaskBoardContent({ options, patientId, claimId, renderingProviderId, pe
10674
10682
  let cursor;
10675
10683
  do {
10676
10684
  const result = await client.listFollowUps({ ...patientId ? { patientId } : {}, ...claimId ? { claimId } : {}, ...renderingProviderId ? { renderingProviderId } : {}, includeResolved: true, limit: 200, ...cursor ? { cursor } : {} });
10677
- found.push(...result.data);
10685
+ found.push(...result.data.map(rfaTaskByResponseOutcome));
10678
10686
  cursor = result.nextCursor ?? void 0;
10679
10687
  if (cursor && seen.has(cursor)) throw new Error("Task pagination could not be completed. Retrying automatically.");
10680
10688
  if (cursor) seen.add(cursor);
@@ -14153,7 +14161,7 @@ var rfaSendDialogCss = `.mbrfa-send-backdrop{position:fixed;z-index:1000;inset:0
14153
14161
  .mbrfa-send [role=alert]{color:var(--mb-danger,#b42318);font-size:13px}
14154
14162
  @media(max-width:640px){.mbrfa-send-backdrop{place-items:end stretch;padding:0}.mbrfa-send{width:100%;max-height:92vh;border-radius:var(--mb-radius) var(--mb-radius) 0 0}.mbrfa-send>footer{flex-direction:column}.mbrfa-send>footer>a{margin:0;align-self:center}}`;
14155
14163
  var treatmentDetail = (item) => [item.procedureCode ? `CPT/HCPCS ${item.procedureCode}` : "", item.quantity ? `Qty ${item.quantity}` : "", item.frequency ?? "", item.duration ?? "", `Dx ${item.diagnosisCode}`].filter(Boolean).join(" \xB7 ");
14156
- function RfaSendDialog({ rfa, client, documentIds, diagnosisDescriptions, directory, directoryLoading, directoryError, environment, canSend, canSign, actorReference, previewUrl, signatureSetup, signatureMissing, onUpdated, onSent, onClose }) {
14164
+ function RfaSendDialog({ rfa, client, documentIds, diagnosisDescriptions, directory, directoryLoading, directoryError, environment, canSend, canSign, actorReference, previewUrl, signatureSetup, signatureMissing, resend, onUpdated, onSent, onClose }) {
14157
14165
  const [method, setMethod] = useState30(() => !rfa.authorizationContact?.fax?.trim() && rfa.authorizationContact?.email?.trim() ? "email" : "fax");
14158
14166
  const [destination, setDestination] = useState30(null);
14159
14167
  const [message, setMessage] = useState30("");
@@ -14265,6 +14273,7 @@ function RfaSendDialog({ rfa, client, documentIds, diagnosisDescriptions, direct
14265
14273
  supporting.length ? /* @__PURE__ */ jsx45("ul", { children: supporting.map((document2) => /* @__PURE__ */ jsx45("li", { children: document2.filename }, document2.id)) }) : /* @__PURE__ */ jsx45("p", { children: "None attached yet." })
14266
14274
  ] })
14267
14275
  ] }),
14276
+ resend ? /* @__PURE__ */ jsx45("p", { className: "mbrfa-send-signature", role: "status", children: "The last attempt did not go through. Check the destination with the claims administrator, or choose another way to send, then send again." }) : null,
14268
14277
  /* @__PURE__ */ jsxs43("div", { className: "mbrfa-send-methods", role: "radiogroup", "aria-label": "Send by", children: [
14269
14278
  /* @__PURE__ */ jsx45("span", { children: "Send by" }),
14270
14279
  /* @__PURE__ */ jsxs43("label", { children: [
@@ -14564,12 +14573,17 @@ var timestamp2 = (form, name) => {
14564
14573
  };
14565
14574
  var label3 = (value) => value.replaceAll("_", " ");
14566
14575
  var displayDate = (value) => value ? new Date(value).toLocaleString() : "Not recorded";
14576
+ var localDateTime = (value) => {
14577
+ const date8 = value ? new Date(value) : null;
14578
+ if (!date8 || !Number.isFinite(date8.getTime())) return "";
14579
+ return new Date(date8.getTime() - date8.getTimezoneOffset() * 6e4).toISOString().slice(0, 16);
14580
+ };
14567
14581
  function RfaLifecycleControls({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride, ...props }) {
14568
14582
  const options = useMemo12(() => ({ ...sessionEndpoint ? { sessionEndpoint } : {}, ...getSession ? { getSession } : {}, ...apiBaseUrl ? { apiBaseUrl } : {}, ...fetchOverride ? { fetch: fetchOverride } : {} }), [sessionEndpoint, getSession, apiBaseUrl, fetchOverride]);
14569
14583
  const identity = useMemo12(() => crypto.randomUUID(), [options]);
14570
14584
  return /* @__PURE__ */ jsx47(LifecycleContent, { ...props, options }, `${identity}:${props.rfa.id}`);
14571
14585
  }
14572
- function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdated, selectedResponseDocumentId, rows: rows3 = false, ...appearance }) {
14586
+ function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdated, selectedResponseDocumentId, rows: rows3 = false, readResponse, ...appearance }) {
14573
14587
  const [rfa, setRfa] = useState32(providedRfa);
14574
14588
  useEffect27(() => {
14575
14589
  setRfa(providedRfa);
@@ -14587,6 +14601,9 @@ function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdat
14587
14601
  const [responsePdf, setResponsePdf] = useState32(null);
14588
14602
  const [previewError, setPreviewError] = useState32("");
14589
14603
  const [previewReload, setPreviewReload] = useState32(0);
14604
+ const [reading, setReading] = useState32(null);
14605
+ const [readingBusy, setReadingBusy] = useState32(false);
14606
+ const [readingChecked, setReadingChecked] = useState32(false);
14590
14607
  useEffect27(() => {
14591
14608
  let active = true;
14592
14609
  setResponsePdf(null);
@@ -14603,6 +14620,27 @@ function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdat
14603
14620
  };
14604
14621
  }, [records, rfa.id, responseDocument, rfa.documents, previewReload]);
14605
14622
  const [outcomes, setOutcomes] = useState32({});
14623
+ useEffect27(() => {
14624
+ let active = true;
14625
+ setReading(null);
14626
+ setReadingChecked(false);
14627
+ if (!readResponse || !responseDocument || !rfa.documents.some((document2) => document2.id === responseDocument && document2.documentType === "ur_response")) return;
14628
+ setReadingBusy(true);
14629
+ readResponse(rfa.id, responseDocument).then((value) => {
14630
+ if (!active) return;
14631
+ setReading({ documentId: responseDocument, value });
14632
+ if (value.status === "read") setOutcomes(Object.fromEntries(value.items.filter((item) => item.outcome !== "not_addressed").map((item) => [item.itemId, item.outcome])));
14633
+ }).catch(() => {
14634
+ if (active) setReading({ documentId: responseDocument, value: { status: "unreadable", items: [] } });
14635
+ }).finally(() => {
14636
+ if (active) setReadingBusy(false);
14637
+ });
14638
+ return () => {
14639
+ active = false;
14640
+ };
14641
+ }, [readResponse, rfa.id, responseDocument]);
14642
+ const read = reading?.documentId === responseDocument && reading.value.status === "read" ? reading.value : null;
14643
+ const readItem = (itemId) => read?.items.find((item) => item.itemId === itemId);
14606
14644
  const alive = useRef24(true);
14607
14645
  const pending = useRef24(false);
14608
14646
  const keys = useRef24(/* @__PURE__ */ new Map());
@@ -14808,15 +14846,21 @@ function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdat
14808
14846
  return decision;
14809
14847
  });
14810
14848
  if (!decisions.length) throw new Error("Choose at least one treatment decision. Other treatments remain pending.");
14849
+ if (read && !readingChecked) throw new Error("Confirm that you checked these decisions against the response.");
14811
14850
  if (decisions.some((item) => item.outcome !== "approved") && !text2(data, "imrDocumentId")) throw new Error("An independent medical review form is required for modified or denied treatment.");
14812
14851
  return { decidedAt: timestamp2(data, "decidedAt"), responseDocumentId: text2(data, "responseDocumentId"), ...text2(data, "imrDocumentId") ? { imrDocumentId: text2(data, "imrDocumentId") } : {}, decisions };
14813
14852
  }, (input, key2) => client.recordDecisions(rfa.id, input, key2)), children: /* @__PURE__ */ jsxs45("fieldset", { disabled, children: [
14814
14853
  /* @__PURE__ */ jsx47("legend", { children: "Treatment decisions" }),
14815
14854
  /* @__PURE__ */ jsx47("p", { children: "Record only treatments addressed by this response. Unselected treatments remain pending." }),
14855
+ readingBusy ? /* @__PURE__ */ jsx47("p", { role: "status", children: "Reading the response\u2026" }) : read ? /* @__PURE__ */ jsxs45("p", { className: "mbrfa-reading", role: "status", children: [
14856
+ "These decisions were read from the response. Check each one against the document before saving",
14857
+ read.items.some((item) => !item.confident || item.outcome === "not_addressed") ? "; the ones marked in orange need a closer look" : "",
14858
+ "."
14859
+ ] }) : reading?.documentId === responseDocument ? /* @__PURE__ */ jsx47("p", { className: "mbrfa-reading", "data-flag": "true", role: "status", children: "This response could not be read automatically. Enter the decisions from the document." }) : null,
14816
14860
  /* @__PURE__ */ jsxs45("div", { className: "mbtd-grid", children: [
14817
14861
  /* @__PURE__ */ jsxs45("label", { children: [
14818
14862
  "Decision time",
14819
- /* @__PURE__ */ jsx47("input", { type: "datetime-local", name: "decidedAt", required: true })
14863
+ /* @__PURE__ */ jsx47("input", { type: "datetime-local", name: "decidedAt", required: true, defaultValue: localDateTime(read?.decidedAt) }, `decidedAt:${read ? reading.documentId : ""}`)
14820
14864
  ] }),
14821
14865
  /* @__PURE__ */ jsxs45("label", { children: [
14822
14866
  "Utilization review response",
@@ -14827,65 +14871,75 @@ function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdat
14827
14871
  ] }),
14828
14872
  documentSelect("imrDocumentId", "Independent medical review form", ["imr_form"], false)
14829
14873
  ] }),
14830
- pendingItems.map((item) => /* @__PURE__ */ jsxs45("fieldset", { children: [
14831
- /* @__PURE__ */ jsxs45("legend", { children: [
14832
- item.procedureCode || "Treatment",
14833
- ": ",
14834
- item.serviceDescription
14835
- ] }),
14836
- /* @__PURE__ */ jsxs45("label", { children: [
14837
- "Decision for ",
14838
- item.procedureCode || item.serviceDescription,
14839
- /* @__PURE__ */ jsxs45("select", { value: outcomes[item.id] ?? "", onChange: (event) => setOutcomes((value) => ({ ...value, [item.id]: event.target.value })), children: [
14840
- /* @__PURE__ */ jsx47("option", { value: "", children: "Leave pending" }),
14841
- /* @__PURE__ */ jsx47("option", { value: "approved", children: "Approved" }),
14842
- /* @__PURE__ */ jsx47("option", { value: "modified", children: "Modified" }),
14843
- /* @__PURE__ */ jsx47("option", { value: "denied", children: "Denied" })
14844
- ] })
14845
- ] }),
14846
- outcomes[item.id] ? /* @__PURE__ */ jsxs45("div", { className: "mbtd-grid", children: [
14847
- outcomes[item.id] !== "denied" ? /* @__PURE__ */ jsxs45(Fragment27, { children: [
14848
- /* @__PURE__ */ jsxs45("label", { children: [
14849
- "Authorization number",
14850
- /* @__PURE__ */ jsx47("input", { name: `${item.id}:authorizationNumber`, required: true })
14851
- ] }),
14852
- /* @__PURE__ */ jsxs45("label", { children: [
14853
- "Authorized procedure code",
14854
- /* @__PURE__ */ jsx47("input", { name: `${item.id}:authorizedProcedureCode` })
14855
- ] }),
14856
- /* @__PURE__ */ jsxs45("label", { children: [
14857
- "Authorized quantity",
14858
- /* @__PURE__ */ jsx47("input", { name: `${item.id}:authorizedQuantity`, type: "number", min: "0.001", max: "100000", step: "any" })
14859
- ] }),
14860
- /* @__PURE__ */ jsxs45("label", { children: [
14861
- "Authorized units",
14862
- /* @__PURE__ */ jsx47("input", { name: `${item.id}:authorizedUnits`, type: "number", min: "1", max: "100000" })
14863
- ] }),
14864
- /* @__PURE__ */ jsxs45("label", { children: [
14865
- "Effective from",
14866
- /* @__PURE__ */ jsx47("input", { name: `${item.id}:effectiveFrom`, type: "date" })
14867
- ] }),
14868
- /* @__PURE__ */ jsxs45("label", { children: [
14869
- "Effective through",
14870
- /* @__PURE__ */ jsx47("input", { name: `${item.id}:effectiveTo`, type: "date" })
14871
- ] })
14872
- ] }) : null,
14873
- outcomes[item.id] !== "approved" ? /* @__PURE__ */ jsxs45(Fragment27, { children: [
14874
- /* @__PURE__ */ jsxs45("label", { children: [
14875
- "Decision reason",
14876
- /* @__PURE__ */ jsx47("textarea", { name: `${item.id}:decisionReason`, required: true })
14877
- ] }),
14878
- /* @__PURE__ */ jsxs45("label", { children: [
14879
- "Reviewer name",
14880
- /* @__PURE__ */ jsx47("input", { name: `${item.id}:reviewerName`, required: true })
14881
- ] }),
14882
- /* @__PURE__ */ jsxs45("label", { children: [
14883
- "Reviewer phone",
14884
- /* @__PURE__ */ jsx47("input", { name: `${item.id}:reviewerPhone`, required: true })
14874
+ pendingItems.map((item) => {
14875
+ const found = readItem(item.id);
14876
+ const flag = read ? !found || found.outcome === "not_addressed" ? "No decision for this treatment was found in the response. It stays pending unless you choose one." : !found.confident ? "This one was hard to read. Check it carefully." : "" : "";
14877
+ const k = `${item.id}:${read ? reading.documentId : ""}`;
14878
+ return /* @__PURE__ */ jsxs45("fieldset", { ...flag ? { "data-flag": "true" } : {}, children: [
14879
+ /* @__PURE__ */ jsxs45("legend", { children: [
14880
+ item.procedureCode || "Treatment",
14881
+ ": ",
14882
+ item.serviceDescription
14883
+ ] }),
14884
+ flag ? /* @__PURE__ */ jsx47("p", { className: "mbrfa-reading", "data-flag": "true", children: flag }) : null,
14885
+ /* @__PURE__ */ jsxs45("label", { children: [
14886
+ "Decision for ",
14887
+ item.procedureCode || item.serviceDescription,
14888
+ /* @__PURE__ */ jsxs45("select", { value: outcomes[item.id] ?? "", onChange: (event) => setOutcomes((value) => ({ ...value, [item.id]: event.target.value })), children: [
14889
+ /* @__PURE__ */ jsx47("option", { value: "", children: "Leave pending" }),
14890
+ /* @__PURE__ */ jsx47("option", { value: "approved", children: "Approved" }),
14891
+ /* @__PURE__ */ jsx47("option", { value: "modified", children: "Modified" }),
14892
+ /* @__PURE__ */ jsx47("option", { value: "denied", children: "Denied" })
14885
14893
  ] })
14894
+ ] }),
14895
+ outcomes[item.id] ? /* @__PURE__ */ jsxs45("div", { className: "mbtd-grid", children: [
14896
+ outcomes[item.id] !== "denied" ? /* @__PURE__ */ jsxs45(Fragment27, { children: [
14897
+ /* @__PURE__ */ jsxs45("label", { children: [
14898
+ "Authorization number",
14899
+ /* @__PURE__ */ jsx47("input", { name: `${item.id}:authorizationNumber`, defaultValue: found?.authorizationNumber ?? "", required: true })
14900
+ ] }),
14901
+ /* @__PURE__ */ jsxs45("label", { children: [
14902
+ "Authorized procedure code",
14903
+ /* @__PURE__ */ jsx47("input", { name: `${item.id}:authorizedProcedureCode`, defaultValue: found?.authorizedProcedureCode ?? "" })
14904
+ ] }),
14905
+ /* @__PURE__ */ jsxs45("label", { children: [
14906
+ "Authorized quantity",
14907
+ /* @__PURE__ */ jsx47("input", { name: `${item.id}:authorizedQuantity`, defaultValue: found?.authorizedQuantity ?? "", type: "number", min: "0.001", max: "100000", step: "any" })
14908
+ ] }),
14909
+ /* @__PURE__ */ jsxs45("label", { children: [
14910
+ "Authorized units",
14911
+ /* @__PURE__ */ jsx47("input", { name: `${item.id}:authorizedUnits`, defaultValue: found?.authorizedUnits ?? "", type: "number", min: "1", max: "100000" })
14912
+ ] }),
14913
+ /* @__PURE__ */ jsxs45("label", { children: [
14914
+ "Effective from",
14915
+ /* @__PURE__ */ jsx47("input", { name: `${item.id}:effectiveFrom`, defaultValue: found?.effectiveFrom ?? "", type: "date" })
14916
+ ] }),
14917
+ /* @__PURE__ */ jsxs45("label", { children: [
14918
+ "Effective through",
14919
+ /* @__PURE__ */ jsx47("input", { name: `${item.id}:effectiveTo`, defaultValue: found?.effectiveTo ?? "", type: "date" })
14920
+ ] })
14921
+ ] }) : null,
14922
+ outcomes[item.id] !== "approved" ? /* @__PURE__ */ jsxs45(Fragment27, { children: [
14923
+ /* @__PURE__ */ jsxs45("label", { children: [
14924
+ "Decision reason",
14925
+ /* @__PURE__ */ jsx47("textarea", { name: `${item.id}:decisionReason`, required: true, defaultValue: found?.decisionReason ?? "" })
14926
+ ] }),
14927
+ /* @__PURE__ */ jsxs45("label", { children: [
14928
+ "Reviewer name",
14929
+ /* @__PURE__ */ jsx47("input", { name: `${item.id}:reviewerName`, defaultValue: found?.reviewerName ?? "", required: true })
14930
+ ] }),
14931
+ /* @__PURE__ */ jsxs45("label", { children: [
14932
+ "Reviewer phone",
14933
+ /* @__PURE__ */ jsx47("input", { name: `${item.id}:reviewerPhone`, defaultValue: found?.reviewerPhone ?? "", required: true })
14934
+ ] })
14935
+ ] }) : null
14886
14936
  ] }) : null
14887
- ] }) : null
14888
- ] }, item.id)),
14937
+ ] }, k);
14938
+ }),
14939
+ read ? /* @__PURE__ */ jsxs45("label", { className: "mbrfa-check", children: [
14940
+ /* @__PURE__ */ jsx47("input", { type: "checkbox", checked: readingChecked, onChange: (event) => setReadingChecked(event.target.checked) }),
14941
+ "I checked each decision above against the response document."
14942
+ ] }) : null,
14889
14943
  /* @__PURE__ */ jsx47("button", { type: "submit", children: "Save treatment decisions" })
14890
14944
  ] }) })
14891
14945
  ] }) : null,
@@ -15118,6 +15172,10 @@ var sentence2 = (value) => {
15118
15172
  var documentTypeLabel = (type) => ({ rfa_form: "DWC Form RFA", clinical_report: "Clinical report", supporting_record: "Supporting record", ur_response: "Utilization review response", imr_form: "Independent medical review form", fax_cover: "Fax cover sheet" })[type] ?? sentence2(type);
15119
15173
  var date7 = (value) => value ? new Date(value).toLocaleString() : "Not recorded";
15120
15174
  var key = () => `rfa-widget-${globalThis.crypto.randomUUID()}`;
15175
+ function rfaCanResend(rfa) {
15176
+ const attempts = rfa.transmissions.filter((sent) => sent.direction === "outbound" && (sent.purpose ?? "submission") === "submission");
15177
+ return rfa.status === "submitted" && !rfa.receivedAt && attempts.length > 0 && attempts.every((sent) => sent.status === "failed");
15178
+ }
15121
15179
  function RfaDashboard({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOverride, patientId, claimId, renderingProviderId, signatureSession, ...props }) {
15122
15180
  const options = useMemo13(() => ({ ...sessionEndpoint ? { sessionEndpoint } : {}, ...getSession ? { getSession } : {}, ...apiBaseUrl ? { apiBaseUrl } : {}, ...fetchOverride ? { fetch: fetchOverride } : {} }), [sessionEndpoint, getSession, apiBaseUrl, fetchOverride]);
15123
15181
  const client = useMemo13(() => createRfaClient4(options), [options]);
@@ -15125,7 +15183,7 @@ function RfaDashboard({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOve
15125
15183
  const identity = useMemo13(() => ({ client, signatureClient, key: key() }), [client, signatureClient]);
15126
15184
  return /* @__PURE__ */ jsx49(RfaDashboardContent, { ...props, ...patientId ? { patientId } : {}, ...claimId ? { claimId } : {}, ...renderingProviderId ? { renderingProviderId } : {}, client, signatureClient, options }, `${identity.key}:${patientId ?? ""}:${claimId ?? ""}:${renderingProviderId ?? ""}`);
15127
15185
  }
15128
- function RfaDashboardContent({ client, signatureClient, options, patientId, claimId, renderingProviderId, initialDraft, initialView = "overview", initialDetailAction, 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, onPreviewDraft, canManageProviderSignatures = false, renderSendSignatureSetup, environment = "sandbox", actorReference, onCreated, onContinue, selectedRfaId, selectedTreatmentId, selectedResponseDocumentId: controlledResponseDocumentId, onSelectRfa, getRfaHref, getPatientHref, getClaimHref, getProviderHref, formPreviewUrl, hideBackButton = false, hideHeading = false, layout = "classic", ...appearance }) {
15186
+ function RfaDashboardContent({ client, signatureClient, options, patientId, claimId, renderingProviderId, initialDraft, initialView = "overview", initialDetailAction, 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, onPreviewDraft, canManageProviderSignatures = false, renderSendSignatureSetup, readRfaResponse, environment = "sandbox", actorReference, onCreated, onContinue, selectedRfaId, selectedTreatmentId, selectedResponseDocumentId: controlledResponseDocumentId, onSelectRfa, getRfaHref, getPatientHref, getClaimHref, getProviderHref, formPreviewUrl, hideBackButton = false, hideHeading = false, layout = "classic", ...appearance }) {
15129
15187
  const active = useRef26(true);
15130
15188
  useEffect28(() => {
15131
15189
  active.current = true;
@@ -15311,7 +15369,7 @@ function RfaDashboardContent({ client, signatureClient, options, patientId, clai
15311
15369
  } }) : selected ? /* @__PURE__ */ jsx49(RfaDetail, { layout, ...initialDetailAction ? { initialAction: initialDetailAction } : {}, ...relatedLinks, ...formPreviewUrl ? { formPreviewUrl } : {}, id: selected, selectedItem, ...selectedResponseDocumentId ? { selectedResponseDocumentId } : {}, client, signatureClient, options, onCopied: (draft2) => {
15312
15370
  selectRfa(draft2.id);
15313
15371
  onCreated?.(draft2);
15314
- }, draftFormProps, canManageProviderSignatures, ...renderSendSignatureSetup ? { renderSendSignatureSetup } : {}, permissions, environment, ...actorReference ? { actorReference } : {}, ...onContinue ? { onContinue } : {}, ...appearance.disabled !== void 0 ? { disabled: appearance.disabled } : {} }, selected) : /* @__PURE__ */ jsxs47(Fragment28, { children: [
15372
+ }, draftFormProps, canManageProviderSignatures, ...renderSendSignatureSetup ? { renderSendSignatureSetup } : {}, ...readRfaResponse ? { readRfaResponse } : {}, permissions, environment, ...actorReference ? { actorReference } : {}, ...onContinue ? { onContinue } : {}, ...appearance.disabled !== void 0 ? { disabled: appearance.disabled } : {} }, selected) : /* @__PURE__ */ jsxs47(Fragment28, { children: [
15315
15373
  view === "overview" ? /* @__PURE__ */ jsx49(RfaTaskBoard, { ...taskPresentation ? { presentation: taskPresentation } : {}, ...taskQuery2 ? { query: taskQuery2 } : {}, ...renderTaskIdentity ? { renderTaskIdentity } : {}, ...navigation?.getTaskHref ? { getTaskHref: navigation.getTaskHref } : {}, ...navigation?.onNavigate ? { onNavigate: navigation.onNavigate } : {}, embedded: true, ...appearance, ...options, ...patientId ? { patientId } : {}, ...claimId ? { claimId } : {}, ...renderingProviderId ? { renderingProviderId } : {}, permissions: permissions.filter((value) => value === "act"), onSelect: (id, documentId) => selectRfa(id, documentId ? { responseDocumentId: documentId } : void 0) }) : /* @__PURE__ */ jsxs47("div", { className: "mbrfa-filters", children: [
15316
15374
  /* @__PURE__ */ jsxs47("label", { className: "mbrfa-search", children: [
15317
15375
  "Search requests",
@@ -15393,7 +15451,7 @@ function RfaDashboardContent({ client, signatureClient, options, patientId, clai
15393
15451
  ] })
15394
15452
  ] });
15395
15453
  }
15396
- function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, client, signatureClient, options, permissions, environment, actorReference, onContinue, disabled, draftFormProps, canManageProviderSignatures, renderSendSignatureSetup, onCopied, getPatientHref, getClaimHref, getProviderHref, formPreviewUrl, initialAction }) {
15454
+ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, client, signatureClient, options, permissions, environment, actorReference, onContinue, disabled, draftFormProps, canManageProviderSignatures, renderSendSignatureSetup, readRfaResponse, onCopied, getPatientHref, getClaimHref, getProviderHref, formPreviewUrl, initialAction }) {
15397
15455
  const [rfa, setRfa] = useState34(null);
15398
15456
  const [error, setError] = useState34("");
15399
15457
  const [busy, setBusy] = useState34(false);
@@ -15576,6 +15634,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
15576
15634
  const locked = busy || disabled;
15577
15635
  const canSign = permissions.includes("sign") && !!actorReference?.trim();
15578
15636
  const unsent = rfa && !rfa.submittedAt && ["draft", "ready", "incomplete", "deferred"].includes(rfa.status);
15637
+ const resendable = !!rfa && rfaCanResend(rfa);
15579
15638
  const reviewable = !!rfa && (!!rfa.submittedAt || ["submitted", "received", "under_review", "information_requested", "approved", "modified", "denied", "mixed", "incomplete", "deferred"].includes(rfa.status));
15580
15639
  const openDocument = (documentId, title) => run(async () => {
15581
15640
  const blob = await client.getDocument(id, documentId);
@@ -15731,7 +15790,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
15731
15790
  " \xB7 Due ",
15732
15791
  date7(item.dueAt)
15733
15792
  ] }, item.id)) }) : null,
15734
- /* @__PURE__ */ jsx49(RfaLifecycleControls, { rows: true, ...selectedResponseDocumentId ? { selectedResponseDocumentId } : {}, ...options, rfa, disabled: !!locked, permissions: permissions.filter((permission) => permission === "act" || permission === "edit"), onUpdated: adopt })
15793
+ /* @__PURE__ */ jsx49(RfaLifecycleControls, { rows: true, ...selectedResponseDocumentId ? { selectedResponseDocumentId } : {}, ...options, ...readRfaResponse ? { readResponse: readRfaResponse } : {}, rfa, disabled: !!locked, permissions: permissions.filter((permission) => permission === "act" || permission === "edit"), onUpdated: adopt })
15735
15794
  ] }) : null
15736
15795
  ] }) }) : /* @__PURE__ */ jsx49(Fragment28, { children: /* @__PURE__ */ jsxs47("div", { id: `${tabId}-details-panel`, role: "tabpanel", "aria-labelledby": `${tabId}-details-tab`, hidden: detailTab !== "details", className: "mbrfa-stack", children: [
15737
15796
  /* @__PURE__ */ jsx49(RfaRequestSummary, { rfa, hideTreatments: true, ...getPatientHref ? { getPatientHref } : {}, ...getClaimHref ? { getClaimHref } : {}, ...getProviderHref ? { getProviderHref } : {}, ...rfa.claimsAdminId ? { onViewClaimsAdministrator: () => setDirectoryOpen(true) } : {} }),
@@ -15858,7 +15917,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
15858
15917
  } }) }),
15859
15918
  /* @__PURE__ */ jsxs47("details", { className: "mbrfa-detail-card", open: Boolean(selectedResponseDocumentId), children: [
15860
15919
  /* @__PURE__ */ jsx49("summary", { children: "Receipt, responses and follow-up" }),
15861
- /* @__PURE__ */ jsx49(RfaLifecycleControls, { ...selectedResponseDocumentId ? { selectedResponseDocumentId } : {}, ...options, rfa, disabled: !!locked, permissions: permissions.filter((permission) => permission === "act" || permission === "edit"), onUpdated: adopt })
15920
+ /* @__PURE__ */ jsx49(RfaLifecycleControls, { ...selectedResponseDocumentId ? { selectedResponseDocumentId } : {}, ...options, ...readRfaResponse ? { readResponse: readRfaResponse } : {}, rfa, disabled: !!locked, permissions: permissions.filter((permission) => permission === "act" || permission === "edit"), onUpdated: adopt })
15862
15921
  ] })
15863
15922
  ] }) }),
15864
15923
  /* @__PURE__ */ jsxs47("div", { hidden: simple && detailTab !== "history", id: `${tabId}-history-panel`, role: detailTab === "history" ? "tabpanel" : void 0, "aria-labelledby": detailTab === "history" ? `${tabId}-history-tab` : void 0, onClick: (event) => {
@@ -15900,8 +15959,8 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
15900
15959
  /* @__PURE__ */ jsx49("summary", { children: "More" }),
15901
15960
  /* @__PURE__ */ jsx49("div", { children: /* @__PURE__ */ jsx49(RfaDraftActions, { deleteWording: true, ...options, rfa, disabled: !!locked, permissions: permissions.filter((permission) => permission === "create" || permission === "edit"), onCopied, onCanceled: adopt }) })
15902
15961
  ] }) : /* @__PURE__ */ jsx49(RfaDraftActions, { ...options, rfa, disabled: !!locked, permissions: permissions.filter((permission) => permission === "create" || permission === "edit"), onCopied, onCanceled: adopt }),
15903
- simple && !unsent && !!rfa.submittedAt && rfa.status !== "canceled" && permissions.includes("act") ? /* @__PURE__ */ jsx49("button", { type: "button", disabled: locked, onClick: () => setDuplicating(true), children: "Send duplicate" }) : null,
15904
- simple && unsent ? /* @__PURE__ */ jsx49("button", { type: "button", className: "mbtd-primary", disabled: locked, onClick: () => setSending(true), children: "Send" }) : simple && reviewable && detailTab === "details" ? /* @__PURE__ */ jsx49("button", { type: "button", disabled: locked, onClick: () => reveal("review"), children: "Record response" }) : null
15962
+ simple && !unsent && !resendable && !!rfa.submittedAt && rfa.status !== "canceled" && permissions.includes("act") ? /* @__PURE__ */ jsx49("button", { type: "button", disabled: locked, onClick: () => setDuplicating(true), children: "Send duplicate" }) : null,
15963
+ simple && (unsent || resendable) ? /* @__PURE__ */ jsx49("button", { type: "button", className: "mbtd-primary", disabled: locked, onClick: () => setSending(true), children: resendable ? "Send again" : "Send" }) : simple && reviewable && detailTab === "details" ? /* @__PURE__ */ jsx49("button", { type: "button", disabled: locked, onClick: () => reveal("review"), children: "Record response" }) : null
15905
15964
  ] })
15906
15965
  ] }) : null,
15907
15966
  simple && duplicating && !unsent ? /* @__PURE__ */ jsx49(
@@ -15920,11 +15979,12 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
15920
15979
  onClose: () => setDuplicating(false)
15921
15980
  }
15922
15981
  ) : null,
15923
- simple && sending && unsent ? (() => {
15982
+ simple && sending && (unsent || resendable) ? (() => {
15924
15983
  const hostSignature = renderSendSignatureSetup?.({ renderingProviderId: rfa.renderingProviderId, providerName: rfa.providerName });
15925
15984
  return /* @__PURE__ */ jsx49(
15926
15985
  RfaSendDialog,
15927
15986
  {
15987
+ resend: resendable,
15928
15988
  rfa,
15929
15989
  client,
15930
15990
  documentIds,