Program rule to limit a repeatable program stage

tracker
(U'aa Philips) #1

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
(Brian O'Donnell) #2

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: https://docs.dhis2.org/master/en/user/html/dhis2_user_manual_en_full.html#program_rules_operators_functions
Hope this helps
Brian

1 Like
(U'aa Philips) #3

Hi Brian,

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

Regards,
U’aa