Inspiration
I work as a Statistician at a University Teaching Hospital in Calabar, Nigeria. Every day I watch doctors face the same invisible problem.
The hospital has a Hospital Management Information System. Patient lab results, vital signs, visit history, and medication records are all stored in it. The data exists — but finding it takes 2 to 4 minutes of navigation per query.
So doctors re-order tests that already exist. They make clinical decisions without prior context. And the HMIS investment goes to waste.
No existing tool solves this for Nigerian teaching hospitals. ChartPilot does.
What it does
ChartPilot is an Autopilot Agent that gives doctors instant, conversational access to patient records during consultations — powered by Qwen-Max on Alibaba Cloud.
A doctor types naturally:
- "Show me Emeka's last two malaria RDT results"
- "What was the BP trend for patient FMC-00451?"
- "Any pending lab results for patients admitted yesterday?"
ChartPilot parses the query with Qwen-Max, executes safe read-only SQL against the HMIS database, scans results for critical clinical values, and returns a Qwen-generated clinical summary — all in under 5 seconds.
How we built it
| Layer | Technology |
|---|---|
| Language Model | Qwen-Max via DashScope International API |
| Backend | FastAPI on Alibaba Cloud ECS |
| Database | SQLite (demo) / ApsaraDB RDS (production) |
| Frontend | React + Vite |
| Compliance | NDPR audit logging |
Five core components:
- Qwen-Max Intent Parser — converts natural language to safe read-only SQL
- HMIS Database Adapter — read-only connector to existing hospital database
- Structured Query Engine — blocks all write operations at database layer
- Critical Value Flag Engine — flags dangerous Hb, BP, Glucose, Malaria RDT
- NDPR Audit Logger — SHA-256 hashed access logging per Nigerian regulation
Challenges we ran into
- Package conflict —
qwen_agent.pyconflicted with theqwen-agentpip package. Resolved by renaming tochartpilot_qwen.py - Nigerian IP block — Standard DashScope endpoint rejected Nigerian connections.
Solution:
dashscope-intl.aliyuncs.com— important finding for African developers - Python 3.13 compatibility — pydantic-core 2.7.1 required Rust compilation. Resolved by upgrading to pydantic >= 2.9.0
Accomplishments
- A doctor can ask in plain English or Nigerian Pidgin and get a real clinical answer from a real hospital database in under 5 seconds
- Patient disambiguation prevents wrong-patient errors — a genuine clinical safety feature
- NDPR-compliant audit logging built from scratch with SHA-256 hashing
- Discovered that
dashscope-intl.aliyuncs.comis the correct endpoint for African developers — benefits every Nigerian builder on Qwen Cloud
What we learned
- Qwen-Max handles Nigerian clinical language better than Western-trained models
- Read-only enforcement must happen at the database layer, not just in prompts
- Nigerian clinical AI must be built by people working in Nigerian clinical settings
What's next
- Voice input for hands-free consultation queries
- Multi-facility deployment across UCTH departments
- Integration with Nigeria's NHIA insurance system
- National rollout to 200+ Nigerian teaching hospitals
Log in or sign up for Devpost to join the conversation.