Program rule to limit a repeatable program stage

Dear all,
Please, I need some guidance in creating a program rule to limit the number of times a program stage is repeated or to hide program stage after it has been filled a number of times.

For example, I would like to hide a program stage after a variable (data element) in that stage has been filled 4 times in a program. How would I go about setting this rule?

Thanks in anticipation.

Best,
U’aa

1 Like

Hi U’aa,
It depends which dhis2 version you are working with, but you should be able to use the d2:count function, with a programrulevariable for the data element that has been filled 4 times.
See docs here: Home - DHIS2 Documentation
Hope this helps
Brian

1 Like

Hi Brian,

Thanks so much. I’ll give it a try now.

Regards,
U’aa