Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : Element_OphTrOperationnote_ProcedureList | ||
Résultat | Element_OphTrOperationnote_ProcedureList | the static model class |
/** * The eye of the procedure is stored in the parent procedure list element. * * @return Eye */ public function getEye() { return Element_OphTrOperationnote_ProcedureList::model()->find('event_id=?', array($this->event_id))->eye; }
protected function appendBookingValues(&$record, $event_id, $booking_diagnosis, $theatre, $bookingcomments, $surgerydate) { if ($api = Yii::app()->moduleAPI->get('OphTrOperationbooking')) { $procedure = Element_OphTrOperationnote_ProcedureList::model()->find('event_id=:event_id', array(':event_id' => $event_id)); $bookingEventID = $procedure['booking_event_id']; foreach (array('booking_diagnosis', 'theatre', 'bookingcomments', 'surgerydate') as $k) { if (${$k}) { $record[$k] = ''; } } if ($bookingEventID) { $operationElement = $api->getOperationForEvent($bookingEventID); $latestBookingID = $operationElement['latest_booking_id']; $operationBooking = OphTrOperationbooking_Operation_Booking::model()->find('id=:id', array('id' => $latestBookingID)); if ($booking_diagnosis) { $diag_el = $operationElement->getDiagnosis(); $disorder = $diag_el->disorder(); if ($disorder) { $record['booking_diagnosis'] = $diag_el->eye->adjective . ' ' . $disorder->term; } else { $record['booking_diagnosis'] = 'Unknown'; } } if ($this->theatre && $operationElement && $operationBooking) { $theatreName = $operationElement->site['name'] . ' ' . $operationBooking->theatre['name']; $record['theatre'] = $theatreName; } if ($this->bookingcomments) { $record['bookingcomments'] = $operationElement['comments']; } if ($this->surgerydate) { $record['surgerydate'] = $operationBooking['session_date']; } } } }
<div class="data-value"><?php echo $supervising_surg_name; ?> </div> </div> </div> <!-- <div class="operationMeta"> <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
/** * Helper method to get the site for the operation booking on this event. * * (currently only supports events that have been saved) */ public function findBookingSite() { if ($pl = Element_OphTrOperationnote_ProcedureList::model()->find('event_id=?', array($this->event->id))) { if ($pl->bookingEvent) { if ($api = Yii::app()->moduleAPI->get('OphTrOperationbooking')) { return $api->findSiteForBookingEvent($pl->bookingEvent); } } } return; }