dhis2-users team mailing list archive
-
dhis2-users team
-
Mailing list archive
-
Message #13035
Re: [Dhis2-devs] Aggregating events based on last value of the data element
Dear Pamod,
to put it simply - if you use October 2016 as reporting date and display this enrollment program indicator, the pivot will be populated only with the data for the children enrolled in October 2016. The child enrolled in October will not show up un the numbers for November. If you want to make a report of all currently positive children, you would have to define a long enough reporting period to capture all enrollment dates, and filter out anyone not positive.
As a reminder there is a planned improvement to allow other dates to be the basis of aggregation: DHIS2-1398 <https://jira.dhis2.org/browse/DHIS2-1398>
Curious to hear how this covers your use case.
Markus
> 10. apr. 2017 kl. 13.37 skrev Pamod Amarakoon <pamodm@xxxxxxxxx>:
>
> Dear Marcus,
>
> Want to clarify something.
>
> Suppose for example Child A has been marked positive for a disease in October 2016 and he has not turned up for further clinic followups. If we configure the program indicator the way you mentioned and select period dimension as last 12 months from pivot table and consider the output, we are interested in obtaining the cross sectional view of number of affected children at a given time.
>
> Will the child A only be calculated for the month of October 2016 or will he be counted on subsequent months as well. (In the output we are expecting to see the prevalence of the disease per month).
>
> Thank you
>
> On Mon, Apr 10, 2017 at 2:47 PM, Markus Bekken <markus@xxxxxxxxx <mailto:markus@xxxxxxxxx>> wrote:
> Hi there Chathura,
>
> it seems that the query you want to make below can be achieved with enrollment program indicators. Assuming the program is built as a multiple event with registration, and the DE1 is part of a repeating program stage, the inherent properties of enrollment program indicators covers much of what you want. Each child will be counted only once, and only the latest value of D1 will be considered for each child.
>
> Can you for example try making a program indicator with analytics type "Enrollment", aggregation type "Sum" and the expression being the value of DE1? Then you can use pivot or the API to query and see if the results match your expectation.
>
> Markus
>
>> 1. apr. 2017 kl. 10.58 skrev chathura widanage <chathurawidanage@xxxxxxxxx <mailto:chathurawidanage@xxxxxxxxx>>:
>>
>> Hi,
>>
>> We are currently using DHIS2 to track nutrition problems of children under 5 years.
>>
>> Assume we have only two children in the database and DE1 be a certain condition that we monitor continuously,
>>
>> child 1 -> [event 1, DE1=1, time=t1] [event 2 - DE1=1,time=t2] [event 3 - DE1=0,time=t3]
>> child 2 -> [event 1, DE1=0, time=t1] [event 2 - DE1=0,time=t2] [event 3 - DE1=0,time=t3]
>>
>> Now if I call "events/aggregate/<psi>?dimension=DE1:EQ:1&startDate=T1&endDate=T2&dimension=ou:<ouid>", is there a parameter that we can set in the query to consider only the last value of the data element in the chosen event series.
>>
>> eg :
>>
>> case
>> T1
>> T2
>> Result
>> Expected result
>> 1
>> t1
>> t1+delta
>> 1
>> 1
>> 2
>> t1
>> t2+delta
>> 2
>> 1
>> 3
>> t1
>> t3+delta
>> 2
>> 0
>> 4
>> t2
>> t3+delta
>> 1
>> 0
>>
>> case 1 : child 1 has the condition (because DE1=1), hence result =1
>> case 2 : child 1 still has the condition, but we want to consider him only once.
>> case 3 : child 1 has got rid of the condition, so we don't want to consider him for the results
>>
>> Why we need this : we want to analyze the state of org unit during a specific period of time and draw a trend chart to determine whether measures taken to improve child health has actually worked or not.
>>
>> <image.png>
>> And also we need to compare the identified risk factors graphically, so we know which area should get the highest focus or attention.
>>
>> <image.png>
>>
>> Please let us know whether above results can be achieved using API version 2.26.
>> Currently we are using SQL Views (2 SQL views + 1 Query) to generate above results, but that is extremely inefficient and expensive.
>>
>> Thanks
>>
>>
>>
>> --
>> Best Regards,
>>
>> Chathura Widanage,
>> Undergraduate,
>> Department of Computer Science and Engineering,
>> University of Moratuwa,
>> Sri Lanka
>> <https://www.linkedin.com/profile/public-profile-settings?trk=prof-edit-edit-public_profile> <http://facebook.com/chathura.widanage> <https://plus.google.com/u/0/109418781686423002025> <https://github.com/chathurawidanage>_______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
>> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx <mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>
>> Unsubscribe : https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
>> More help : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx <mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~dhis2-devs <https://launchpad.net/~dhis2-devs>
> More help : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
>
>
>
>
> --
> Regards,
> Dr. Pamod Amarakoon
> MBBS (SL)
> MSc (Biomedical Informatics), EMSc (Health Admin)
> Medical Officer in Health Informatics
> Nutrition Coordination Division
> Ministry of Health, Nutrition and Indigenous Medicine,
> Sri Lanka
>
> Confidentiality Notice: the information contained in this email and any attachments may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution, or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachments for any purpose, nor disclose all or any part of the contents to any other person.
>
>
>
Follow ups
References