How samer-4/priorauth-rag works
This repository is an active-development prior-authorization appeal builder. Its principal workflow takes a denial letter and clinical notes, extracts structured denial details, selects payer policy criteria, finds and evaluates supporting evidence, generates a structured appeal draft, and checks the draft for grounding and consistency. The graph focuses on the implemented pipeline; the README’s planned RAG, agent orchestration, and deployment capabilities are not shown as current components. Connections are based on the README and sampled source, including the case runner; other runtime details were not inspected.
Main entry points: baseline_eval.py Case Workflow · stage5_generation.py Appeal Generation · stage1_extraction.py Denial Extraction · stage2_lookup.py Criteria Lookup
Components 13
Case and Policy Inputs
- Denial Letters
data/cases/cases_v1/denial_letters - Clinical Notes
data/cases/cases_v1/notes - Payer Policies
data/policies/policies_txt
Criteria and Evidence
- Denial Extraction
src/stage1_extraction.py - Criteria Lookup
src/stage2_lookup.py - Evidence Extraction
src/stage3_evidence_extraction.py - Sufficiency Judgment
src/stage4_sufficiency_judgement.py
Appeal Workflow
- Case Workflow
src/baseline_eval.py - Appeal Generation
src/stage5_generation.py - Letter Rendering
src/stage5_generation.py - Draft Verification
src/stage6_verification.py
Model Service
- Anthropic API
Other components
- Case Submitter
Connections 17
- Case Submitter → Case Workflow: submits case
src/baseline_eval.py - Case Workflow → Denial Letters: reads letter
src/baseline_eval.py - Case Workflow → Clinical Notes: reads notes
src/baseline_eval.py - Case Workflow → Denial Extraction: extracts details
src/baseline_eval.py - Case Workflow → Payer Policies: reads policy
src/baseline_eval.py - Case Workflow → Criteria Lookup: extracts criteria
src/baseline_eval.py - Case Workflow → Evidence Extraction: extracts evidence
src/baseline_eval.py - Case Workflow → Sufficiency Judgment: judges sufficiency
src/baseline_eval.py - Case Workflow → Appeal Generation: generates draft
src/baseline_eval.py - Appeal Generation → Letter Rendering: formats letter
src/stage5_generation.py - Case Workflow → Draft Verification: checks draft
src/baseline_eval.py - Denial Extraction → Anthropic API: requests extraction
src/stage1_extraction.py - Criteria Lookup → Anthropic API: requests criteria
src/stage2_lookup.py - Evidence Extraction → Anthropic API: requests evidence
src/stage3_evidence_extraction.py - Sufficiency Judgment → Anthropic API: requests judgment
src/stage4_sufficiency_judgement.py - Appeal Generation → Anthropic API: requests draft
src/stage5_generation.py - Draft Verification → Anthropic API: checks claims
src/stage6_verification.py