Issue: Improve Prescriptions and Multi-Consultation Workflow in Verify Medicines
Issue Summary
Improve multi-consultation workflow handling in Prescriptions and Verify Medicines queues by replacing popup/separate page flows with dropdown-based interactions, fixing queue transition issues, and supporting consultations without prescriptions.
Problem Statement
Current workflow has multiple issues for patients having multiple consultations:
1. Popup/Separate Screen Workflow
- Prescriptions open inside popup/modal.
- Verify Medicines opens separate consultation details screen.
- Workflow becomes difficult to manage for multiple consultations.
2. Verify Medicines Redirection Problem
- After verifying one consultation, user is redirected back to queue immediately.
- User must reopen patient again to continue remaining consultations.
3. Counseling Queue Transition Issue
- Single consultation patients move correctly to Counseling Queue.
- Multiple consultation patients sometimes remain stuck even after medicines are marked as "Given".
4. Consultation Without Prescription Not Supported
Doctors may:
- Reassign patient to another specialist
- Complete consultation without medicines
- Give observation/advice only
Currently the system forces medicine entry and blocks workflow progression.
Impact
- Poor volunteer/pharmacy workflow experience
- Difficult handling of multiple consultations
- Unnecessary navigation and redirection
- Incomplete support for real medical workflows
Proposed Solution
Consultation Dropdown/Accordion UI
Convert consultation handling into inline dropdown/accordion based UI.
Prescriptions Queue
-
Remove popup/modal.
-
Expand consultation inline.
-
Show:
- Previous Camp Prescriptions
- Add New Prescriptions form
- Add Another Prescription button
- Add New Prescriptions button
- Cancel button
Verify Medicines Queue
-
Remove separate consultation details screen.
-
Expand consultation inline.
-
Show:
- Medicines list
- Edit/Delete actions
- Add Medicine button
- Verify Medicines button
Verify Medicines Workflow Changes
-
After verifying one consultation:
- Stay on same page
- Do not redirect immediately
- Mark completed consultation with green highlight/border
-
Allow remaining consultations to continue directly.
-
Redirect/move patient to Counseling Queue only after all consultations are completed.
Consultation Without Medicines Support
Add support for:
- "No Prescription Required" OR
- "Complete Consultation Without Medicines"
Expected behavior:
- Consultation can complete without medicine entry.
- Skip Medicine Pickup flow when no medicines are prescribed.
- Continue workflow normally.
Test-Driven Development
Acceptance Criteria (Given-When-Then)
Scenario 1: Inline Consultation Expansion
Given a patient has multiple consultations
When user clicks a consultation
Then consultation should expand inline as dropdown/accordion
And popup/modal should not open
Scenario 2: Verify Medicines Multi-Consultation Workflow
Given a patient has multiple consultations
When user verifies medicines for one consultation
Then user should remain on same Verify Medicines page
And completed consultation should show green highlight
And remaining consultations should still be accessible
Scenario 3: Final Queue Transition
Given all consultations are completed
When final consultation medicines are verified
Then patient should move to Counseling Queue
Scenario 4: Consultation Without Prescription
Given doctor does not prescribe medicines
When consultation is completed
Then workflow should continue without mandatory prescription entry
Test Cases
| Test ID | Test Description | Precondition | Test Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| TC-001 | Expand consultation inline | Patient has multiple consultations | 1. Open consultation 2. Click consultation |
Dropdown expands inline | High |
| TC-002 | Verify medicines without redirect | Multiple consultations exist | 1. Verify one consultation | Stay on same page | High |
| TC-003 | Completed consultation highlight | Consultation verified | 1. Verify medicines | Green highlighted consultation | High |
| TC-004 | Final counseling queue movement | All consultations completed | 1. Verify final consultation | Move to Counseling Queue | High |
| TC-005 | Consultation without medicines | No medicines prescribed | 1. Complete consultation | Workflow continues successfully | High |
Unit Test Requirements
Components/Functions to Test:
| Module/Component | Function/Hook | Test Cases to Cover |
|---|---|---|
UpdatePrescriptionPage |
Consultation accordion logic | TC-001 |
VerifyMedicinesPage |
Verify medicines workflow | TC-002, TC-003 |
QueueTransitionLogic |
Counseling queue movement | TC-004 |
PrescriptionForm |
No prescription handling | TC-005 |
Test Assertions Required:
-
Renders consultation accordion correctly -
Handles consultation expansion properly -
Prevents unnecessary page redirects -
Updates consultation completion UI -
Handles multi-consultation workflow correctly -
Moves patient to Counseling Queue correctly -
Supports consultation without medicines
Implementation Details
Files to Change
| File Path | Action | Purpose |
|---|---|---|
src/pages/UpdatePrescriptionPage.tsx |
Modify | Add accordion workflow |
src/pages/VerifyMedicinesPage.tsx |
Modify | Inline consultation expansion |
src/components/ConsultationAccordion.tsx |
Create/Modify | Shared accordion component |
src/hooks/useQueueTransition.ts |
Modify | Queue transition handling |
src/__tests__/ |
Create | Unit tests |
Technical Considerations
- Maintain current business logic while changing UI interaction.
- Only one accordion should remain open at a time.
- Queue transition logic should validate all consultations before redirect.
- Add optional consultation completion flow without medicines.
UI/UX Requirements
- Inline accordion/dropdown interactions
- No popup/modal usage
- No separate consultation detail page
- Green highlight for completed consultations
- Smooth multi-consultation navigation flow
Testing Strategy
Manual Testing
Test Environment:
- Browser: Chrome/Firefox
- Viewport: Desktop
- User Role: Volunteer/Pharmacy
Manual Test Steps:
- Open patient with multiple consultations
- Verify consultation expansion behavior
- Verify medicines for one consultation
- Confirm no immediate redirect occurs
- Verify completed consultation highlight
- Verify final Counseling Queue transition
- Test consultation without medicines workflow
Automated Testing
Unit Tests:
-
Accordion rendering tests -
Multi-consultation workflow tests -
Queue transition tests -
No prescription workflow tests
Integration Tests (if applicable):
-
Consultation flow navigation tests -
Queue status transition tests
Test Data Requirements
const mockTestData = {
patient: {
consultations: 2,
prescriptions: [],
verifyMedicinesStatus: []
}
}
Definition of Done
-
Acceptance criteria met -
All test cases passing -
Manual testing completed -
Queue transition works correctly -
Multi-consultation workflow verified -
No unnecessary redirects -
Accordion UI working properly -
Consultation without medicines supported -
No console errors -
ESLint/Prettier checks pass
Additional Context
Notes
- This issue mainly improves multi-consultation workflow handling.
- Current implementation works properly only for single consultation patients.
- Workflow should support realistic hospital consultation scenarios.