Inspiration
Clinicians receive dozens of EHR inbox messages and abnormal lab results every day. The hard part is not simply reading a lab value. It is quickly combining that value with the patient's medications, active conditions, and prior lab trend to decide how urgent follow-up should be.
A potassium of 6.1 mmol/L is concerning in any patient, but it is even more concerning in a patient taking lisinopril, spironolactone, and ibuprofen: three independent potassium-raising medications. LabLens was built around that idea: abnormal labs should be triaged in context.
What it does
LabLens is a clinician-facing lab triage agent built inside Prompt Opinion. It turns an incoming abnormal lab result into a medication-aware action packet for clinician review.
The agent calls four MCP tools:
get_patient_contextpulls active conditions, medications, allergies, and encounters from FHIR.get_lab_trendretrieves prior lab values and computes whether the trend is rising, falling, stable, or insufficient.analyze_medication_lab_interactionsidentifies relevant medication-lab interactions and explains pharmacology mechanisms.classify_lab_followup_urgencydeterministically classifies the result as URGENT, SOON, ROUTINE, or INSUFFICIENT_DATA.
The final output includes urgency, a recommended review path, medication mechanisms, risk factors, a transparent rule trace, and a clinician-review-only safety disclaimer.
How we built it
LabLens uses a Python FastMCP server with FastAPI, Pydantic validation, and FHIR R4 queries. The server implements SHARP-style FHIR context headers so Prompt Opinion can pass the patient context into each tool call.
We used deterministic logic for clinical urgency classification so the same inputs always produce the same output. The LLM is used only for plain-language medication mechanism narration. It cannot add medications, invent drug classes, or decide urgency.
The demo uses hand-authored synthetic FHIR patient bundles only. No real PHI is used.
Challenges we ran into
The biggest challenge was making the system clinically useful while keeping it auditable. We did not want a black-box chatbot making medical claims. So we separated the system into deterministic tools, strict schemas, and a single constrained LLM call.
Another challenge was integrating FHIR context through Prompt Opinion and MCP. The agent needs to receive the selected patient context, call our MCP server, query FHIR resources, and return a clinician-facing answer with visible tool calls.
Accomplishments we're proud of
We built a working Prompt Opinion MCP toolchain that demonstrates medication-aware lab triage end to end.
The strongest demo case shows a synthetic patient with potassium 6.1 mmol/L and three potassium-raising medications: lisinopril, spironolactone, and ibuprofen. LabLens identifies the medication stack, recognizes the rising lab trend, and returns an URGENT classification with a transparent rule trace.
We also included cases that show trend-aware creatinine triage, chronic HbA1c follow-up without over-alerting, and fail-safe INSUFFICIENT_DATA behavior when context is missing.
What we learned
We learned how to structure healthcare AI so that the LLM adds useful explanation without controlling safety-critical decisions. We also learned how MCP tools, FHIR data, and Prompt Opinion's agent platform can work together to make clinical workflows more transparent.
What's next
Future work would expand the validated lab and medication coverage, improve deployment stability, and test the workflow with clinician feedback. LabLens is currently a synthetic demo for clinician review only, not autonomous medical advice.
Log in or sign up for Devpost to join the conversation.