@mindbill/react 0.77.62 → 0.77.64

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
@@ -227,6 +227,8 @@ type BillSubmissionProcedureOption = {
227
227
  code: string;
228
228
  description: string;
229
229
  allowedAmount?: number;
230
+ /** Units a line starts with when this code is chosen, for services with a customary or minimum quantity. */
231
+ defaultUnits?: number;
230
232
  };
231
233
  type BillSubmissionModifierOption = {
232
234
  code: string;
@@ -437,6 +439,11 @@ type BillSubmissionFormProps = {
437
439
  procedureOptions?: BillSubmissionProcedureOption[];
438
440
  /** Extend the existing procedure picker with treatment codes and authoritative fee quotes. */
439
441
  treatmentBilling?: boolean;
442
+ /** Lines added when a procedure is chosen, keyed by that procedure's code. A code already on the bill is not added again. */
443
+ companionLines?: Readonly<Record<string, readonly {
444
+ code: string;
445
+ units?: number;
446
+ }[]>>;
440
447
  /** Opt in to editable treatment billed charges; fee quotes remain separate estimates. */
441
448
  editableTreatmentCharges?: boolean;
442
449
  onSearchProcedureCodes?: (input?: BillProcedureCodeSearchInput) => Promise<BillProcedureCodePage>;
@@ -522,7 +529,7 @@ declare function BillSubmissionProvidersSection(): ReactElement;
522
529
  declare function BillSubmissionServiceLinesSection(): ReactElement;
523
530
  declare function BillSubmissionAttachmentsSection(): ReactElement;
524
531
  declare function BillSubmissionActions(): ReactElement;
525
- declare function BillSubmissionForm({ initialBill, idempotencyKey, attachments, onSubmit, onSubmitted, getSession, sessionEndpoint, apiBaseUrl, profileOptions, billingSettings, reportAutofill, profileDisplay, fetch: fetchOverride, onListMedicalProviderNetworks, onListClaimsAdministrators, onSearchClaimsAdministrators, onGetClaimsAdministratorDirectory, claimsAdministratorSources, claimsAdministratorHint, diagnosisOptions, onSearchDiagnoses, onLookupPostalCode, procedureOptions, treatmentBilling, editableTreatmentCharges, onSearchProcedureCodes, onQuoteFee, modifierOptions, taxonomyOptions, deliveryRoutePicker, deliveryRouteDialogTitle, attachmentReportTypeMode, attachmentReportTypes, defaultAttachmentReportType, appearance, className, style, disabled, submitLabel, heading, description, attentionFields, attentionMessage, children, }: BillSubmissionFormProps): ReactElement;
532
+ declare function BillSubmissionForm({ initialBill, idempotencyKey, attachments, onSubmit, onSubmitted, getSession, sessionEndpoint, apiBaseUrl, profileOptions, billingSettings, reportAutofill, profileDisplay, fetch: fetchOverride, onListMedicalProviderNetworks, onListClaimsAdministrators, onSearchClaimsAdministrators, onGetClaimsAdministratorDirectory, claimsAdministratorSources, claimsAdministratorHint, diagnosisOptions, onSearchDiagnoses, onLookupPostalCode, procedureOptions, treatmentBilling, companionLines, editableTreatmentCharges, onSearchProcedureCodes, onQuoteFee, modifierOptions, taxonomyOptions, deliveryRoutePicker, deliveryRouteDialogTitle, attachmentReportTypeMode, attachmentReportTypes, defaultAttachmentReportType, appearance, className, style, disabled, submitLabel, heading, description, attentionFields, attentionMessage, children, }: BillSubmissionFormProps): ReactElement;
526
533
 
527
534
  type BillSubmissionProfileOption<K extends "billingProvider" | "renderingProvider" | "serviceLocation"> = {
528
535
  id: string;
package/dist/index.js CHANGED
@@ -2423,7 +2423,14 @@ var messages = {
2423
2423
  telehealth_modifier_requires_ground_rule_review: "This telehealth modifier needs fee review for the service date.",
2424
2424
  conflicting_telehealth_modifiers: "Review the telehealth modifiers; the selected modes conflict.",
2425
2425
  telehealth_modifier_93_not_adopted_for_date: "Audio-only modifier 93 is not adopted for this service date. Review the dated telehealth rules.",
2426
- telehealth_modifier_required: "Select the telehealth modifier that matches the service and its date."
2426
+ telehealth_modifier_required: "Select the telehealth modifier that matches the service and its date.",
2427
+ timed_testing_add_on_requires_primary_service: "Add the first-hour or first-30-minute testing code for the same date; this code is billed only with it.",
2428
+ timed_testing_units_exceed_adopted_mue: "The units are above the daily limit for this code. Lower the units, or submit with documentation for review.",
2429
+ timed_testing_unit_limit_unverified: "The daily unit limit for this code could not be confirmed for this service date.",
2430
+ timed_testing_indicators_or_modifiers_require_review: "Remove the modifiers from this testing code to get an automatic fee, or submit it for review.",
2431
+ modifier_requires_ground_rule_review: "This modifier changes how the fee is calculated and needs review.",
2432
+ physician_service_context_required_or_adjustment_not_supported: "This service is billed with other same-day services and needs fee review.",
2433
+ separate_schedule_or_payment_formula_required: "This code is paid under a separate schedule and needs fee review."
2427
2434
  };
2428
2435
  function feeReviewMessage(reason) {
2429
2436
  if (!reason) return "Checking the fee schedule\u2026";
@@ -8213,6 +8220,7 @@ function billSubmissionCalculationContext(code, placeOfService, details, saved =
8213
8220
  return context;
8214
8221
  }
8215
8222
  var isMedicalLegalCode = (code) => /^ML/i.test(code.trim());
8223
+ var billingModeForLines = (lines) => lines.some((line) => isMedicalLegalCode(line.code)) ? "med_legal" : "professional";
8216
8224
  function billSubmissionFeeRequest(bill, line, context = line.feeContext ?? {}) {
8217
8225
  const dateOfService = parseBillSubmissionDate(line.serviceDate ?? bill.service.date) ?? "";
8218
8226
  const sameDayServices = bill.serviceLines.filter((candidate) => candidate.code.trim() && parseBillSubmissionDate(candidate.serviceDate ?? bill.service.date) === dateOfService);
@@ -8376,6 +8384,19 @@ function blankLine() {
8376
8384
  function lineHasContent(line) {
8377
8385
  return Boolean(line.code.trim() || line.modifiers?.length || line.charge != null || line.drug || line.formData);
8378
8386
  }
8387
+ function withAddedBillSubmissionLines(lines, added) {
8388
+ if (!added?.length) return lines;
8389
+ const entered = [...lines];
8390
+ while (entered.length && !lineHasContent(entered.at(-1))) entered.pop();
8391
+ const present = new Set(entered.map((line) => line.code.trim().toUpperCase()));
8392
+ for (const line of added) {
8393
+ const code = line.code.trim().toUpperCase();
8394
+ if (!code || present.has(code)) continue;
8395
+ present.add(code);
8396
+ entered.push({ code, modifiers: [], units: line.units ?? 1 });
8397
+ }
8398
+ return entered;
8399
+ }
8379
8400
  function ensureTrailingBillSubmissionLine(lines) {
8380
8401
  const normalized = lines.length ? lines.map((line) => ({ ...line, modifiers: [...line.modifiers ?? []], units: line.units ?? 1 })) : [];
8381
8402
  while (normalized.length > 1 && !lineHasContent(normalized.at(-1)) && !lineHasContent(normalized.at(-2))) normalized.pop();
@@ -8485,7 +8506,7 @@ function setBillSubmissionLineDiagnoses(bill, index, codes2) {
8485
8506
  }
8486
8507
  function cloneInitialBill(bill, treatmentBilling = false) {
8487
8508
  const cloned = cloneBill(bill);
8488
- if (treatmentBilling && cloned.serviceLines.some((line) => line.code.trim() && !isMedicalLegalCode(line.code))) cloned.billingMode = "professional";
8509
+ if (treatmentBilling && cloned.serviceLines.some((line) => line.code.trim())) cloned.billingMode = billingModeForLines(cloned.serviceLines);
8489
8510
  if (cloned.billingMode !== "professional") cloned.diagnoses = applyBillSubmissionEvaluationDiagnoses(cloned.diagnoses, initialEvaluationType(bill));
8490
8511
  return billSubmissionUsesSharedDiagnoses(cloned) ? setBillSubmissionSharedDiagnoses(cloned, cloned.diagnoses ?? []) : cloned;
8491
8512
  }
@@ -8574,14 +8595,13 @@ function validateBillSubmission(bill) {
8574
8595
  if (bill.renderingProvider?.taxonomy && !/^[A-Za-z0-9]{10}$/.test(bill.renderingProvider.taxonomy.trim())) errors["renderingProvider.taxonomy"] = "Enter a valid 10-character taxonomy code.";
8575
8596
  if (bill.serviceLocation?.placeOfServiceCode && !/^\d{2}$/.test(bill.serviceLocation.placeOfServiceCode.trim())) errors["serviceLocation.placeOfServiceCode"] = "Enter a valid 2-digit place of service code.";
8576
8597
  const lines = submittedLines(bill.serviceLines);
8577
- if (lines.some((line) => isMedicalLegalCode(line.code)) && lines.some((line) => line.code && !isMedicalLegalCode(line.code))) errors.serviceLines = "Submit medical-legal and treatment services on separate bills.";
8578
8598
  if (!lines.length) errors.serviceLines = "Add at least one service line";
8579
8599
  lines.forEach((line, index) => {
8580
8600
  required2(`serviceLines.${index}.code`, line.code, "Select a procedure code.");
8581
8601
  const pointers = line.diagnosisPointers ?? [];
8582
8602
  if (pointers.length > 4 || new Set(pointers).size !== pointers.length || pointers.some((pointer) => !Number.isInteger(pointer) || pointer < 1 || pointer > (bill.diagnoses?.length ?? 0)) || bill.billingMode === "professional" && !pointers.length) errors[`serviceLines.${index}.diagnosisPointers`] = "Select up to four diagnoses for this service line.";
8583
8603
  if (!Number.isInteger(line.units) || (line.units ?? 0) < 1) errors[`serviceLines.${index}.units`] = "Enter at least 1 unit";
8584
- if (bill.billingMode === "professional" && (!Number.isFinite(line.charge) || (line.charge ?? 0) <= 0)) errors[`serviceLines.${index}.charge`] = "Enter the billed charge";
8604
+ if ((bill.billingMode === "professional" || !isMedicalLegalCode(line.code) && lines.some((other) => isMedicalLegalCode(other.code))) && (!Number.isFinite(line.charge) || (line.charge ?? 0) <= 0)) errors[`serviceLines.${index}.charge`] = "Enter the billed charge";
8585
8605
  });
8586
8606
  return { valid: Object.keys(errors).length === 0, fieldErrors: errors };
8587
8607
  }
@@ -8640,15 +8660,15 @@ function TextDateInput({ value, onChange, disabled, required: required2, ariaLab
8640
8660
  invalid ? /* @__PURE__ */ jsx20("small", { className: "mbsf-error", children: "Use MM/DD/YYYY" }) : null
8641
8661
  ] });
8642
8662
  }
8643
- function ComboBox({ value, placeholder, options, disabled, loading, loadingMore, invalid, preserveValueOnOpen = false, filterOptions = true, onOpen, onQuery, onEndReached, onSelect, createOption, ariaLabel }) {
8663
+ function ComboBox({ value, placeholder, options, disabled, loading, loadingMore, invalid, preserveValueOnOpen = false, filterOptions = true, matchCodeIgnoringSeparators = false, onOpen, onQuery, onEndReached, onSelect, createOption, ariaLabel }) {
8644
8664
  const [open, setOpen] = useState12(false);
8645
8665
  const [query, setQuery] = useState12("");
8646
8666
  const visible = useMemo6(() => {
8647
8667
  const q = query.trim().toLowerCase();
8648
- const matches = q && filterOptions ? options.filter((option) => `${option.id} ${option.label} ${option.detail ?? ""} ${(option.badges ?? []).join(" ")} ${(option.affiliatedEntities ?? []).join(" ")} ${option.trailing ?? ""}`.toLowerCase().includes(q)) : options;
8668
+ const matches = q && filterOptions ? options.filter((option) => `${option.id} ${option.label} ${option.detail ?? ""} ${(option.badges ?? []).join(" ")} ${(option.affiliatedEntities ?? []).join(" ")} ${option.trailing ?? ""}`.toLowerCase().includes(q) || matchCodeIgnoringSeparators && /[\s-]/.test(q) && option.id.toLowerCase().includes(q.replace(/[\s-]+/g, ""))) : options;
8649
8669
  const custom = createOption?.(query) ?? null;
8650
8670
  return custom && !matches.some((option) => option.id.toUpperCase() === custom.id.toUpperCase()) ? [...matches, custom] : matches;
8651
- }, [createOption, filterOptions, options, query]);
8671
+ }, [createOption, filterOptions, matchCodeIgnoringSeparators, options, query]);
8652
8672
  const showMenu = open;
8653
8673
  return /* @__PURE__ */ jsxs19("div", { className: "mbsf-combo", children: [
8654
8674
  /* @__PURE__ */ jsx20("input", { className: "mbsf-input", role: "combobox", "aria-label": ariaLabel, "aria-invalid": invalid, "aria-expanded": showMenu, autoComplete: "off", disabled, placeholder, value: open ? query : value, onFocus: () => {
@@ -8707,7 +8727,7 @@ function focusFirstInvalid(form) {
8707
8727
  }
8708
8728
  }
8709
8729
  function customProcedureOption(query) {
8710
- const code = query.trim().toUpperCase().replace(/\s+/g, "");
8730
+ const code = query.trim().toUpperCase().replace(/[\s-]+/g, "");
8711
8731
  if (!/^(?:\d{5}|[A-Z]\d{4}|WC\d{3}|ML(?:20[0-5]|PRR))$/.test(code)) return null;
8712
8732
  return { id: code, label: code, detail: "Use this CPT, HCPCS, or medical-legal code" };
8713
8733
  }
@@ -8808,6 +8828,7 @@ function BillSubmissionForm({
8808
8828
  onLookupPostalCode,
8809
8829
  procedureOptions,
8810
8830
  treatmentBilling = false,
8831
+ companionLines,
8811
8832
  editableTreatmentCharges = false,
8812
8833
  onSearchProcedureCodes,
8813
8834
  onQuoteFee,
@@ -8898,7 +8919,7 @@ function BillSubmissionForm({
8898
8919
  const diagnosisAppendPending = useRef8(false);
8899
8920
  const payerRequest = useRef8(0);
8900
8921
  const payerAppendPending = useRef8(false);
8901
- const procedures = useMemo6(() => mergeOptions(DEFAULT_BILL_SUBMISSION_PROCEDURES, [...procedureOptions ?? [], ...procedureResults, ...treatmentBilling ? [{ code: "WC002", description: "Progress report" }, { code: "WC003", description: "Permanent and stationary report (PR-3)" }, { code: "WC004", description: "Permanent and stationary report (PR-4)" }] : []]), [procedureOptions, procedureResults, treatmentBilling]);
8922
+ const procedures = useMemo6(() => mergeOptions(DEFAULT_BILL_SUBMISSION_PROCEDURES, [...procedureResults.filter((result) => !DEFAULT_BILL_SUBMISSION_PROCEDURES.some((item) => item.code.toUpperCase() === result.code.toUpperCase())), ...procedureOptions ?? [], ...treatmentBilling ? [{ code: "WC002", description: "Progress report" }, { code: "WC003", description: "Permanent and stationary report (PR-3)" }, { code: "WC004", description: "Permanent and stationary report (PR-4)" }] : []]), [procedureOptions, procedureResults, treatmentBilling]);
8902
8923
  const orderedClaimsAdministratorSources = useMemo6(() => [...claimsAdministratorSources ?? []].filter((source) => source.name.trim()).sort((left, right) => Number(right.source.toLowerCase() === "eams") - Number(left.source.toLowerCase() === "eams")), [claimsAdministratorSources]);
8903
8924
  const sourceClaimsAdministratorName = orderedClaimsAdministratorSources[0]?.name.trim() ?? "";
8904
8925
  const initializationKey = useMemo6(
@@ -9029,7 +9050,8 @@ function BillSubmissionForm({
9029
9050
  if (Object.hasOwn(patch, "modifiers")) setFeeDetails((current) => ({ ...current, [index]: { ...detailsForLine(index), interpretationLocation: "", professionalComponentBasis: "" } }));
9030
9051
  if (Object.hasOwn(patch, "code")) setFeeDetails((current) => ({ ...current, [index]: {} }));
9031
9052
  setBill((current) => {
9032
- const serviceLines = ensureTrailingBillSubmissionLine(current.serviceLines.map((line, lineIndex) => {
9053
+ const added = patch.code != null && patch.code !== current.serviceLines[index]?.code ? Object.entries(companionLines ?? {}).find(([code]) => code.trim().toUpperCase() === patch.code.trim().toUpperCase())?.[1] : void 0;
9054
+ const serviceLines = ensureTrailingBillSubmissionLine(withAddedBillSubmissionLines(current.serviceLines.map((line, lineIndex) => {
9033
9055
  if (lineIndex !== index) return line;
9034
9056
  const next = { ...line, ...patch };
9035
9057
  if (patch.code != null && patch.code !== line.code) {
@@ -9037,6 +9059,10 @@ function BillSubmissionForm({
9037
9059
  delete next.feeContext;
9038
9060
  delete next.drug;
9039
9061
  }
9062
+ if (patch.code != null && patch.code !== line.code && (patch.units === void 0 || patch.units === line.units)) {
9063
+ const startingUnits = (code) => procedures.find((item) => item.code.toUpperCase() === code.trim().toUpperCase())?.defaultUnits ?? 1;
9064
+ if ((line.units ?? 1) === startingUnits(line.code)) next.units = startingUnits(patch.code);
9065
+ }
9040
9066
  if (treatmentBilling && next.code && !isMedicalLegalCode(next.code)) {
9041
9067
  if (!editableTreatmentCharges || patch.code != null && patch.code !== line.code) delete next.charge;
9042
9068
  return next;
@@ -9045,9 +9071,9 @@ function BillSubmissionForm({
9045
9071
  if (charge != null) return { ...next, charge };
9046
9072
  if (Object.hasOwn(patch, "code")) delete next.charge;
9047
9073
  return next;
9048
- }));
9074
+ }), added));
9049
9075
  const populated = serviceLines.filter((line) => line.code.trim());
9050
- return { ...sharedDiagnoses ? setBillSubmissionSharedDiagnoses(replaceBillSubmissionServiceLines(current, serviceLines), current.diagnoses ?? []) : replaceBillSubmissionServiceLines(current, serviceLines), ...treatmentBilling && populated.length ? { billingMode: populated.every((line) => isMedicalLegalCode(line.code)) ? "med_legal" : "professional" } : {} };
9076
+ return { ...sharedDiagnoses ? setBillSubmissionSharedDiagnoses(replaceBillSubmissionServiceLines(current, serviceLines), current.diagnoses ?? []) : replaceBillSubmissionServiceLines(current, serviceLines), ...treatmentBilling && populated.length ? { billingMode: billingModeForLines(populated) } : {} };
9051
9077
  });
9052
9078
  };
9053
9079
  const setLineCharge = (index, charge) => setBill((current) => ({
@@ -9405,7 +9431,7 @@ function BillSubmissionForm({
9405
9431
  } else if (charge != null) next.charge = charge;
9406
9432
  return next;
9407
9433
  }).filter(lineHasContent);
9408
- const clean = { ...cloneBill(bill), serviceLines: pricedLines, ...treatmentBilling && pricedLines.length ? { billingMode: pricedLines.every((line) => isMedicalLegalCode(line.code)) ? "med_legal" : "professional" } : {} };
9434
+ const clean = { ...cloneBill(bill), serviceLines: pricedLines, ...treatmentBilling && pricedLines.length ? { billingMode: billingModeForLines(pricedLines) } : {} };
9409
9435
  const previewBillKey = JSON.stringify(clean);
9410
9436
  const previewCurrent = cmsPreview?.billKey === previewBillKey;
9411
9437
  const liveErrors = JSON.stringify(validateBillSubmission(clean).fieldErrors);
@@ -9829,7 +9855,7 @@ function BillSubmissionForm({
9829
9855
  ] }),
9830
9856
  bill.serviceLines.map((line, index) => /* @__PURE__ */ jsxs19("div", { className: "mbsf-line", children: [
9831
9857
  /* @__PURE__ */ jsxs19("div", { "data-label": "Procedure code", "data-field-path": `serviceLines.${index}.code`, "data-invalid": Boolean(errors[`serviceLines.${index}.code`]), children: [
9832
- /* @__PURE__ */ jsx20(ComboBox, { ariaLabel: `Procedure code ${index + 1}`, invalid: Boolean(errors[`serviceLines.${index}.code`]), disabled: locked, value: line.code, placeholder: "Search or enter code\u2026", loading: procedureLoading, onOpen: () => loadProcedures(""), onQuery: loadProcedures, options: procedures.map((item) => ({ id: item.code, label: item.code, detail: item.description })), createOption: customProcedureOption, onSelect: (option) => {
9858
+ /* @__PURE__ */ jsx20(ComboBox, { ariaLabel: `Procedure code ${index + 1}`, invalid: Boolean(errors[`serviceLines.${index}.code`]), disabled: locked, value: line.code, placeholder: "Search or enter code\u2026", matchCodeIgnoringSeparators: true, loading: procedureLoading, onOpen: () => loadProcedures(""), onQuery: loadProcedures, options: procedures.map((item) => ({ id: item.code, label: item.code, detail: item.description })), createOption: customProcedureOption, onSelect: (option) => {
9833
9859
  const switched = isMedicalLegalCode(line.code) && !isMedicalLegalCode(option.id);
9834
9860
  const [updated] = applyBillSubmissionEvaluationModifiers([{ ...line, code: option.id, ...switched ? { modifiers: (line.modifiers ?? []).filter((value) => !["94", "95", "96"].includes(value.replace(/^-/, ""))) } : {} }], evaluationType);
9835
9861
  setLine(index, updated);
@@ -9853,7 +9879,7 @@ function BillSubmissionForm({
9853
9879
  /* @__PURE__ */ jsx20("input", { className: "mbsf-input", "aria-label": `Units ${index + 1}`, "aria-invalid": Boolean(errors[`serviceLines.${index}.units`]), type: "number", min: 1, max: treatmentBilling && isAnesthesiaCandidate(line.code) ? 1 : void 0, value: line.units ?? 1, onChange: (event) => setLine(index, { units: Number(event.target.value) }) }),
9854
9880
  errors[`serviceLines.${index}.units`] ? /* @__PURE__ */ jsx20("small", { className: "mbsf-error", role: "alert", children: errors[`serviceLines.${index}.units`] }) : null
9855
9881
  ] }),
9856
- /* @__PURE__ */ jsx20("div", { className: "mbsf-money", "data-label": editableTreatmentCharges && treatmentBilling ? "Billed charge" : "Allowed", "data-field-path": `serviceLines.${index}.charge`, "data-invalid": Boolean(errors[`serviceLines.${index}.charge`]), children: lineCharge(line, index) == null ? quoteKeys[index] ? !supportedFeeJurisdiction || !quoteFee || !quoteInputs[index]?.dateOfService || isTherapyEditorCode(line.code) && !quoteInputs[index]?.therapyContext || feeQuotes[quoteKeys[index]] ? "Needs review" : "Checking\u2026" : "\u2014" : lineCharge(line, index).toLocaleString(void 0, { style: "currency", currency: "USD" }) }),
9882
+ /* @__PURE__ */ jsx20("div", { className: "mbsf-money", "data-label": editableTreatmentCharges && treatmentBilling ? "Billed charge" : "Allowed", "data-field-path": `serviceLines.${index}.charge`, "data-invalid": Boolean(errors[`serviceLines.${index}.charge`]), children: lineCharge(line, index) == null ? quoteKeys[index] ? !supportedFeeJurisdiction || !quoteFee || !quoteInputs[index]?.dateOfService || isTherapyEditorCode(line.code) && !quoteInputs[index]?.therapyContext ? "Needs review" : feeQuotes[quoteKeys[index]]?.status === "error" ? "Fee unavailable" : feeQuotes[quoteKeys[index]] ? "Needs review" : "Checking\u2026" : "\u2014" : lineCharge(line, index).toLocaleString(void 0, { style: "currency", currency: "USD" }) }),
9857
9883
  /* @__PURE__ */ jsx20("button", { className: "mbsf-icon-btn", type: "button", "aria-label": `Remove service line ${index + 1}`, disabled: locked || !lineHasContent(line) && index === bill.serviceLines.length - 1, onClick: () => {
9858
9884
  setFeeDetails({});
9859
9885
  if (individualDiagnoses.current) individualDiagnoses.current.splice(index, 1);
@@ -20056,7 +20082,7 @@ function ConnectedBillLifecycle({
20056
20082
  initialBill: correctionInitialBill,
20057
20083
  profileOptions: data.options ? organizationProfileOptions(data.options) : {},
20058
20084
  ...billingSettings ? { billingSettings } : {},
20059
- treatmentBilling: data.bill.billingMode === "professional",
20085
+ treatmentBilling: data.bill.billingMode === "professional" || data.bill.lineItems.some((line) => !/^ML/i.test(line.code.trim())),
20060
20086
  attachments: correctionAttachments,
20061
20087
  onSubmit: submitCorrection,
20062
20088
  onListMedicalProviderNetworks: lifecycle.listMedicalProviderNetworks,
@@ -20097,7 +20123,7 @@ function ConnectedBillLifecycle({
20097
20123
  initialBill: correctionInitialBill,
20098
20124
  profileOptions: data.options ? organizationProfileOptions(data.options) : {},
20099
20125
  ...billingSettings ? { billingSettings } : {},
20100
- treatmentBilling: data.bill.billingMode === "professional",
20126
+ treatmentBilling: data.bill.billingMode === "professional" || data.bill.lineItems.some((line) => !/^ML/i.test(line.code.trim())),
20101
20127
  attachments: correctionAttachments,
20102
20128
  onSubmit: submitNewBillFromForm,
20103
20129
  onListMedicalProviderNetworks: lifecycle.listMedicalProviderNetworks,
@@ -20221,7 +20247,7 @@ function ConnectedBillLifecycle({
20221
20247
  initialBill: correctionInitialBill,
20222
20248
  profileOptions: data.options ? organizationProfileOptions(data.options) : {},
20223
20249
  ...billingSettings ? { billingSettings } : {},
20224
- treatmentBilling: data.bill.billingMode === "professional",
20250
+ treatmentBilling: data.bill.billingMode === "professional" || data.bill.lineItems.some((line) => !/^ML/i.test(line.code.trim())),
20225
20251
  attachments: correctionAttachments,
20226
20252
  onSubmit: submitDuplicateFromForm,
20227
20253
  onListMedicalProviderNetworks: lifecycle.listMedicalProviderNetworks,