All data contracts in ClaimJumper are defined as Zod schemas inDocumentation 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.
lib/schemas.ts. TypeScript types are derived with z.infer<typeof Schema> — there are no hand-written interfaces for domain objects. Every model output is validated against these schemas before it is used anywhere downstream: if an OpenAI response does not satisfy the schema, parsing throws and the error propagates to the pipeline’s error boundary.
Remittance & Claim
These schemas model the structured output of the ingest stage — the parsed representation of a raw EOB remittance screenshot.RemittanceMetaSchema / RemittanceMeta
Payer-level header data present on every remittance document. Extracted once per EOB and shared across all claims on the same remittance.
notice_date and payment_date are validated as ISO date strings by Zod’s .date() refinement. code_legend must contain at least one entry — the pipeline relies on it to resolve CARC and RARC definitions for drafting.
ClaimMetaSchema / ClaimMeta
Claim-level header data identifying the patient and claim.
service_date is the date of service for the claim as a whole; individual service lines carry their own service_date fields via ServiceLineSchema.
ServiceLineSchema / ServiceLine
A single denial line extracted from a claim. Represents one procedure code and its associated adjustment reason codes.
rarc and notes are explicitly nullable() in Zod rather than optional — the model must emit null for absent values rather than omitting the field entirely. This ensures Structured Outputs can enforce strict JSON schema compliance.
ClaimSchema / Claim
A single independently processable claim extracted from a remittance, grouping the shared remittance header, the claim metadata, and all service lines belonging to that claim.
remittance field is repeated on every Claim rather than hoisted — this makes each Claim self-contained and avoids shared-reference bugs when claims from the same EOB are processed in parallel.
IngestOutputSchema / IngestOutput
The direct output of the ingest pipeline stage: an array of at least one Claim.
The Responses API Structured Outputs feature requires a JSON object at the schema root — a bare array is not valid as a top-level schema. The ingest pipeline extracts
IngestResponseSchema wraps IngestOutputSchema in an object envelope for this reason:response.claims after parsing and passes the unwrapped IngestOutput to the rest of the pipeline.Triage
These schemas capture the AI triage model’s classification of a denial line and the invariant-enforcement layer applied on top of it.LaneSchema / Lane
The five possible disposition lanes for a denial line.
AdjustmentLineSchema / AdjustmentLine
A reduced, triage-focused view of a service line, constructed in the route handler by projecting the fields relevant to denial classification. This is what the triage model receives — not the full ServiceLine.
ServiceLineSchema, rarc and notes are optional (not nullable) here — the field is omitted entirely when absent, matching the constructor logic in the route handler.
TriageModelOutputSchema / TriageModelOutput
The raw structured output from the triage model before invariant enforcement. Contains the lane decision plus supporting reasoning.
confidence represents the model’s certainty in its lane assignment. recovery_probability is the model’s estimate that the denial is recoverable (through appeal or corrected claim). Both are bounded [0, 1] by Zod .min(0).max(1).
DenialTriageSchema / DenialTriage
Extends TriageModelOutputSchema with an overrides array appended by the invariants layer after model inference. Invariants may force a lane change or inject override notes without altering the model’s original reasoning fields.
overrides is an empty array when no invariants fired. Any injected triage function passed via PipelineDependencies must return an already-enforced DenialTriage.
Prioritization
PrioritizedLineSchema / PrioritizedLine
The output of the prioritization stage. Wraps a triage-annotated AdjustmentLine with scheduling information and a composite priority score used to sort the work queue.
priority_score is validated as .finite() — Infinity, -Infinity, and NaN are rejected. The prioritization stage uses today (injected or live UTC) to compute deadline and urgency relative to the notice_date on the denial line.
Draft
DraftInputSchema / DraftInput
The explicit, validated input to the draft pipeline stage. Keeps the full parsed Claim and ServiceLine available to the model rather than the lossy AdjustmentLine projection, ensuring citations can be verified against actual parsed field values.
adaptForDrafting() in lib/pipeline/draft.ts constructs and validates a DraftInput via DraftInputSchema.parse() before passing it to the model.
DraftCitationSchema / DraftCitation
A single verifiable citation in a generated draft artifact. Every claim made in the draft body must be grounded in a citation that the server can resolve and verify against the parsed input.
DraftArtifactSchema / DraftArtifact
The final, validated draft artifact stored on a QueueItem. Produced by the draft pipeline stage and returned as part of the TriageResponse.
lane is one of "appeal", "corrected_claim", or "human_review" — the draft pipeline is not invoked for "patient_bill" or "write_off" lanes. For "human_review", the content is a structured review brief generated without a model call; citations will be an empty array.
Schema validation pattern
ClaimJumper uses the OpenAI Responses API’s Structured Outputs feature to constrain model output to a known JSON shape, then validates the parsed response with Zod before it enters the pipeline. The two OpenAI client helpers inlib/openai.ts implement this pattern:
z.toJSONSchema(schema) converts the Zod schema to a JSON Schema object that OpenAI uses to constrain generation. After the API responds, schema.parse(JSON.parse(response.output_text)) re-validates the output with full Zod semantics — including refinements like .min(), .date(), and .finite() that JSON Schema cannot always enforce at the API level.