← Back to team overview

dhis2-devs team mailing list archive

Re: Program rules combining several Dataelements. Not working?

 

Hi there Jose,
the example you gave should work fine.

It seems the reason that your particular espression is not evaluated to true(triggering the actions you hooked to the rule), is the middle clause of your expression:
> #{AdoptedMethod} == '[35] UID'

This evaluates to:
>  '[35] IUD' == '[35] UID' 
..which is false. Can it be only a typo in the expression or the data element value - the U and I should be switched around?

Best regards,
Markus

> 1. jun. 2016 kl. 15.17 skrev Jose Garcia Muñoz <josemp10@xxxxxxxxx>:
> 
> 
> Hi devs.
> 
> Are 'complex' program rules working? I mean by 'complex' combining different datalements. For example:
> 
> #{CurrentMethod} == '[35] IUD' && #{AdoptedMethod} == '[35] UID' && #{ServiceProvided} != '[38] IUD removal'
> 
> But when I check the value of the expresion in the JS console I get the following information:
> 
> Expression with id rule:M8qUeTSwhnF was successfully run. Original condition was: #{CurrentMethod} == '[35] IUD' && #{AdoptedMethod} == '[35] UID' && #{ServiceProvided} != '[38] IUD removal' - Evaluation ended up as:'[35] IUD' == '[35] IUD' && '[35] IUD' == '[35] UID' && '[42] MA' != '[38] IUD removal' - Result of evaluation was:false
> 
> The result should be true, right? Am I doing something wrong?
> 
> Regards
> Jose
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp



Follow ups

References