<div class="detailRow leftAlign"> <div class="label"> Operation(s) Performed: </div> <div class="value pronounced"> <?php $operations_perf = Element_OphTrOperationnote_ProcedureList::model()->find('event_id = ?', array($this->event->id)); foreach ($operations_perf->procedures as $procedure) { echo "<strong>{$operations_perf->eye->name} {$procedure->term}</strong><br>"; } ?> </div> </div> <div class="surgeonList"> <?php $surgeon_element = Element_OphTrOperationnote_Surgeon::model()->find('event_id = ?', array($this->event->id)); $surgeon_name = ($surgeon = User::model()->findByPk($surgeon_element->surgeon_id)) ? $surgeon->getFullNameAndTitle() : 'Unknown'; $assistant_name = ($assistant = User::model()->findByPk($surgeon_element->assistant_id)) ? $assistant->getFullNameAndTitle() : 'None'; $supervising_surg_name = ($supervising_surg = User::model()->findByPk($surgeon_element->supervising_surgeon_id)) ? $supervising_surg->getFullNameAndTitle() : 'None'; ?> <div> First Surgeon <br> <strong><?php echo $surgeon_name; ?> </strong> </div> <div> Assistant Surgeon <br>
protected function appendOpNoteValues(&$record, $event_id, $anaesthetic_type, $anaesthetic_delivery, $anaesthetic_comments, $anaesthetic_complications, $cataract_report, $incision_site, $cataract_complication_notes, $cataract_predicted_refraction, $cataract_iol_type, $cataract_iol_power, $tamponade_used, $surgeon, $surgeon_role, $assistant, $assistant_role, $supervising_surgeon, $supervising_surgeon_role, $opnote_comments) { $anaesthetic = Element_OphTrOperationnote_Anaesthetic::model()->find('event_id = :event_id', array(':event_id' => $event_id)); if ($anaesthetic_type) { $record['anaesthetic_type'] = $anaesthetic->anaesthetic_type['name']; } if ($anaesthetic_delivery) { $record['anaesthetic_delivery'] = $anaesthetic->anaesthetic_delivery['name']; } if ($anaesthetic_comments) { $record['anaesthetic_comments'] = $anaesthetic['anaesthetic_comment']; } if ($anaesthetic_complications) { $complications = array(); if (isset($anaesthetic->anaesthetic_complications)) { foreach ($anaesthetic->anaesthetic_complications as $complication) { $complications[] = $complication['name']; } $record['anaesthetic_complications'] = implode(',', $complications); } } if ($cataract_report) { foreach (array('cataract_report', 'cataract_predicted_refraction', 'cataract_iol_type', 'cataract_iol_power') as $k) { $record[$k] = ''; } if ($cataract_element = Element_OphTrOperationnote_Cataract::model()->find('event_id = :event_id', array(':event_id' => $event_id))) { $record['cataract_report'] = trim(preg_replace('/\\s\\s+/', ' ', $cataract_element['report'])); $record['cataract_predicted_refraction'] = $cataract_element->predicted_refraction; if ($cataract_element->iol_type) { $record['cataract_iol_type'] = $cataract_element->iol_type->name; } else { $record['cataract_iol_type'] = 'None'; } $record['cataract_iol_power'] = $cataract_element->iol_power; } } if ($incision_site) { $record['incision_site'] = 'Unknown'; $record['length_of_incision'] = 'Unknown'; $record['meridian'] = 'Unknown'; $record['incision_type'] = 'Unknown'; $record['iol_position'] = 'Unknown'; $cataract_operation_details_element = Element_OphTrOperationnote_Cataract::model()->find('event_id = :event_id', array(':event_id' => $event_id)); if ($cataract_operation_details_element) { $incisionSite = OphTrOperationnote_IncisionSite::model()->find('id = :id', array(':id' => $cataract_operation_details_element['incision_site_id'])); if ($incisionSite) { $record['incision_site'] = $incisionSite->name; } if ($cataract_operation_details_element['length']) { $record['length_of_incision'] = $cataract_operation_details_element['length']; } if ($cataract_operation_details_element['meridian']) { $record['meridian'] = $cataract_operation_details_element['meridian']; } $incision = OphTrOperationnote_IncisionType::model()->find('id = :id', array(':id' => $cataract_operation_details_element['incision_type_id'])); if ($incision) { $record['incision_type'] = $incision->name; } $iolPosition = OphTrOperationnote_IOLPosition::model()->find('id = :id', array(':id' => $cataract_operation_details_element['iol_position_id'])); if ($iolPosition) { $record['iol_position'] = $iolPosition->name; } } } if ($cataract_complication_notes) { $record['Cataract Complication Notes'] = 'Unknown'; if ($cataract_complication_notes_element = Element_OphTrOperationnote_Cataract::model()->find('event_id = :event_id', array(':event_id' => $event_id))) { if ($cataract_complication_notes_element['complication_notes']) { $record['Cataract Complication Notes'] = $cataract_complication_notes_element['complication_notes']; } } } if ($tamponade_used) { if ($tamponade_element = Element_OphTrOperationnote_Tamponade::model()->find('event_id = :event_id', array(':event_id' => $event_id))) { $record['tamponade_used'] = $tamponade_element->gas_type->name; } else { $record['tamponade_used'] = 'None'; } } if ($surgeon || $surgeon_role || $assistant || $assistant_role || $supervising_surgeon || $supervising_surgeon_role) { $surgeon_element = Element_OphTrOperationnote_Surgeon::model()->findByAttributes(array('event_id' => $event_id)); foreach (array('surgeon', 'assistant', 'supervising_surgeon') as $surgeon_type) { $role = $surgeon_type . '_role'; if (${$surgeon_type} || ${$role}) { $surgeon = $surgeon_element->{$surgeon_type}; if (${$surgeon_type}) { $record[$surgeon_type] = $surgeon ? $surgeon->getFullName() : 'None'; } if (${$role}) { $record["{$surgeon_type}_role"] = $surgeon ? $surgeon->role : 'None'; } } } } if ($this->opnote_comments) { $comments = Element_OphTrOperationnote_Comments::model()->find('event_id = :event_id', array(':event_id' => $event_id)); $record['opnote_comments'] = trim(preg_replace('/\\s\\s+/', ' ', $comments['comments'])); } }