protected function generateStructuredPatientFactors()
{
$data = array();
foreach (OphCoCvi_ClericalInfo_PatientFactor::model()->active()->findAll() as $factor) {
$answer = $this->getPatientFactorAnswer($factor);
if (!$answer || $answer->is_factor == 2) {
$isFactor = '';
} elseif ($answer->is_factor == 1) {
$isFactor = 'Y';
} elseif ($answer->is_factor == 0) {
$isFactor = 'N';
}
$comments = $answer ? $answer->comments : '';
$label = $factor->name;
if ($factor->require_comments) {
$label .= "\n{$factor->comments_label}: {$comments}";
}
$data[] = array($label, $isFactor);
}
return $data;
}