Fix repeat medicine consultation and prescription UI flow
Overview
This MR updates the frontend repeat medicine flow to reuse the existing consultation and prescription UI without requiring a real doctor assignment.
Repeat medicine patients now follow the same consultation and prescription experience as normal patients while displaying "Repeat Medicine" instead of a doctor name.
What does this MR do and why?
Previously, repeat medicine patients showed invalid/empty consultation states such as:
- No consultations found
- Invalid consultation ID format
- Missing prescription flow
The frontend expected a normal doctor consultation flow with a valid doctor reference.
This MR updates the frontend logic to:
- Support repeat medicine consultation flow
- Reuse the existing prescription UI
- Display "Repeat Medicine" as the consultation card title
- Handle repeat medicine consultation rendering properly
Changes Made
Frontend Changes
- Added repeat medicine conditional rendering logic
- Updated consultation card title handling
- Reused existing consultation and prescription UI for repeat medicine patients
- Added repeat medicine fallback handling for consultation rendering
- Prevented invalid consultation state in prescription flow
- Maintained same click behavior and prescription modal flow
Technical Details
Root Cause
Frontend consultation flow depended on:
- valid doctor data
- normal consultation mapping
For repeat medicine patients:
- no real doctor existed
- consultation rendering failed
- prescription flow showed invalid consultation errors
Fix Implemented
title = visit.is_repeat_medicine
? "Repeat Medicine"
: doctor.name;
Also updated consultation rendering flow to support repeat medicine consultations without requiring a real doctor.
Type of Change
-
🐛 Bug fix (non-breaking change that fixes an issue) -
🎨 UI/UX improvement -
✨ New feature (non-breaking change that adds functionality)
Related Issues / References
Screenshots or Screen Recordings
| Before |
|---|
![]() |
| After |
| ----------------------------------------------------------------- |
![]() |
How to Set Up and Validate Locally
-
Checkout this branch
-
Start frontend:
bun dev -
Register a repeat medicine patient
-
Complete vitals flow
-
Verify existing prescription modal/page opens correctly
-
Verify normal patient flow still works correctly
Testing Done
-
Manual testing completed
Test Cases Covered
| Scenario | Expected Result | Status |
|---|---|---|
| Normal consultation flow | Existing UI works normally | |
| Repeat medicine consultation rendering | "Repeat Medicine" card shown | |
| Prescription modal opening | Opens correctly | |
| Repeat medicine prescription flow | Reuses existing UI correctly |
Known Limitations / Technical Debt
- Repeat medicine currently reuses existing consultation UI flow
- Future improvement can introduce dedicated repeat medicine consultation type if needed
Additional Notes
This MR intentionally reuses the current consultation and prescription workflow to avoid duplicate UI implementations and maintain a consistent user experience for repeat medicine patients.

