getDataOwner method
Implementation
Future<DataOwnerDto?> getDataOwner(String dataOwnerId) async {
return Future.wait([
_getHcpDataOwner(dataOwnerId),
_getPatientDataOwner(dataOwnerId),
_getDeviceDataOwner(dataOwnerId)
]).then((foundDataOwners) {
final validDataOwners = foundDataOwners.where((dataOwner) => dataOwner != null);
if (validDataOwners.length > 1) {
throw FormatException("$dataOwnerId corresponds to multiple data owners");
}
return validDataOwners.firstOrNull;
});
}