Inspiration

Prior authorization is one of the most destructive administrative failures in American healthcare. Physicians spend 13 hours per week on PA paperwork — time stolen directly from patient care. The American Medical Association found that 94% of physicians report PA delays cause serious harm to patients.

In oncology, a delayed authorization for a chemotherapy cycle can mean a missed treatment window and disease progression. In the ICU, a delayed authorization for a critical antibiotic can mean a 7% increase in mortality per hour.

The math is brutal: $35 billion per year in administrative costs. 1 in 4 Americans affected by PA delays. 1 in 3 PA denials eventually overturned on appeal — meaning the system itself is wrong one-third of the time. And yet, when denials happen, physicians are expected to manually write appeals from scratch while trying to care for patients.

We built PA Authorization Agent because this is not a documentation problem — it is a reasoning problem. The authorization packet that determines whether a patient gets treatment requires reading labs, understanding protocol context, aligning to payer rules, citing relevant evidence, and anticipating denial logic. That is exactly where a well-grounded AI system can help.

Prior authorization is the "last mile" problem of healthcare AI — the point where intelligence must become action. This is the endgame we chose to solve.


What It Does

The PA Authorization Agent is a complete prior authorization lifecycle system built on the Prompt Opinion platform using MCP (Model Context Protocol) and FHIR standards.

A clinician selects a patient, types one sentence, and receives a complete PA packet in under 60 seconds.

Full workflow — automatically, in sequence:

1. Patient Data Retrieval
Reads patient context from FHIR plus uploaded clinical documentation (DocumentReference) with no manual copy-paste.

2. Documentation Completeness Check
Checks procedure-specific required evidence (e.g., pathology, recent labs, physician attestation, protocol citation, prior treatment history, medical necessity statement). Returns completeness score and missing items before submission so denials can be prevented proactively.

3. Payer-Specific Coverage Analysis
Supports major payer profiles (Aetna, Blue Cross Blue Shield, UnitedHealthcare, Cigna, Medicare Advantage), including timelines, step therapy logic, denial patterns, and portal guidance. Returns approval likelihood and payer-specific success factors.

4. Clinical Justification Letter Generation
Groq llama-3.3-70b generates a formal letter grounded in chart-verified facts. No static templates; patient-specific clinical reasoning is applied to diagnosis, treatment history, contraindications, and urgency.

5. Letter Safety Verification
Every claim in the letter is checked against source patient data. Returns safety score, verdict, and flagged statements requiring physician verification before signing.

6. Clinical Trial Matching
Queries ClinicalTrials.gov v2 in real time for recruiting studies matching diagnosis/age/context, with relevance filtering.

7. Appeal Letter Generation
When denial reason is present, generates targeted appeal arguments specific to that denial, using clinical counter-evidence.

8. Peer-to-Peer Review Preparation
Generates physician-ready talking points, likely payer objections, rebuttals, and call strategy for time-sensitive peer-to-peer reviews.

9. Da Vinci PAS FHIR Submission
Constructs standards-compliant FHIR Claim bundle per Da Vinci PAS and posts to reference $submit endpoint, positioning for live payer API integrations.

10. FHIR Audit Record
Creates a FHIR R4 AuditEvent on physician approval for traceable PA decision records.

Clinical scenarios demonstrated:

  • Jennifer Mitchell, 43F — High-Risk B-cell ALL, HD-MTX, Aetna
  • Robert Chen, 57M — Rheumatoid Arthritis, Adalimumab, BCBS
  • Marcus Williams, 58M — Septic Shock, Meropenem, UHC (life-threatening allergy contraindication context)

How We Built It

Stack:

  • Platform: Prompt Opinion (BYO Agent + MCP Server)
  • MCP Server: Python FastMCP, deployed on Railway
  • LLM: Google Gemini (agent reasoning) + Groq llama-3.3-70b (letter generation/verification)
  • FHIR: SHARP context extension, FHIR R4
  • Clinical Trials: ClinicalTrials.gov API v2
  • Standards: MCP, A2A, FHIR R4, CMS-0057-F, Da Vinci PAS IG

Architecture layers:

  1. BYO Agent receives user request with FHIR patient context injected
  2. Agent executes MCP tools in deterministic sequence
  3. Tools fetch and structure patient facts directly from source context
  4. LLM generates clinician-readable prose from verified fact anchors
  5. Independent verification pass audits outputs before physician review

Key technical decision:
We moved to deterministic tool-level extraction with raw JSON pass-through between steps, rather than relying on LLM-to-LLM data handoffs. This eliminated silent field loss and made outputs auditable.


Challenges We Ran Into

FHIR scope and reliability constraints
Access to structured resource types was inconsistent in some runs. We adopted a DocumentReference-first strategy for reliability and richer clinical context.

Hallucination risk in clinical letters
Early generations occasionally included unsupported clinical details. We addressed this with a deterministic extraction layer and mandatory verification pass (generate -> verify).

Payer-rule heterogeneity
Payer requirements differ materially in step therapy, decision timelines, and denial behavior. We implemented payer-specific profiles instead of generic rules.

Clinical trial retrieval noise
Raw trial API results can be noisy. We added relevance ranking (condition alignment, age fit, phase preference) for practical utility.


Accomplishments We're Proud Of

  • Complete PA packet generated in under 60 seconds from one prompt
  • Safety verification layer with physician-facing accountability before sign-off
  • Peer-to-peer prep tool for one of the most operationally painful steps in PA
  • Real-time ClinicalTrials.gov integration inside PA workflow
  • Standards-forward architecture aligned with CMS-0057-F and Da Vinci PAS
  • High documentation completeness and stronger first-pass packet quality in demo scenarios
  • Clinically meaningful contraindication handling (e.g., severe beta-lactam allergy exception logic)

What We Learned

The difference between "AI writing text" and "AI supporting clinical decisions" is grounding plus accountability.

The most important lesson: the hardest part is not generating a polished letter — it is proving which claims are chart-verifiable before a physician signs.

We also learned the last mile of healthcare AI is physician workflow fit: outputs must be fast, auditable, and structured for action under time pressure.


What's Next

  • Live payer FHIR API integration as CMS-0057-F payer endpoints mature
  • Denial prediction before submission using payer patterns + completeness signals
  • Expanded payer coverage beyond top national plans
  • SMART on FHIR EHR integration for Epic/Cerner launch workflows
  • Sepsis-to-PA fast-track orchestration for urgent antibiotic authorization scenarios

Built With

  • a2a-protocol
  • clinicaltrials-gov-api
  • cms-0057-f
  • fastmcp
  • fhir-r4
  • gemini
  • groq
  • mcp-protocol
  • prompt-opinion
  • python
  • railway
  • sharp-extension
Share this project:

Updates