findByHCPartyPatient method
Future<List<DecryptedContactDto> >
findByHCPartyPatient(
- UserDto user,
- String hcPartyId,
- PatientDto patient,
- String? planOfActionsIds,
- bool? skipClosedContacts,
- CryptoConfig<
DecryptedContactDto, ContactDto> config,
Implementation
Future<List<DecryptedContactDto>> findByHCPartyPatient(UserDto user, String hcPartyId, PatientDto patient, String? planOfActionsIds,
bool? skipClosedContacts, CryptoConfig<DecryptedContactDto, ContactDto> config) async {
var keys = await config.crypto.decryptEncryptionKeys(user.dataOwnerId()!, patient.delegations);
if (keys.isEmpty) {
throw FormatException("No delegation for user");
}
return Future.wait((await this.rawListContactsByHCPartyAndPatientSecretFKeys(hcPartyId, keys.join(","),
planOfActionsIds: planOfActionsIds, skipClosedContacts: skipClosedContacts))!
.map((it) => config.decryptContact(user.dataOwnerId()!, it)));
}