How enos22/hospital-management-system works
This is a Flask hospital-management backend exposing APIs for appointments, identity and staff/patient administration, records, laboratory workflows, prescriptions, pharmacy, billing, reports, doctor matching, and notifications. The principal appointment flow accepts a request, checks scheduling conflicts, and persists the appointment; billing requests delegate invoice and payment operations to services. The tree and excerpts show several independent route/service styles, so this is a feature map rather than one unified pipeline. Some route families and models are unsampled; their relationships are omitted where the evidence does not establish calls.
Main entry points: medical_record.py SQLAlchemy models · appointment_routes.py Appointment API · billing_routes.py Billing and reports · prescription_routes.py Prescription API
Components 25
Access and administration
- Authentication
HMS-Backend/server/app/routes/auth_routes.py - User administration
HMS-Backend/server/app/routes/admin_routes.py - Patient management
HMS-Backend/server/app/routes/patient_routes.py - Doctor management
HMS-Backend/server/app/routes/doctor_routes.py - Role authorization
HMS-Backend/server/app/middleware/role_middleware.py
Clinical workflows
- Appointment API
HMS-Backend/server/app/routes/appointment_routes.py - Conflict checking
HMS-Backend/server/app/utils/conflict_checker.py - Appointment scheduling
HMS-Backend/server/app/services/appointment_service.py - Medical records API
HMS-Backend/server/app/routes/medical_record_routes.py - Record services
HMS-Backend/server/app/services/record_service.py - Laboratory API
HMS-Backend/server/app/routes/laboratory_routes.py - Prescription API
HMS-Backend/server/app/routes/prescription_routes.py - Prescription services
HMS-Backend/server/app/services/prescription_service.py - Pharmacy inventory
HMS-Backend/server/app/routes/pharmacy_routes.py - Notification API
HMS-Backend/server/app/routes/notification_routes.py - Notification delivery
HMS-Backend/server/app/services/notification_service.py
Billing and matching
- Billing and reports
HMS-Backend/server/app/routes/billing_routes.py - Invoice and payment logic
HMS-Backend/server/app/services/billing_service.py - Financial reporting
HMS-Backend/server/app/services/report_service.py - Doctor matching
HMS-Backend/server/app/services/matching_service.py
Persistence and shared services
- SQLAlchemy models
HMS-Backend/server/app/models/medical_record.py - Relational database
- Response utilities
HMS-Backend/server/app/utils/responses.py - Initial data setup
HMS-Backend/server/seed.py
Other components
- API client
Connections 22
- API client → Authentication: sends requests
HMS-Backend/server/app/routes/auth_routes.py - API client → Appointment API: sends requests
HMS-Backend/server/app/routes/appointment_routes.py - API client → Billing and reports: sends requests
HMS-Backend/server/app/routes/billing_routes.py - API client → Medical records API: sends requests
HMS-Backend/server/app/routes/medical_record_routes.py - Appointment API → Conflict checking: checks conflicts
HMS-Backend/server/app/routes/appointment_routes.py - Appointment API → SQLAlchemy models: reads and writes
HMS-Backend/server/app/routes/appointment_routes.py - Appointment API → Response utilities: formats responses
HMS-Backend/server/app/routes/appointment_routes.py - Medical records API → Record services: delegates records
HMS-Backend/server/app/routes/medical_record_routes.py - Record services → SQLAlchemy models: reads and writes
HMS-Backend/server/app/services/record_service.py - Prescription API → Prescription services: delegates prescriptions
HMS-Backend/server/app/routes/prescription_routes.py - Prescription API → Role authorization: checks roles
HMS-Backend/server/app/routes/prescription_routes.py - Prescription services → SQLAlchemy models: reads and writes
HMS-Backend/server/app/services/prescription_service.py - Pharmacy inventory → Role authorization: checks roles
HMS-Backend/server/app/routes/pharmacy_routes.py - Notification API → Notification delivery: delegates delivery
HMS-Backend/server/app/routes/notification_routes.py - Notification delivery → SQLAlchemy models: persists notifications
HMS-Backend/server/app/services/notification_service.py - Billing and reports → Invoice and payment logic: delegates billing
HMS-Backend/server/app/routes/billing_routes.py - Billing and reports → Financial reporting: requests reports
HMS-Backend/server/app/routes/billing_routes.py - Billing and reports → Doctor matching: requests matching
HMS-Backend/server/app/routes/billing_routes.py - Invoice and payment logic → Relational database: reads and writes
HMS-Backend/server/app/services/billing_service.py - Appointment scheduling → Relational database: scheduling persistence
- Initial data setup → SQLAlchemy models: loads model data
HMS-Backend/server/seed.py - SQLAlchemy models → Relational database: maps records