-
-
Dashboard Ward Scan Open: full screen showing all 4 patients ranked with risk badges
-
Critical Patient Detail James Harrington (CRITICAL), the Cross-Parameter AI Patterns panel with the 3 sepsis/cardiorenal/respiratory alerts.
-
Prompt Opinion Platform: BYO agent page showing the 4 MCP tools connected and listed.
-
Clinical Signals
-
Recommended Actions AI-GENERATED & SHARP Context Envelope A2A READY
-
Low Patient Details
Inspiration
Every ICU nurse knows the feeling: a patient looks "stable on paper" right up until they aren't. Traditional Early Warning Systems fire alerts when a single parameter crosses a threshold — heart rate over 100, BP under 90. But the most dangerous deterioration is silent. It happens when heart rate is 108, respiratory rate is 22, WBC is 14, and CRP is 87 — each value individually "borderline," collectively screaming sepsis. No rule-based system catches that. We built one that does.
Sepsis kills 270,000 Americans annually. 80% of those deaths are potentially preventable with earlier detection. That statistic is what drove us to build Silent Deterioration Monitor.
What It Does
Silent Deterioration Monitor is a healthcare AI MCP Superpower deployed on the Prompt Opinion platform that detects multi-parameter deterioration patterns in real time using FHIR R4 patient data.
5 MCP Tools:
| Tool | Function |
|---|---|
get_patient_vitals |
Fetches HR, BP, SpO2, RR, Temperature from FHIR R4 Observations |
get_lab_results |
Fetches creatinine, potassium, WBC, CRP, hemoglobin from FHIR Labs |
assess_deterioration_risk |
Full AI assessment — NEWS2 + cross-pattern detection + Groq LLM + SHARP envelope |
scan_ward_for_deterioration |
Scans up to 10 patients simultaneously, ranked by risk score |
build_sharp_context |
Builds A2A-ready SHARP context envelope for downstream agent chains |
The AI detects 3 critical cross-parameter patterns rule-based systems cannot:
- Sepsis Triad — tachycardia + tachypnea + leukocytosis + elevated CRP together meet SIRS criteria. Each value alone passes threshold checks. Combined, they signal septic shock.
- Cardiorenal Syndrome — hypotension + rising creatinine = organ coupling. Neither parameter alone triggers standard alerts. Together they indicate cardiorenal failure.
- Respiratory-Hemodynamic Coupling — low SpO2 + compensatory tachypnea + tachycardia = active physiological compensation. The patient is one step from decompensation.
Every assessment produces a SHARP context envelope — a structured A2A-ready payload that propagates patient identity, FHIR tokens, risk scores, and clinical findings through any downstream agent chain on the Prompt Opinion platform without re-authentication or data re-fetching.
How I Built It
Stack:
- MCP Server: TypeScript +
@modelcontextprotocol/sdkwith SSE transport - FHIR: HAPI FHIR R4 public sandbox — real FHIR R4 Observation resources with LOINC codes (8867-4 heart rate, 9279-1 respiratory rate, 2160-0 creatinine, etc.)
- Clinical Scoring: Custom NEWS2 implementation (NHS gold standard) with per-parameter breakdown and aggregate scoring
- LLM Layer: Groq API with
llama-3.3-70b-versatile— generates differential diagnoses, urgency justification, clinical narrative, and next-step recommendations - SHARP Adapter: Custom TypeScript module building spec-compliant SHARP envelopes with agent chain tracking, propagation rules, and TTL management
- Platform: Registered as MCP Superpower + BYO Agent on Prompt Opinion
- Dashboard: Vanilla HTML/CSS/JS clinical monitoring UI with real-time risk visualization
Architecture:
FHIR R4 Server (HAPI sandbox / Epic / Cerner)
↓ FHIR REST API
MCP Server (5 tools)
├── fhirClient.ts — FHIR R4 data fetching
├── riskEngine.ts — NEWS2 + cross-parameter detection
├── llmAnalyzer.ts — Groq LLM clinical enrichment
└── sharpAdapter.ts — SHARP context builder
↓ MCP Protocol (SSE)
Prompt Opinion Platform
└── BYO Agent — Silent Deterioration Monitor
↓ SHARP Context (A2A chain)
Downstream Agents (Medication Safety, Escalation, Documentation)
Challenges I Ran Into
SSE Transport Stability — Free Cloudflare tunnels cancel long-lived SSE connections (stream error code 0). Solved by switching to ngrok which properly supports persistent SSE streams.
FHIR Data Variability — The public HAPI FHIR sandbox returns inconsistent data for different patient IDs. Built a synthetic fallback layer that always produces clinically meaningful deterioration patterns for demos while the real FHIR calls run in parallel.
Multi-Parameter Scoring — Designing a scoring system that weighs cross-parameter interactions rather than just individual values required careful clinical research. NEWS2 handles the vital sign aggregate; we built a separate lab risk engine and a pattern detection layer on top, then combined all three into a single composite score.
LLM Clinical Consistency — Getting the Groq LLM to return consistent, structured JSON with genuine clinical reasoning (not hallucinated values) required careful prompt engineering: low temperature (0.2), strict JSON-only output, explicit field schemas, and graceful fallback when the API is unavailable.
Accomplishments That I'm Proud Of
- Real FHIR data flowing end-to-end — actual LOINC-coded Observation resources from a FHIR R4 server, not mocked JSON
- NEWS2 fully implemented — NHS-validated scoring with per-parameter breakdown, not just a number
- 3 cross-parameter clinical patterns detected by AI that no threshold-based system can catch
- Groq LLM generating real differential diagnoses — sepsis vs cardiorenal vs ARDS, not generic text
- SHARP envelopes that actually propagate through the Prompt Opinion A2A chain
- Ward scan scanning 10 patients in parallel — priority-ranked in under 3 seconds
- Production-grade architecture — graceful degradation, error handling, synthetic fallback, audit logging built in
What I Learned
- MCP is genuinely powerful for healthcare — the tool abstraction maps perfectly to clinical workflows where each specialist (labs, vitals, risk scoring) is a separate capability
- SHARP context is the key to A2A healthcare agents — without it, every agent re-fetches and re-authenticates. With it, patient context flows like water through a pipeline
- NEWS2 is underused in digital health — it's NHS-validated, publicly documented, and maps cleanly to FHIR Observation resources. More AI tools should use it as a foundation
- The "AI Factor" in healthcare is cross-signal reasoning — not summarization, not Q&A. The genuine clinical value is detecting what combinations of signals mean, not what each signal means individually
- LLM + rules = better than either alone — NEWS2 catches the aggregate vital sign picture; the LLM catches the clinical narrative and differential. Neither is sufficient without the other
What's Next for Silent Deterioration Monitor
- Temporal trend analysis — deterioration is about trajectory, not just current values. Next version tracks vitals over 6/12/24 hours and detects worsening trends even when current values are still "normal"
- SMART-on-FHIR OAuth2 — production EHR integration with proper token handling via the SHARP extension spec
- Medication interaction layer — cross-reference deteriorating renal function with nephrotoxic medications currently prescribed (a separate MCP tool)
- Notification agent — A2A integration with a downstream alert agent that pages the responsible clinician when risk crosses CRITICAL threshold
- Validation study — retrospective analysis against real de-identified ICU data to measure how many hours earlier the system would have triggered vs standard NEWS2 thresholds
- Pediatric adaptation — PEWS (Pediatric Early Warning Score) implementation for the children's hospital use case (directly relevant to judge Stephon Proctor at CHOP)
Built With
- a2a
- api
- fhirr4
- groq
- hapi
- llama3.370b
- mcp
- news2
- ngrok
- node.js
- sharp
- typescript
Log in or sign up for Devpost to join the conversation.