You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A comprehensive patient engagement platform built with Flask and a React-style SPA frontend. PatientPortal enables patients to manage their health profiles, track medications, view lab results, set wellness goals, and communicate securely with healthcare providers.
Features
Patient Profile Management
Complete demographic information management
Emergency contact details
Insurance information (provider, policy, group)
Medical details: blood type, allergies, height/weight
Soft-delete (deactivation) for data integrity
Health Records Timeline
Chronological view of all health events
Record types: visits, diagnoses, treatments, procedures, immunizations, referrals
Provider and facility tracking
Follow-up date management
Color-coded timeline visualization
Medication Tracker
Active medication list with dosage and frequency
Schedule-based reminders (supports various frequencies)
Adherence tracking (doses taken vs. scheduled)
Adherence percentage with visual progress bars
Refill date tracking and pharmacy info
One-click dose recording
Lab Results Dashboard
Results with reference ranges and visual indicators
# Clone the repository
git clone https://github.com/yourusername/patientportal.git
cd patientportal
# Run the start script
chmod +x start.sh
./start.sh
# Build and run with Docker Compose
docker-compose up --build
# Or build manually
docker build -t patientportal .
docker run -p 8019:8019 patientportal
The application will be available at http://localhost:8019
API Reference
Patients
Method
Endpoint
Description
GET
/api/patients
List all patients
GET
/api/patients/:id
Get patient by ID
POST
/api/patients
Create new patient
PUT
/api/patients/:id
Update patient
DELETE
/api/patients/:id
Deactivate patient
Health Records
Method
Endpoint
Description
GET
/api/patients/:id/records
List health records
POST
/api/patients/:id/records
Create health record
Medications
Method
Endpoint
Description
GET
/api/patients/:id/medications
List medications
POST
/api/patients/:id/medications
Create medication
POST
/api/medications/:id/dose
Record a dose taken
Lab Results
Method
Endpoint
Description
GET
/api/patients/:id/labs
List lab results
POST
/api/patients/:id/labs
Create lab result
Wellness
Method
Endpoint
Description
GET
/api/patients/:id/wellness
List wellness entries
POST
/api/patients/:id/wellness
Create/update entry
Messages
Method
Endpoint
Description
GET
/api/patients/:id/messages
List messages
POST
/api/patients/:id/messages
Send message
PUT
/api/messages/:id/read
Mark as read
Dashboard & Utilities
Method
Endpoint
Description
GET
/api/patients/:id/dashboard
Dashboard summary
POST
/api/health/bmi
Calculate BMI
POST
/api/health/score
Calculate health score
POST
/api/health/interpret-lab
Interpret lab result
Testing
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ -v --cov=. --cov-report=term-missing
# Run specific test file
pytest tests/test_api.py -v
pytest tests/test_services.py -v
Health Score Methodology
The composite health score is calculated using weighted components:
Component
Weight
Scoring Criteria
BMI
25%
Based on BMI category (normal=100, overweight=70, etc.)
Activity
20%
Daily step goal achievement percentage
Medication Adherence
25%
Doses taken vs. doses scheduled
Lab Results
20%
Percentage of results in normal range
Sleep Quality
10%
Sleep goal achievement percentage
Grades:
A (90-100): Excellent health metrics
B (80-89): Good overall health
C (70-79): Fair, room for improvement
D (60-69): Needs attention
F (below 60): Significant improvement needed
Lab Result Interpretation
Results are automatically categorized:
Status
Condition
Color
Normal
Within reference range
Green
Low
Below reference range
Orange
High
Above reference range
Red
Critical Low
At or below critical threshold
Dark Red
Critical High
At or above critical threshold
Dark Red
Configuration
Environment variables:
Variable
Default
Description
PATIENTPORTAL_PORT
8019
Server port
PATIENTPORTAL_DEBUG
false
Debug mode
DATABASE_URL
SQLite local
Database connection string
SECRET_KEY
dev key
Flask secret key
Design Decisions
SPA Architecture: Hash-based routing provides a smooth, modern UX without page reloads
SQLite: Zero-config database, perfect for development and small deployments
Health Score Engine: Weighted composite scoring provides actionable health insights
Built as a showcase for patient engagement and digital wellness platform capabilities,
demonstrating expertise in healthcare IT, self-service portals, and wellness tracking systems.
About
Patient engagement platform with health records, medication tracking, lab results, wellness goals, and provider messaging