diff --git a/care/facility/api/serializers/prescription.py b/care/facility/api/serializers/prescription.py index ed68e772a7..17806c68fa 100644 --- a/care/facility/api/serializers/prescription.py +++ b/care/facility/api/serializers/prescription.py @@ -127,6 +127,10 @@ def validate(self, attrs): raise serializers.ValidationError( {"indicator": "Indicator should be set for PRN prescriptions."} ) + if attrs.get("max_dosage") and attrs.get("max_dosage") < attrs.get("base_dosage"): + raise serializers.ValidationError( + {"max_dosage": "Max dosage cannot be less than base dosage."} + ) attrs.pop("frequency", None) attrs.pop("days", None) else: