A Flask-powered medical report analysis API that transforms complex medical documents into patient-friendly explanations.
Doclyst Backend processes medical reports (blood tests, X-rays, ECGs) and returns clear, simple explanations that anyone can understand—without providing medical advice or diagnoses.
| Input | Output |
|---|---|
| Medical report (PDF/PNG/JPG) | Simple explanation + urgency indicator + disclaimer |
┌─────────────────┐
│ Medical Report │ (PDF / PNG / JPG)
└────────┬────────┘
▼
┌─────────────────┐
│ Flask API │ POST /analyze
└────────┬────────┘
▼
┌─────────────────┐
│ 🔤 PaddleOCR │ Text Extraction
└────────┬────────┘
▼
┌─────────────────┐
│ 🧠 ERNIE │ Medical Explanation
└────────┬────────┘
▼
┌─────────────────┐
│ JSON Response │ Status + Summary + Findings
└─────────────────┘
# Clone and navigate
cd Doclyst-Backend
# Create virtual environment
python -m venv .venv
# Activate (Windows)
.venv\Scripts\activate
# Activate (Linux/Mac)
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Copy environment template
cp .env.example .env
# Edit .env with your API keys
Environment Variables:
| Variable | Description |
|---|---|
ERNIE_ACCESS_TOKEN | ERNIE API token |
GROQ_API_KEY | Groq LLM API key |
# Development
python app.py
# Production
gunicorn app:app
Server runs at http://localhost:5000
POST /analyzeAnalyze one or more medical report files.
Request:
Content-Type: multipart/form-data
Field: file (supports multiple files)
Response:
{
"overallStatus": "ATTENTION",
"summary": "Most of your results look good. A few values need attention.",
"tests": [
{
"name": "Hemoglobin",
"value": "10.2 g/dL",
"range": "12.0 - 17.5 g/dL",
"explanation": "Your hemoglobin is slightly below the typical range, which may cause tiredness.",
"status": "warning"
}
],
"disclaimer": "Doclyst does not provide medical advice. This explanation is for understanding only."
}
Status Levels:
| Status | Meaning |
|---|---|
NORMAL | All values within expected range |
ATTENTION | Some values need monitoring |
URGENT | Consult a doctor promptly |
GET /healthHealth check endpoint.
{"status": "healthy", "service": "doclyst-backend"}
Doclyst-Backend/
├── app.py # Flask application entry
├── config.py # Configuration management
├── routes/
│ └── analyze.py # API endpoints
├── services/
│ ├── ocr_service.py # OCR integration
│ ├── ernie_service.py # LLM integration
│ ├── medical_parser.py # Data structuring
│ └── risk_engine.py # Urgency assessment
├── utils/
│ ├── file_utils.py # File handling
│ └── text_cleaner.py # Text normalization
├── requirements.txt
└── README.md
| Type | Support |
|---|---|
| Blood Tests (CBC) | ✅ Full analysis |
| Biochemistry Panels | ✅ Full analysis |
| ECG Reports | ✅ Full analysis |
| X-ray Reports | ✅ Full analysis |
| ECG Images | ✅ Description only |
| X-ray Images | ✅ Description only |
Doclyst prioritizes patient safety:
"We help patients understand, not decide."
# Test with cURL
curl -X POST http://localhost:5000/analyze \
-F "file=@your_report.jpg"
# Test multiple files
curl -X POST http://localhost:5000/analyze \
-F "file=@page1.jpg" \
-F "file=@page2.jpg"
pip install -r requirements.txtgunicorn app:appMIT License
16 commits
Python
100.0%
A Flask-powered medical report analysis API that transforms complex medical documents into patient-friendly explanations.
Doclyst Backend processes medical reports (blood tests, X-rays, ECGs) and returns clear, simple explanations that anyone can understand—without providing medical advice or diagnoses.
| Input | Output |
|---|---|
| Medical report (PDF/PNG/JPG) | Simple explanation + urgency indicator + disclaimer |
┌─────────────────┐
│ Medical Report │ (PDF / PNG / JPG)
└────────┬────────┘
▼
┌─────────────────┐
│ Flask API │ POST /analyze
└────────┬────────┘
▼
┌─────────────────┐
│ 🔤 PaddleOCR │ Text Extraction
└────────┬────────┘
▼
┌─────────────────┐
│ 🧠 ERNIE │ Medical Explanation
└────────┬────────┘
▼
┌─────────────────┐
│ JSON Response │ Status + Summary + Findings
└─────────────────┘
# Clone and navigate
cd Doclyst-Backend
# Create virtual environment
python -m venv .venv
# Activate (Windows)
.venv\Scripts\activate
# Activate (Linux/Mac)
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Copy environment template
cp .env.example .env
# Edit .env with your API keys
Environment Variables:
| Variable | Description |
|---|---|
ERNIE_ACCESS_TOKEN | ERNIE API token |
GROQ_API_KEY | Groq LLM API key |
# Development
python app.py
# Production
gunicorn app:app
Server runs at http://localhost:5000
POST /analyzeAnalyze one or more medical report files.
Request:
Content-Type: multipart/form-data
Field: file (supports multiple files)
Response:
{
"overallStatus": "ATTENTION",
"summary": "Most of your results look good. A few values need attention.",
"tests": [
{
"name": "Hemoglobin",
"value": "10.2 g/dL",
"range": "12.0 - 17.5 g/dL",
"explanation": "Your hemoglobin is slightly below the typical range, which may cause tiredness.",
"status": "warning"
}
],
"disclaimer": "Doclyst does not provide medical advice. This explanation is for understanding only."
}
Status Levels:
| Status | Meaning |
|---|---|
NORMAL | All values within expected range |
ATTENTION | Some values need monitoring |
URGENT | Consult a doctor promptly |
GET /healthHealth check endpoint.
{"status": "healthy", "service": "doclyst-backend"}
Doclyst-Backend/
├── app.py # Flask application entry
├── config.py # Configuration management
├── routes/
│ └── analyze.py # API endpoints
├── services/
│ ├── ocr_service.py # OCR integration
│ ├── ernie_service.py # LLM integration
│ ├── medical_parser.py # Data structuring
│ └── risk_engine.py # Urgency assessment
├── utils/
│ ├── file_utils.py # File handling
│ └── text_cleaner.py # Text normalization
├── requirements.txt
└── README.md
| Type | Support |
|---|---|
| Blood Tests (CBC) | ✅ Full analysis |
| Biochemistry Panels | ✅ Full analysis |
| ECG Reports | ✅ Full analysis |
| X-ray Reports | ✅ Full analysis |
| ECG Images | ✅ Description only |
| X-ray Images | ✅ Description only |
Doclyst prioritizes patient safety:
"We help patients understand, not decide."
# Test with cURL
curl -X POST http://localhost:5000/analyze \
-F "file=@your_report.jpg"
# Test multiple files
curl -X POST http://localhost:5000/analyze \
-F "file=@page1.jpg" \
-F "file=@page2.jpg"
pip install -r requirements.txtgunicorn app:appMIT License
16 commits
Python
100.0%