An intelligent medical platform designed to optimize cardiology consultations through AI-driven patient pre-evaluation, automated medical reporting, and post-consultation follow-up.
The cardiology field faces critical challenges:
- Shortage of cardiologists with uneven geographical distribution
- Inefficient patient triage without prior medical assessment
- Time-consuming consultations spent gathering basic information
- Limited post-consultation follow-up and patient monitoring
Care Pulse addresses these challenges by providing:
- Pre-consultation assessment - AI-powered questionnaire to gather patient symptoms and medical history
- Intelligent patient triage - Automatic risk assessment using the Kansas City Cardiomyopathy Questionnaire (KCCQ)
- Structured medical reports - Automated generation of comprehensive patient summaries
- Doctor dashboard - Prioritized patient view with detailed diagnostic information
The application uses a microservices architecture orchestrated with Docker Compose:
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend β β PostgreSQL β
β (Streamlit) βββββββΊβ (FastAPI) βββββββΊβ Database β
β Port 8501 β β Port 8000 β β Port 5432 β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β Scaleway AI β
β (Mistral LLM) β
βββββββββββββββββββ
Frontend (Streamlit)
- Patient interface for questionnaire completion
- Doctor dashboard for viewing and managing patient diagnostics
- PDF report generation and download
Backend (FastAPI + Tortoise ORM)
- RESTful API for patient and diagnostic management
- Integration with Scaleway AI for medical text generation
- KCCQ score calculation and risk assessment
- PostgreSQL database interaction via Tortoise ORM
Database (PostgreSQL)
- Patient records
- Diagnostic data with questionnaire responses
- Doctor information
- Docker (version 20+)
- Docker Compose (version 3.8+)
- Scaleway AI API key (or OpenAI-compatible API)
- Clone the repository
git clone https://github.com/EpsilonFO/Care_Pulse.git
cd Care_Pulse- Configure environment variables
Create a .env file in the root directory:
cp .envexemple .envEdit .env with your credentials:
DATABASE_URL=postgres://user:password@db:5432/mydatabase
OPENAI_BASE_URL=https://api.scaleway.ai/YOUR-PROJECT-ID/v1
OPENAI_API_KEY=your_api_key_here- Launch the application
docker-compose up --buildThis will start:
- Backend API: http://localhost:8000
- Frontend UI: http://localhost:8501
- PostgreSQL: localhost:5432
- Create a patient
curl -X POST http://localhost:8000/create/patient/ \
-H "Content-Type: application/json" \
-d '{"nom":"John Doe"}'-
Access the patient interface
- Navigate to http://localhost:8501
- Click "Chatbot patient" in the sidebar
- Enter patient name and complete the questionnaire
-
View results in doctor dashboard
- Click "Docteur" in the sidebar
- Select a patient to view their assessment and KCCQ score
docker-compose downTo remove all data including the database:
docker-compose down -v- 12-question KCCQ assessment covering:
- Physical limitations
- Symptom frequency and burden
- Quality of life impact
- Social limitations
- AI-powered question translation and adaptation
- Automatic score calculation (0-100 scale)
The system calculates a comprehensive KCCQ score:
- 0-25: Severe limitations (High Risk)
- 26-50: Moderate limitations (Medium Risk)
- 51-75: Mild limitations (Low-Medium Risk)
- 76-100: Minimal limitations (Low Risk)
- Patient list with complete diagnostic information
- Detailed questionnaire responses
- AI-generated medical summary in French
- Risk level assessment based on KCCQ score
- Automated summary using Mistral NeMo LLM
- References to scientific literature (KCCQ validation studies)
- PDF export capability
Once running, access the interactive API documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
| Method | Endpoint | Description |
|---|---|---|
| POST | /create/patient/ |
Create a new patient |
| POST | /create/docteur/ |
Create a new doctor |
| GET | /diagnostic |
Retrieve questionnaire questions |
| POST | /recup-diagnostic/ |
Submit patient responses |
| GET | /get_diagnostique/ |
Get all diagnostic records |
Care_Pulse/
βββ docker-compose.yaml # Docker orchestration
βββ .env # Environment variables (create this)
βββ .envexemple # Example environment file
β
βββ backend/
β βββ Dockerfile
β βββ requirements.txt
β βββ BACKEND.md # Backend documentation
β βββ app/
β βββ main.py # FastAPI application entry
β βββ routes.py # API endpoints
β βββ db_models.py # Database models
β βββ enter_model.py # Pydantic schemas
β βββ ds.py # AI question adaptation
β βββ diago.py # Diagnostic summary generation
β βββ score.py # KCCQ score calculation
β
βββ frontend/
βββ Dockerfile
βββ requirements.txt
βββ FRONTEND.md # Frontend documentation
βββ pages/
βββ patient.py # Patient interface
βββ doctor.py # Doctor dashboard
Backend
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
export DATABASE_URL="postgres://user:password@localhost:5432/mydatabase"
uvicorn app.main:app --reloadFrontend
cd frontend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
streamlit run pages/patient.pyUsing Aerich for database schema management:
cd backend
aerich init -t app.db_models
aerich migrate
aerich upgradeContributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source. Please specify your preferred license (MIT, Apache 2.0, etc.).
- Kansas City Cardiomyopathy Questionnaire (KCCQ) by John A. Spertus et al.
- Scaleway AI for LLM infrastructure
- Mistral AI for the Mistral NeMo model
For questions or issues:
- Open an issue on GitHub
- Refer to component-specific documentation:
backend/BACKEND.mdfrontend/FRONTEND.md
Note: This project was developed as part of the DoctoGreed Hackathon to demonstrate AI applications in healthcare optimization.