[ LMIS Usecase ] Updating tracker attribute not working using program rule with DE values of stage

Hello community leaders,

Do we have any known issues in assign action in program rules for updating tracker attributes with data element values from stage? This is for an LMIS usecase

Requirement: We will receive medicine stock from donors and will enrol the details in tracker. There is one enrolment tracker attribute called Remaining Quantity. During initial enrolment it will be same as Total Quantity.

After enrolment, for each event in distribution stage Remaining Quantity tracker attribute needs to get updated like
Total Quantity - Distributed Qty

Rule is getting evaluated, but tracker attribute not getting updated, any suggestions would be extremely helpful

Rule action screenshot for more details

Hi @Scott probably you can guide him on this?

Hello @Karoline Shall i request your help on this? Can this be a bug? or i’m using it wrongly?

Hi @jthomas this looks correct to me. What version are you using? Can you reproduce the issue on play.dhis2.org?

Tagging the tracker team if they can help more - @YuryR @Enzo and @Markus

1 Like

Hello @Scott @YuryR @Enzo @Markus

Dhis2 version is 2.35.1

I was able to reproduce this in play.dhis2.org. May be tonight it gets overwritten?


Hi @jpatrick !

I can confirm that the value does not get assigned to the attribute as a result of the programRuleAction in your Program Rule.

However, I cannot confirm that it is impossible to assign values to attributes.

I have tested by creating a simple PR (it is still in play):


It is set up to always assign a value to the attribute and the value is assigned, but only when the program stage is not specified in the program rule.
If the program Stage is specified, the value does not get assigned to the attribute.

This leads me to a conclusion that the assignment of a value to an attribute can only happen during enrollment.

Hello @YuryR

Thanks for helping me on this. Yes during enrollment it worked for me too.

So is it a feature limitation or design that we cannot update attribute values during stages?

How can i confirm this. If it’s a limitation what could be the best alternate workaround to make it happen.

I would like to seek your kind advice

That’s strange, Should we raise a JIRA if it’s a bug @YuryR It looks to be a nice to have feature in LMIS

So at the moment, you cannot change or assign TEA data values with program rules when you enter data in program stages.

Here is some further information on that:

“The problem with this is that the assignments to tracked entity attributes will be triggered when you are in the registration form, or if you open the edit profile widget - but generally not when you enter data in program stages.”

I have talked to the devs and since this is a feature, not a bug, I have created the following issue: https://jira.dhis2.org/browse/DHIS2-11025 - follow that issue for updates.

1 Like