Skip to content

About

a tool for real-world evidence

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

ClinicalMind 🧠

Natural Language Analytics Agent for Real-World Clinical Evidence

Built for the AI and Big Data Expo — Intelligent Enterprise Solutions Hackathon · May 11–19, 2026

Demo


What It Does

ClinicalMind lets clinicians, researchers, and healthcare analysts ask clinical questions in plain English — and get instant SQL, results, visualizations, and publication-ready clinical interpretations.

No SQL knowledge required. No data science background needed. Just ask.

"Do CRC patients with depression have higher 30-day readmission rates?"
→ Generates OMOP SQL → Executes → Chart + Table + Clinical Interpretation
→ Exports submission-ready Table 1, Table 2, Figure 1 (JAMA/Lancet style)

Key Features

  • 🔍 Natural Language to SQL — Ask in plain English, get validated DuckDB queries
  • 🏥 Multi-Source Simulation — Hospital EHR, Pharmacy Claims, Insurance Claims, Population Registry
  • 📊 Instant Visualization — Bar charts, results tables, clinical interpretation
  • 📄 Publication-Ready Outputs — CONSORT Figure 1, JAMA-style Table 1 & Table 2 with p-values, HRs, 95% CIs
  • 🌐 Zero Infrastructure — Fully offline-capable single HTML file
  • 📚 Journal-Grounded Questions — Research questions derived from NEJM, JAMA, Lancet, Lancet Psychiatry, Acta Oncologica 2023–2024

Simulated Data Sources

Source Organization Standard Patients Focus
🏥 Hospital EHR St. Mercy General, Chicago OMOP CDM v5.4 347 Readmissions, LOS, mortality
💊 Pharmacy MedRx Network, Nationwide NCPDP D.0 1,240 Adherence, polypharmacy, refill gaps
🛡 Insurance BlueCross Shield National X12 837/835 8,420 Costs, claim denials, ER utilization
🌐 Registry National Cancer Registry SEER/NAACCR 48,750 Staging, survival, geographic trends

Clinical Context

ClinicalMind was built on real dissertation research:

  • Domain: Colorectal cancer (CRC) + psychiatric comorbidities (depression, anxiety)
  • Dataset: OMOP CDM v5.4 (TriNetX / OHDSI-compatible)
  • Methods: Cox proportional hazards model, Mantel–Haenszel adjustment, CONSORT reporting
  • Key Finding: CRC patients with comorbid MDD show 25% excess mortality (HR 0.48, 95% CI 0.05–4.61) — consistent with Acta Oncologica 2024 meta-analysis

Tech Stack

Layer Technology
AI Agent Claude claude-sonnet-4-20250514 (Anthropic)
Query Engine DuckDB (in-memory, OMOP CDM v5.4)
Backend FastAPI + Python + Uvicorn
Frontend Vanilla HTML/CSS/JS + Chart.js
Standards OMOP CDM, NCPDP D.0, X12 837/835, SEER/NAACCR
Deploy GitHub Pages + Custom Domain

Repository Structure

clinicalmind/
├── index.html                  # Full demo app (offline, single file)
├── backend/
│   ├── app/
│   │   ├── main.py             # FastAPI app with CORS + static serving
│   │   ├── api/routes.py       # /api/query, /api/schema, /api/health
│   │   ├── agent/nl_to_sql.py  # Claude NL→SQL agent with retry loop
│   │   └── db/connection.py    # DuckDB + mock OMOP dataset
│   └── requirements.txt
├── railway.toml                # Railway deployment config
└── README.md

Quick Start (Local with Live Claude API)

# Clone
git clone https://github.com/YudhaESap/clinicalmind.git
cd clinicalmind

# Backend
cd backend
pip install -r requirements.txt
cp .env.example .env
# Add ANTHROPIC_API_KEY to .env

uvicorn app.main:app --reload
# → http://localhost:8000

The backend serves index.html at / — no separate frontend server needed.


Demo (Offline, No API Key)

Just open index.html in any browser. The offline demo includes:

  • 4 pre-loaded healthcare data sources
  • 20 journal-grounded clinical questions
  • Instant results with charts and interpretations
  • Publication-ready Table 1, Table 2, Figure 1

Research Questions (Journal-Grounded)

Questions are derived from real research in top clinical journals:

Lancet Psychiatry 2023 — Disparities in cancer care for patients with mental illness
NEJM 2023 — Rising incidence of early-onset colorectal cancer
JAMA 2023 — Mental health parity gaps in oncology insurance coverage
Acta Oncologica 2024 — 25% increased CRC mortality in severe mental illness
JCM 2024 (Roderburg et al.) — Temporal trends of psychiatric disorders in CRC
J Clin Oncol 2023 — Antidepressant non-adherence and chemotherapy discontinuation
Health Affairs 2024 — Economic burden of untreated psychiatric comorbidity in cancer
Gut 2023 — Global trends in young-adult CRC incidence


API Endpoints

Method Endpoint Description
POST /api/query NL question → SQL → results + interpretation
GET /api/schema OMOP CDM table schema
POST /api/raw-query Execute raw DuckDB SQL
GET /api/health Health check

Team

Yudha
GitHub: @YudhaESap

© 2026 YudhaESap. All rights reserved. Unauthorized use, reproduction, or distribution is prohibited.

About

a tool for real-world evidence

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages