← Back to team overview

dhis2-devs team mailing list archive

Re: [Dhis2-users] HELP with program indicator/report

 

Hey again Georgi,
this seems like a bug with the d2:hasValue function. Using enrollment analytics, the intended outcome for d2:hasValue(#{programStageWithNoEvents.dataelement}) is false. Just making sure your program indcator was an enrollment program indicator - could you register this as a bug?

Markus

> 28. aug. 2017 kl. 12.01 skrev Georgi Chakarov <georgi@xxxxxxxxxxxxxxxxxxx>:
> 
> Hi Markus,
>  
> Thanks a lot for putting thoughts into this! I also did.
>  
> I do have a pivotal data element, but regardless of the expression it wouldn’t work. This is because DHIS2 cannot evaluate a data element from an event that hasn’t been created. 
> Let’s assume that my entity is at second stage. This means that I have created events for the first and the second stage (the third stage will have event only when the entity passes at the third stage). 
> In this case the filter would be:
> d2:hasValue(#{stage1.dataelement}) && d2:hasValue(#{stage2.dataelement}) && !d2:hasValue(#{stage3.dataelement}) && !d2:hasValue(#{stage4.dataelement})
>  
> I have tested this, but DHIS2 fails to produce a result because stage 3 and 4 do not have events yet, thus the indicator cannot assess whether the pivotal data element in these stages has value or not.
> Is this making sense?
>  
> So, I decided to play with tracked entity attribute values in the profile of my entity.
> Markus, can I assign values to a tracked entity (with an option set), based on a data element value in a current stage?
>  
> Regards,
>  
> Georgi
>  
>  
> From: Markus Bekken [mailto:markus@xxxxxxxxx] 
> Sent: Monday, August 28, 2017 11:30 AM
> To: Georgi Chakarov <georgi@xxxxxxxxxxxxxxxxxxx>
> Cc: DHIS Users <dhis2-users@xxxxxxxxxxxxxxxxxxx>; DHIS 2 Developers list <dhis2-devs@xxxxxxxxxxxxxxxxxxx>
> Subject: Re: [Dhis2-users] HELP with program indicator/report
>  
> Hi there Georgi,
> We do not have a function that does exactly what you asked for, but hopefully we can find a way if we examine the data elements in your stages. Do the stages have a data element that is mandatory, or at least so pivotal that you can sue that data element to determine wether the event should be counted? If so I'd recommend looking at a program indicator with the analytics type enrollment. With this strategy you can make four program indicators that fullfills the explicit requirement for 1, 2, 3 and 4 stages:
> Just first stage:
> d2:hasValue(#{stage1.dataelement}) && !d2:hasValue(#{stage2.dataelement}) && !d2:hasValue(#{stage3.dataelement}) && !d2:hasValue(#{stage4.dataelement})
> Just first and second stage:
> d2:hasValue(#{stage1.dataelement}) && d2:hasValue(#{stage2.dataelement}) && !d2:hasValue(#{stage3.dataelement}) && !d2:hasValue(#{stage4.dataelement})
> ..and so on.
>  
> With the above strategy you would find every tracked entity that has followed the expected sequence of events. If you have any requirements for how to count the possible cases that deviates the normal(just stage 1 and 3 for example), the expressions might look different.
>  
> If there is no data element that you can use to proxy the presence of events, you will need a new function for checking events regardless of data. In that case, please report this as a Jira issue.
>  
> Markus
>  
> 25. aug. 2017 kl. 12.11 skrev Georgi Chakarov <georgi@xxxxxxxxxxxxxxxxxxx <mailto:georgi@xxxxxxxxxxxxxxxxxxx>>:
>  
> Hello all,
>  
> I have a tracker program with 4 consecutive non-repeatable stages. Each new stage is created after completion of the previous stage.
> I am trying to create a report/program indicator that counts the tracked entities at their latest stage. In other words, I want to know how many tracked entities I have at each stage without double counting.
>  
> For example, I have 10 tracked entities each of them starting at stage I. 2 tracked entities progressed at stage II , 2 progressed at stage III and two progressed at stage IV.
> My report should show (program indicator should calculate) that 4 tracked entities are still at stage I, 2 are in stage II, 2 are in stage III and 2 are in stage IV.
>  
> Do you have any idea how to build this one?
>  
> Georgi
>  
>   
> Georgi Chakarov, CIA | georgi@xxxxxxxxxxxxxxxxxxx <mailto:georgi@xxxxxxxxxxxxxxxxxxx> | +1-647-478-5634 x 104 | LogicalOutcomes c/o Centre for Social Innovation, 720 Bathurst Street, Toronto Canada M5S 2R4 | You may unsubscribe from receiving commercial electronic messages from LogicalOutcomes by emailing info@xxxxxxxxxxxxxxxxxxx <mailto:info@xxxxxxxxxxxxxxxxxxx>
>  
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users <https://launchpad.net/~dhis2-users>
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx <mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~dhis2-users <https://launchpad.net/~dhis2-users>
> More help   : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>

References