findByHCPartyAndPatient method
Future<List<DecryptedDocumentDto> >
findByHCPartyAndPatient(
- UserDto user,
- String hcpId,
- DecryptedPatientDto patient,
- CryptoConfig<
DecryptedDocumentDto, DocumentDto> config,
Implementation
Future<List<DecryptedDocumentDto>> findByHCPartyAndPatient(UserDto user, String hcpId, DecryptedPatientDto patient, CryptoConfig<DecryptedDocumentDto, DocumentDto> config) async {
var keys = await config.crypto.decryptEncryptionKeys(user.dataOwnerId()!, patient.delegations);
if (keys.isEmpty) {
throw FormatException("No delegations for user");
}
return this.findByHCPartyAndPatientForeignKeys(user, hcpId, keys.join(","), config);
}