OEModule\OphCiExamination\models\Element_OphCiExamination_NearVisualAcuity::getLetter_string PHP Method

getLetter_string() public method

returns the default letter string for the va readings. Converts all readings to Snellen Metre as this is assumed to be the standard for correspondence.
public getLetter_string ( ) : string
return string
    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";
    }