public function getIOPValuesAsTable($patient)
{
if ($episode = $patient->getEpisodeForCurrentSubspecialty()) {
if ($iop = $this->getElementForLatestEventInEpisode($episode, 'models\\Element_OphCiExamination_IntraocularPressure')) {
$iopVals = $iop->getValues();
$i = 0;
$output = '<table>';
while (isset($iopVals['right'][$i]) || isset($iopVals['left'][$i])) {
if ($i === 0) {
$lCCT = $this->getCCTLeftNoUnits($patient);
$rCCT = $this->getCCTRightNoUnits($patient);
$output .= '<tr><th class="large-6">RE [' . $rCCT . ']</th><th class="large-6">LE [' . $lCCT . ']</th></tr>';
}
$output .= '<tr>';
if (isset($iopVals['right'][$i])) {
$right = $iopVals['right'][$i];
$instr = isset($right->instrument->short_name) && strlen($right->instrument->short_name) > 0 ? $right->instrument->short_name : $right->instrument->name;
$readingNameRight = $right->instrument->scale ? $right->qualitative_reading->name : $right->reading->name;
$output .= '<td>' . $readingNameRight . ':' . $instr . '</td>';
} else {
$output .= '<td> </td>';
}
if (isset($iopVals['left'][$i])) {
$left = $iopVals['left'][$i];
$instr = isset($left->instrument->short_name) && strlen($left->instrument->short_name) > 0 ? $left->instrument->short_name : $left->instrument->name;
$readingNameLeft = $left->instrument->scale ? $left->qualitative_reading->name : $left->reading->name;
$output .= '<td>' . $readingNameLeft . ':' . $instr . '</td>';
} else {
$output .= '<td> </td>';
}
$output .= '</tr>';
++$i;
}
$output .= '</table>';
return $output;
}
}
return '';
}