Seeking assistance: Big challenges with program rules

I am finding it difficult to hide program stages based on the value selected from an attribute and a DE, so I am seeking a solution or guidance on which path I should follow to set the logic.
Below the image and description of my case:

  1. From the image, if a user selects reinforcement from the option set attribute, only A program stage should be displayed (B and C program stages must be hidden from the user)
  2. if a user selects Suivi from the option set attribute, only B program stage should be displayed (A and C program stages must be hidden from the user)
  3. if a user selects Appui from the option set attribute, only C program stage should be displayed (A and B program stages must be hidden from the user)
  4. if A_DE from A program stage is yes, open D program stage
  5. if B_DE from B program stage is yes, open E program stage
  6. if C_DE from B program stage is yes, open E program stage

I have tried to build the program rules but none of them works. What happens is although the PRs have been built, the user sees all (five) program stages no matter whether the kind of enrollment selected from the attribute is reinforcement or suivi or appui.

I will be very very grateful for your help, even possible app restructuring.

1 Like

I have similar difficulty

I have resolved this in the past. You can set up a zoom link for tomorrow Wednesday (tomorrow) 18:00GMT+1.

I will like to take you and any interested member through the process. (if this is not against the rule).

OR

Try to install DHIS2 Capture and log in to the Child Programme, I have also implemented the logic there.

Cheers.

In the Child Programme, if you did not answer yes to BCG, the next stage will not be available

Hi @adulojusm,

Your help is welcome. The IT officer who should configure my zoom account is absent today. Would you mind sharing a zoom link with for tomorrow? I am anxious for the meeting.

Thanks

Have you been able to resolve this issue? if not, let use this link::

I had a similar problem in the past, this is a mathematical problem. Try to build the algorithm first and then make the code. If you have any problems in this process I can t help you.

Hi @asacur,

It is interesting to hear hat you had a similar problem and solved it. I am having problems and I am wondering if you could give me a step by step guidance on how you did it.

Thanks

Yes share in private with me a credential for test server. I will do it for you.

Hi @asacur,

I do every test on Dhie 2 demo Sierra Leone. Would you mind configuring it on demo so that I can download the configuration? or write a description of the solution? We do not have a demo server in place.

Thanks

Hi @adulojusm.

I haven’t resolved the issue yet. We can use the link.

Thanks

Step by step example:

Step 1:

a. Create an attribute (let call it “Stage Control”)

b. Add it to your Attribute Type

c. Add it to the Program and make sure you hide it from data entry screen, ( for me I use program rules for this, if you are using andriod app, just design the DataEntry form but do not include it there.)

Step2

a. Create program variable to track the value of the “Stage Control”

b. Create another to track the value of a mandatory field in the current stage (or preceding stage).



c. Create a program rule to hide the stage until the value of the “Stage Control” is for example 1 -repeat this for all the stages you want to hide until a stage is completed. e.g create another Program Rule to hide a stage until the value of the “Stage Control” contain a particular value e.g Programe rule Expression can look like

program rule action:

Finally

Make sure the stages you want to hide did not have the Auto Greneration Box checked:

Hi @adulojusm,

Following your steps, I am unable to hide a program stage. Is V(event_status) in step C a function?

Thanks