getPatientAndTryDecrypt method

  1. @override
Future<PotentiallyEncryptedPatient?> getPatientAndTryDecrypt(
  1. String patientId
)
override

Gets a patient and tries to decrypt its content. If it is not possible to decrypt the content only the unencrypted data will be available. This method is useful to allow new patient users to access some of their own data before their doctor actually gave them access to their own data: instead of giving an error if the data can't be decrypted (like what happens in getPatient) you will be able to get at least partial information.

Implementation

@override
Future<PotentiallyEncryptedPatient?> getPatientAndTryDecrypt(String patientId) async {
  final patient = await _api.basePatientApi.rawGetPatient(patientId);
  if (patient == null) return null;
  return await _tryDecrypt(patient);
}