Skip to content

chsachin799/MedCognis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

35 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MedCognis Health

MedCognis Health is a high-performance clinical triage and command center platform engineered for modern healthcare environments.

The system addresses a core operational challenge in emergency and inpatient care: accurate, transparent, and real-time patient prioritization.

MedCognis Overview

By combining:

  • Machine Learning (XGBoost)
  • Rule-based clinical safety overrides
  • Explainable AI (SHAP)
  • Local LLM-powered clinical assistance (Llama 3 via Ollama)

MedCognis delivers interpretable, data-driven risk scoring to support faster clinical decisions and optimized patient flow.

๐Ÿš€ Key Features

๐Ÿง  Hybrid Risk Scoring Engine

  • XGBoost-based triage classification
  • Hard-coded safety overrides (critical BP, SpOโ‚‚, HR thresholds)
  • Multi-layer prioritization logic

Features

๐Ÿง  How the AI Engine Works

The core of MedCognis is its dual-layer AI engine that combines the predictive power of XGBoost with the clinical rigor of Safety Overrides.

  1. Structured Data Analysis: The engine processes 10+ clinical parameters (Age, BP, HR, SpOโ‚‚, etc.) to identify complex risk patterns.
  2. Clinical Safety Overrides: Before final scoring, the system checks for critical threshold violations (e.g., Temp > 40ยฐC or SpOโ‚‚ < 90%) to ensure high-risk patients are never underestimated by purely statistical models.
  3. Real-time Explainability: Using SHAP, the engine identifies exactly which features (like high Heart Rate or Age) contributed most to the risk score, providing clinicians with immediate diagnostic context.

AI Engine Input AI Engine Results

๐Ÿ” Explainable AI (XAI)

  • Integrated SHAP (SHapley Additive exPlanations)
  • Feature-level transparency for every prediction
  • Clinician-readable reasoning outputs

Analysis Insights

๐Ÿฉบ Diagnostic Mapping

  • Symptom-vital correlation engine
  • Condition prediction
  • Specialist recommendation routing

Diagnostic Mapping

๐Ÿ“Š Real-Time Command Center

  • Glassmorphism-inspired UI
  • ICU load tracking
  • Department capacity visibility
  • Vital trend radar & bar charts

Dashboard

๐Ÿ“„ Automated EHR Parsing

  • Heuristic PDF/Text ingestion
  • Rapid structured data extraction
  • In-memory preprocessing pipeline

๐Ÿค– Local LLM Integration

Clinical Chat

  • Secure, on-premise clinical assistant
  • Powered by Llama 3 via Ollama
  • No external data transmission

๐Ÿ— System Architecture

MedCognis follows a decoupled, service-oriented architecture optimized for low-latency clinical operations.

Architecture Diagram

1๏ธโƒฃ Frontend Layer โ€“ Next.js 16

  • Framework: Next.js (App Router)
  • UI Styling: Tailwind CSS v4
  • Data Visualization: Recharts
  • Animations: Framer Motion
  • Icons: Lucide React
  • State Management: React hooks integrated with triage utilities

2๏ธโƒฃ Backend Layer โ€“ FastAPI

Orchestration between Frontend, ML models, and Database. Key Endpoints:

  1. Patient registration
  2. Risk prediction
  3. Model retraining
  4. Clinical AI chat

3๏ธโƒฃ Intelligence Layer

  • Predictive Model: XGBoost classifier
  • Data: Trained on structured clinical features
  • Explainability: SHAP-based interpretability module

๐Ÿ’ฌ Clinical AI Assistant

  • Local LLM endpoint
  • Ollama runtime
  • Offline inference capability

4๏ธโƒฃ Persistence Layer โ€“ SQLite

  • Transactional local database
  • Patient records storage
  • Role-Based Access Control (RBAC)
  • Visit history tracking

๐Ÿ›  Technology Stack

Layer Technologies
Frontend Next.js 16, Tailwind CSS v4, Recharts, Framer Motion, Lucide React
Backend Python 3.10+, FastAPI, Uvicorn
AI / ML XGBoost, SHAP, Scikit-Learn, Pandas, NumPy
Local LLM Ollama (Llama 3)
Database SQLite 3
Dev Tools npm, pip

โš™ Installation Guide

๐Ÿ“Œ Prerequisites

  • Node.js โ‰ฅ 18
  • Python โ‰ฅ 3.10
  • Ollama installed and running

๐Ÿ”น Backend Setup

cd Models
python -m venv .venv
source .venv/bin/activate     # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python app.py

Backend Startup

๐Ÿ”น Frontend Setup

# From project root
npm install
npm run dev

Frontend Startup

๐Ÿ”น Ollama Setup

Ensure Ollama daemon is active:

ollama pull llama3

Ollama Setup Default endpoint: http://localhost:11434

๐Ÿงช Usage Guide

1๏ธโƒฃ Access Dashboard Open: http://localhost:3000

2๏ธโƒฃ Patient Triage

  • Navigate to Patient Records
  • Upload CSV / JSON / PDF
  • Trigger AI risk assessment

Patient Records

3๏ธโƒฃ Analytics View

  • Inspect SHAP explanations
  • Review risk breakdown
  • Examine recommended specialists

Analysis Views

4๏ธโƒฃ Clinical Assistant

  • Access Support & Help
  • Interact with local LLM for structured guidance

Chatbot Interface

๐Ÿ“‚ Folder Structure

โ”œโ”€โ”€ app/                 # Next.js App Router
โ”œโ”€โ”€ Models/              # Backend & ML Logic
โ”‚   โ”œโ”€โ”€ app.py
โ”‚   โ”œโ”€โ”€ triage_logic.py
โ”‚   โ””โ”€โ”€ triage_xgboost.pkl
โ”œโ”€โ”€ components/          # Reusable UI Components
โ”œโ”€โ”€ lib/                 # Frontend utilities
โ”œโ”€โ”€ public/              # Static assets
โ”œโ”€โ”€ types/               # TypeScript interfaces
โ””โ”€โ”€ README.md

๐Ÿ”ฎ Future Enhancements

  • DICOM imaging integration (MRI/CT)
  • Predictive bed capacity forecasting
  • Federated learning model updates
  • Multi-branch hospital synchronization
  • Advanced anomaly detection in vitals

๐Ÿ‘ฅ Contributors

Team Name: Phoenixphones Clinical AI Lead: Phoenixphones teams

Members:

  1. Naveen (Leader)
  2. Prashant Gupta (Frontend Developer)
  3. Sachin Chauhan (Synthesis Data Vault Generation and Research Work)
  4. Bibek Kumar Sah (Resources Generator and Idea Creator)

๐Ÿ“œ License

Licensed under the MIT License. See LICENSE file for details.

โš  Disclaimer

MedCognis Health is a clinical decision support system. It is not a substitute for licensed medical judgment and must be used under professional supervision.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors