giveAccessTo method
Give access to another dataOwner to the patient
Parameters:
Data owner id can be either a:
- healthcarePartyId,
- patientId
- deviceId
Implementation
@override
Future<Patient> giveAccessTo(Patient patient, String delegatedTo) async {
final updatedPatient = await giveAccessToPotentiallyEncrypted(patient, delegatedTo);
if (updatedPatient is Patient) {
return updatedPatient;
}
throw StateError("Patient could not be decrypted after giveAccessTo update\nOriginal: ${patient}\nUpdated: ${updatedPatient}");
}