listByHealthcareParty method

Future<DecryptedPaginatedListPatientDto?> listByHealthcareParty(
  1. UserDto user,
  2. String hcPartyId,
  3. String? sortField,
  4. String? startKey,
  5. String? startDocumentId,
  6. int? limit,
  7. String? sortDirection,
  8. CryptoConfig<DecryptedPatientDto, PatientDto> config,
)

Implementation

Future<DecryptedPaginatedListPatientDto?> listByHealthcareParty(UserDto user, String hcPartyId, String? sortField, String? startKey, String? startDocumentId, int? limit, String? sortDirection,
    CryptoConfig<DecryptedPatientDto, PatientDto> config) async {

  return await (await this.rawFindPatientsByHealthcareParty(hcPartyId: hcPartyId, sortField: sortField, startKey: startKey, startDocumentId: startDocumentId, limit: limit, sortDirection: sortDirection))?.let((it) async =>
      DecryptedPaginatedListPatientDto(
          rows: await Future.wait(it.rows.map((it) => config.decryptPatient(user.dataOwnerId()!, it))),
          pageSize: it.pageSize,
          totalSize: it.totalSize,
          nextKeyPair: it.nextKeyPair)
  );
}