OEModule\OphCoCvi\components\OphCoCvi_API::renderAlertForVA PHP Method

renderAlertForVA() public method

public renderAlertForVA ( Patient $patient, $element, $show_create = false ) : mixed
$patient Patient
$element
$show_create - flag to indicate whether the create button should be shown
return mixed
    public function renderAlertForVA(Patient $patient, $element, $show_create = false)
    {
        if (!$element->cvi_alert_dismissed && !$this->hasCVI($patient)) {
            $base_values = array();
            foreach (array_merge($element->right_readings, $element->left_readings) as $reading) {
                $base_values[] = $reading->value;
            }
            return $this->renderPartial('OphCoCvi.views.patient._va_alert', array('threshold' => $this->yii->params['thresholds']['visualAcuity']['alert_base_value'], 'visible' => $this->isVaBelowThreshold($base_values), 'show_create' => $show_create));
        }
        return '';
    }