Functions

Link copied to clipboard

Whether to allow or not cached results for online queries. Its value is 'false' by default.

Link copied to clipboard
open override fun blockingCount(): Int

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.

Link copied to clipboard

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.

Link copied to clipboard
open override fun blockingGetUids(): List<String>

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.

Link copied to clipboard
open override fun blockingIsEmpty(): Boolean

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.

Link copied to clipboard

Filter by assigned user mode.

IMPORTANT: this filter has effect if DHIS2 version is 2.32 or later. Otherwise, it is ignored.

Link copied to clipboard
fun byAttribute(attributeId: String): EqLikeItemFilterConnector<TrackedEntitySearchCollectionRepository>
Link copied to clipboard
fun byDataValue(dataElement: String): EqLikeItemFilterConnector<TrackedEntitySearchCollectionRepository>

Filter the tracked entity for those matching this filter. If this method is called several times, conditions are appended with AND connector.

Link copied to clipboard

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.

Link copied to clipboard

Define an event date filter. It only applies if a program has been specified in .byProgram.

Link copied to clipboard

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.

Link copied to clipboard
fun byFilter(attributeId: String): EqLikeItemFilterConnector<TrackedEntitySearchCollectionRepository>

Add a "filter" to the query. If this method is called several times, conditions are appended with AND connector.

Link copied to clipboard

Filter by follow up status. It only applies if a program has been specified in .byProgram.

Link copied to clipboard

Define an incident date filter. It only applies if a program has been specified in .byProgram.

Link copied to clipboard

Whether to include or not deleted tracked entity instances.

IMPORTANT: currently this filter only applies to offline instances.

Link copied to clipboard

Define an lastUpdated date filter.

Link copied to clipboard

Define the organisation unit mode. See OrganisationUnitMode for more details on the modes.

Link copied to clipboard

Filter by tracked entity instance organisation unit.

Link copied to clipboard

Filter by enrollment program. Only one program can be specified.

Link copied to clipboard

Define an enrollment date filter. It only applies if a program has been specified in .byProgram.

Link copied to clipboard

Filter by event program stage. Only one program can be specified.

Link copied to clipboard

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.

Link copied to clipboard
fun byQuery(): EqLikeItemFilterConnector<TrackedEntitySearchCollectionRepository>
Link copied to clipboard

Filter by sync status.

IMPORTANT: using this filter forces offlineOnly mode.

Link copied to clipboard

Filter by trackedEntity uid

Link copied to clipboard

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.

Link copied to clipboard

Filter by TrackedEntityType. Only one type can be specified.

Link copied to clipboard
open override fun count(): Single<Int>

Get the count of elements in an asynchronous way, returning a Single.

Link copied to clipboard
Link copied to clipboard
open override fun get(): Single<List<TrackedEntitySearchItem>>

Get the objects in scope in an asynchronous way, returning a Single<List>.

Link copied to clipboard
open override fun getPaged(pageSize: Int): LiveData<PagedList<TrackedEntitySearchItem>>

Handy method to use in conjunction with PagedListAdapter to build paged lists.

Link copied to clipboard
Link copied to clipboard
open override fun getPagingData(pageSize: Int): Flow<PagingData<TrackedEntitySearchItem>>

Uses Paging3 library and return a Flow

Link copied to clipboard
open override fun getUids(): Single<List<String>>

Get the list of uids of objects in scope in an asynchronous way, returning a Single<List<String>>.

Link copied to clipboard
open override fun isEmpty(): Single<Boolean>

Check if selection of objects in current scope with applied filters is empty in an asynchronous way, returning a Single.

Link copied to clipboard

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.

Link copied to clipboard

Only TrackedEntityInstances coming from local database are shown in the list.

Link copied to clipboard

Get a ReadOnlyObjectRepository pointing to the first element in the list.

Link copied to clipboard

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.

Link copied to clipboard

Only TrackedEntityInstances coming from the server are shown in the list.

Important: Internet connection is required to use this mode.

Link copied to clipboard

Order by tracked entity instance attribute value.

Link copied to clipboard

Order by completion date of the most recent event. This order only applies to local results.

Link copied to clipboard

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.

Link copied to clipboard

Order by enrollment date of most recent enrollment. This order only applies to local results.

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard

Order by incident date of most recent enrollment. This order only applies to local results.

Link copied to clipboard

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.

Link copied to clipboard

Order by organisation unit name of the tracked entity instance.

Link copied to clipboard

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().