← Back to team overview

dhis2-devs team mailing list archive

Re: Querying Events API for a data value

 

Thanks Abyot! Only had to add ouMode=DESCENDANTS to search all OUs.

On Thu, Apr 19, 2018 at 11:08 AM, Abyot Asalefew Gizaw <abyot@xxxxxxxxx>
wrote:

> Hi,
>
> See below
>
>
>
>
> The end point is
>
> https://play.dhis2.org/2.29/api/28/events/query.json?orgUnit
> =DiszpKrYNg8&programStage=Zj7UnCAulEk&filter=qrur9Dvnyt5:GT:11:LT:13
>
> or
>
> https://play.dhis2.org/2.29/api/28/events/query.json?orgUnit
> =DiszpKrYNg8&programStage=Zj7UnCAulEk&filter=qrur9Dvnyt5:EQ:12
>
> This works only from api/events/query endpoint. It is also mandatory to
> specify program stage.
>
> --
> Abyot A. Gizaw.
> Senior Engineer, DHIS2
> University of Oslo
> http://www.dhis2.org
>
> On Thu, Apr 19, 2018 at 10:58 AM, David Huser <dhuser@xxxxxxxxxxxxxx>
> wrote:
>
>> Hi,
>>
>> Is there a way to filter the Event API for a data value (to only return
>> events where it matches to the value)?
>>
>> What I tried:
>>
>>    - Variations of this (undocumented) call but get events back where
>>    the value != 12  -- https://play.dhis2.org/2.29/ap
>>    i/events.json?program=q04UBOqq3rp&filter=lsJCUffec9h:eq:12
>>    <https://play.dhis2.org/2.29/api/events.json?program=q04UBOqq3rp&filter=lsJCUffec9h:eq:12>
>>
>>    - /api/analytics/events/query/programUID.json?dimension=... works but
>>    this has two shortcomings: Analytics need to be run and dimension/period
>>    restrictions where I need the response instantly, across all periods.
>>
>> Happy to create a JIRA issue if requested.
>>
>> Best,
>> David
>>
>


-- 


*David Huser*
DHIS2 Support Specialist
dhuser@xxxxxxxxxxxxxx | https://baosystems.com |  2900 K Street, Suite 507,
Washington D.C. 20007

PNG image


References