modifyHealthElement method

Implementation

Future<DecryptedHealthElementDto?> modifyHealthElement(UserDto user, DecryptedHealthElementDto healthElementDto,
    CryptoConfig<DecryptedHealthElementDto, HealthElementDto> config) async {
  final HealthElementDto encryptedHealthElement = await config.encryptHealthElement(user.dataOwnerId()!,
      <String>{...(user.autoDelegations["all"] ?? {}), ...(user.autoDelegations["medicalInformation"] ?? {})}, healthElementDto);
  var modifiedHealthElement = await this.rawModifyHealthElement(encryptedHealthElement);
  return modifiedHealthElement != null ? await config.decryptHealthElement(user.dataOwnerId()!, modifiedHealthElement) : null;
}