filterHealthElements method
Future<DecryptedPaginatedListHealthElementDto>
filterHealthElements(
- UserDto user,
- FilterChain<
HealthElementDto> filterChainHealthElement, - CryptoConfig<
DecryptedHealthElementDto, HealthElementDto> config, - String? startDocumentId,
- int? limit,
Implementation
Future<DecryptedPaginatedListHealthElementDto> filterHealthElements(UserDto user, FilterChain<HealthElementDto> filterChainHealthElement,
CryptoConfig<DecryptedHealthElementDto, HealthElementDto> config, String? startDocumentId, int? limit) async {
final PaginatedListHealthElementDto? paginatedListHealthElement =
await this.rawFilterHealthElementsBy(filterChainHealthElement, startDocumentId: startDocumentId, limit: limit);
if (paginatedListHealthElement == null) {
throw Exception("Couldn't get the paginatedList");
}
final List<DecryptedHealthElementDto> rows =
await Future.wait(paginatedListHealthElement.rows.map((e) => config.decryptHealthElement(user.dataOwnerId()!, e)));
return DecryptedPaginatedListHealthElementDto(
pageSize: paginatedListHealthElement.pageSize,
totalSize: paginatedListHealthElement.totalSize,
rows: rows,
nextKeyPair: paginatedListHealthElement.nextKeyPair);
}