DischargeIQ: Bridging the Gap Between Data and Care 🏥
Inspiration
Hospital readmissions are one of the most significant challenges in modern healthcare. In the US alone, they cost the system $26 billion annually and contribute to 125,000 preventable deaths.
Our inspiration for DischargeIQ came from a simple observation: clinicians are drowning in data but starving for insights. When a patient is discharged, critical details — like a missing follow-up appointment, a high-risk medication interaction, or a social determinant like living in a food desert — often fall through the cracks. While Generative AI offers incredible potential for clinical reasoning, the "black box" nature and hallucination risks of LLMs make them dangerous for pure arithmetic. We set out to build a "Trust-First" architecture that uses deterministic logic for safety and AI for empathy.
What it does
DischargeIQ is a Prompt Opinion (PO) Community MCP Server that optimizes the hospital discharge workflow. It provides 7 specialized tools that transform raw FHIR (Fast Healthcare Interoperability Resources) data into a "Discharge Readiness Dashboard."
The core of DischargeIQ is its Hybrid Architecture:
- Deterministic Engine: Computes clinical scores like the LACE index and Charlson Comorbidity Index (CCI) with 100% mathematical accuracy using Python.
- AI Reasoning: Uses the PO Platform's LLM to interpret those scores, detect nuanced clinical gaps, and generate personalized, multilingual patient education materials.
Key Tools:
- CalculateLACEScore: Computes the 30-day readmission risk using the formula: $$LACE = L + A + C + E$$ (L: Length of Stay, A: Acuity, C: Comorbidities, E: ED visits)
- IdentifyReadmissionRiskGaps: A 6-rule engine that catches high-risk oversights (e.g., Warfarin without INR monitoring).
- GenerateMedicationCard: Creates "fridge-friendly" schedules in the patient's native language.
- SDOH Flagging: Automatically identifies patients discharged to food deserts or high-poverty areas using ZIP code data.
How we built it
We built DischargeIQ using a modern, clinical-grade stack:
- Language: Python 3.11 with FastAPI for the MCP server.
- Standards: Built entirely on the FHIR R4 standard to ensure compatibility with modern EHRs like Epic and Cerner.
- Context: Implemented SHARP header propagation, allowing clinical agents to pass patient context seamlessly between tools without storing PII on the server.
- Clinical Logic: Developed a robust rules engine that maps thousands of ICD-10 codes to comorbidity weights.
- Testing: Built a synthetic cohort of 51 diverse patient bundles to validate the system across scenarios ranging from elective surgery to complex multi-morbidity.
Challenges we ran into
- The "Hallucination" Barrier: Early prototypes showed that LLMs often miscalculated LACE scores (e.g., $7 + 3 = 11$). We solved this by adopting the "Compute what's computable" philosophy — ensuring all math happens in Python before the AI sees it.
- FHIR Complexity: Health data is deeply nested and often messy. We built a suite of 13 "Summarizers" to flatten complex JSON resources into clean, tool-ready context.
- Mapping ICD-10 to CCI: Creating a deterministic map for the Charlson Comorbidity Index required meticulous cross-referencing of medical literature to ensure every condition prefix (like
I50for CHF) was weighted correctly.
Accomplishments that we're proud of
- 23 Passing Tests: Our clinical logic is verified by an extensive integration test suite covering scoring and gap detection.
- Proved Impact at Scale: We ran our rules engine against our 51-patient test cohort and detected 49 critical clinical gaps (like missing renal checks for Metformin) that a human might have missed.
- Zero-Math AI: We successfully demonstrated that an MCP server can provide "Structured Context" that guides an LLM to better reasoning without requiring it to do arithmetic.
- Health Equity: Our ability to generate medication instructions in the patient's native language directly addresses one of the leading causes of readmission: medication confusion.
What we learned
- Trust is Built on Transparency: Doctors trust an AI more when it says "I calculated a LACE score of 7 because of these 4 specific ICD-10 codes" than when it just provides a summary.
- Context is Everything: The SHARP extension is a game-changer for MCP servers. Being able to provide a "System Prompt" alongside tool results ensures the LLM stays in its "clinical lane."
- Hybrid is the Future: Pure AI is too risky for healthcare, and pure code is too rigid. The future is deterministic logic wrapped in a generative shell.
What's next for DischargeIQ
- Marketplace Launch: Deploying the server to Hugging Face Spaces for 24/7 accessibility via the Prompt Opinion platform.
- HEDIS & Quality Measures: Expanding the rules engine to track hospital quality metrics and clinical safety measures in real-time.
- Admission-to-Discharge Tracking: Moving beyond "at the door" analysis to identifying readmission risks the moment a patient is admitted.
Built With
- and-interaction-data)-sharp-extension-spec:-(stateless-fhir-context-propagation)-rxnorm:-(standardized-clinical-drug-normalization)-infrastructure-&-devops:-docker:-(production-hardened
- boxed-warnings
- fastmcp-(model-context-protocol)-ai-platform:-prompt-opinion-(agentic-orchestration-and-sharp-context-management)-healthcare-apis-&-standards:-hl7-fhir-r4:-(electronic-health-record-data-retrieval)-openfda-api:-(real-time-drug-label
- languages:-python-3.11+-(asynchronous-core)-frameworks-&-sdks:-fastapi
Log in or sign up for Devpost to join the conversation.