Hi DHIS2 Community,
I’m encountering an issue with a program rule in DHIS2 that behaves inconsistently between the Web and Android versions.
Context:
I have set up a program rule to hide a specific field, namely “Gestational Age in weeks,” if the woman is not pregnant. The rule is based on the condition that the value of a certain data element (#{VIH - GROSSESSE}
) is not equal to ‘1’. The rule is as follows:
#{VIH - GROSSESSE} != '1'
Expected Behavior:
- On the Web version of DHIS2, this rule works as expected; the field is hidden when
#{VIH - GROSSESSE}
is not equal to ‘1’.
Issue:
- On the Android version, the rule does not behave as expected. Interestingly, when I try an alternative formulation of the rule:
d2:hasValue("#{VIH - GROSSESSE}") && #{VIH - GROSSESSE} != '1'
- The behavior is paradoxical: it hides the field when
#{VIH - GROSSESSE}
is equal to ‘1’ on Android, which is the opposite of what it should do, while it continues to work correctly on the Web.
Versions:
- DHIS2 Version: 2.38
- Android Version: V2.9.1 (SDK Version: 1.9.1)
Steps Taken:
- I have tried different formulations of the rule, such as reversing the logic or simplifying conditions, but the issue persists.
- I have also ensured that both the Web and Android versions are up to date.
Request for Assistance:
Has anyone else experienced similar issues with program rules behaving differently between Web and Android? Any suggestions on how to resolve this inconsistency or insights into why this might be happening would be greatly appreciated.
Thank you in advance for your help!
Best regards,