Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sputhenofficial/claimjumper/llms.txt

Use this file to discover all available pages before exploring further.

After triage, every service line is assigned an appeal deadline, an urgency score, and a priority score — all deterministically, with no model calls. These three values drive the order of the denial work queue: the billing team sees the lines that need attention soonest, weighted by their financial recovery potential, at the top of the list. The algorithm is implemented in lib/pipeline/prioritize.ts and is fully covered by regression tests.

Appeal deadline calculation

The deadline is calculated from the remittance’s notice_date using two constants that model the Medicare Part A/B redetermination window:
ConstantValuePurpose
RECEIPT_PRESUMPTION_DAYS5Assumed days from notice date to provider receipt
REDETERMINATION_DAYS120Standard redetermination filing window
The formula in plain terms:
deadline = notice_date + 5 days (receipt presumption) + 120 days (redetermination)
         = notice_date + 125 days total
The function signature:
export function calculateAppealDeadline(noticeDate: string): string
noticeDate is an ISO calendar date string (e.g. "2025-03-01"). The function returns the deadline as an ISO calendar date string. All arithmetic is performed in UTC to avoid daylight-saving edge cases.
The deadline is a conservative approximation for triage and queue-ordering purposes. Actual payer-specific deadlines — including Medicare Advantage, Medicaid, and commercial payer rules — vary significantly and must be verified by the billing team before acting on any line.

Urgency score

Urgency is a 0–1 value that increases as the deadline approaches. It is calculated using the URGENCY_SCALE_DAYS constant (125), which equals the total presumed window from notice date to deadline. Formula:
urgency = clamp((125 - daysRemaining) / 125, 0, 1)
where daysRemaining is the number of calendar days from today to the deadline.
  • A line with 125 or more days remaining → urgency 0.0 (no time pressure)
  • A line with 0 days remaining → urgency 1.0 (at the deadline)
  • A line past the deadline → urgency clamped to 1.0
  • A line with 62 days remaining → urgency ≈ 0.50
The function signature:
export function calculateUrgency(deadline: string, today: string): number
Both arguments are ISO calendar date strings.

Priority score

The priority score combines three signals: how much money is at stake, how likely recovery is, and how urgently the deadline is approaching. Formula:
priority_score = billed_amount × recovery_probability × urgency
FactorSourceNotes
billed_amountAdjustmentLine.billed_amountThe provider’s charged amount for the line
recovery_probabilityDenialTriage.recovery_probabilityModel-estimated 0–1 probability of successful recovery
urgencyCalculated above0–1 time-pressure score
A high-value line with a strong recovery probability and an approaching deadline rises to the top of the queue. A low-value line that is unlikely to recover, even with an urgent deadline, scores lower.

Sort order

prioritize() returns lines in the following order:
1

Sort by deadline ascending

Lines with the soonest deadline appear first. A line due in 10 days always precedes a line due in 60 days, regardless of dollar value.
2

Sort by priority score descending within the same deadline date

Among lines sharing the same deadline date, higher priority_score wins. This surfaces the most financially valuable, highest-probability-of-recovery lines within each deadline bucket.

prioritize() function

The full function signature and sort logic from lib/pipeline/prioritize.ts:
export function prioritize(inputs: readonly PrioritizeInput[], today: string): PrioritizedLine[] {
  return inputs
    .map(({ line, triage }) => {
      const deadline = calculateAppealDeadline(line.notice_date);
      const urgency = calculateUrgency(deadline, today);

      return {
        line,
        triage,
        deadline,
        urgency,
        priority_score: line.billed_amount * triage.recovery_probability * urgency,
      };
    })
    .sort((left, right) =>
      left.deadline.localeCompare(right.deadline) || right.priority_score - left.priority_score,
    );
}
PrioritizeInput is { line: AdjustmentLine; triage: DenialTriage }. The output is an array of PrioritizedLine objects, each carrying the original line and triage data alongside the three computed values (deadline, urgency, priority_score).
The deadline calculation is a conservative approximation for triage purposes. Actual payer-specific deadlines must be verified by the billing team before acting on any denial.

Build docs developers (and LLMs) love