Inspiration
700,000 ED visits and 100,000 hospitalizations every year (AHRQ) are caused by post-discharge medication errors. Most of those failures are already visible in the FHIR record at discharge time they just aren't being read in time, by the right person, with the right context.
We didn't want to build another generalist healthcare summarizer. We wanted to build a Specialist Auditor: an MCP server that catches the specific discharge failures nobody flagged, and proves it with FHIR evidence a CIO can attach to a budget request.
What it does
TransitionPilot is an MCP server (Path A Superpower). Given a patient's FHIR R4 bundle, it returns a "Discharge Failure Prevented" memo with:
- Failures prevented high-risk patterns the engine caught (drug-drug interactions, duplicate opioids, insulin without monitoring, heart-failure discharges without 14-day follow-up, allergy/medication conflicts).
- Logic-Link evidence every recommendation cites the specific FHIR resource ID (MedicationRequest, Condition, Observation, AllergyIntolerance, Encounter, Task) that drove it. Click any badge in the demo UI to see the raw FHIR JSON.
- Audit tasks — actionable items mapped to FHIR Task export, with owner (Pharmacist / RN / Hospitalist / Care Coordinator) and SLA.
- Reconciled medication table — continue / held / new / stopped, each row with FHIR provenance.
- Patient-friendly instructions in plain English (~8th grade), with optional Spanish caregiver version.
- Exposure band — coarse low/medium/high financial-impact label per failure (no false precision).
The headline brand promise: "Specialist Auditor, not generalist summarizer."
Try it live
- Live MCP-protocol endpoint (this is what the platform connects to):
https://powell-motel-warning-crown.trycloudflare.com/mcp/ - Health check: https://powell-motel-warning-crown.trycloudflare.com/health
- Interactive demo UI: https://powell-motel-warning-crown.trycloudflare.com/demo/ui/
- GitHub (AGPL-3.0): https://github.com/Masoud-Masoori/transition-pilot
- Demo video files (MP4): https://github.com/Masoud-Masoori/transition-pilot/releases/tag/v0.1.0-demo
How we built it
Stack: Python 3.11 + FastAPI + Pydantic + httpx + Anthropic Claude Haiku 4.5 (with Groq Llama 3.3 70B fallback).
Architecture:
- A deterministic rule engine detects 5 hard-coded high-risk patterns against the FHIR bundle. The LLM never invents these findings.
- An async parallel FHIR client fetches MedicationRequest / Condition / Observation / AllergyIntolerance / Encounter / Task / Appointment in one
asyncio.gather()— well under the platform's 60-second timeout. - A Claude Haiku synthesis layer writes the human-readable memo (clinician summary + patient instructions + Spanish caregiver version) using Anthropic tool-use for guaranteed structured output.
- An Evidence-or-Null safety rule is enforced two ways: in the system prompt (LLM is told it MUST cite FHIR resource IDs from the bundle, or label as "Provider-Directed (No FHIR Link Found)") AND post-hoc validation (every cited ID is checked against the bundle; any rogue ID is stripped and confidence downgraded to
needs_review). - A demo UI renders a split-screen forensic replay: the Day-6 readmission on the left, the Day-0 prevention on the right, with clickable Logic-Link badges that slide out the FHIR evidence.
5 hard-coded high-risk patterns:
- Anticoagulant + interacting antibiotic without INR follow-up
- Duplicate active opioid prescriptions
- Insulin prescribed without glucose monitoring
- Heart failure discharge with no 14-day follow-up appointment
- Allergy conflict (with cross-class table for penicillin → amoxicillin etc.)
Challenges we ran into
- The 60-second platform timeout drove every architecture decision. Solution: parallel FHIR fetch + deterministic-rules-before-LLM + single LLM call with tool-use schema. Demo runs in ~100ms server-side without LLM, ~2.5s with synthesis.
- AI hubris is the #1 reason clinician judges reject healthcare AI demos. Solution: structural Evidence-or-Null enforcement at both the prompt layer and a post-call citation validator. The LLM literally cannot cite a FHIR ID we don't have on file.
- Cross-class allergy detection — penicillin allergy → amoxicillin medication. RxNorm hierarchy queries are heavy; we built a small fixed allergen-class table for the common landmines (penicillin, sulfa, NSAIDs, opioids, aspirin, statins).
Accomplishments we're proud of
- 11/11 unit tests pass on the deterministic engine across all 5 patterns + the no-empty-Logic-Link invariant.
- The demo UI renders a forensic split-screen with clickable FHIR evidence — judges see the AI's reasoning bound to actual chart data.
- Strategy was locked via a 3-way LLM council debate (GPT-5.5 VC partner + contrarian red-teamer + Gemini hospitalist clinician). All three council members independently rejected our original differentiator stack and converged on the "Specialist Auditor with Logic-Link" framing.
What we learned
The most important hackathon lesson: judges remember one image per demo. We built our entire pipeline around the moment the judge clicks a MedicationRequest/... badge and sees the raw FHIR JSON that drove the AI's recommendation. Everything else is in service of that one image.
What's next
- Real EHR integration via SMART-on-FHIR (the architecture is already SMART-launch-ready).
- Two more pattern detectors (steroid-induced hyperglycemia surveillance, anticoagulation bridging plans for pre-procedure cases).
- A "near-miss audit log" so a hospital can run TransitionPilot retrospectively over their last 30 days of discharges and see how many failures it would have caught.
Log in or sign up for Devpost to join the conversation.