care_fe icon indicating copy to clipboard operation
care_fe copied to clipboard

Add frontend validation for titrated dosage

Open nihal467 opened this issue 9 months ago • 2 comments

Describe the bug

Currently, if we enter start dosage higher than the target dosage, in the medicine titrated dosage, the system accept it.

To Reproduce Steps to reproduce the behavior:

  1. Go consultation page, create a medicine with titarted dosage
  2. start dose is 15 and target dose is 10
  3. try to administor it
  4. See error

Expected behavior

there should be a frontend validation to ensure the target dosage is higher than the start dosage

Screenshots

image

nihal467 avatar Apr 26 '24 19:04 nihal467

:warning: Refrain from assigning this issue to yourself if you have another P1 issue assigned that is not yet closed.

github-actions[bot] avatar Apr 26 '24 19:04 github-actions[bot]

@nihal467 this seems good... I will make the PR today itself for this issue its a small one can you assign me

hrit2773 avatar Apr 27 '24 09:04 hrit2773

@nihal467 , there are some other issues as well. For example, one can change the units separately, which I think should not be permissible and many more of such vital errors. Therefore, should I include them as well in the PR, or just the start-target in this and file another PR to address them together?

Sulochan-khadka avatar Apr 28 '24 19:04 Sulochan-khadka

@Sulochan-khadka the issue is assigned to @hrit2773 , feel free to open a new issue for the bug you found related to this module

nihal467 avatar Apr 28 '24 20:04 nihal467

Sure @nihal467 . @hrit2773 , let me know if I can help you out to create PR as soon as possible. I think you will have to create and pass a function to DosageFormField so that a proper validation is added , so that it not only works when data is added from start to target but also checks if the start is changed again.

Sulochan-khadka avatar Apr 28 '24 20:04 Sulochan-khadka

@Sulochan-khadka can you take this up... actually I started working on another issue which is a big one so I'm into that flow. I think this is a high priority issue right @nihal467

hrit2773 avatar Apr 29 '24 10:04 hrit2773

Yeah sure... Will be creating a PR soon...

Sulochan-khadka avatar Apr 29 '24 10:04 Sulochan-khadka

hi @nihal467 i want to work on this issue please assign me this.

soumya-maheshwari avatar Apr 29 '24 16:04 soumya-maheshwari

Hey @soumya-maheshwari actually I have progressed significantly... Therefore if you already have progressed further, let me know... Otherwise I will be raising a PR in 2-3 hours.

Sulochan-khadka avatar Apr 29 '24 16:04 Sulochan-khadka

Hey @Sulochan-khadka it's fine you can continue with the issue as i have not started working on it.

soumya-maheshwari avatar Apr 29 '24 16:04 soumya-maheshwari

Screenshot 2024-04-30 at 4 14 26 PM is the UI all OK ? @nihal467 ? Or should the message be displayed somewhere else? Currently it is checking for validation once the submit is clicked.

Sulochan-khadka avatar Apr 30 '24 10:04 Sulochan-khadka

it's an expected behavior, @Sulochan-khadka closing this issue, feel free to assign new issues

nihal467 avatar Apr 30 '24 11:04 nihal467

@nihal467 is this solved? And I am unable to understand the meaning of expected behaviour in this reference? Does it mean that this was not even an issue?

Sulochan-khadka avatar Apr 30 '24 12:04 Sulochan-khadka