TrackedEntityAttributeReservedValueManager

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun blockingCount(attributeUid: String, organisationUnitUid: String?): Int
Link copied to clipboard
fun blockingDownloadAllReservedValues(numberOfValuesToFillUp: Int?)
Link copied to clipboard
fun blockingDownloadReservedValues(attributeUid: String, numberOfValuesToFillUp: Int?)
Link copied to clipboard
fun blockingGetValue(attributeUid: String, organisationUnitUid: String): String
Link copied to clipboard
fun count(attributeUid: String, organisationUnitUid: String?): Single<Int>

Get the count of the reserved values by attribute. If a organisation unit uid is inserted as parameter the method will return the count of the reserved values by attribute and organisation unit.

Link copied to clipboard
fun downloadAllReservedValues(numberOfValuesToFillUp: Int?): Observable<D2Progress>

Downloads reserved values for all the trackedEntityAttributeValues of type "generated", that is, it applies .downloadReservedValues for every generated attribute.

Link copied to clipboard
fun downloadReservedValues(attributeUid: String, numberOfValuesToFillUp: Int?): Observable<D2Progress>

Download of TrackedEntityInstance reserved values. The number of reserved values is filled up to the numberOfValuesToFillUp. If not defined, it defaults to .FILL_UP_TO.



The download is only triggered for this attribute passed as parameter.



If the attribute pattern is dependent on OrganisationUnit code (that is, it contains "ORG_UNIT_CODE"), it reserves values for each orgUnit assigned to the programs with this attribute. It applies the limit per orgUnit. Otherwise the limit is applied per attribute.

Link copied to clipboard

Generate a list of reserved value summaries from the existing tracked entity attribute reserved values in the DB.

Link copied to clipboard
fun getValue(attributeUid: String, organisationUnitUid: String): Single<String>

Get a reserved value and remove it from database. If the number of available values is below a threshold (default .FILL_UP_TO * .FACTOR_TO_REFILL) it tries to download before returning a value.