public function getLetter_string()
{
if (!($unit = OphCiExamination_VisualAcuityUnit::model()->find('name = ?', array(Yii::app()->params['ophciexamination_visualacuity_correspondence_unit'])))) {
throw new Exception('Configured visual acuity correspondence unit was not found: ' . Yii::app()->params['ophciexamination_visualacuity_correspondence_unit']);
}
$text = "Near Visual acuity:\n";
if ($this->hasRight()) {
$text .= 'Right Eye: ';
if ($this->getCombined('right')) {
$text .= $this->getCombined('right', $unit->id);
} else {
$text .= $this->getTextForSide('right');
}
} else {
$text .= 'Right Eye: not recorded';
}
$text .= "\n";
if ($this->hasLeft()) {
$text .= 'Left Eye: ';
if ($this->getCombined('left')) {
$text .= $this->getCombined('left', $unit->id);
} else {
$text .= $this->getTextForSide('left');
}
} else {
$text .= 'Left Eye: not recorded';
}
return $text . "\n";
}