setHealthElementsDelegations method

Future<List<DecryptedHealthElementDto>> setHealthElementsDelegations(
  1. UserDto user,
  2. List<IcureStubDto> icureStubDtos,
  3. CryptoConfig<DecryptedHealthElementDto, HealthElementDto> config
)

Implementation

Future<List<DecryptedHealthElementDto>> setHealthElementsDelegations(UserDto user, List<IcureStubDto> icureStubDtos,
    CryptoConfig<DecryptedHealthElementDto, HealthElementDto> config) async {
  final List<HealthElementDto>? healthElements = await this.rawSetHealthElementsDelegations(icureStubDtos);
  return healthElements != null
      ? await Future.wait(healthElements.map((healthElement) => config.decryptHealthElement(user.dataOwnerId()!, healthElement)))
      : List<DecryptedHealthElementDto>.empty();
}