Adding Prescriptions & Verify Medicines to Coordinator Dashboard
Feature Summary
Add Prescriptions and Verify Medicines modules to Coordinator Dashboard without affecting existing Queue functionality.
Problem Statement
Currently, the Coordinator Dashboard only supports Queue Management.
New modules — Prescriptions and Verify Medicines — need to be added to the Coordinator Dashboard.
However, while adding these features:
- Queue functionality must remain completely unchanged
- Prescriptions and Verify Medicines must work as independent modules
The challenge is to integrate these new features without:
- Modifying existing queue behavior
- Creating dependency between queue and new modules
Proposed Solution
- Coordinator Dashboard
-
Extend dashboard to include:
- Queue Management (unchanged)
- Prescriptions (new)
- Verify Medicines (new)
-
Dashboard should act as navigation-only (no business logic)
- Queue Management
- No changes
- Continues to control patient flow and status updates
- Prescriptions Page
-
Independent module
-
Fetch patients where: status === "CONSULTATION_DONE"
-
Allow:
- View prescription
- Add/Edit prescription
-
On save:
- Update prescription data
- Update status → "PRESCRIPTION_DONE"
-
Must NOT use queue logic
- Verify Medicines Page
-
Independent module
-
Fetch patients where: status === "PRESCRIPTION_DONE"
-
Allow:
- Verify medicines
-
Must NOT use queue logic
Test-Driven Development
Acceptance Criteria (Given-When-Then)
Scenario 1: Coordinator Dashboard Navigation Given user is on Coordinator Dashboard When user clicks "Queue Management" Then existing queue functionality should work unchanged
When user clicks "Prescriptions" Then user should navigate to prescriptions page
When user clicks "Verify Medicines" Then user should navigate to verify medicines page
Scenario 2: Prescription Update Flow Given patient status is "CONSULTATION_DONE" When user opens Prescriptions page Then patient should appear in list
When user updates prescription and clicks save Then prescription should be updated And patient status should become "PRESCRIPTION_DONE"
Scenario 3: Verify Medicines Flow Given patient status is "PRESCRIPTION_DONE" When user opens Verify Medicines page Then patient should appear in list
When user verifies medicines Then verification should be saved successfully
Scenario 4: Empty State Given no patients match required status When user opens page Then empty state message should display
Scenario 5: Validation Error Given user enters invalid prescription data When user submits Then validation error should display And form should not submit
Scenario 6: API Error Given API fails during update When user saves prescription Then error message should display And no status update should occur
Technical Specification
Files to Modify:
- src/pages/CoordinatorDashboard.tsx → Add navigation buttons
- src/pages/Prescriptions.tsx → Implement prescription module
- src/pages/VerifyMedicines.tsx → Implement verification module
- src/services/patient.ts → API updates
Definition of Done
- Coordinator dashboard includes new modules
- Queue functionality remains unchanged
- Prescriptions page works independently
- Verify Medicines page works independently
- Prescription update works correctly
- No queue logic used in these pages