Draft: Resolve "feat(api): Implement Specialization-Based Assignment & Multi-Queue Management"
Description
This merge request implements the full Specialization-Based Assignment workflow, replacing the legacy doctor-centric assignment model. It allows volunteers to assign patients to medical specializations (e.g., ENT, General Physician) and enables doctors to claim patients from these specialization pools.
Key Features & Changes:
-
Database Strategy (Phase 1):
- Updated ConsultationQueue table to support
specializationand nullabledoctor_id. - Added automated data migration to backfill specialization for existing records.
- Updated ConsultationQueue table to support
-
Volunteer Workflow (Phase 2):
- Added
POST /api/v1/queue/assign: Assign patient to one or more specializations. - Added
GET /api/v1/queue/patient/{book_no}/all: View all active queues for a patient.
- Added
-
Doctor Workflow (Phase 3):
- Added
GET /api/v1/queue/specialization/{name}: Fetch the "Pool" of waiting patients + claimed patients. - Updated "Start Consultation" logic to assign the
doctor_id(Claiming). - Implemented "Multi-Queue State Management": Putting parallel queues on hold when consultation starts.
- Added
Checklist
-
Code follows project API guidelines. -
Tests for API endpoints are included and passing. -
API documentation is updated (if applicable). -
Performance considerations have been addressed.
Related Issue(s)
Edited by Kushal Lagichetty