← Back to team overview

dhis2-devs team mailing list archive

Missing orderby clause in TrackedEntityInstance Ids query


Hi DHIS team,

We are hitting the below API to fetch TrackedEntityInstance(TEI) Ids


The above API call will give first 1000 TEI ids because the call is
paginated with pagesize=1000. Like that we are making calls for other pages
to fetch all the TEI Ids.

DHIS is using the below query to get the TEI ids

select distinct tei from TrackedEntityInstance tei left join
tei.trackedEntityAttributeValues where (  tei.organisationUnit.path LIKE
'/a2cf79e8g34/a1c343a3w24%') and  tei.deleted is false;

In this query we couldn't find any order by clause. Is there any chance
that few of the TEI ids which are returned in some page are going to be
repeated in another page also.
Is this query going to be executed every time for each paginated API call?

Rajeswari Gottipati
Sr Consultant
Email rajeswag@xxxxxxxxxxxxxxxx
Telephone +91 9949292931 <+91%209949292931>
[image: ThoughtWorks]

Follow ups