PR to assign value to a tracked entity and data element not working in Android

Bonjour Natalie,

I think I have found your issue. The logic of some Program Rules is not correct… the funny thing is that some are OK and some are wrong so in some cases you could have got a proper calculated value.

For example, I am checking and your assignation of values to a PRV for “plaie in mouth” is correct:
PR er_assign_plaie-0-non
image
PR er_assign_plaie-3-oui
image

However, if I go to another one, for example for the bouton
PR er_assign_bouton-0-non
image
PR er_assign_bouton-5-oui
image

As you can see, the logic to calculate the 0 when “NO” is selected is not valid. You should have used the OR operator (II) and not the AND (&&) . As your expression now is something like “If the ER_button Data Element has no value AND it is choosen the option NO” assign a zero. Which will never happen.

I believe that if you fix those program rules you will get the proper result.

A tip, you can probably use the following API call to quickly identify your Program Rules that might be wrong:

https://example.com/api/programRules?fields=displayName,condition&filter=condition:like:&&filter=condition:like:!

The %26 is the URL translation of && and the %21 is the URL translation of !. So basically you will retrieve all those Program Rules which contain the && and the ! .

Hope it helps!

2 Likes