protected function getPreAntiseptDrugString($drug_id) { if (!$drug_id) { return 'N/A'; } if ($drug = OphTrIntravitrealinjection_AntiSepticDrug::model()->findByPk($drug_id)) { return $drug->name; } else { return 'UNKNOWN'; } }
<div class="large-4 column end"> <?php echo CHtml::dropDownList('drug_id', '', CHtml::listData(OphTrIntravitrealinjection_Treatment_Drug::model()->findAll(array('order' => 'name asc')), 'id', 'name'), array('empty' => '- Please select -')); ?> </div> </div> <div class="row field-row"> <div class="large-2 column"> <?php echo CHtml::label('Pre Injection Antiseptic', 'pre_antisept_drug_id'); ?> </div> <div class="large-4 column end"> <?php echo CHtml::dropDownList('pre_antisept_drug_id', '', CHtml::listData(OphTrIntravitrealinjection_AntiSepticDrug::model()->findAll(array('order' => 'name asc')), 'id', 'name'), array('empty' => '- Please select -')); ?> </div> </div> <div class="row field-row"> <div class="large-2 column"> </div> <div class="large-4 column end"> <input type="hidden" name="summary" value="0" /> <?php echo CHtml::checkBox('summary'); ?> <?php echo CHtml::label('Summarise patient data', 'summary');
* This file is part of OpenEyes. * OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see <http://www.gnu.org/licenses/>. * * @link http://www.openeyes.org.uk * * @author OpenEyes <*****@*****.**> * @copyright Copyright (c) 2008-2011, Moorfields Eye Hospital NHS Foundation Trust * @copyright Copyright (c) 2011-2013, OpenEyes Foundation * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0 */ ?> <?php $antiseptic_drugs = OphTrIntravitrealinjection_AntiSepticDrug::model()->with('allergies')->activeOrPk($element->{$side . '_pre_antisept_drug_id'})->findAll(); $antiseptic_drugs_opts = array('empty' => '- Please select -', 'nowrapper' => true, 'options' => array()); $antiseptic_allergic = false; foreach ($antiseptic_drugs as $drug) { $opts = array(); foreach ($drug->allergies as $allergy) { if ($this->patient->hasAllergy($allergy)) { $opts['data-allergic'] = 1; if ($drug->id == $element->{$side . '_pre_antisept_drug_id'}) { $antiseptic_allergic = true; } } } $antiseptic_drugs_opts['options'][(string) $drug->id] = $opts; } $skin_drugs = OphTrIntravitrealinjection_SkinDrug::model()->with('allergies')->activeOrPk($element->{$side . '_pre_skin_drug_id'})->findAll();