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.
triage() in lib/pipeline/triage.ts accepts an AdjustmentLine and returns a DenialTriage. GPT-5.6 Sol reads Group Code, CARC, and RARC together to decide the lane, then produces a rationale, evidence list, confidence score, and recovery probability. After the model responds, enforceInvariants() runs synchronously — its result is the final, trusted triage decision that callers receive. The model’s raw output is never returned directly.
Function signature
AdjustmentLine is a Zod-validated object with the fields that drive the routing decision:
| Field | Type | Description |
|---|---|---|
group_code | string | Claim adjustment group code (e.g. CO, PR, OA) |
carc | string | Claim Adjustment Reason Code |
rarc | string (optional) | Remittance Advice Remark Code, if present |
billed_amount | number | Nonnegative billed amount |
description | string | Human-readable service description |
notice_date | string (ISO 8601) | Remittance notice date, used by prioritization |
notes | string (optional) | Any claim-level remark from the remittance |
DenialTriage is TriageModelOutput extended with overrides:
overrides is populated by enforceInvariants(). It contains the human-readable reason for each safety rule that fired. When overrides is non-empty, lane will always be "human_review".
Model output fields
TriageModelOutputSchema defines the six fields the model must produce:
lane — the resolution lane for this denial. One of:
| Value | Meaning |
|---|---|
appeal | File a formal appeal with the payer |
corrected_claim | Resubmit with corrected information |
patient_bill | Patient cost-share responsibility |
write_off | Provider contractual adjustment |
human_review | Escalate — confidence too low or rule fired |
root_cause — a short description of why the claim was denied. Derived from the adjustment codes; no external knowledge is injected.
rationale — a sentence citing the specific Group Code, CARC, and RARC combination that drove the lane decision. This is what the biller reads when reviewing a queue item.
evidence_needed — an array of strings listing what the billing team must gather for the recommended lane to succeed (e.g. medical records, authorization number, corrected date of birth). Empty array if nothing additional is required.
confidence — a 0–1 float expressing the model’s certainty in the lane assignment. Values below 0.6 are automatically overridden to human_review by enforceInvariants().
recovery_probability — a 0–1 float representing the likelihood that working this denial results in payment. Used by prioritize() to weight the priority score. A write_off will typically carry 0; a clear timely-filing appeal with documentation may carry 0.7 or higher.
Invariant enforcement
enforceInvariants() is exported from lib/pipeline/invariants.ts with the following signature:
responseWithSchema() returns the model output, triage() calls enforceInvariants() and returns its result:
enforceInvariants() checks three rules:
CO→ notpatient_bill— a contractual obligation is the provider’s to absorb; it can never be billed to the patient.CARC 197→ notwrite_off— a payer-responsibility denial cannot be automatically written off; a human must make that decision.confidence < 0.6→human_review— routing below the automation threshold is always escalated.
"human_review" and the reason is appended to overrides. The route handler trusts the returned DenialTriage directly — it never calls enforceInvariants() again on the same result.
Safety invariants are implemented in code, not in the prompt. The prompt instructs the model to avoid certain assignments, but the invariant layer guarantees them regardless of model output. See the Safety Invariants page for the full rule set and rationale.
Prompt design
The triage prompt atprompts/triage.md positions the model as a healthcare reimbursement attorney and certified professional coder with fifteen years of EOB experience. The key constraints it enforces:
lane = human_review and name the missing field rather than guessing.
The model reasoning effort level is
"high", set in the responseWithSchema() call inside triage.ts. This gives the model maximum deliberation time for lane decisions that will directly affect billing team workflows.