Inspiration

Medical errors are the third leading cause of death in Canada, with over 60% tied to preventable issues like drug interactions, lab-based contraindications, and unsafe patient discharges. These aren’t caused by incompetence; they’re the result of overwhelmed, short-staffed hospital teams struggling to keep up with complex patient data.

BayMax is designed to act as a second brain for healthcare workers. It doesn’t replace clinical judgment, but it supports it by reading patient records in real time, understanding the context, and flagging potential risks that could otherwise be missed.

Whether it’s a dangerous drug interaction, a contraindication based on labs like creatinine or hemoglobin, or signs a patient shouldn’t yet be discharged, BayMax translates those complexities into clear, actionable alerts.

BayMax won’t make decisions but it will inform them, ensuring hospital staff never miss a critical warning buried in the data. In high-pressure environments where seconds matter and patient safety is on the line, BayMax offers the clarity clinicians need to protect lives.


What it does

BayMax helps nurses, residents, and pharmacists prevent three high-risk clinical errors:

  • Drug-drug interactions flagged using DDInter and SciBERT semantic matching
  • Lab-based contraindications detected by comparing patient-specific labs (e.g., creatinine, hemoglobin) to drug safety data
  • Unsafe discharges identified through LLM-based clinical reasoning that evaluates vitals, labs, and unresolved conditions

It summarizes risks, explains the context, and surfaces only the most critical alerts to support fast, safe decisions without disrupting workflows.


How we built it

  • Data Parsing: Extracts from FHIR-style patient records in JSON format, including medications, labs, vitals, and conditions.
  • Drug Safety Engine: Integrated DDInter and FDA label data; used SciBERT to detect semantic drug-drug risks.
  • Lab Reasoning: Translated lab values into text-like features and used sentence similarity to detect contraindications.
  • Discharge Safety: Encoded the patient’s overall clinical status and applied LLM-based logic to detect discharge readiness.
  • Implemented OAuth authentication to enable secure access and simulate future integration with EHR systems
  • Tech Stack: React, Firebase, OAuth, Tailwind CSS, SciBERT, DDInter, Gemini API, HuggingFace, Framer Motion, and FHIR patient datasets from Synthea.

Challenges we ran into

  • Fine-tuning SciBERT vector embeddings to reflect accurate semantic similarity between drugs, conditions, and lab-based risks
  • Calibrating similarity thresholds to avoid false positives/negatives in drug contraindication detection
  • Normalizing medical phrases like "renal failure" or "eGFR < 30" for meaningful comparisons in vector space
  • Extracting useful sentence-level warnings from unstructured FDA label text using embeddings
  • Ensuring DDI and DrugLab modules work simultaneously without blocking or duplication
  • Handling Gemini API rate limits while maintaining low-latency response for discharge reasoning
  • Integrating backend logic with the frontend UI while managing async API calls and state updates
  • Coordinating JSON parsing, drug checks, and LLM-based discharge reasoning into a seamless pipeline

Accomplishments that we're proud of

  • Leveraged SciBERT with Hugging Face for semantic drug and condition matching using custom vector embeddings
  • Successfully parsed large, poorly formatted FHIR files, extracting medications, labs, vitals, and conditions
  • Designed and animated a BayMax-inspired AI assistant to make the interface more engaging and intuitive
  • Built a complete end-to-end system: from FHIR parsing → semantic analysis → AI assessments → real-time frontend alerts
  • Integrated Gemini AI to generate discharge explanations and contextual reasoning for clinical risk

What we learned

  • How to correctly parse and navigate complex, nested FHIR files, even when the structure is inconsistent or incomplete
  • Gained hands-on experience using SciBERT for biomedical text embedding and Hugging Face for fine-tuning and vector comparisons
  • Learned to build a full-stack AI workflow that connects clinical data parsing, semantic modeling, and frontend integration
  • Explored how semantic similarity can enhance safety in clinical settings by surfacing non-obvious risks from unstructured text
  • Improved frontend UX by incorporating interactive design elements that make AI feedback more approachable and user-friendly

What's next for BayMax

  • Integration into real EHR systems using FHIR APIs.
  • Voice command support for hands-free clinical use.
  • Fine-tuning on real discharge summaries and case reports.
  • Deploying pilot studies in teaching hospitals to test accuracy, relevance, and speed.
  • Expanding to cover pediatrics, oncology, and chronic disease management.

BayMax is just the beginning of smarter, AI-assisted clinical safety tools and we’re excited to keep building even after this hackathon.

Built With

Share this project:

Updates