Inspiration

ClearDose was inspired by a real experience in my family. My sister-in-law, who has lupus and kidney disease, was prescribed Bactrim and ended up dealing with severe complications afterward. That experience stuck with me because the risk was not caused by a rare disease or some impossible edge case. It came from medications, renal function, and incomplete clinical context colliding during care transitions.

I started thinking about how difficult it must be for clinicians to quickly piece together medication safety risks while handling discharge decisions under time pressure. Medication lists, labs, allergies, diagnoses, and notes often live in different parts of the chart, and important renal context can easily be missed.

The goal of ClearDose was to build something practical and explainable instead of another generic AI health assistant. I wanted the system to reason over real patient context using deterministic clinical safety logic, while still using AI where it actually helps: organizing findings, generating readable reviews, and communicating uncertainty clearly.

What it does

ClearDose performs discharge medication safety reviews using live FHIR patient data. The system evaluates:

  • renal impairment and renal dosing risk
  • nephrotoxic drug interactions
  • polypharmacy
  • allergy-related risks
  • data completeness and confidence

The current focus is renal safety because that was the original motivating problem, but the architecture was designed so additional safety domains like hepatic safety, pregnancy safety, or pediatric dosing could be added later.

How it was built

The project uses two main components:

  • an MCP server that retrieves FHIR data, normalizes patient context, and runs deterministic clinical safety rules
  • an A2A medication safety agent that orchestrates retrieval and composes the final clinician-facing review

The MCP layer handles the actual clinical reasoning. It pulls Conditions, MedicationRequests, Allergies, Labs, and Clinical Notes from FHIR records and converts them into a normalized patient risk context. Rule modules then evaluate renal impairment, drug interactions, polypharmacy, and allergy risks before mapping findings into a stable response schema.

The A2A layer focuses on orchestration and presentation. It gathers structured findings from the MCP server and generates a readable discharge safety review with supporting evidence, recommendations, confidence scoring, and data completeness assessment.

One design decision I cared about was avoiding hallucinated certainty. If data is missing, the system explicitly reports incomplete context instead of pretending the patient is low risk.

Challenges

The hardest part was not the rule logic. It was the clinical data flow itself.

Early in development, many patient reviews returned empty findings because the FHIR context, tokens, or live retrieval path were incomplete. A large part of the work became debugging how Prompt Opinion passed FHIR context into the A2A agent and then into the MCP server.

Another challenge was balancing explainability with flexibility. I did not want the system behaving like a black-box LLM making clinical claims without traceable evidence. At the same time, I still wanted natural clinician-facing summaries. That led to the final hybrid design where deterministic rules generate the findings and the AI layer focuses on orchestration and review composition.

What I learned

This project gave me a much deeper understanding of:

  • FHIR data structures and healthcare interoperability
  • MCP and A2A agent architecture
  • clinical safety workflows
  • explainable AI system design
  • how difficult incomplete healthcare data can be in real-world systems

It also reinforced how important conservative system behavior is in healthcare. Sometimes the safest output is not a diagnosis or recommendation. It is clearly communicating that the available data is incomplete.

Built With

Share this project:

Updates

Submission history