Get program rules to work on the DHIS2 Capture app

Good day Everyone,

I have a tracker program that has a program rule that adds up a couple of data elements and returns a total.
This works fine on the web version but on the Andriod Capture application it doesn’t work can you please advise me on this?

Hello @Mr_jorge

Have you read the following doc to find out if your rule is supported on android ?

Do not hesitate to share your rule too.

Regards

2 Likes

It’s a program rule that “Assigns Value” to a specific data element by adding other data elements in the current event.

Hi @Mr_jorge

I suggest to change the condition (step 2) to one of the following options:

  1. If you are expecting for the 3 data elements to have value:

d2:hasValue(#{MT Transport}) && d2:hasValue(#{MT Per Diem}) && d2:hasValue(#{MT Airtime})

You can also use OR if you are expecting for at least 1 data element to have value.

  1. (#{MT Transport} +#{MT Per Diem} +#{MT Airtime}) >= 0

The idea is that the condition can be evaluated and return a true/false response in order to activate the action.

Let us know if this helps.

4 Likes

Thank you so much, Nancy. I applied the 2nd recommendation (#MT Transport +#MT Per Diem +#MT Airtime) >= 0 and the Android Capture application now responds to the Program Rule appropriately.