modifyPatient method

Implementation

Future<DecryptedPatientDto?> modifyPatient(
    UserDto user, DecryptedPatientDto patientDto, CryptoConfig<DecryptedPatientDto, PatientDto> config) async {
  final PatientDto encryptedPatient = await config.encryptPatient(
      user.dataOwnerId()!,
      <String>{...(user.autoDelegations["all"] ?? {}), ...(user.autoDelegations["medicalInformation"] ?? {})},
      patientDto.initPatient());
  var modifiedPatient = await this.rawModifyPatient(encryptedPatient);
  return modifiedPatient != null ? await config.decryptPatient(user.dataOwnerId()!, modifiedPatient) : null;
}