How abd523/hms-backend works
This repository is a Django REST API for hospital operations. A user sends requests through the central URL router to resource endpoints for patients, doctors, appointments, billing, laboratory work, pharmacy, prescriptions, medical records, and notifications; endpoints expose model-backed CRUD, with analytics and dashboard summaries as additional results. The model layer represents the persistent domain. The sampled routing and view code supports the main API paths; unsampled app endpoints are included where the central router documents them, but their internal behavior is not inferred.
Main entry points: urls.py API router · views.py Dashboard stats · appointments/models.py Appointments · patients/models.py Patient records
Components 23
Identity and oversight
- Accounts API
accounts/views.py - Users and audit log
accounts/models.py - Dashboard stats
accounts/views.py - Notifications API
notifications/views.py - Notifications
notifications/models.py
Care operations
- Patient API
patients/views.py - Patient records
patients/models.py - Doctor API
doctors/views.py - Doctor profiles
doctors/models.py - Appointments API
appointments/views.py - Appointments
appointments/models.py - Appointment serializers
appointments/serializers.py
Clinical services
- Laboratory API
laboratory/views.py - Lab requests and tests
laboratory/models.py - Pharmacy API
pharmacy/views.py - Medicines
pharmacy/models.py - Records and prescriptions API
prescriptions/views.py - Medical records and prescriptions
prescriptions/models.py
API and reporting
- API router
core/urls.py - Billing API
billing/views.py - Invoices
billing/models.py - Revenue analytics
billing/views.py
Other components
- API user
Connections 33
- API user → API router: sends requests
- API router → Accounts API: routes accounts
core/urls.py - API router → Billing API: routes invoices
core/urls.py - API router → Revenue analytics: routes analytics
core/urls.py - API router → Pharmacy API: routes medicines
core/urls.py - API router → Laboratory API: routes lab work
core/urls.py - API router → Appointments API: routes appointments
core/urls.py - API router → Patient API: routes patients
core/urls.py - API router → Doctor API: routes doctors
core/urls.py - API router → Notifications API: routes notifications
core/urls.py - API router → Records and prescriptions API: routes records
core/urls.py - API router → Records and prescriptions API: routes prescriptions
core/urls.py - Accounts API → Users and audit log: reads and manages
accounts/views.py - Accounts API → Dashboard stats: serves dashboard
accounts/views.py - Dashboard stats → Patient records: counts patients
accounts/views.py - Dashboard stats → Doctor profiles: counts doctors
accounts/views.py - Dashboard stats → Appointments: counts appointments
accounts/views.py - Dashboard stats → Invoices: sums paid invoices
accounts/views.py - Patient API → Patient records: reads and writes
patients/views.py - Patient API → Users and audit log: logs registration
patients/views.py - Doctor API → Doctor profiles: reads and writes
doctors/views.py - Appointments API → Appointments: reads and writes
appointments/views.py - Appointments API → Appointment serializers: serializes data
appointments/views.py - Appointments → Patient records: references patient
appointments/models.py - Appointments → Doctor profiles: references doctor
appointments/models.py - Billing API → Invoices: reads and writes
billing/views.py - Billing API → Users and audit log: logs payment
billing/views.py - Revenue analytics → Invoices: aggregates revenue
billing/views.py - Revenue analytics → Patient records: aggregates demographics
billing/views.py - Laboratory API → Lab requests and tests: reads and writes
laboratory/views.py - Pharmacy API → Medicines: reads and writes
pharmacy/views.py - Records and prescriptions API → Medical records and prescriptions: reads and writes
prescriptions/views.py - Notifications API → Notifications: reads and writes
notifications/views.py