Inspiration
In Egypt and across the developing world, there is no central system for medical records. Every hospital visit starts from zero. Patients, especially the elderly, carry crumpled prescriptions in bags and struggle to remember what medications they take or what their last lab results showed. When they see a new doctor or visit a different hospital, critical history is lost. Tests get repeated, medication errors happen, and doctors make decisions with incomplete information. We watched our own family members go through this and thought: every person with a smartphone should be able to photograph a prescription, a lab report, or an X-ray and have it stored, organized, and ready to share with any doctor instantly. That's why we built MediTrack.
What it does
MediTrack is a cross-platform medical records platform powered by Gemini AI. Patients photograph any medical document (prescription, lab report, radiology scan) and Gemini's vision API extracts structured data automatically: medication names, dosages, lab values with exact reference ranges, imaging findings with severity, all with confidence scores. No typing or medical knowledge required.
Once records are stored, patients and doctors can ask natural-language questions about the full medical history: "What medications am I on?", "Show my last blood test results", "Any drug allergies documented?" Gemini responds with accurate answers drawn exclusively from documented data, never diagnoses or medical advice.
The platform also includes real-time vitals tracking with AI-powered analysis, family groups so guardians can manage records for elderly parents or children, doctor-patient messaging, a notification system, and full English/Arabic bilingual support. It runs as a web app at meditrack.evolvai.me and as a native mobile app built with React Native.
How we built it
- Backend: FastAPI with SQLAlchemy and SQLite, handling authentication (JWT), role-based access control, and all API logic. A provider-agnostic LLM framework wraps Gemini 2.0 Flash for document extraction and Q&A, with specialized prompt templates for each document type (prescriptions, lab reports, radiology).
- Web Frontend: React with Vite, featuring document upload with processing status, a chat interface with voice input (Web Speech API in English and Arabic), and role-based dashboards for patients, doctors, and admins.
- Mobile App: React Native with Expo, including a camera-based document scanner, real-time vitals entry with AI analysis, daily health tips from Gemini, and an AI chat assistant (MediBot), all with secure local storage via Expo SecureStore.
- AI Safety: Defense-in-depth with input validation against prompt injection, role-based system prompts, output filtering to prevent information leakage, and full audit logging with request correlation IDs. Gemini is constrained to report documented facts only, never generate medical opinions.
- Deployment: Dockerized with Nginx reverse proxy, deployed on DigitalOcean with Caddy for TLS, and GitHub Actions for CI/CD.
Challenges we ran into
Lab report variability was the biggest AI challenge. Lab reports differ wildly across laboratories: different formats, naming conventions (WBC vs. White Blood Cell Count, Hgb vs. Hemoglobin), and reference ranges that vary by lab, instrument, and patient population. We had to engineer prompts that instruct Gemini to extract the exact reference ranges printed on the document rather than substituting standard values, because clinical decisions depend on that precision.
Arabic support required more than translation. Medical terminology in Arabic, right-to-left layout throughout the entire UI, and ensuring Gemini handles bilingual queries all needed careful implementation across both web and mobile.
AI safety in a medical context was a constant balancing act. We needed Gemini to be helpful enough to extract and organize data accurately while being strictly constrained from generating anything that could be mistaken for medical advice. Building the input validation, role-based prompts, and output filtering layers took significant iteration.
Cross-platform consistency between web and mobile with a shared backend required careful API design to ensure the same data flows and access controls worked seamlessly across both platforms.
Accomplishments that we're proud of
- A patient with zero technical knowledge can photograph a prescription and have it fully digitized in seconds, solving a real daily problem for millions of people in Egypt and similar countries.
- Our document extraction pipeline handles prescriptions, lab reports, and radiology scans with confidence scoring, and adding new document types requires only a new prompt template with no code changes.
- The AI safety architecture enforces that Gemini never provides diagnoses or treatment recommendations, only documented facts, making it a system healthcare professionals can actually trust.
- Full English and Arabic bilingual support across web and mobile, including voice input in both languages.
- Family groups with role-based access (admin, guardian, member, dependent) let caregivers manage records for elderly parents or children, which is how healthcare actually works in our communities.
- The entire system is live and functional at meditrack.evolvai.me with a companion mobile app.
What we learned
Building a medical AI application taught us that constraining AI is harder than enabling it. Making Gemini extract data accurately was the straightforward part. Making it reliably refuse to interpret results, suggest diagnoses, or give health advice, even when users explicitly ask, required multiple layers of safety engineering.
We also learned that document understanding is fundamentally different from text understanding. Lab reports are not just text; they are structured layouts where the position of a value relative to its reference range matters. Gemini's vision capabilities made this possible without traditional OCR pipelines.
Working with users in Egypt reinforced that the simplest interaction model wins. Our early designs had multi-step upload flows. What actually works is: point camera, take photo, done. Everything else should be automatic.
What's next for MediTrack
- Shareable medical summaries: Generate a QR code or secure link that patients can show at any hospital to give doctors instant read-only access to their complete history, solving the "starting from zero" problem permanently.
- Offline AI extraction: On-device document processing so patients in areas with poor connectivity can still digitize records.
- More document types: Immunization records, surgical notes, discharge summaries, and insurance documents, each requiring only a new Gemini prompt template.
- Provider network: Connect patients with verified doctors on the platform for remote consultations, particularly valuable for rural areas in Egypt where specialist access is limited.
- Health trend alerts: Use Gemini to analyze longitudinal data and flag concerning trends (e.g., steadily rising blood pressure over months) for proactive care.
- Regional expansion: Localize for additional languages common in the MENA region and Sub-Saharan Africa where the same medical records fragmentation problem exists.
Log in or sign up for Devpost to join the conversation.