getPatient method
Get a Patient
Each patient is uniquely identified by a patient id. The patient id is a UUID. This patientId
is the preferred method to retrieve one specific patient.
Parameters:
- String patientId (required):
Implementation
@override
Future<Patient?> getPatient(String patientId) async => await PatientDtoMapper(await _api.basePatientApi.getPatient(
(await _api.baseUserApi.getCurrentUser() ?? (throw StateError("There is no user currently logged in. You must call this method from an authenticated MedTechApi"))),
patientId,
patientCryptoConfig(_api.crypto)))
?.toPatient()
?? (throw StateError("Could not find patient ${patientId} with current user"));