How heuscartist/uraanai-medical-platform works
Project type and purpose
• This is a full-stack, Python-based web application built on Streamlit.
• Purpose: Assist doctors with patient management and AI-driven medical tools (X-ray disease detection, chatbot, OCR prescription parsing, heart risk prediction).
File structure
Top-level files
• app.py / run.py – Streamlit entrypoints
• healthcare.db – SQLite patient database
• requirements.txt – Python dependencies
Directories
• models/ – serialized ML artifacts (Keras models, pickled scalers, logistic-regression model)
• pages/ – Streamlit “multi-page” modules (auth, dashboard, disease_detection, chatbot, heart_risk, prescription_ocr)
• rag/ – static PDF resources used for Retrieval-Augmented Generation or explainability
Pull additional insights from README
• Frontend & App: Streamlit multi-page interface
• Database: SQLite3 for secure patient data
• ML: Keras (TensorFlow) for image models, scikit-learn for tabular models
• NLP/chatbot: Calls Gemini API for explanations
• OCR: Tesseract/EasyOCR for prescription parsing
a. Main components
1. Streamlit Application
– Pages Router (auth.py → dashboard.py → feature pages)
2. Data Storage
– SQLite database (healthcare.db)
3. ML Inference Layer
– Disease Detection Service
• Loads Keras models (pneumonia.h5, pneumonia.keras, etc.) and scaler.pkl
– Heart Risk Service
• Loads log_reg_model.pkl
4. NLP Chatbot Service
– Gemini API (external)
– RAG storage (PDFs in rag/)
5. OCR Service
– Tesseract/EasyOCR library
6. Static Assets & Reporting
– Heatmaps, Grad-CAM visualizations, Plotly charts
b. Relationships and data flows
• User → Streamlit Frontend
• Frontend → Auth module → SQLite
• Dashboard & Feature Pages → Database (CRUD)
• Disease Detection Page → ML Inference → returns prediction + explainability → Frontend
• Chatbot Page → pulls context from DB or free text → calls Gemini API → renders answer
• Prescription OCR Page → sends image to OCR Service → returns structured text → optional DB write
• Heart Risk Page → sends vitals data to Heart Risk Service → returns risk score & insights
c. Architectural patterns and principles
• Single-code-base, multi-page architecture (Streamlit’s page router)
• Separation of concerns: pages (UI) vs. models (inference) vs. data (SQLite) vs. external APIs
• Modular ML services: each feature page loads only its required model
• Externalization of heavy compute: calls out to Gemini, OCR libraries
d. Key technologies and frameworks
• Streamlit (UI & routing)
• SQLite3 (persistent storage)
• TensorFlow/Keras (image classification)
• scikit-learn (heart risk model)
• Gemini API (NLP & explainability)
• Tesseract/EasyOCR (OCR)
• Python libraries: NumPy, Pandas, OpenCV, Plotly