/**
* Call edit init and set attribute for alerting which side the latest injection management
* implies should be injected.
*
* @see BaseEventTypeController::createInit()
*/
protected function initActionCreate()
{
parent::initActionCreate();
$this->editInit();
// set up the injection side if provided by the injection management in examination
$exam_api = Yii::app()->moduleAPI->get('OphCiExamination');
// We only want to show the injection mananagement side highlighting from injection management that has
// been created on the day of this injection
$since = new DateTime();
$since->setTime(0, 0, 0);
if ($this->episode && $exam_api && ($imc = $exam_api->getLatestInjectionManagementComplex($this->episode, $since))) {
if ($side = $imc->getInjectionSide()) {
$this->side_to_inject = $side;
} else {
$this->side_to_inject = 0;
}
}
}