Local web application for comprehensive management of laboratory results and clinical documents with hybrid AI capabilities (local/cloud) and HL7 FHIR support.
- β Patient profile management (up to 4 profiles)
- β Local storage of PDFs and documents
- β Complete HL7 FHIR interoperability
- β Configurable local and cloud AI
- β Trend visualization and analytics
- β Smart alert system
- β Automatic backup and restoration
- β Full containerization with Docker
- Python 3.10+
- Docker and Docker Compose (optional but recommended)
- At least 4GB RAM for optimal performance
- 2GB free disk space minimum
git clone <repo>
cd bloodwork-tracker
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your configurations
python run.pyThe easiest way to run Blood Work Tracker is using Docker Compose. This ensures all dependencies are properly configured and isolated.
First, ensure you have Docker and Docker Compose installed:
# Check if Docker is installed
docker --version
# Check if Docker Compose is installed
docker-compose --versionThen run the application:
# Clone the repository
git clone <repo>
cd bloodwork-tracker
# Copy the example environment file
cp .env.example .env
# Edit the .env file to configure your settings
nano .env # or use your preferred editor
# Start the services using Docker Compose
docker-compose up -d
# View logs to ensure everything started correctly
docker-compose logs -f
# Access the application at http://localhost:5000The default docker-compose.yml includes:
- Main application service
- PostgreSQL database (for persistent data storage)
- Optional services for AI integration (when configured)
To customize your deployment, modify the .env file before starting the containers. The application will automatically initialize the database and create the necessary tables on first startup.
# Stop the services
docker-compose down
# Stop and remove volumes (removes all data)
docker-compose down -v
# View service logs
docker-compose logs -f
# View specific service logs
docker-compose logs -f app # for the main application
docker-compose logs -f db # for the database- Create first admin user (default: admin/admin123)
- Configure AI provider in .env
- Import LOINC/UCUM codes (optional)
- Create/Edit/Delete profiles
- Assign biomarkers with LOINC codes
- Set reference ranges
- Upload laboratory PDFs
- Create observations manually
- Import FHIR Bundle
- Trend charts by biomarker
- Report comparison
- Out-of-range value alerts
POST /api/v1/auth/login
{
"username": "admin",
"password": "password"
}GET /fhir/Patient/{id}
GET /fhir/Observation?patient={id}
GET /fhir/DiagnosticReport?patient={id}
GET /fhir/Bundle?patient={id}POST /api/v1/ai/consult
{
"question": "How have my glucose levels evolved?",
"provider": "local",
"context_type": "fhir_bundle",
"patient_id": 1
}- JWT for authentication
- AES-256 for encryption at rest
- RBAC for access control
- Complete audit trail
pytest tests/ -v --cov=app| DB Field | FHIR Field | Type |
|---|---|---|
| id | resource.id | string |
| name | name[0].text | string |
| birth_date | birthDate | date |
| gender | gender | code |
| DB Field | FHIR Field | Type |
|---|---|---|
| value | valueQuantity.value | decimal |
| unit | valueQuantity.unit | string |
| ref_min | referenceRange[0].low.value | decimal |
| ref_max | referenceRange[0].high.value | decimal |
| interpretation | interpretation[0].coding[0].code | code |
AI_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama2AI_PROVIDER=lmstudio
LMSTUDIO_BASE_URL=http://localhost:1234AI_PROVIDER=openai
AI_SEND_TO_CLOUD=true
OPENAI_API_KEY=your-api-keyAI_PROVIDER=mock
AI_SEND_TO_CLOUD=falseFor detailed Docker installation and management instructions, see the Installation section above.
Basic Docker Compose commands:
# Start all services in detached mode
docker-compose up -d
# Stop all services
docker-compose down
# View logs from all services
docker-compose logs -f
# View logs from specific service
docker-compose logs -f app # for the main application
docker-compose logs -f db # for the databaseMIT License
This application does NOT provide medical diagnoses. It only offers informative summaries and guidance. Always consult with a healthcare professional.