Program Stages Do not Hide as per my condition

I have 7 stages. Need to display them according to the completed date from the date of birth. I have implemented number of program rules to each of the stages to hide until the completed date.

this is my program rule
d2:daysBetween( A{DOB}, V{current_date} ) <=42
d2:daysBetween( A{DOB}, V{current_date} ) <=70
d2:daysBetween( A{DOB}, V{current_date} ) <=98
d2:daysBetween( A{DOB}, V{current_date} ) <=252
d2:daysBetween( A{DOB}, V{current_date} ) <=336
d2:daysBetween( A{DOB}, V{current_date} ) <=420

At first, it works well, all the program stages are hidden. The second program stage is also hidden unless 42 days are completed but what happens is third and 4th stages open at the same time, the program rule to hide 4th stage while the 3rd stage is open doesnot work and so on, 5th and 6th program stages also open at the same time.

I have attached the picture with this post



Hi @riwaj.amakomaya

I think the that you might need to customize the conditions a bit more by adding two conditions for each rule. For instance,

<=42

42 && <=70
70 && <=98
98 && <=252
252 && <=336
336 && <=420

This will restrict the rule to open apply when the condition is within a certain range that no other program stage is in. I hope this is what you actually want? Please correct me if that’s not the desired condition.

Thanks!

Hello @Gassim I tried using the expression you provided. The outcome is same. What I want is there are 7 times the doses need to be provided to the child from his/her date of birth. The first of doses after the birth, then in 6 weeks, then in 10 weeks , then in 14 weeks ,then in 9 months, then in 12 months , then in 15 months. I have applied above expression in each of the time period and hidden the remaining stages. It works when I first start, according to the date of birth when I start the Birth Stage , all of them are hidden,

But in 87 days it opens two stages which is not as per the rule


Only the third stage should had opened up. The expression for all of the conditions are same.
and before 300 days all of the stages opened that is also against the rule. Having problem in this.

Thanks