giveAccessTo method

  1. @override
Future<Patient> giveAccessTo(
  1. Patient patient,
  2. String delegatedTo
)
override

Give access to another dataOwner to the patient

Parameters:

  • Patient patient to giveAccessTo delegateTo
  • String delegatedTo: dataOwnerId to giveAccessTo

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}");
}