Modern Operating Room Management Dashboard with FHIR Integration
Features β’ Tech Stack β’ Getting Started β’ Architecture β’ API
MedicHub is a comprehensive operating room management system designed for healthcare facilities. It provides real-time monitoring of operating room utilization, cost tracking, equipment lifecycle management, and seamless integration with FHIR-compliant health information systems.
- π Real-time Dashboard - Monitor all operating rooms with live status updates
- π° Cost Analytics - Automatic calculation of operation costs (equipment depreciation, materials, staff)
- π FHIR Integration - Full HL7 FHIR R4 compliance with InterSystems IRIS Health
- π Smart Scheduling - Intelligent operation scheduling with conflict detection
- π₯ Multi-role Access - Customized views for doctors, nurses, and administrators
- π Advanced Analytics - Detailed reports on room utilization and resource optimization
- Complete Dashboard Overview - Real-time visualization of all 20+ operating rooms
- Cost Breakdown Analysis - Detailed cost tracking per operation with equipment depreciation, materials, and labor costs
- Resource Optimization - Identify bottlenecks and optimize room scheduling
- KPI Monitoring - Track key performance indicators and utilization metrics
- Patient Management - Comprehensive patient records with medical history
- Operation Scheduling - Calendar view with drag-and-drop scheduling
- Perioperative Protocols - Digital forms for pre/during/post-operative documentation
- Equipment Tracking - Monitor equipment usage, maintenance, and lifecycle
- Room Preparation - Checklists for room setup and sterilization
- Inventory Management - Track materials and supplies with EAN-13 barcode support
- Real-time Updates - Live notifications for operation status changes
- Framework: Django 5.0 with Django REST Framework
- Database: PostgreSQL 15
- Cache: Redis 7
- FHIR Server: InterSystems IRIS Health Community Edition
- Task Queue: Celery with Redis broker
- Architecture: Modular Monolith (easily scalable to microservices)
- Framework: Next.js 14 (React 18)
- Styling: Tailwind CSS 3
- UI Components: Headless UI, Material-UI
- Charts: Recharts, FullCalendar
- State Management: React Query (TanStack Query)
- Real-time: Socket.io
- Containerization: Docker & Docker Compose
- Web Server: Nginx (production)
- Static Files: WhiteNoise
- CORS: django-cors-headers
- Docker & Docker Compose
- Git
- (Optional) Node.js 18+ and Python 3.11+ for local development
-
Clone the repository
git clone https://github.com/Plokar/HackJakBrno.git cd medichub -
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Start the development environment
docker-compose -f docker-compose.dev.yml up --build
-
Initialize the database
docker-compose -f docker-compose.dev.yml exec backend python manage.py migrate docker-compose -f docker-compose.dev.yml exec backend python manage.py createsuperuser
-
Load sample data (optional)
docker-compose -f docker-compose.dev.yml exec backend python manage.py generate_fhir_data --load-synthea -
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000/api
- Admin Panel: http://localhost:8000/admin
- FHIR Server: http://localhost:32783/fhir/r4
The backend is structured as a modular monolith, allowing for easy migration to microservices in the future:
backend/
βββ apps/ # Domain modules (bounded contexts)
β βββ operating_rooms/ # Core operating room management
β βββ authentication/ # User authentication & authorization
β βββ items/ # Generic items module
βββ services/ # Business logic layer
β βββ fhir_service.py # FHIR server integration
β βββ fhir_mappers.py # Django β FHIR mappings
β βββ nis_integration.py # Hospital system integration
β βββ caching_service.py # FHIR data caching
βββ core/ # Shared utilities
βββ config/ # Django configuration
All core entities synchronize with the FHIR server:
- Patient β FHIR Patient resource
- Doctor β FHIR Practitioner resource
- OperatingRoom β FHIR Location resource
- Operation β FHIR Procedure resource
- Equipment β FHIR Device resource
- Material β FHIR SupplyDelivery resource
βββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Next.js β ββββ β Django β ββββ β IRIS FHIR β
β Frontend β β REST API β β Server β
βββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β
ββββββββββββββββ
β PostgreSQL β
β Database β
ββββββββββββββββ
GET /api/operating-rooms/ # List all operating rooms
POST /api/operating-rooms/ # Create new room
GET /api/operating-rooms/{id}/ # Get room details
PUT /api/operating-rooms/{id}/ # Update room
DELETE /api/operating-rooms/{id}/ # Delete room
GET /api/operations/ # List operations
POST /api/operations/ # Schedule new operation
GET /api/operations/{id}/ # Operation details
GET /api/operations/{id}/costs/ # Cost breakdown
GET /api/operating-rooms/fhir/patients/search/ # Search FHIR patients
POST /api/operating-rooms/fhir/patients/generate/ # Generate test data
POST /api/operating-rooms/fhir/patients/sync_from_fhir/ # Sync from FHIR
POST /api/operating-rooms/fhir/patients/{id}/sync_to_fhir/ # Sync to FHIR
GET /api/operating-rooms/fhir/server/ # FHIR server status
GET /api/medic/dashboard/stats/ # Real-time dashboard statistics
GET /api/medic/rooms/{id}/status/ # Individual room status
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements-dev.txt
python manage.py migrate
python manage.py runservercd frontend
npm install
npm run dev# Backend tests
docker-compose -f docker-compose.dev.yml exec backend pytest
# Frontend tests (if configured)
cd frontend
npm test# Backend linting
cd backend
flake8 .
black .
# Frontend linting
cd frontend
npm run lintCustom extensions for hospital-specific data:
procedure-cost-breakdown- Detailed operation cost trackingdevice-cost- Equipment purchase pricedevice-lifetime-hours- Equipment expected lifetimedevice-used-hours- Equipment usage trackingmaterial-unit-price- Material cost per unitdoctor-hourly-rate- Practitioner hourly rate
Automatic tracking of:
- Purchase price and acquisition date
- Expected lifetime in hours
- Current usage hours
- Calculated depreciation per hour
- Remaining lifetime percentage
Materials can be tracked with EAN-13 barcodes for:
- Inventory management
- Quick material lookup
- Supply chain integration
- OperatingRoom - Operating room details with capacity and status
- Patient - Patient demographic and medical history
- Doctor - Practitioner information and specializations
- Operation - Scheduled procedures with assigned resources
- Equipment - Medical devices with lifecycle tracking
- Material - Consumables and supplies
- PerioperativeProtocol - Pre/intra/post-operative documentation
- Operations are performed in OperatingRooms by Doctors on Patients
- Equipment and Materials are consumed during Operations
- PerioperativeProtocols document each Operation phase
- All entities sync bidirectionally with FHIR server
- Authentication: JWT-based authentication with refresh tokens
- Authorization: Role-based access control (RBAC)
- GDPR Compliance: Data anonymization and audit logging
- FHIR Security: OAuth2 integration ready
- API Security: CORS configuration, rate limiting
Create a .env file in the root directory:
# Django
DJANGO_SECRET_KEY=your-secret-key-here
DJANGO_DEBUG=False
ALLOWED_HOSTS=localhost,127.0.0.1
# Database
POSTGRES_DB=medichub
POSTGRES_USER=medichub_user
POSTGRES_PASSWORD=secure_password
# FHIR Server
FHIR_SERVER_URL=http://fhir-server:52773/fhir/r4
IRIS_USERNAME=SuperUser
IRIS_PASSWORD=SYS
# Redis
CELERY_BROKER_URL=redis://redis:6379/0
CELERY_RESULT_BACKEND=redis://redis:6379/0
# Frontend
NEXT_PUBLIC_API_URL=http://localhost:8000/api- Built for FakultnΓ nemocnice u svatΓ© Anny v BrnΔ (St. Anne's University Hospital Brno)
- FHIR integration powered by InterSystems IRIS Health
- Test data generated with Syntheaβ’
Made with β€οΈ for healthcare professionals