← All projects

02 / HEALTHCARE / APPLIED AI

Medication Safety Agent

Analyze medication and lab data, manage medication changes, and keep every safety explanation traceable to evidence.

DatabricksUnity CatalogFastAPIRxNorm / RxTermsDailyMed / openFDADrug-drug + drug-lab rulesGrounded AI

Working prototype · safety analysis + medication management

View public GitHub repository →

Overview

Two connected workflows, one patient context.

The application combines Medication Safety Analysis with Medication Management. The first evaluates deterministic drug-drug and drug-lab rules with evidence-linked findings and AI explanation. The second supports medication search, review, safety-check, add, and discontinue without losing the patient context.

The problem

A useful medication-safety tool needs more than a risk score. It needs medication lookup, clear evidence, pre-add review, explicit handling of proposed versus current medications, and controls that prevent stale or incomplete checks from being treated as current.

My contribution

Defined and built the safety and medication-management workflows, organized rules and evidence in Databricks, integrated RxNorm/RxTerms lookup and live FDA-label fallback, and kept AI constrained to explaining findings rather than creating them.

Architecture

Clinical logic stays centralized; workflow stays responsive.

Medication CRUD/lookup is deterministic and uses Unity Catalog plus RxNorm/RxTerms. The clinical pre-add safety check reuses the same central safety endpoint as the main analysis.

Application walkthrough

Search → review → safety check → add.

The application makes the medication-management flow explicit and keeps the safety-analysis tab available against the same patient/lab context.

Medication Safety Agent medication lookup

1. Medication lookup

Debounced RxNorm/RxTerms search lets the user select the intended medication while the active list remains visible.

Medication Safety Agent pre-add safety review

2. Pre-add safety review

A proposed medication is screened before persistence. High, Moderate, or Unreviewed findings require an explicit acknowledgement before saving.

Medication Safety Agent drug drug and drug lab findings

3. Drug-drug + drug-lab findings

The analysis separates interaction findings from laboratory-context findings, shows severity/evidence, and follows them with a grounded explanation.

Workflow capabilities

  • Drug-drug and drug-lab findings: separate cards, severity, expandable evidence, and RxNorm-normalized medications.
  • 4-step add wizard: Search → Review → Safety Check → Add.
  • Current / Proposed medications: safety findings do not erase what a patient is actually taking; a contemplated medication can remain Proposed.
  • Discontinue with history: soft-discontinue removes a medication from the active list while preserving history.
  • Safety guardrails: stale-result invalidation, duplicate handling, dependency health gating, and acknowledgement before saving elevated-risk findings.
  • Unreviewed fallback: live openFDA labeling can surface a trusted excerpt when the curated rule table has no pair; AI paraphrases the evidence but does not promote it into a reviewed rule.

Representative safety-analysis scenario

For the synthetic P001 scenario shown in the application, the result is HIGH with 3 drug-drug findings and 3 drug-lab findings. This demonstrates both rule dimensions in one view while keeping the evidence and explanation traceable.

3 + 3Drug-drug + drug-lab findings in the representative high-risk scenario
4-step addSearch → Review → Safety Check → Add
Demo modePublic repository can demonstrate the UI without a Databricks account

Engineering test coverage remains supporting evidence, not the product headline. Synthetic demonstration only; not intended for patient care.

Back to all projects