Tracked Entity Instance Query Collection Repository
Properties
Functions
Whether to allow or not cached results for online queries. Its value is 'false' by default.
Get the count of elements. Important: this is a blocking method and it should not be executed in the main thread. Consider the asynchronous version .count.
Get the list of objects in a synchronous way. Important: this is a blocking method and it should not be executed in the main thread. Consider the asynchronous version .get.
Get the list of uids of objects in scope in a synchronous way. Important: this is a blocking method and it should not be executed in the main thread. Consider the asynchronous version .getUids.
Check if selection of objects with applied filters is empty in a synchronous way. Important: this is a blocking method and it should not be executed in the main thread. Consider the asynchronous version .isEmpty.
Filter by assigned user mode.
IMPORTANT: this filter has effect if DHIS2 version is 2.32 or later. Otherwise, it is ignored.
Filter the tracked entity for those matching this filter. If this method is called several times, conditions are appended with AND connector.
Filter by enrollment status. It only applies if a program has been specified in .byProgram.
IMPORTANT: this filter accepts a list of status, but only the first one will be used for the online query because the web API does not support querying by multiple status.
Define an event date filter. It only applies if a program has been specified in .byProgram.
Filter by event status. It only applies if a program has been specified in .byProgram.
IMPORTANT: this filter requires that eventStartDate .byEventStartDate and eventEndDate .byEventEndDate are defined.
Add a "filter" to the query. If this method is called several times, conditions are appended with AND connector.
Filter by follow up status. It only applies if a program has been specified in .byProgram.
Define an incident date filter. It only applies if a program has been specified in .byProgram.
Whether to include or not deleted tracked entity instances.
IMPORTANT: currently this filter only applies to offline instances.
Define an lastUpdated date filter.
Define the organisation unit mode. See OrganisationUnitMode for more details on the modes.
Filter by tracked entity instance organisation unit.
Filter by enrollment program. Only one program can be specified.
Define an enrollment date filter. It only applies if a program has been specified in .byProgram.
Filter by event program stage. Only one program can be specified.
Apply the filters defined in a ProgramStageWorkingList. It will overwrite previous filters in case they overlap. In the same way, they could be overwritten by subsequent filters.
Filter by sync status.
IMPORTANT: using this filter forces offlineOnly mode.
Filter by trackedEntity uid
Apply the filters defined in a TrackedEntityInstanceFilter. It will overwrite previous filters in case they overlap. In the same way, they could be overwritten by subsequent filters.
Filter by TrackedEntityType. Only one type can be specified.
Get the objects in scope in an asynchronous way, returning a Single<List>
.
Uses Paging3 library and return a Flow
TrackedEntityInstances coming from local database are shown in first place. Once there are no more results, it continues with TrackedEntityInstances coming from the server. This method may speed up the initial load.
Important: Internet connection is required to use this mode.
Only TrackedEntityInstances coming from local database are shown in the list.
Get a ReadOnlyObjectRepository pointing to the first element in the list.
TrackedEntityInstances coming from the server are shown in first place. Once there are no more results online, it continues with TrackedEntityInstances in local database.
Important: Internet connection is required to use this mode.
Only TrackedEntityInstances coming from the server are shown in the list.
Important: Internet connection is required to use this mode.
Order by tracked entity instance attribute value.
Order by completion date of the most recent event. This order only applies to local results.
Order by created date. If a program is provided, it takes the created of most recent enrollment. Otherwise it takes the value of the tracked entity instance.
Order by enrollment date of most recent enrollment. This order only applies to local results.
Order by enrollment status.
Order by most recent event. It takes the event date and, if it is null, it fallbacks to due date. This order only applies to local results.
Order by incident date of most recent enrollment. This order only applies to local results.
Order by last updated date. If a program is provided, it takes the last updated of most recent enrollment. Otherwise it takes the value of the tracked entity instance.
Order by organisation unit name of the tracked entity instance.
Returns a new ReadOnlyObjectRepository whose scope is the one of the current repository plus the equal filter applied to the uid. This method is equivalent to byUid().eq(uid).one().