fix(prescriptions): fix days and quantity field handling when adding new prescriptions
Summary
Fixes issues in the Update Prescription flow related to days and quantity input handling.
Problem
- Quantity field defaulted to
1, causing digit concatenation (e.g. typing20resulted in120) - Invalid prescriptions could be submitted due to missing validation
- No Validation Alerts
- For the Medicines like Syrups , Gel, Ointment, Cream, Lotions the quantities are calculated incorrectly.
- No Doctor names for the prescriptions and Consultations
- No Grouping of the medicines in the Manage Prescriptions
What Changed
- Fixed quantity input to allow clean numeric entry
- Removed silent default values for days and quantity
- Updated Days Field Min:
1, Max:31 - Added Quick Days Access Buttons
7101531 - Added Dosage button to choose between the
Full DosageorHalf Dosage - Added Validation Alerts
- Changed the buttons names -
- Converted prescription logic to:
- One prescription = multiple medicines
- Medicines are now grouped and submitted as a single prescription batch
- Added automatic handling for manual-quantity medicine types:
- Syrup
- Gel
- Ointment
- Cream
- Lotion
-(Directly redirect to
By Quantity)
- Improved dosage calculation:
quantity = days × time slots- Half dosage =
ceil(total / 2)
- Updated layout:
- Days, Dosage, and Calculated Quantity appear in one row
- Doctor name now displayed in consultation list and Prescriptions
- Mobile Friendly
##Images
- Display the Doctor Names in the Consultations
- Added Quick Days Selection, Dosage Button.
- Multiple Medicines are displayed in a single form in the Manage Prescriptions
- Mobile View
Behavior
-
By Dosage: Quantity is auto-calculated from
days × time slots - By Quantity: Only total quantity is required (days and time slots are hidden)
- For Syrups, Gels, Ointment can only be added By Quantity not by Dosage, when these types of medicines are selected it redirects to By Quantity
Edited by Mukthanand Reddy M



