@mindbill/react 0.77.40 → 0.77.42

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
@@ -1020,6 +1020,8 @@ type RfaDraftFormProps = TreatmentDraftAppearance & RfaContactDirectoryProps & {
1020
1020
  managePracticeHref?: string;
1021
1021
  manageLocationsHref?: string;
1022
1022
  onRefreshProfile?: () => Promise<void>;
1023
+ /** The organization profile is still loading: show the practice as information, not as empty boxes to type into. */
1024
+ profilePending?: boolean;
1023
1025
  /** Save unsigned content and continue to the host's reviewed signing workflow. */
1024
1026
  onReview?: (draft: RfaDraftInput) => Promise<void>;
1025
1027
  /** Save unsigned content before opening the host's actual PDF packet preview. */
@@ -1055,7 +1057,7 @@ type RfaDraftFormProps = TreatmentDraftAppearance & RfaContactDirectoryProps & {
1055
1057
  /** Remove blank optional item fields, retaining an explicitly cleared return fax. */
1056
1058
  declare function normalizeRfaDraft(draft: RfaDraftInput): RfaDraftInput;
1057
1059
  declare function validateRfaDraft(draft: RfaDraftInput): string | null;
1058
- declare function RfaDraftForm({ initialDraft, identity, officialForm, formDetails, selectors, onEditPractice, onEditLocation, treatmentTemplates, onSaveTreatmentTemplate, onManageTreatmentTemplates, managePracticeHref, manageLocationsHref, onRefreshProfile, onReview, onPreview, searchClaimsAdministrators, getClaimsAdministratorDirectory, embedded, onSave, onBack, mode, searchDiagnosisCodes, organizationProfile, savedDiagnosisCodes, supportingDocuments, disabled, ...appearance }: RfaDraftFormProps): ReactElement;
1060
+ declare function RfaDraftForm({ initialDraft, identity, officialForm, formDetails, selectors, onEditPractice, onEditLocation, treatmentTemplates, onSaveTreatmentTemplate, onManageTreatmentTemplates, managePracticeHref, manageLocationsHref, onRefreshProfile, profilePending, onReview, onPreview, searchClaimsAdministrators, getClaimsAdministratorDirectory, embedded, onSave, onBack, mode, searchDiagnosisCodes, organizationProfile, savedDiagnosisCodes, supportingDocuments, disabled, ...appearance }: RfaDraftFormProps): ReactElement;
1059
1061
 
1060
1062
  /** A saved set of requested treatments. Diagnoses stay with the claim, so templates do not carry them. */
1061
1063
  type RfaTreatmentTemplate = {
package/dist/index.js CHANGED
@@ -10508,7 +10508,7 @@ function TreatmentDraftShell({ title, description, children, hideHeading = false
10508
10508
  .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
10509
  @media(max-width:760px){.mbtd .mbrfa-template-save{grid-template-columns:minmax(0,1fr)}}
10510
10510
  .mbtd .mbrfa-form-grid>.mbrfa-row-start{grid-column:1/span 3}.mbtd .mbrfa-form-grid textarea[rows="2"]{min-height:44px}
10511
- .mbtd .mbrfa-review-type{display:grid;gap:4px;margin-top:10px;padding-top:12px;border-top:1px dashed var(--mb-border)}.mbtd .mbrfa-review-type>span{font-size:12px;font-weight:500;color:var(--mb-muted)}.mbtd .mbrfa-review-type>span>small{margin-left:10px;font-weight:400}
10511
+ .mbtd .mbrfa-option-group{display:grid;gap:4px;grid-column:1/-1}.mbtd .mbrfa-option-group+.mbrfa-option-group{margin-top:6px;padding-top:14px;border-top:1px solid var(--mb-border)}.mbtd .mbrfa-option-group>span{font-size:12px;font-weight:600;color:var(--mb-muted)}.mbtd .mbrfa-option-group>span>small{margin-left:10px;font-weight:400}
10512
10512
  .mbtd .mbrfa-docs{display:grid;gap:10px}
10513
10513
  .mbtd .mbrfa-doc{display:flex;align-items:center;gap:12px;padding:10px 14px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface)}.mbtd .mbrfa-doc>span{display:grid;min-width:0;flex:1}.mbtd .mbrfa-doc strong{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mbtd .mbrfa-doc small{font-size:12px;color:var(--mb-muted)}.mbtd .mbrfa-doc>button{border:0;background:none;min-height:32px;width:32px;padding:0;font-size:20px;line-height:1;color:var(--mb-muted)}.mbtd .mbrfa-doc>button:hover{color:var(--mb-text)}
10514
10514
  .mbtd button.mbrfa-dropzone{display:grid;justify-items:center;gap:6px;width:100%;padding:28px 16px;border:1.5px dashed color-mix(in srgb,var(--mb-accent) 45%,var(--mb-border));border-radius:var(--mb-control-radius);background:var(--mb-soft);color:var(--mb-accent);cursor:pointer;text-align:center}.mbtd button.mbrfa-dropzone strong{font-size:15px;font-weight:600;color:var(--mb-text)}.mbtd button.mbrfa-dropzone small{font-size:13px;color:var(--mb-muted)}.mbtd button.mbrfa-dropzone:hover,.mbtd button.mbrfa-dropzone[data-over=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 8%,var(--mb-surface))}
@@ -13242,7 +13242,7 @@ function validateRfaDraft(draft2) {
13242
13242
  }
13243
13243
  return null;
13244
13244
  }
13245
- function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetails, selectors, onEditPractice, onEditLocation, treatmentTemplates, onSaveTreatmentTemplate, onManageTreatmentTemplates, managePracticeHref, manageLocationsHref, onRefreshProfile, onReview, onPreview, searchClaimsAdministrators, getClaimsAdministratorDirectory, embedded = false, onSave, onBack, mode = "create", searchDiagnosisCodes, organizationProfile, savedDiagnosisCodes = [], supportingDocuments, disabled = false, ...appearance }) {
13245
+ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetails, selectors, onEditPractice, onEditLocation, treatmentTemplates, onSaveTreatmentTemplate, onManageTreatmentTemplates, managePracticeHref, manageLocationsHref, onRefreshProfile, profilePending = false, onReview, onPreview, searchClaimsAdministrators, getClaimsAdministratorDirectory, embedded = false, onSave, onBack, mode = "create", searchDiagnosisCodes, organizationProfile, savedDiagnosisCodes = [], supportingDocuments, disabled = false, ...appearance }) {
13246
13246
  const [savedDraft, setDraft] = useState28(() => normalizeRfaDraft(initialDraft));
13247
13247
  useEffect23(() => {
13248
13248
  if (identity) setDraft((current) => {
@@ -13287,7 +13287,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
13287
13287
  const [practiceManualChoice, setPracticeManual] = useState28(null);
13288
13288
  const savedPractices = organizationProfile?.billingProviders ?? [];
13289
13289
  const typedPractice = Boolean(savedDraft.requestingPractice?.name?.trim() || savedDraft.requestingPractice?.address?.trim());
13290
- const practiceManual = practiceManualChoice ?? (organizationProfile ? savedPractices.length === 0 || typedPractice && !savedPractices.some((provider) => provider.name === savedDraft.requestingPractice?.name) : true);
13290
+ const practiceManual = practiceManualChoice ?? (organizationProfile ? savedPractices.length === 0 || typedPractice && !savedPractices.some((provider) => provider.name === savedDraft.requestingPractice?.name) : !profilePending);
13291
13291
  const [administratorOverride, setAdministratorOverride] = useState28(null);
13292
13292
  const identityKey = `${identity?.claimId ?? ""}:${identity?.claimsAdminId ?? ""}`;
13293
13293
  const previousClaim = useRef20(identityKey);
@@ -13377,32 +13377,41 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
13377
13377
  /* @__PURE__ */ jsxs41("fieldset", { disabled: locked, className: "mbrfa-request-details", children: [
13378
13378
  /* @__PURE__ */ jsx43("legend", { children: "Request type" }),
13379
13379
  /* @__PURE__ */ jsxs41("div", { className: "mbtd-grid", children: [
13380
- /* @__PURE__ */ jsxs41("div", { className: "mbrfa-request-types", role: "group", "aria-label": "Request type", children: [
13381
- /* @__PURE__ */ jsxs41("label", { className: "mbrfa-check", children: [
13382
- /* @__PURE__ */ jsx43("input", { type: "radio", name: "request-type", checked: (draft2.requestType ?? "new") === "new", onChange: () => update({ requestType: "new" }) }),
13383
- /* @__PURE__ */ jsx43("span", { children: /* @__PURE__ */ jsx43("strong", { children: "New Request" }) })
13380
+ /* @__PURE__ */ jsxs41("div", { className: "mbrfa-option-group", children: [
13381
+ /* @__PURE__ */ jsxs41("span", { children: [
13382
+ "Request type",
13383
+ /* @__PURE__ */ jsx43(RfaRequired, {})
13384
13384
  ] }),
13385
- /* @__PURE__ */ jsxs41("label", { className: "mbrfa-check", children: [
13386
- /* @__PURE__ */ jsx43("input", { type: "radio", name: "request-type", checked: draft2.requestType === "resubmission_material_change", onChange: () => update({ requestType: "resubmission_material_change" }) }),
13387
- /* @__PURE__ */ jsxs41("span", { children: [
13388
- /* @__PURE__ */ jsx43("strong", { children: "Resubmission" }),
13389
- " \u2013 Change in Material Facts"
13385
+ /* @__PURE__ */ jsxs41("div", { className: "mbrfa-request-types", role: "group", "aria-label": "Request type", children: [
13386
+ /* @__PURE__ */ jsxs41("label", { className: "mbrfa-check", children: [
13387
+ /* @__PURE__ */ jsx43("input", { type: "radio", name: "request-type", checked: (draft2.requestType ?? "new") === "new", onChange: () => update({ requestType: "new" }) }),
13388
+ /* @__PURE__ */ jsx43("span", { children: /* @__PURE__ */ jsx43("strong", { children: "New Request" }) })
13389
+ ] }),
13390
+ /* @__PURE__ */ jsxs41("label", { className: "mbrfa-check", children: [
13391
+ /* @__PURE__ */ jsx43("input", { type: "radio", name: "request-type", checked: draft2.requestType === "resubmission_material_change", onChange: () => update({ requestType: "resubmission_material_change" }) }),
13392
+ /* @__PURE__ */ jsxs41("span", { children: [
13393
+ /* @__PURE__ */ jsx43("strong", { children: "Resubmission" }),
13394
+ " \u2013 Change in Material Facts"
13395
+ ] })
13390
13396
  ] })
13391
13397
  ] })
13392
13398
  ] }),
13393
- /* @__PURE__ */ jsxs41("label", { className: "mbrfa-check", children: [
13394
- /* @__PURE__ */ jsx43("input", { type: "checkbox", checked: draft2.expedited ?? false, onChange: (event) => update({ expedited: event.target.checked }) }),
13395
- "Expedited Review: Check box if employee faces an imminent and serious threat to his or her health"
13396
- ] }),
13397
- /* @__PURE__ */ jsxs41("label", { className: "mbrfa-check", children: [
13398
- /* @__PURE__ */ jsx43("input", { type: "checkbox", checked: draft2.writtenConfirmation ?? false, onChange: (event) => update({ writtenConfirmation: event.target.checked }) }),
13399
- "Check box if request is a written confirmation of a prior oral request"
13399
+ /* @__PURE__ */ jsxs41("div", { className: "mbrfa-option-group", children: [
13400
+ /* @__PURE__ */ jsx43("span", { children: "Check any that apply" }),
13401
+ /* @__PURE__ */ jsxs41("label", { className: "mbrfa-check", children: [
13402
+ /* @__PURE__ */ jsx43("input", { type: "checkbox", checked: draft2.expedited ?? false, onChange: (event) => update({ expedited: event.target.checked }) }),
13403
+ "Expedited Review: Check box if employee faces an imminent and serious threat to his or her health"
13404
+ ] }),
13405
+ /* @__PURE__ */ jsxs41("label", { className: "mbrfa-check", children: [
13406
+ /* @__PURE__ */ jsx43("input", { type: "checkbox", checked: draft2.writtenConfirmation ?? false, onChange: (event) => update({ writtenConfirmation: event.target.checked }) }),
13407
+ "Check box if request is a written confirmation of a prior oral request"
13408
+ ] })
13400
13409
  ] }),
13401
- /* @__PURE__ */ jsxs41("div", { className: "mbrfa-review-type", children: [
13410
+ /* @__PURE__ */ jsxs41("div", { className: "mbrfa-option-group", children: [
13402
13411
  /* @__PURE__ */ jsxs41("span", { children: [
13403
13412
  "Review type",
13404
13413
  /* @__PURE__ */ jsx43(RfaRequired, {}),
13405
- /* @__PURE__ */ jsx43("small", { children: "Sets the decision due date. Not printed on the RFA." })
13414
+ /* @__PURE__ */ jsx43("small", { children: "Sets the decision due date." })
13406
13415
  ] }),
13407
13416
  /* @__PURE__ */ jsx43("div", { className: "mbrfa-request-types", role: "group", "aria-label": "Review type", children: [["prospective", "Prospective", "before treatment"], ["concurrent", "Concurrent", "during inpatient treatment"], ["retrospective", "Retrospective", "after treatment"]].map(([value, name, when]) => /* @__PURE__ */ jsxs41("label", { className: "mbrfa-check", children: [
13408
13417
  /* @__PURE__ */ jsx43("input", { type: "radio", name: "review-type", checked: (draft2.reviewType ?? "prospective") === value, onChange: () => update({ reviewType: value }) }),
@@ -14578,12 +14587,13 @@ function RfaDashboardContent({ client, signatureClient, options, patientId, clai
14578
14587
  }, []);
14579
14588
  const references = useMemo12(() => createBillReferenceClient2(options), [options]);
14580
14589
  const [profile, setProfile] = useState32();
14590
+ const [profileSettled, setProfileSettled] = useState32(false);
14581
14591
  useEffect26(() => {
14582
14592
  if (!savedProfileChanges) return;
14583
14593
  const merge = (current, saved) => saved?.length ? [...current.map((item) => saved.find((next) => next.id === item.id) ?? item), ...saved.filter((next) => !current.some((item) => item.id === next.id))] : current;
14584
14594
  setProfile((current) => current ? { ...current, billingProviders: merge(current.billingProviders, savedProfileChanges.billingProviders), locations: merge(current.locations, savedProfileChanges.locations) } : current);
14585
14595
  }, [savedProfileChanges]);
14586
- const draftFormProps = { officialForm, ...officialForm && (treatmentTemplates || onSaveTreatmentTemplate) ? { treatmentTemplates: treatmentTemplates ?? [], onSaveTreatmentTemplate, onManageTreatmentTemplates } : {}, ...onEditPractice ? { onEditPractice } : {}, ...onEditLocation ? { onEditLocation } : {}, ...managePracticeHref ? { managePracticeHref } : {}, ...manageLocationsHref ? { manageLocationsHref } : {}, onRefreshProfile: async () => {
14596
+ const draftFormProps = { officialForm, profilePending: !profile && !profileSettled, ...officialForm && (treatmentTemplates || onSaveTreatmentTemplate) ? { treatmentTemplates: treatmentTemplates ?? [], onSaveTreatmentTemplate, onManageTreatmentTemplates } : {}, ...onEditPractice ? { onEditPractice } : {}, ...onEditLocation ? { onEditLocation } : {}, ...managePracticeHref ? { managePracticeHref } : {}, ...manageLocationsHref ? { manageLocationsHref } : {}, onRefreshProfile: async () => {
14587
14597
  const next = await createOrganizationClient4(options).getBillingProfile();
14588
14598
  if (active.current) setProfile(next);
14589
14599
  }, ...client.searchClaimsAdministrators ? { searchClaimsAdministrators: client.searchClaimsAdministrators } : {}, ...client.getClaimsAdministratorDirectory ? { getClaimsAdministratorDirectory: client.getClaimsAdministratorDirectory } : {}, searchDiagnosisCodes: references.searchDiagnosisCodes, ...profile ? { organizationProfile: profile } : {} };
@@ -14629,6 +14639,8 @@ function RfaDashboardContent({ client, signatureClient, options, patientId, clai
14629
14639
  createOrganizationClient4(options).getBillingProfile().then((value) => {
14630
14640
  if (active2 && Array.isArray(value?.billingProviders) && Array.isArray(value?.locations)) setProfile(value);
14631
14641
  }).catch(() => {
14642
+ }).finally(() => {
14643
+ if (active2) setProfileSettled(true);
14632
14644
  });
14633
14645
  return () => {
14634
14646
  active2 = false;