Hi Devs,

I’ve been working on some quite complex program indicators, and before I commit 
them to production, I would be very grateful if you could confirm how Yes and 
No are supposed to be handled in program indicator expressions.

I’ve noticed that within the program indicators, they currently resolve as 
Yes=1, No=0 and non-response=null.  So for example:

·         Putting the data element ‘YesNoDE’ itself into an Event Report 
displays: Yes

·         Creating an indicator containing #{YesNoDE} displays: 1

·         You can do complex indicators involving the Yes/No data element, eg 
an index calculation:
1.2345 + #{YesNoDE_A}*2.3456+#{YesNoDE_B}*0.7654.

·         You can even put these complex calculations within a d2:condition, eg 
to test thresholds:
d2:condition('1.2345 + #{YesNoDEa}*2.3456+#{YesNoDEb}*0.7654>3.1',1,0)

This is all excellent, as it enables us to do all sorts of powerful 
calculations/conditions with Yes/No responses interpreted as 1 or 0.  ☺

So my question: is this expected behaviour, and will it remain consistent in 
future versions of DHIS2?  I’ve noticed, for example, that there are some 
rendering bugs in Event Capture, where ‘No’ appears as ‘0’ etc – is there any 
chance that the handling above will be broken when those bugs are fixed, or 
will I be able to continue to rely on it?

Cheers, Sam.

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to