How to use program rule to hide stage using Tracked entity attribute value

Hello there, I am using dhis2 version 2.38.3.1. I was trying to hide a program stage based on value entered on tracked entity attribute. I added a program rule with the action of hiding a stage with a program rule expression of A{sex } != ‘G2’- meaning if the selected sex isn’t with the option code G1, hide the selected stage. how can I solve this?

Hi @blen , in response to your inquiry, you can use a program rule for this.
Start by creating a program rule variable, and choose “tracked entity attribute” as the source type.
Next, for your program rule, the program rule expression would be A{program_rule_variable} == ‘Female’, then in the program rule actions, select “Hide program stage”, and select the program stage to hide if the gender = female.

I have created a sample program on DHIS 2 Demo - Sierra Leone, version 2.38.4.3 called “DHIS2 Community - Test”. You can check it out


I hope our response is able to solve the issue you were facing. With :heavy_heart_exclamation: from the Dhistance Team.

DHISTANCE.com: The Easiest DHIS2 Setup. Up and running in 5 minutes! No technical knowledge needed!

Great Support with Data Security/Confidentiality.