MediCore AI is a next-generation, AI-native Hospital Management System (HMS) designed to streamline clinical, administrative, and supply chain operations. Unlike traditional EHR or ERP systems, MediCore leverages pure machine learning and deep learning algorithms to predict patient inflow, optimize supply chains, and detect financial anomalies in real-time.
- Key Features
- AI Architecture
- Tech Stack
- Installation
- Configuration
- Usage
- System Architecture
- Roadmap
- Contributing
- License
- Predictive Admissions: ML models (LSTM/XGBoost) forecast daily ER and ward admissions based on historical data, weather, and local epidemiology.
- Risk Stratification: Real-time triage scoring using anomaly detection to identify high-risk patients before they deteriorate.
- Smart Scheduling: Automated appointment booking that minimizes wait times and maximizes physician availability.
- Anomaly Detection: Isolated Forest algorithms flag unusual billing codes, insurance mismatches, or duplicate invoices to prevent revenue leakage.
- Dynamic Pricing: Adjusts service costs based on insurance provider contracts and real-time operational costs.
- Demand Forecasting: Predicts which medical services (e.g., surgeries, scans) will see high demand in the upcoming quarter.
- Replenishment Prediction: ARIMA and Prophet models forecast usage of consumables (gloves, syringes, PPE) to automate purchase orders.
- Supplier Scoring: NLP analyzes supplier contracts and historical delivery times to recommend the best vendor.
- Waste Reduction: Identifies expiring medicines and suggests prioritized usage pathways to reduce waste.
This platform is built on a Pure-AI Kernel—every feature relies on data-driven decisions rather than static rules.
| Module | Algorithm | Purpose |
|---|---|---|
| Patient Flow | XGBoost + LSTM | Time-series forecasting of bed occupancy. |
| Clinical Risk | Isolation Forest | Detects outliers in vital signs/lab results. |
| Billing Fraud | Autoencoders (Neural Nets) | Reconstructs billing data; high reconstruction error = fraud. |
| Inventory | Prophet (Meta) | Seasonal decomposition for supply demand. |
| NLP Extractor | BERT (Fine-tuned) | Extracts structured data from physician notes. |
- Backend: Python 3.11 (FastAPI)
- AI/ML: PyTorch, Scikit-learn, XGBoost, Prophet, HuggingFace Transformers
- Database: PostgreSQL (Structured) + MongoDB (Unstructured notes)
- Vector DB: Pinecone (for semantic search in medical history)
- Orchestration: Apache Airflow (for retraining pipelines)
- Frontend: React (TypeScript) + TailwindCSS
- Infra: Docker + Kubernetes (Azure/AWS)
- Python 3.11+
- Docker & Docker Compose
- Node.js 20+
- PostgreSQL 15
git clone https://github.com/yourorg/medicore-ai.git
cd medicore-ai# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
cp .env.example .env
# Edit .env with your database credentials and API keyscd frontend
npm installdocker-compose up --buildThis spins up the API, Postgres, Redis, and the AI model serving layer.
Critical Environment Variables:
DATABASE_URL=postgresql://user:pass@localhost:5432/medicore
MODEL_REGISTRY_PATH=/models/registry
REDIS_URL=redis://localhost:6379
SECRET_KEY=your_jwt_secret
MLFLOW_TRACKING_URI=http://localhost:5000Model Retraining Schedule: The models automatically retrain daily at 02:00 AM via Airflow DAGs. To manually trigger:
airflow dags trigger retrain_patient_flowOnce running, navigate to:
- User Interface:
http://localhost:3000 - API Docs:
http://localhost:8000/docs - ML Monitoring (MLflow):
http://localhost:5000
# Predict bed occupancy for next 7 days
POST /api/v1/predict/beds
{
"hospital_id": "H001"
}
# Detect fraudulent claims in billing
POST /api/v1/fraud/detect
{
"invoice_id": "INV-90210"
}
# Restock recommendation
GET /api/v1/supplies/restock?ward_id=3graph TD
UI[React Frontend] --> API[FastAPI Gateway]
API --> Auth[JWT Auth]
API --> Cache[Redis Cache]
API --> DB[(PostgreSQL)]
API --> ML[Model Serving Layer]
ML --> LSTM[Patient Flow LSTM]
ML --> FB[Prophet Inventory]
ML --> AE[Autoencoder Fraud]
DB --> ETL[ETL Pipelines]
ETL --> Raw[Raw Data Lake]
Raw --> Train[Retraining Triggers]
Train --> Registry[MLflow Registry]
Registry --> ML
- MVP with Patient Flow and Inventory (Q1)
- Billing Fraud Detection Module (Q2)
- GPT-based Clinical Assistant: Summarizing patient history for doctors (Q3)
- Federated Learning: Enabling hospitals to train models without sharing sensitive data (Q4)
We welcome contributions! Please read our Contributing Guidelines.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
AI Engineering Lead: john.doe@medicore.com
Project Repository: [github.com/theinnsidecoder]