listHealthElementsByHCPartyAndPatient method
Future<List<DecryptedHealthElementDto> >
listHealthElementsByHCPartyAndPatient(
- UserDto user,
- String hcPartyId,
- PatientDto patient,
- CryptoConfig<
DecryptedHealthElementDto, HealthElementDto> config,
Implementation
Future<List<DecryptedHealthElementDto>> listHealthElementsByHCPartyAndPatient(UserDto user, String hcPartyId, PatientDto patient,
CryptoConfig<DecryptedHealthElementDto, HealthElementDto> config) async {
final Set<String> keys = await config.crypto.decryptEncryptionKeys(user.dataOwnerId()!, patient.delegations);
if (keys.isEmpty) {
throw Exception("No delegation for this user");
}
return await listHealthElementsByHCPartyAndPatientForeignKeys(user, hcPartyId, keys.join(","), config);
}