Skip to content

fix(prescriptions): fix days and quantity field handling when adding new prescriptions

Mukthanand Reddy M requested to merge fix/prescription-quantity-dosage into develop

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. typing 20 resulted in 120)
  • 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 7 10 15 31
  • Added Dosage button to choose between the Full Dosage or Half 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

  1. Display the Doctor Names in the Consultations

Doctors_Names

  1. Added Quick Days Selection, Dosage Button.

Updated_UI_for_Add_medicines

  1. Multiple Medicines are displayed in a single form in the Manage Prescriptions

Multiple_Medicines

  1. Mobile View

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

Merge request reports

Loading