@mindbill/react 0.77.27 → 0.77.29

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 CHANGED
@@ -12863,7 +12863,6 @@ function validateRfaDraft(draft2) {
12863
12863
  for (const value of [draft2.employeeName, draft2.providerName]) if (!value.trim() || value.length > 200) return "Employee and provider names are required (up to 200 characters).";
12864
12864
  if (draft2.requestType !== void 0 && !["new", "resubmission_material_change", "oral_authorization_confirmation"].includes(draft2.requestType)) return "Choose a valid request type.";
12865
12865
  if (draft2.reviewType !== void 0 && !["prospective", "concurrent", "retrospective"].includes(draft2.reviewType)) return "Choose a valid review type.";
12866
- if (draft2.requestType === "resubmission_material_change" && !draft2.materialChange?.trim()) return "Describe the material change for this resubmission.";
12867
12866
  if ((draft2.rationale?.length ?? 0) > 2e4 || (draft2.materialChange?.length ?? 0) > 2e4) return "Rationale and material change must each be at most 20,000 characters.";
12868
12867
  if (draft2.placeOfServiceCode !== void 0 && !/^\d{2}$/.test(draft2.placeOfServiceCode)) return "Place of service must contain two digits.";
12869
12868
  if ((draft2.providerNpi?.length ?? 0) > 20 || (draft2.providerPhone?.length ?? 0) > 30 || (draft2.claimNumber?.length ?? 0) > 100) return "Check provider contact and claim number lengths.";
@@ -13015,11 +13014,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
13015
13014
  /* @__PURE__ */ jsxs39("label", { className: "mbrfa-check", children: [
13016
13015
  /* @__PURE__ */ jsx41("input", { type: "checkbox", checked: draft2.writtenConfirmation ?? false, onChange: (event) => update({ writtenConfirmation: event.target.checked }) }),
13017
13016
  "Check box if request is a written confirmation of a prior oral request"
13018
- ] }),
13019
- draft2.requestType === "resubmission_material_change" ? /* @__PURE__ */ jsxs39("label", { children: [
13020
- "Material change (required)",
13021
- /* @__PURE__ */ jsx41("textarea", { required: true, maxLength: 2e4, value: draft2.materialChange ?? "", onChange: (event) => update({ materialChange: event.target.value }) })
13022
- ] }) : null
13017
+ ] })
13023
13018
  ] })
13024
13019
  ] }),
13025
13020
  /* @__PURE__ */ jsxs39("fieldset", { children: [
@@ -13137,8 +13132,8 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
13137
13132
  /* @__PURE__ */ jsx41("textarea", { maxLength: 2e4, value: draft2.rationale ?? "", onChange: (event) => update({ rationale: event.target.value }) })
13138
13133
  ] }),
13139
13134
  draft2.requestType === "resubmission_material_change" ? /* @__PURE__ */ jsxs39("label", { className: "mbtd-wide", children: [
13140
- "Material change (required)",
13141
- /* @__PURE__ */ jsx41("textarea", { required: true, maxLength: 2e4, value: draft2.materialChange ?? "", onChange: (event) => update({ materialChange: event.target.value }) })
13135
+ "Material change (optional)",
13136
+ /* @__PURE__ */ jsx41("textarea", { maxLength: 2e4, value: draft2.materialChange ?? "", onChange: (event) => update({ materialChange: event.target.value }) })
13142
13137
  ] }) : null
13143
13138
  ] })
13144
13139
  ] }),
@@ -13317,6 +13312,24 @@ function SavedIdentityForm({ client, claimId, renderingProviderId, onSave, canCr
13317
13312
  active = false;
13318
13313
  };
13319
13314
  }, [client, query, effectiveClaimId, effectiveProviderId, renderingProviderId, reload]);
13315
+ const refreshProfile = draftFormProps?.officialForm ? draftFormProps.onRefreshProfile : void 0;
13316
+ const refreshOnReturn = !!draftFormProps?.officialForm;
13317
+ useEffect23(() => {
13318
+ if (!refreshOnReturn) return;
13319
+ let last = Date.now();
13320
+ const refresh = () => {
13321
+ if (document.visibilityState === "hidden" || Date.now() - last < 2e3) return;
13322
+ last = Date.now();
13323
+ setReload((value) => value + 1);
13324
+ void refreshProfile?.().catch(() => void 0);
13325
+ };
13326
+ window.addEventListener("focus", refresh);
13327
+ document.addEventListener("visibilitychange", refresh);
13328
+ return () => {
13329
+ window.removeEventListener("focus", refresh);
13330
+ document.removeEventListener("visibilitychange", refresh);
13331
+ };
13332
+ }, [refreshOnReturn, refreshProfile]);
13320
13333
  const claim = context?.claims.find((value) => value.claimId === selectedClaim);
13321
13334
  const provider = context?.renderingProviders.find((value) => value.id === selectedProvider);
13322
13335
  const locked = disabled || loading;
@@ -13487,7 +13500,7 @@ function SavedIdentityForm({ client, claimId, renderingProviderId, onSave, canCr
13487
13500
  providerFields
13488
13501
  ] })
13489
13502
  ] }),
13490
- loading ? /* @__PURE__ */ jsx42("p", { role: "status", children: "Loading saved claims and providers\u2026" }) : null,
13503
+ loading && !(official && context) ? /* @__PURE__ */ jsx42("p", { role: "status", children: "Loading saved claims and providers\u2026" }) : null,
13491
13504
  error ? /* @__PURE__ */ jsx42("p", { role: "alert", children: error }) : null,
13492
13505
  claim && provider && !official ? /* @__PURE__ */ jsxs40("p", { className: "mbtd-note", children: [
13493
13506
  "Create a request for ",