filterPatients method
Load patients from the database by filtering them using the provided filter
.
Filters are complex selectors that are built by combining basic building blocks. Examples of filters available for Patient are AllPatientsFilter and PatientsByIdsFilter. This method returns a paginated list of patient (with a cursor that lets you query the following items).
Parameters:
Implementation
@override
Future<PaginatedListPatient?> filterPatients(Filter<Patient> filter, {String? nextPatientId, int? limit, String? startKey}) async {
final localCrypto = _api.crypto;
final currentUser = (await _api.baseUserApi.getCurrentUser())
?? (throw StateError("There is no user currently logged in. You must call this method from an authenticated MedTechApi"));
final ccPatient = patientCryptoConfig(localCrypto);
return (await base_api.PatientApiCrypto(_api.basePatientApi).filterPatientsBy(
currentUser, base_api.FilterChain<base_api.PatientDto>(filter.toAbstractFilterDto()), startKey, nextPatientId, limit, ccPatient))
?.toPaginatedListPatient();
}