Bug: Prescription Creation Allowed Before Consultation Completion
🔀 MR: Block Prescription Creation Until Consultation Completion
Summary
This MR updates the frontend prescription flow to ensure prescriptions can only be created after patient consultation is completed, based on the existing patient status API.
Changes
- Integrated patient status check using
/api/v1/patients/{book_no}/status - Blocked prescription form access when
"consultation_completed"is missing - Added safeguard validation before prescription submit/save
- Displayed clear, user-friendly error message for ongoing consultations
- Handled API failure and unexpected status values gracefully
Scope
- Frontend-only logic update
- No backend or API changes
- No changes to prescription business rules
UX Notes
- Users receive immediate feedback if consultation is still in progress
- No impact on completed consultation flows
Testing
- Verified prescription access blocked during consultation
- Verified prescription access allowed after consultation completion
- Verified safe behavior on API failure / empty status
Notes
- Logic is isolated and maintainable
- Regression-free update
Edited by Kushal Lagichetty