@mindbill/react 0.51.0 → 0.52.1

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/README.md CHANGED
@@ -214,7 +214,7 @@ The component includes the interaction model, not just the markup:
214
214
  - complete, server-backed ICD-10 search with an alphabetized 100-code first page, automatic 100-code scroll paging, common-injury quick picks, and removable chips;
215
215
  - an authenticated claims-administrator browser that opens to an alphabetized 50-item page, loads later pages on scroll, searches from the first character, and preserves exact-name and claim-number evidence;
216
216
  - explicit routing-payer selection when the administrator requires it, with aliases, affiliated entities, claim-number hints, delivery type, clearinghouse routes, and payer identifiers shown in context;
217
- - QME, AME, and Psych QME evaluation modes with medical-legal modifier defaults; Psych QME also seeds `Z04.6` when no more specific diagnosis was supplied, and exposes it as a Psych quick pick;
217
+ - QME, AME, Psych QME, and Psych AME evaluation modes with medical-legal modifier defaults; psychiatric QME evaluations combine `95` and `96`, while psychiatric AME evaluations combine `94` and `96`. Both psychiatric modes seed `Z04.6` when no more specific diagnosis was supplied, and exposes it as a Psych quick pick;
218
218
  - a searchable rendering-provider taxonomy combobox that accepts either a human-readable specialty search or an exact 10-character taxonomy code;
219
219
  - searchable workers-comp procedure/modifier controls, medical-legal fee-schedule amounts, totals, valid manual CPT/HCPCS entry, and an automatically maintained empty line;
220
220
  - removable source documents with new-tab previews and a full-width click, panel-drop, or whole-page PDF upload area. Auto-attached documents can be removable when the host sets `removable: true`; otherwise they remain locked by default. Med-legal mode assigns every document to `J4 - Med-Legal Report` without showing another control; professional mode shows the complete searchable PWK01 report-type directory. Override that presentation with `attachmentReportTypeMode`, `attachmentReportTypes`, and `defaultAttachmentReportType`.
package/dist/index.d.ts CHANGED
@@ -188,7 +188,7 @@ type BillSubmissionReportTypeOption = {
188
188
  };
189
189
  declare const MED_LEGAL_REPORT_TYPE_CODE = "OZ:J4";
190
190
  declare const BILL_SUBMISSION_REPORT_TYPES: readonly BillSubmissionReportTypeOption[];
191
- type BillSubmissionEvaluationType = "qme" | "ame" | "psych_qme";
191
+ type BillSubmissionEvaluationType = "qme" | "ame" | "psych_qme" | "psych_ame";
192
192
  type BillSubmissionAddress = {
193
193
  line1: string;
194
194
  line2?: string;
@@ -441,7 +441,7 @@ declare function parseBillSubmissionDate(value: string): string | undefined;
441
441
  declare function formatBillSubmissionDate(value: string | null | undefined): string;
442
442
  declare function applyBillSubmissionEvaluationModifiers(lines: BillSubmissionInput$1["serviceLines"], type: BillSubmissionEvaluationType): BillSubmissionInput$1["serviceLines"];
443
443
  declare const PSYCH_QME_DEFAULT_DIAGNOSIS = "Z04.6";
444
- /** Seed Psych QME's general examination code only when no diagnosis was supplied. */
444
+ /** Seed the psychiatric examination code only when no diagnosis was supplied. */
445
445
  declare function applyBillSubmissionEvaluationDiagnoses(diagnoses: string[] | undefined, type: BillSubmissionEvaluationType): string[];
446
446
  declare function validateBillSubmission(bill: BillSubmissionInput$1): BillSubmissionValidation;
447
447
  declare function normalizeClaimsAdministratorName(value: string): string;
@@ -1227,11 +1227,14 @@ type ConnectedPaymentReviewProps = BillingOperationsClientOptions & {
1227
1227
  declare function ConnectedPaymentReview({ initialQuery, onSelectBill, onPostPayment, appearance, className, style, ...options }: ConnectedPaymentReviewProps): ReactElement;
1228
1228
 
1229
1229
  type NotificationAgingDay = 30 | 60 | 90;
1230
+ type NotificationReportDigest = "off" | "daily" | "weekly";
1230
1231
  type NotificationPreferences = {
1231
1232
  enabled: boolean;
1232
1233
  statusUpdates: boolean;
1233
1234
  agingDays: NotificationAgingDay[];
1234
1235
  quietHours: boolean;
1236
+ /** Optional for existing adapters; omitted means off. */
1237
+ reportDigest?: NotificationReportDigest;
1235
1238
  };
1236
1239
  /** A projection from the host's authenticated server, not the raw administrative API. */
1237
1240
  type NotificationSettingsSnapshot = {
@@ -1273,6 +1276,8 @@ type NotificationRecipientInvitation = {
1273
1276
  statusUpdates: boolean;
1274
1277
  agingDays: NotificationAgingDay[];
1275
1278
  quietHours: boolean;
1279
+ /** Optional for existing hosts; omitted means off. */
1280
+ reportDigest?: NotificationReportDigest;
1276
1281
  };
1277
1282
  type NotificationRecipient = Omit<NotificationRecipientInvitation, "requestId"> & {
1278
1283
  externalUserId: string;
@@ -1640,4 +1645,4 @@ type MindBillWidgetProps = {
1640
1645
  declare function MindBillBillTimeline(props: MindBillWidgetProps): ReactElement;
1641
1646
  declare function MindBillBillReview(props: MindBillWidgetProps): ReactElement;
1642
1647
 
1643
- export { BILL_STATUS_AGING_BUCKETS, BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS, BILL_SUBMISSION_DOCUMENT_TYPES, BILL_SUBMISSION_REPORT_TYPES, BILL_SUBMISSION_REQUIRED_FIELDS, type BillActivityEvent, BillActivityTimeline, type BillActivityTimelineProps, type BillAgingBucket, type BillAgingBucketId, BillAgingSummary, type BillAgingSummaryProps, BillCourtesyCopyForm, type BillCourtesyCopyFormProps, BillExplanationOfReview, type BillExplanationOfReviewProps, BillHistoryTable, type BillHistoryTableProps, BillLifecycleActions, type BillLifecycleActionsProps, BillLifecycleProgress, type BillLifecycleProgressProps, type BillLifecycleProgressStepsOptions, type BillLifecycleStage, BillList, type BillListProps, BillPayerContactCard, type BillPayerContactCardProps, BillPaymentLedger, type BillPaymentLedgerProps, BillReadOnlyForm, type BillReadOnlyFormProps, type BillRegistryAge, type BillRegistryItem, type BillRegistryQuery, type BillRegistryResult, type BillRegistrySort, type BillRegistryStatus, BillRejectionNotice, type BillRejectionNoticeProps, BillRemittanceCard, type BillRemittanceCardProps, type BillReviewAttachment, type BillReviewBillingProvider, type BillReviewClinician, type BillReviewData, type BillReviewDocumentType, type BillReviewDraft, type BillReviewFeatures, BillReviewForm, type BillReviewFormProps, type BillReviewLineItem, type BillReviewLocation, type BillReviewPayer, type BillReviewSaveInput, BillSnapshotSummary, type BillSnapshotSummaryProps, type BillStatusAction, type BillStatusAgingCell, BillStatusAgingMatrix, type BillStatusAgingMatrixData, type BillStatusAgingMatrixProps, type BillStatusAgingRow, type BillStatusClient, type BillStatusClientOptions, type BillStatusData, type BillStatusSession, type BillStatusSessionProvider, type BillStatusSessionRequest, BillStatusSummary, type BillStatusSummaryProps, BillSubmissionActions, type BillSubmissionAddress, type BillSubmissionAttachmentReportTypeMode, BillSubmissionAttachmentsSection, BillSubmissionClaimSection, type BillSubmissionDiagnosisOption, type BillSubmissionDocumentType, type BillSubmissionEvaluationType, BillSubmissionForm, type BillSubmissionFormProps, type BillSubmissionFormValue, BillSubmissionHeader, type BillSubmissionInput$1 as BillSubmissionInput, type BillSubmissionModifierOption, BillSubmissionPatientSection, type BillSubmissionPostalPlace, type BillSubmissionProcedureOption, type BillSubmissionProfileOption, type BillSubmissionProfileOptions, BillSubmissionProvidersSection, type BillSubmissionReportTypeOption, type BillSubmissionRibbonItem, type BillSubmissionRoute, type BillSubmissionSectionId, BillSubmissionServiceLinesSection, type BillSubmissionSourceAttachment, type BillSubmissionTaxonomyOption, type BillSubmissionUpload, type BillSubmissionValidation, BillSubmissionsRibbon, type BillSubmissionsRibbonProps, BillTasksDashboard, type BillTasksDashboardCell, type BillTasksDashboardProps, type BillTasksResult, type BillingComponentProps, BillingDashboard, type BillingDashboardBill, type BillingDashboardProps, type BillingDashboardSummary, type BillingOperationsClient, type BillingOperationsClientOptions, BillingReport, type BillingReportDimension, type BillingReportProps, type BillingReportRow, BillingSettings, ClaimsAdministratorDirectoryDialog, type ClaimsAdministratorDirectoryDialogProps, ConnectedBillLifecycle, type ConnectedBillLifecycleProps, ConnectedBillSearch, type ConnectedBillSearchProps, ConnectedBillStatus, type ConnectedBillStatusProps, ConnectedBillTasksDashboard, type ConnectedBillTasksDashboardProps, ConnectedBillingWorkspace, type ConnectedBillingWorkspaceProps, ConnectedNotificationRecipientsSettings, ConnectedNotificationSettings, ConnectedPaymentReview, type ConnectedPaymentReviewProps, ConnectedProductivityReport, ConnectedServiceLineItemsReport, type CourtesyCopyRecipientOption, DEFAULT_BILL_SUBMISSION_MODIFIERS, DEFAULT_BILL_SUBMISSION_PROCEDURES, DEFAULT_BILL_SUBMISSION_TAXONOMIES, MED_LEGAL_REPORT_TYPE_CODE, MindBillBillReview, MindBillBillTimeline, type MindBillReactAppearance, type MindBillThemePreset, type MindBillWidgetProps, type NotificationAgingDay, type NotificationPreferences, type NotificationRecipient, type NotificationRecipientInvitation, type NotificationRecipientsAdapter, NotificationRecipientsSettings, type NotificationRecipientsSettingsProps, type NotificationRecipientsSnapshot, NotificationSettings, type NotificationSettingsAdapter, type NotificationSettingsProps, type NotificationSettingsSnapshot, type NotificationSettingsUpdate, OrganizationOnboarding, type OrganizationOnboardingProps, PSYCH_QME_DEFAULT_DIAGNOSIS, type PaymentReviewItem, type PaymentReviewQuery, type PaymentReviewRange, type PaymentReviewResult, type ProductivityReport, ReportBillStatusDialog, type ReportBillStatusDialogProps, SECOND_REVIEW_REASON_TEMPLATES, SecondReviewForm, type SecondReviewFormProps, SendRouteDialog, type SendRouteDialogProps, type SendRouteSubmission, type ServiceLineItemsReport, type UseBillLifecycleOptions, type UseBillLifecycleResult, type UseBillStatusOptions, type UseBillStatusResult, type W9ExtractionStatus, W9Upload, type W9UploadProps, applyBillSubmissionEvaluationDiagnoses, applyBillSubmissionEvaluationModifiers, billActivityEventLabel, billAgingBucket, billAgingDays, billLifecycleDisplayLabel, billLifecycleStage, billSubmissionsRibbonDeliveryLabel, billSubmissionsRibbonFromHistory, buildBillReviewSaveInput, buildBillStatusAgingCsv, buildBillStatusAgingMatrix, buildBillingReportCsv, buildBillingReportRows, calculateBillSubmissionAllowedAmount, chooseClaimsAdministrator, claimsAdministratorRecommendations, createBillStatusClient, createBillingOperationsClient, ensureTrailingBillSubmissionLine, ensureTrailingProcedureLine, exactClaimsAdministratorMatch, extractSendRouteEmail, formatBillSubmissionDate, formatSendRouteFax, isBillLifecycleDraft, mindBillAppearanceStyle, mindBillThemePresets, normalizeClaimsAdministratorName, organizationProfileOptions, parseBillSubmissionDate, prepareBillSubmissionDocuments, resolveMindBillAppearance, submittedClaimsAdministrator, summarizeBillingDashboard, useBillLifecycle, useBillStatus, validateBillSubmission, visibleBillLifecycleActions };
1648
+ export { BILL_STATUS_AGING_BUCKETS, BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS, BILL_SUBMISSION_DOCUMENT_TYPES, BILL_SUBMISSION_REPORT_TYPES, BILL_SUBMISSION_REQUIRED_FIELDS, type BillActivityEvent, BillActivityTimeline, type BillActivityTimelineProps, type BillAgingBucket, type BillAgingBucketId, BillAgingSummary, type BillAgingSummaryProps, BillCourtesyCopyForm, type BillCourtesyCopyFormProps, BillExplanationOfReview, type BillExplanationOfReviewProps, BillHistoryTable, type BillHistoryTableProps, BillLifecycleActions, type BillLifecycleActionsProps, BillLifecycleProgress, type BillLifecycleProgressProps, type BillLifecycleProgressStepsOptions, type BillLifecycleStage, BillList, type BillListProps, BillPayerContactCard, type BillPayerContactCardProps, BillPaymentLedger, type BillPaymentLedgerProps, BillReadOnlyForm, type BillReadOnlyFormProps, type BillRegistryAge, type BillRegistryItem, type BillRegistryQuery, type BillRegistryResult, type BillRegistrySort, type BillRegistryStatus, BillRejectionNotice, type BillRejectionNoticeProps, BillRemittanceCard, type BillRemittanceCardProps, type BillReviewAttachment, type BillReviewBillingProvider, type BillReviewClinician, type BillReviewData, type BillReviewDocumentType, type BillReviewDraft, type BillReviewFeatures, BillReviewForm, type BillReviewFormProps, type BillReviewLineItem, type BillReviewLocation, type BillReviewPayer, type BillReviewSaveInput, BillSnapshotSummary, type BillSnapshotSummaryProps, type BillStatusAction, type BillStatusAgingCell, BillStatusAgingMatrix, type BillStatusAgingMatrixData, type BillStatusAgingMatrixProps, type BillStatusAgingRow, type BillStatusClient, type BillStatusClientOptions, type BillStatusData, type BillStatusSession, type BillStatusSessionProvider, type BillStatusSessionRequest, BillStatusSummary, type BillStatusSummaryProps, BillSubmissionActions, type BillSubmissionAddress, type BillSubmissionAttachmentReportTypeMode, BillSubmissionAttachmentsSection, BillSubmissionClaimSection, type BillSubmissionDiagnosisOption, type BillSubmissionDocumentType, type BillSubmissionEvaluationType, BillSubmissionForm, type BillSubmissionFormProps, type BillSubmissionFormValue, BillSubmissionHeader, type BillSubmissionInput$1 as BillSubmissionInput, type BillSubmissionModifierOption, BillSubmissionPatientSection, type BillSubmissionPostalPlace, type BillSubmissionProcedureOption, type BillSubmissionProfileOption, type BillSubmissionProfileOptions, BillSubmissionProvidersSection, type BillSubmissionReportTypeOption, type BillSubmissionRibbonItem, type BillSubmissionRoute, type BillSubmissionSectionId, BillSubmissionServiceLinesSection, type BillSubmissionSourceAttachment, type BillSubmissionTaxonomyOption, type BillSubmissionUpload, type BillSubmissionValidation, BillSubmissionsRibbon, type BillSubmissionsRibbonProps, BillTasksDashboard, type BillTasksDashboardCell, type BillTasksDashboardProps, type BillTasksResult, type BillingComponentProps, BillingDashboard, type BillingDashboardBill, type BillingDashboardProps, type BillingDashboardSummary, type BillingOperationsClient, type BillingOperationsClientOptions, BillingReport, type BillingReportDimension, type BillingReportProps, type BillingReportRow, BillingSettings, ClaimsAdministratorDirectoryDialog, type ClaimsAdministratorDirectoryDialogProps, ConnectedBillLifecycle, type ConnectedBillLifecycleProps, ConnectedBillSearch, type ConnectedBillSearchProps, ConnectedBillStatus, type ConnectedBillStatusProps, ConnectedBillTasksDashboard, type ConnectedBillTasksDashboardProps, ConnectedBillingWorkspace, type ConnectedBillingWorkspaceProps, ConnectedNotificationRecipientsSettings, ConnectedNotificationSettings, ConnectedPaymentReview, type ConnectedPaymentReviewProps, ConnectedProductivityReport, ConnectedServiceLineItemsReport, type CourtesyCopyRecipientOption, DEFAULT_BILL_SUBMISSION_MODIFIERS, DEFAULT_BILL_SUBMISSION_PROCEDURES, DEFAULT_BILL_SUBMISSION_TAXONOMIES, MED_LEGAL_REPORT_TYPE_CODE, MindBillBillReview, MindBillBillTimeline, type MindBillReactAppearance, type MindBillThemePreset, type MindBillWidgetProps, type NotificationAgingDay, type NotificationPreferences, type NotificationRecipient, type NotificationRecipientInvitation, type NotificationRecipientsAdapter, NotificationRecipientsSettings, type NotificationRecipientsSettingsProps, type NotificationRecipientsSnapshot, type NotificationReportDigest, NotificationSettings, type NotificationSettingsAdapter, type NotificationSettingsProps, type NotificationSettingsSnapshot, type NotificationSettingsUpdate, OrganizationOnboarding, type OrganizationOnboardingProps, PSYCH_QME_DEFAULT_DIAGNOSIS, type PaymentReviewItem, type PaymentReviewQuery, type PaymentReviewRange, type PaymentReviewResult, type ProductivityReport, ReportBillStatusDialog, type ReportBillStatusDialogProps, SECOND_REVIEW_REASON_TEMPLATES, SecondReviewForm, type SecondReviewFormProps, SendRouteDialog, type SendRouteDialogProps, type SendRouteSubmission, type ServiceLineItemsReport, type UseBillLifecycleOptions, type UseBillLifecycleResult, type UseBillStatusOptions, type UseBillStatusResult, type W9ExtractionStatus, W9Upload, type W9UploadProps, applyBillSubmissionEvaluationDiagnoses, applyBillSubmissionEvaluationModifiers, billActivityEventLabel, billAgingBucket, billAgingDays, billLifecycleDisplayLabel, billLifecycleStage, billSubmissionsRibbonDeliveryLabel, billSubmissionsRibbonFromHistory, buildBillReviewSaveInput, buildBillStatusAgingCsv, buildBillStatusAgingMatrix, buildBillingReportCsv, buildBillingReportRows, calculateBillSubmissionAllowedAmount, chooseClaimsAdministrator, claimsAdministratorRecommendations, createBillStatusClient, createBillingOperationsClient, ensureTrailingBillSubmissionLine, ensureTrailingProcedureLine, exactClaimsAdministratorMatch, extractSendRouteEmail, formatBillSubmissionDate, formatSendRouteFax, isBillLifecycleDraft, mindBillAppearanceStyle, mindBillThemePresets, normalizeClaimsAdministratorName, organizationProfileOptions, parseBillSubmissionDate, prepareBillSubmissionDocuments, resolveMindBillAppearance, submittedClaimsAdministrator, summarizeBillingDashboard, useBillLifecycle, useBillStatus, validateBillSubmission, visibleBillLifecycleActions };
package/dist/index.js CHANGED
@@ -2474,27 +2474,31 @@ function formatBillSubmissionDate(value) {
2474
2474
  const [year, month, day] = parsed.split("-");
2475
2475
  return `${month}/${day}/${year}`;
2476
2476
  }
2477
- function evaluationModifier(type, code) {
2478
- if (!/^ML(?:200|201|202|203|PRR)$/.test(code.toUpperCase())) return void 0;
2479
- if (type === "ame") return code.toUpperCase() === "ML200" || code.toUpperCase() === "MLPRR" ? void 0 : "94";
2480
- if (type === "psych_qme") return code.toUpperCase() === "ML200" ? "95" : code.toUpperCase() === "MLPRR" ? void 0 : "96";
2481
- return "95";
2477
+ function evaluationModifiers(type, code) {
2478
+ const normalizedCode = code.toUpperCase();
2479
+ if (!/^ML(?:200|201|202|203|PRR)$/.test(normalizedCode)) return [];
2480
+ const isAme = type === "ame" || type === "psych_ame";
2481
+ if (normalizedCode === "ML200" || normalizedCode === "MLPRR") return isAme ? [] : ["95"];
2482
+ const modifiers = [isAme ? "94" : "95"];
2483
+ if (type === "psych_qme" || type === "psych_ame") modifiers.push("96");
2484
+ return modifiers;
2482
2485
  }
2483
2486
  function applyBillSubmissionEvaluationModifiers(lines, type) {
2484
2487
  return lines.map((line) => {
2485
- const auto = evaluationModifier(type, line.code);
2488
+ const auto = evaluationModifiers(type, line.code);
2486
2489
  const modifiers = (line.modifiers ?? []).filter((item) => !["94", "95", "96"].includes(item.replace(/^-/, "")));
2487
- return { ...line, modifiers: auto ? [auto, ...modifiers] : modifiers };
2490
+ return { ...line, modifiers: [...auto, ...modifiers] };
2488
2491
  });
2489
2492
  }
2490
2493
  var PSYCH_QME_DEFAULT_DIAGNOSIS = "Z04.6";
2491
2494
  function applyBillSubmissionEvaluationDiagnoses(diagnoses, type) {
2492
2495
  const current = [...diagnoses ?? []];
2493
- return type === "psych_qme" && !current.some((code) => code.trim()) ? [PSYCH_QME_DEFAULT_DIAGNOSIS] : current;
2496
+ return (type === "psych_qme" || type === "psych_ame") && !current.some((code) => code.trim()) ? [PSYCH_QME_DEFAULT_DIAGNOSIS] : current;
2494
2497
  }
2495
2498
  function initialEvaluationType(bill) {
2496
- if (bill.renderingProvider?.isAme) return "ame";
2497
- return bill.renderingProvider?.specialty?.toLowerCase().includes("psych") ? "psych_qme" : "qme";
2499
+ const isPsych = bill.renderingProvider?.specialty?.toLowerCase().includes("psych");
2500
+ if (bill.renderingProvider?.isAme) return isPsych ? "psych_ame" : "ame";
2501
+ return isPsych ? "psych_qme" : "qme";
2498
2502
  }
2499
2503
  function cloneInitialBill(bill) {
2500
2504
  const cloned = cloneBill(bill);
@@ -3069,7 +3073,7 @@ function BillSubmissionForm({
3069
3073
  };
3070
3074
  const changeEvaluation = (type) => {
3071
3075
  setEvaluationType(type);
3072
- setBill((current) => ({ ...current, diagnoses: applyBillSubmissionEvaluationDiagnoses(current.diagnoses, type), renderingProvider: { ...current.renderingProvider, isAme: type === "ame", isQme: type !== "ame", ...type === "psych_qme" && !current.renderingProvider?.specialty ? { specialty: "Psychiatry" } : {} }, serviceLines: applyBillSubmissionEvaluationModifiers(current.serviceLines, type) }));
3076
+ setBill((current) => ({ ...current, diagnoses: applyBillSubmissionEvaluationDiagnoses(current.diagnoses, type), renderingProvider: { ...current.renderingProvider, isAme: type === "ame" || type === "psych_ame", isQme: type === "qme" || type === "psych_qme", ...(type === "psych_qme" || type === "psych_ame") && !current.renderingProvider?.specialty ? { specialty: "Psychiatry" } : {} }, serviceLines: applyBillSubmissionEvaluationModifiers(current.serviceLines, type) }));
3073
3077
  };
3074
3078
  const lineCharge = (line) => calculateBillSubmissionAllowedAmount(line, procedures) ?? (Number.isFinite(line.charge) ? Number(line.charge) : void 0);
3075
3079
  const total = submittedLines(bill.serviceLines).reduce((sum, line) => sum + (lineCharge(line) ?? 0), 0);
@@ -3393,8 +3397,8 @@ function BillSubmissionForm({
3393
3397
  const serviceLinesSection = /* @__PURE__ */ jsxs6("fieldset", { className: "mbsf-card", disabled: locked, children: [
3394
3398
  /* @__PURE__ */ jsx6("legend", { className: "mbsf-legend", children: "Evaluation & service lines" }),
3395
3399
  /* @__PURE__ */ jsx6("p", { className: "mbsf-help", children: "Sets the evaluator/specialty modifier on medical-legal evaluation lines." }),
3396
- /* @__PURE__ */ jsx6("div", { className: "mbsf-segments", role: "group", "aria-label": "Evaluation type", children: [["qme", "QME (default)"], ["ame", "AME"], ["psych_qme", "Psych QME"]].map(([type, label]) => /* @__PURE__ */ jsx6("button", { className: "mbsf-segment", type: "button", "aria-pressed": evaluationType === type, onClick: () => changeEvaluation(type), children: label }, type)) }),
3397
- /* @__PURE__ */ jsx6("p", { className: "mbsf-help", children: evaluationType === "ame" ? "Agreed Medical Evaluator \u2014 eligible ML evaluation codes default to modifier -94." : evaluationType === "psych_qme" ? "Psychiatric QME \u2014 eligible ML evaluation codes default to modifier -96 (-95 for ML200)." : "Qualified Medical Evaluator \u2014 eligible ML evaluation codes default to modifier -95." }),
3400
+ /* @__PURE__ */ jsx6("div", { className: "mbsf-segments", role: "group", "aria-label": "Evaluation type", children: [["qme", "QME (default)"], ["ame", "AME"], ["psych_qme", "Psych QME"], ["psych_ame", "Psych AME"]].map(([type, label]) => /* @__PURE__ */ jsx6("button", { className: "mbsf-segment", type: "button", "aria-pressed": evaluationType === type, onClick: () => changeEvaluation(type), children: label }, type)) }),
3401
+ /* @__PURE__ */ jsx6("p", { className: "mbsf-help", children: evaluationType === "psych_ame" ? "Psychiatric or psychological AME \u2014 eligible ML evaluation codes default to modifiers -94 and -96." : evaluationType === "ame" ? "Agreed Medical Evaluator \u2014 eligible ML evaluation codes default to modifier -94." : evaluationType === "psych_qme" ? "Psychiatric or psychological QME \u2014 eligible ML evaluation codes default to modifiers -95 and -96 (-95 only for ML200 and MLPRR)." : "Qualified Medical Evaluator \u2014 eligible ML evaluation codes default to modifier -95." }),
3398
3402
  /* @__PURE__ */ jsxs6("div", { className: "mbsf-lines", "data-field-path": "serviceLines", "data-invalid": Boolean(errors.serviceLines), children: [
3399
3403
  /* @__PURE__ */ jsxs6("div", { className: "mbsf-line-head", children: [
3400
3404
  /* @__PURE__ */ jsxs6("span", { children: [
@@ -3414,8 +3418,8 @@ function BillSubmissionForm({
3414
3418
  bill.serviceLines.map((line, index) => /* @__PURE__ */ jsxs6("div", { className: "mbsf-line", children: [
3415
3419
  /* @__PURE__ */ jsxs6("div", { "data-label": "Procedure code", "data-field-path": `serviceLines.${index}.code`, "data-invalid": Boolean(errors[`serviceLines.${index}.code`]), children: [
3416
3420
  /* @__PURE__ */ jsx6(ComboBox, { ariaLabel: `Procedure code ${index + 1}`, invalid: Boolean(errors[`serviceLines.${index}.code`]), disabled: locked, value: line.code, placeholder: "Search or enter code\u2026", options: procedures.map((item) => ({ id: item.code, label: item.code, detail: item.description })), createOption: customProcedureOption, onSelect: (option) => {
3417
- const auto = evaluationModifier(evaluationType, option.id);
3418
- setLine(index, { code: option.id, ...auto ? { modifiers: [auto, ...(line.modifiers ?? []).filter((item) => !["94", "95", "96"].includes(item.replace(/^-/, "")))] } : line.modifiers ? { modifiers: line.modifiers } : {} });
3421
+ const [updated] = applyBillSubmissionEvaluationModifiers([{ ...line, code: option.id }], evaluationType);
3422
+ setLine(index, updated);
3419
3423
  } }),
3420
3424
  line.code ? /* @__PURE__ */ jsx6("small", { className: "mbsf-help", children: procedures.find((item) => item.code === line.code)?.description ?? "Custom CPT, HCPCS, or medical-legal code" }) : null,
3421
3425
  errors[`serviceLines.${index}.code`] ? /* @__PURE__ */ jsx6("small", { className: "mbsf-error", role: "alert", children: errors[`serviceLines.${index}.code`] }) : null
@@ -5422,7 +5426,7 @@ function ConnectedPaymentReview({ initialQuery, onSelectBill, onPostPayment, app
5422
5426
  import { useEffect as useEffect10, useId as useId3, useRef as useRef5, useState as useState12 } from "react";
5423
5427
  import { Fragment as Fragment11, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
5424
5428
  function defaultNotificationPreferences() {
5425
- return { enabled: false, statusUpdates: false, agingDays: [], quietHours: true };
5429
+ return { enabled: false, statusUpdates: false, agingDays: [], quietHours: true, reportDigest: "off" };
5426
5430
  }
5427
5431
  function notificationSettingsUpdate(preferences, consent) {
5428
5432
  return {
@@ -5430,15 +5434,18 @@ function notificationSettingsUpdate(preferences, consent) {
5430
5434
  statusUpdates: preferences.statusUpdates === true,
5431
5435
  agingDays: [30, 60, 90].filter((day) => preferences.agingDays.includes(day)),
5432
5436
  quietHours: preferences.quietHours === true,
5437
+ reportDigest: preferences.reportDigest === "daily" || preferences.reportDigest === "weekly" ? preferences.reportDigest : "off",
5433
5438
  consent: consent === true
5434
5439
  };
5435
5440
  }
5436
5441
  function notificationSettingsNeedsConsent(previous, next) {
5437
5442
  if (!next.enabled) return false;
5443
+ if ((previous?.reportDigest ?? "off") !== (next.reportDigest ?? "off")) return true;
5438
5444
  if (!previous?.enabled || previous.statusUpdates !== next.statusUpdates || previous.quietHours !== next.quietHours) return true;
5439
5445
  return JSON.stringify(notificationSettingsUpdate(previous, false).agingDays) !== JSON.stringify(notificationSettingsUpdate(next, false).agingDays);
5440
5446
  }
5441
5447
  var css11 = `
5448
+ .mbns-digest{display:grid;gap:6px;margin-top:12px}.mbns-digest select{font:inherit;min-height:44px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);color:var(--mb-text);padding:10px 12px}.mbns-digest select:focus-visible{outline:2px solid var(--mb-accent);outline-offset:3px}
5442
5449
  .mbns{color:var(--mb-text);font-family:var(--mb-font);font-size:14px;line-height:1.5;min-width:0}.mbns *{box-sizing:border-box}.mbns h2,.mbns p{margin:0}.mbns-card{padding:24px;background:var(--mb-surface);border:1px solid var(--mb-border);border-radius:var(--mb-radius);box-shadow:var(--mb-shadow)}
5443
5450
  .mbns-header{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;margin-bottom:24px}.mbns h2{font-size:20px;line-height:1.3;font-weight:700}.mbns-muted{color:var(--mb-muted)}.mbns-header p{margin-top:6px;max-width:56ch}.mbns-badge{flex-shrink:0;background:var(--mb-soft);color:var(--mb-muted);padding:4px 9px;border-radius:var(--mb-control-radius);font-size:12px;font-weight:650}
5444
5451
  .mbns-account{padding:14px 16px;background:var(--mb-soft);border-radius:var(--mb-control-radius);margin-bottom:20px;overflow-wrap:anywhere}.mbns-account strong{display:block;font-weight:650}.mbns-account p{margin-top:3px;font-size:13px}
@@ -5481,7 +5488,7 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
5481
5488
  };
5482
5489
  }, [adapter, reload]);
5483
5490
  const needsConsent = notificationSettingsNeedsConsent(snapshot?.preferences ?? null, draft);
5484
- const hasCategory = draft.statusUpdates || draft.agingDays.length > 0;
5491
+ const hasCategory = draft.statusUpdates || draft.agingDays.length > 0 || (draft.reportDigest ?? "off") !== "off";
5485
5492
  const changed = JSON.stringify(notificationSettingsUpdate(draft, false)) !== JSON.stringify(notificationSettingsUpdate(snapshot?.preferences ?? defaultNotificationPreferences(), false));
5486
5493
  const busy = phase !== "ready";
5487
5494
  const canSave = !busy && changed && (!draft.enabled || !!snapshot?.canEnable && hasCategory && (!needsConsent || consent));
@@ -5570,6 +5577,15 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
5570
5577
  /* @__PURE__ */ jsx16("strong", { children: "Quiet hours" }),
5571
5578
  /* @__PURE__ */ jsx16("small", { children: "Hold emails from 7 pm to 7 am Pacific time." })
5572
5579
  ] })
5580
+ ] }),
5581
+ /* @__PURE__ */ jsxs16("label", { className: "mbns-digest", children: [
5582
+ /* @__PURE__ */ jsx16("strong", { children: "Scheduled activity digest" }),
5583
+ /* @__PURE__ */ jsxs16("select", { value: draft.reportDigest ?? "off", onChange: (event) => update({ reportDigest: event.target.value }), children: [
5584
+ /* @__PURE__ */ jsx16("option", { value: "off", children: "Off" }),
5585
+ /* @__PURE__ */ jsx16("option", { value: "daily", children: "Daily" }),
5586
+ /* @__PURE__ */ jsx16("option", { value: "weekly", children: "Weekly" })
5587
+ ] }),
5588
+ /* @__PURE__ */ jsx16("small", { className: "mbns-muted", children: "Activity counts at 9 am Pacific, every day or every Monday. No patient details, financial reports or attachments." })
5573
5589
  ] })
5574
5590
  ] }),
5575
5591
  draft.enabled && !hasCategory && /* @__PURE__ */ jsx16("p", { className: "mbns-notice", children: "Select at least one update type to enable notifications." }),
@@ -5603,16 +5619,25 @@ function notificationRecipientInvitation(input, requestId) {
5603
5619
  audience: input.audience,
5604
5620
  statusUpdates: preferences.statusUpdates,
5605
5621
  agingDays: preferences.agingDays,
5606
- quietHours: preferences.quietHours
5622
+ quietHours: preferences.quietHours,
5623
+ reportDigest: preferences.reportDigest ?? "off"
5607
5624
  };
5608
5625
  }
5609
5626
  var css12 = `
5627
+ .mbnr-digest{margin-top:12px}.mbnr-digest small{display:block;margin-top:6px}
5610
5628
  .mbnr{font:14px/1.5 var(--mb-font);color:var(--mb-text);min-width:0}.mbnr *{box-sizing:border-box}.mbnr h2,.mbnr h3,.mbnr p{margin:0}.mbnr h2{font-size:20px}.mbnr h3{font-size:15px}.mbnr-card{border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);padding:24px}.mbnr header{display:flex;gap:16px;justify-content:space-between;align-items:start;margin-bottom:24px}.mbnr-muted{color:var(--mb-muted)}.mbnr header p{margin-top:6px;max-width:65ch}.mbnr-badge{background:var(--mb-soft);padding:4px 9px;border-radius:var(--mb-control-radius);white-space:nowrap;font-size:12px}.mbnr-form{display:grid;gap:16px;padding:20px;background:var(--mb-soft);border-radius:var(--mb-control-radius)}.mbnr-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}.mbnr label{display:block}.mbnr label>span{display:block;font-weight:600;margin-bottom:6px}.mbnr input[type=email],.mbnr select{width:100%;min-height:44px;background:var(--mb-surface);color:var(--mb-text);font:inherit;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);padding:10px 12px}.mbnr-check{display:flex!important;gap:10px;align-items:center;min-height:36px}.mbnr input[type=checkbox]{width:17px;height:17px;accent-color:var(--mb-accent)}.mbnr fieldset{border:0;margin:0;padding:0;min-width:0}.mbnr legend{font-weight:600;margin-bottom:6px}.mbnr-days{display:flex;gap:20px;flex-wrap:wrap}.mbnr button{font:inherit;font-weight:600;min-height:44px;padding:10px 14px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);color:var(--mb-text);cursor:pointer}.mbnr button:disabled{opacity:.5;cursor:not-allowed}.mbnr button.mbnr-primary{background:var(--mb-accent);border-color:var(--mb-accent);color:var(--mb-accent-contrast)}.mbnr :is(input,button,select):focus-visible{outline:2px solid var(--mb-accent);outline-offset:3px}.mbnr-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center}.mbnr-list{margin-top:28px;display:grid;gap:12px}.mbnr-recipient{border-top:1px solid var(--mb-border);padding-top:16px;display:flex;gap:16px;justify-content:space-between;align-items:start}.mbnr-email{overflow-wrap:anywhere;font-weight:600}.mbnr-state{display:flex;gap:10px;align-items:center;flex-shrink:0}.mbnr-error{color:var(--mb-danger)}.mbnr-notice{margin-top:16px!important}.mbnr-pagination{margin-top:20px}.mbnr-empty{padding:20px 0;color:var(--mb-muted)}@media(max-width:600px){.mbnr-card{padding:18px}.mbnr-form{padding:16px}.mbnr-fields{grid-template-columns:1fr}.mbnr-recipient{flex-direction:column}.mbnr-state{width:100%;justify-content:space-between}.mbnr header{flex-wrap:wrap}}
5611
5629
  `;
5612
5630
  function NotificationRecipientsSettings(props) {
5613
5631
  return /* @__PURE__ */ jsx17(RecipientSettingsSession, { ...props }, props.identityKey);
5614
5632
  }
5615
5633
  var ConnectedNotificationRecipientsSettings = NotificationRecipientsSettings;
5634
+ function recipientCategories(recipient) {
5635
+ return [
5636
+ recipient.statusUpdates ? "Status and payment updates" : "",
5637
+ recipient.agingDays.length ? `${recipient.agingDays.join(" / ")} day reminders` : "",
5638
+ recipient.reportDigest === "daily" ? "Daily activity digest" : recipient.reportDigest === "weekly" ? "Weekly activity digest" : ""
5639
+ ].filter(Boolean).join(" \xB7 ") || "No email categories";
5640
+ }
5616
5641
  function RecipientSettingsSession({ adapter, appearance, className, style }) {
5617
5642
  const titleId = useId4();
5618
5643
  const [snapshot, setSnapshot] = useState13(null);
@@ -5664,7 +5689,7 @@ function RecipientSettingsSession({ adapter, appearance, className, style }) {
5664
5689
  setNotice("We couldn't confirm the request. Retry unchanged to check the same invitation, or reload recipients. Do not assume an email was sent.");
5665
5690
  }
5666
5691
  }
5667
- const canInvite = !busy && !!snapshot?.available && !!email.trim() && (preferences.statusUpdates || preferences.agingDays.length > 0);
5692
+ const canInvite = !busy && !!snapshot?.available && !!email.trim() && (preferences.statusUpdates || preferences.agingDays.length > 0 || (preferences.reportDigest ?? "off") !== "off");
5668
5693
  return /* @__PURE__ */ jsxs17("section", { className: `mbnr ${className ?? ""}`, style: { ...mindBillAppearanceStyle(appearance), ...style }, "aria-labelledby": titleId, "aria-busy": busy, children: [
5669
5694
  /* @__PURE__ */ jsx17("style", { children: css12 }),
5670
5695
  /* @__PURE__ */ jsxs17("div", { className: "mbnr-card", children: [
@@ -5721,9 +5746,18 @@ function RecipientSettingsSession({ adapter, appearance, className, style }) {
5721
5746
  /* @__PURE__ */ jsxs17("label", { className: "mbnr-check", children: [
5722
5747
  /* @__PURE__ */ jsx17("input", { type: "checkbox", checked: preferences.quietHours, onChange: (event) => setPreferences((value) => ({ ...value, quietHours: event.target.checked })) }),
5723
5748
  "Quiet hours \xB7 7 pm\u20137 am Pacific"
5749
+ ] }),
5750
+ /* @__PURE__ */ jsxs17("label", { className: "mbnr-digest", children: [
5751
+ /* @__PURE__ */ jsx17("span", { children: "Scheduled activity digest" }),
5752
+ /* @__PURE__ */ jsxs17("select", { value: preferences.reportDigest ?? "off", onChange: (event) => setPreferences((value) => ({ ...value, reportDigest: event.target.value })), children: [
5753
+ /* @__PURE__ */ jsx17("option", { value: "off", children: "Off" }),
5754
+ /* @__PURE__ */ jsx17("option", { value: "daily", children: "Daily" }),
5755
+ /* @__PURE__ */ jsx17("option", { value: "weekly", children: "Weekly" })
5756
+ ] }),
5757
+ /* @__PURE__ */ jsx17("small", { className: "mbnr-muted", children: "Activity counts at 9 am Pacific, every day or every Monday. No financial reports or attachments." })
5724
5758
  ] })
5725
5759
  ] }),
5726
- /* @__PURE__ */ jsx17("p", { className: "mbnr-muted", children: "Emails contain general alerts, not patient details, reports or attachments. The recipient reviews these choices and can unsubscribe at any time." }),
5760
+ /* @__PURE__ */ jsx17("p", { className: "mbnr-muted", children: "Emails contain general alerts and activity counts, not patient details, reports or attachments. The recipient reviews these choices and can unsubscribe at any time." }),
5727
5761
  /* @__PURE__ */ jsxs17("div", { className: "mbnr-actions", children: [
5728
5762
  /* @__PURE__ */ jsx17("button", { type: "submit", className: "mbnr-primary", disabled: !canInvite, children: busy ? "Please wait\u2026" : "Send confirmation invitation" }),
5729
5763
  hasReceipt && /* @__PURE__ */ jsx17("button", { type: "button", disabled: busy, onClick: () => {
@@ -5744,8 +5778,7 @@ function RecipientSettingsSession({ adapter, appearance, className, style }) {
5744
5778
  /* @__PURE__ */ jsxs17("p", { className: "mbnr-muted", children: [
5745
5779
  recipient.audience === "practice" ? "Practice-wide" : `${recipient.assignedBillCount} assigned bills`,
5746
5780
  " \xB7 ",
5747
- recipient.statusUpdates ? "Status and payment updates" : "Reminders only",
5748
- recipient.agingDays.length ? ` \xB7 ${recipient.agingDays.join(" / ")} day reminders` : ""
5781
+ recipientCategories(recipient)
5749
5782
  ] }),
5750
5783
  recipient.deliveryStatus === "unknown" && /* @__PURE__ */ jsx17("p", { className: "mbnr-muted", children: "Invitation delivery unconfirmed. No automatic resend." })
5751
5784
  ] }),