Issue with hide field program rules in Android 2.4.2

I am having a problem with hide field program rule in Android. I’m using Android Capture 2.4.2 and DHIS2 2.34.6. I tested the rule in the web and the older DHIS2 capture version which is 2.3.2 and it works well. The rule is

Condition: #{took_medicine} != true (the person did not take a medicine)
Action: Hide field: “date medicine taken”
Action: Show Warning: “Please take your medicine”

#{took_medicine} is a Yes Only field.

The warning shows and hides correctly in the capture 2.4.2 however the hide field always shows regardless of the response. What could be the problem?


Hi @Pomi_Daniel ,

I have performed a test on 2.4.2 with the same program rules and actions you mentioned here and I did not experience the same problem. Might be the case that you have another program rule that is causing the misbehavior?

1 Like

Hi @jaime.bosque,

Thank you for your feedback. I rechecked all the program rules and everything looks fine. I retested the program rules on version 2.3.x and everything works well. I only notice this problem on 2.4.x. I also tried to see the log and it says

17321 21620 W RuleEngineExecution: Condition#{took_medicine} != true not executed: Variable took_medicine not present

However the variable is already there in the program rule variables list. Why do I see this behavior in 2.4.x and not in 2.3.x?

Thank you,

Is the PRV took_medicine maybe being hidden by another program rule?