Health Sage:AI 驱动的健康报告分析平台
Rohitdas07x/health-sage
Health Sage 是一个全栈 AI 医疗平台,支持上传 PDF 医疗与化验报告,自动提取健康指标、检测异常值并生成患者友好版和临床风格两种 AI 摘要。平台还提供历史趋势追踪、报告对比、基于报告的 AI 聊天机器人、专科医生推荐和附近医疗机构建议,后端采用 JWT 认证与密码哈希等安全机制。
AI-Powered Health Report Analysis Platform
Health Sage is a full-stack AI-powered healthcare platform that helps users understand medical and laboratory reports through intelligent metric extraction, AI-generated summaries, abnormal value detection, historical trend analysis, report comparison, specialist recommendations, nearby healthcare suggestions, and a report-based AI chatbot.
📌 About Health Sage
Health Sage is designed to make complex medical and laboratory reports easier to understand.
Users can upload PDF-based health reports, extract important medical metrics, identify abnormal values, receive AI-powered patient-friendly and clinical summaries, track health metrics over time, compare reports, interact with an AI chatbot, receive specialist recommendations, and discover nearby healthcare facilities.
The platform combines modern full-stack development with AI-powered analysis to provide a simple and organized health-report understanding experience.
✨ Key Features
📄 AI-Powered Medical Report Analysis
Health Sage allows users to upload and analyze PDF-based medical and laboratory reports.
The system can:
- Upload PDF medical and laboratory reports
- Extract text from uploaded reports
- Identify important health metrics
- Detect abnormal or out-of-range values
- Organize extracted information into structured data
- Generate AI-powered insights from report information
🤖 AI-Powered Health Summaries
Health Sage generates multiple types of summaries to make medical information easier to understand.
👤 Patient-Friendly Summary
Provides a simple explanation for everyday users.
It helps users understand:
- What their report contains
- Which values may require attention
- What important health metrics mean
- Important observations from the report
👨⚕️ Clinical-Style Summary
Provides a more structured interpretation containing:
- Important medical metrics
- Abnormal findings
- Relevant observations
- Report-based clinical context
💬 Report-Based AI Chatbot
Users can ask questions directly about their uploaded medical report.
Example questions include:
What is my problem?
Which values are abnormal?
Explain my TSH level.
What does my platelet count mean?
Which specialist should I consult?
What should I ask my doctor about this report?
The chatbot is designed to provide report-grounded responses based on information extracted from the uploaded medical report.
📈 Historical Health Trends
Health Sage allows users to track important health metrics across multiple reports.
Users can:
- View historical health values
- Compare previous and current measurements
- Visualize changes over time
- Monitor important laboratory metrics
- Identify long-term health trends
Examples of trackable metrics include:
- TSH
- Free T4
- Hemoglobin
- WBC Count
- RBC Count
- Platelet Count
- Blood Sugar
- LDL Cholesterol
- HDL Cholesterol
- Triglycerides
- Total Cholesterol
🔄 Report Comparison
Health Sage can help users compare health information between multiple uploaded reports.
This makes it easier to understand how important health metrics have changed over time.
The comparison feature can help users:
- Compare previous and current report values
- Identify increased or decreased metric values
- Observe changes in abnormal metrics
- Understand health progress over time
- Review historical report information in one place
🚨 Abnormal Metric Detection
The system identifies potentially abnormal or out-of-range health values from uploaded reports.
Detected abnormal metrics can be used for:
- AI-generated explanations
- Health report summaries
- Historical trend analysis
- Report comparison
- Specialist recommendations
- Report-based chatbot conversations
👨⚕️ Specialist Recommendations
Health Sage maps detected abnormal health metrics to relevant healthcare specialists.
| Health Metric | Suggested Specialist |
|---|---|
| TSH / Thyroid-related values | Endocrinologist |
| Cholesterol | Cardiologist |
| Blood Sugar | Diabetologist / Endocrinologist |
| Abnormal Blood Count | General Physician |
| Liver-related Metrics | Gastroenterologist |
These recommendations are intended to help users understand which type of healthcare professional may be relevant for discussing their report results.
🏥 Nearby Healthcare Suggestions
Health Sage can provide nearby healthcare facility suggestions based on relevant location services.
The platform can help users discover:
- Nearby hospitals
- Clinics
- Healthcare facilities
- Relevant medical locations
The project integrates location and knowledge services to improve healthcare discovery.
🌙 Dark Mode Support
Health Sage includes a dark-mode-friendly user experience to provide a comfortable interface in different viewing environments.
Dark mode helps provide:
- A more comfortable viewing experience
- Reduced brightness in low-light environments
- A modern application interface
- Better visual flexibility for users
🔐 Authentication & Security
Health Sage includes security-focused backend functionality such as:
- User registration
- User login
- JWT-based authentication
- Protected API routes
- Password hashing
- Request and input validation
- Environment variable protection
- API key protection through
.env
🛠️ Tech Stack
Frontend
Backend
Backend Services
AI Infrastructure
APIs & Healthcare Services
🏗️ Project Architecture
health-sage/
│
├── backend/
│ │
│ ├── config/
│ │ └── db.js
│ │
│ ├── controllers/
│ │ ├── authController.js
│ │ ├── chatController.js
│ │ └── reportController.js
│ │
│ ├── middleware/
│ │ ├── auth.middleware.js
│ │ ├── upload.middleware.js
│ │ └── validate.middleware.js
│ │
│ ├── models/
│ │ ├── Metric.js
│ │ ├── Report.js
│ │ └── user.js
│ │
│ ├── routes/
│ │ ├── authRoutes.js
│ │ ├── chatRoutes.js
│ │ └── reportRoutes.js
│ │
│ ├── services/
│ │ ├── emailService.js
│ │ ├── geoapifyService.js
│ │ ├── groqService.js
│ │ ├── hospitalService.js
│ │ ├── placesService.js
│ │ └── wikidataService.js
│ │
│ ├── utils/
│ │ ├── hash.js
│ │ └── specialistMap.js
│ │
│ ├── .env
│ ├── package.json
│ ├── package-lock.json
│ └── server.js
│
├── frontend/
│ │
│ ├── public/
│ │
│ ├── src/
│ │ ├── assets/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── App.jsx
│ │ └── main.jsx
│ │
│ ├── .env
│ ├── index.html
│ ├── package.json
│ ├── package-lock.json
│ └── vite.config.js
│
├── .gitignore
├── README.md
├── sample.pdf
└── test.http
🔄 Application Workflow
┌─────────────────┐
│ USER │
└────────┬────────┘
│
▼
┌─────────────────────────┐
│ Upload Medical Report │
│ PDF File │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ PDF Text Extraction │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ AI Metric Extraction │
│ Groq + Llama 3.3 │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Abnormal Value Detection│
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ MongoDB Storage │
│ Reports + Metrics + User│
└────────────┬────────────┘
│
▼
┌──────────────────┼───────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌──────────────┐
│ AI Summary │ │ Report │ │ Historical │
│ Patient + │ │ Comparison │ │ Health Trends│
│ Clinical │ │ │ │ │
└──────┬──────┘ └──────┬──────┘ └──────┬───────┘
│ │ │
└──────────────────┼───────────────────┘
│
▼
┌─────────────────────────┐
│ Specialist Recommendation│
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Nearby Hospitals / │
│ Clinics & Healthcare │
│ Facilities │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Report-Based AI Chat │
│ Ask Questions About Your│
│ Medical Report │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Health Sage Dashboard │
│ + Dark Mode │
└─────────────────────────┘
⚙️ Installation
1. Clone the Repository
git clone https://github.com/Rohitdas07x/health-sage.git
cd health-sage2. Setup Backend
cd backendInstall dependencies:
npm install
Create a .env file:
PORT=5000 MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret GROQ_API_KEY=your_groq_api_key
Run the backend:
npm run dev
Backend:
http://localhost:5000
3. Setup Frontend
Open another terminal and run:
cd frontendInstall dependencies:
npm install
Run the frontend:
npm run dev
Frontend:
http://localhost:5173
📡 API Overview
Authentication
POST /api/auth/register
POST /api/auth/login
Reports
POST /api/reports/upload
GET /api/reports
GET /api/reports/:id
GET /api/reports/metrics/trends
AI Chat
POST /api/chat
🧠 AI Capabilities
Health Sage uses AI to transform extracted medical report information into structured and understandable insights.
Current capabilities include:
- Structured health metric extraction
- Abnormal value identification
- Patient-friendly explanations
- Clinical-style summaries
- Report-grounded conversations
- Context-aware health report assistance
- Specialist recommendations
- Health metric interpretation
- Historical health trend analysis
- Report comparison support
The AI system is designed to work with information extracted from uploaded reports and provide report-relevant assistance.
📊 Supported Health Insights
Examples of health metrics that can be tracked include:
- WBC Count
- RBC Count
- Platelet Count
- Hemoglobin
- TSH
- Free T4
- LDL Cholesterol
- HDL Cholesterol
- Triglycerides
- Total Cholesterol
- Blood Sugar
- Liver-related Metrics
Additional health metrics can be supported as the application evolves.
🔮 Future Roadmap
Health Sage is designed to expand beyond traditional PDF laboratory reports.
Future versions may support additional medical reports and AI-assisted medical image understanding.
🩻 Medical Image & Report Support
Future versions may include:
- X-Ray image analysis
- X-Ray report explanation
- CT Scan image analysis
- CT Scan report explanation
- MRI image analysis
- MRI report explanation
- Ultrasound image analysis
- Ultrasound report explanation
- Medical image-based AI insights
- Combined image and report analysis
📷 Scan & Image Upload
Future versions may allow users to upload supported medical images and reports for AI-assisted analysis.
🧠 Enhanced AI Assistant
Future AI improvements may include:
- More context-aware medical conversations
- Better explanations for complex reports
- Advanced multi-report comparison
- Personalized health trend analysis
- Image and report-based conversations
- Advanced report interpretation
📊 Advanced Health Dashboard
Planned improvements include:
- More detailed visualizations
- Health history timeline
- Advanced metric comparison
- Long-term health monitoring
- Advanced health analytics
- Improved health insights
🌟 Additional Future Improvements
- 🎙️ Voice-based health assistant
- 🌐 Multi-language support
- 📈 Advanced health analytics
- 🔔 Personalized health reminders
- 👨⚕️ Doctor appointment integration
- 📱 Improved mobile experience
🔒 Security & Privacy
Health information is sensitive.
Health Sage includes:
- JWT authentication
- Password hashing
- Protected API routes
- Environment variable protection
- API key protection through
.env - Input validation
- Secure authentication flow
🎯 Project Goal
The goal of Health Sage is to make complex medical information easier for everyday users to understand.
The platform focuses on helping users understand:
- What their health values mean
- Which values may be abnormal
- How health metrics change over time
- How different reports compare
- What questions they can ask a healthcare professional
- Which type of specialist may be relevant
- Where nearby healthcare facilities may be available
Health Sage is designed as an AI-assisted health information platform that supports users in better understanding their medical reports.
🙏 Acknowledgments
- Node.js — JavaScript runtime environment
- Express.js — Backend web framework
- MongoDB — NoSQL database
- Mongoose — MongoDB object modeling
- React — Frontend UI library
- Vite — Frontend development tooling
- Tailwind CSS — Utility-first CSS framework
- Chart.js — Data visualization
- Groq — AI inference
- Llama — Large language model
- Geoapify — Location and geospatial services
- OpenStreetMap — Geographic data
- Wikidata — Structured knowledge base
📄 License
This project is licensed under the MIT License.
👨💻 Author
Rohit Das
Full-Stack Developer | AI Enthusiast
Made with ❤️ for better health understanding
⭐ Star this repository if you find it helpful!
来源:GitHub · github.com