protected function initWithEventId($id)
{
$criteria = new CDbCriteria();
$criteria->addCondition('event_type_id = ?');
$criteria->params = array($this->event_type->id);
if (!$id || !($this->event = Event::model()->findByPk($id, $criteria))) {
throw new CHttpException(404, 'Invalid event id.');
}
$this->patient = $this->event->episode->patient;
$this->episode = $this->event->episode;
}