Assiatnce: Conflicting program rules

Hi everyone,

My tracker program has three program stages AP, LTUP and RT.
image

AP and LTUP hide RT program stage if the following condition is met:

  1. If AP - DOT en la communidad data element is empty or it is false, hide RT program stage.


                                                                            OR
    
  2. If LTFU - DOT en la communidad data element is empty or it is false, hide RT program stage.


The first (1) program rule works fine, but the second program rule does not work because when I select yes in the Data Element, it does not show the RT program stage. while in 1 it shows. It is the same logic; what differs are the names of the data elements which are in two program stages

I am looking forward to any explanation about what might be wrong and what may be the solution.

Thanks

Hi!

Just use d2:hasValue(‘varname’) without #{}

Regards, Ulanbek

Hi @Ulanbek ,

Removing #{} from program variables make both program rules not working.

Thanks

!d2:hasValue(‘AP - DOT en la communidad’) || #{AP - DOT en la communidad} == false

!d2:hasValue(‘LTFU - DOT en la communidad’) || #{LTFU - DOT en la communidad} == false

Have you done this way?

Hi @hernandezmachava,
Did @Ulanbek suggestion work for you?

You can mark it as solution if it did; otherwise, let’s get more support for this? Thank you!

Hi @Ulanbek, @Gassim

That’s exactly what I have done, but both program rules are not working.

Thanks

@hernandezmachava, I did not get why you need 2 rules do the sane hide RT action?
Much easier to make 1 rule instead
(d2:hasValue(‘AP - DOT en la communidad’) || #{AP - DOT en la communidad} == false) ||
(! d2:hasValue(‘LTFU - DOT en la communidad’) || #{LTFU - DOT en la communidad} == false)

I think the problem is because you hide RT stage by 2 rules. As I understood the AP - DOT en la communidad & LTFU- DOT en la communidad could not take true value the same time.
So basically you hide with one rules and trying to unhide with the second rule. It won’t work.
So you should draw the rules on the paper and redefine the logic
Good luck

Hi @Ulanbek,

I combined the two rules, but it is still not working. What I have done is transforming the two data elements into one DOT en la comunidad and assign it to both program stages and create one program rule (! d2:hasValue(#{DOT en la communidad}) || #{DOT en la communidad} == false). By doing so, I managed to get things working.
My question is: is there any problem with assigning the same data element to different program stages?

Thanks again for your help.