Program rule odd behaviour

Hi everyone

I’m having an odd behaviour with a Program Rule
The Data Element in question (lets call it Side Effect) is of Value type Yes/No
I wanted to only show another data element when Side Effect has Yes clicked
But for some reason it is not working.
I changed the program rule to print the current value of Side Effect not either Yes or No is clicked, and I got this result

For some reason it is by default evaluating to true like it has a value on the database
For similar situation on similar fields the things works well for similar program rules, but for this particular one something odd seems to be happening

Here is the expression and actions of the program rule

I’m using dhis2 2.39.7
Best regards

Does it work if you use this instead?

d2:hasValue(#{side_effects_postoperative_management_30_min}) && #{side_effects_postoperative_management_30_min}

That said, I agree that the Yes/No field should in any case not return true when no option is selected.

1 Like