listHealthElementsByHCPartyAndPatientForeignKeys method
Future<List<DecryptedHealthElementDto> >
listHealthElementsByHCPartyAndPatientForeignKeys(
- UserDto user,
- String hcPartyId,
- String secretFKeys,
- CryptoConfig<
DecryptedHealthElementDto, HealthElementDto> config,
Implementation
Future<List<DecryptedHealthElementDto>> listHealthElementsByHCPartyAndPatientForeignKeys(UserDto user, String hcPartyId, String secretFKeys,
CryptoConfig<DecryptedHealthElementDto, HealthElementDto> config) async {
final List<HealthElementDto>? healthElements = await this.rawListHealthElementsByHCPartyAndPatientForeignKeys(hcPartyId, secretFKeys);
if (healthElements == null || healthElements.isEmpty) {
throw Exception("No delegation for this user");
}
return await Future.wait(healthElements.map((healthElement) => config.decryptHealthElement(user.dataOwnerId()!, healthElement)));
}