The followings are the available columns in table 'common_ophthalmic_disorder':
Inheritance: extends BaseActiveRecordVersioned
Ejemplo n.º 1
0
 public function actionIsCommonOphthalmic($id)
 {
     $firm = Firm::model()->findByPk(Yii::app()->session['selected_firm_id']);
     if ($cd = CommonOphthalmicDisorder::model()->find('disorder_id=? and subspecialty_id=?', array($id, $firm->serviceSubspecialtyAssignment->subspecialty_id))) {
         echo "<option value=\"{$cd->disorder_id}\" data-order=\"{$cd->display_order}\">" . $cd->disorder->term . "</option>";
     }
 }
Ejemplo n.º 2
0
 /**
  * Wrapper to track the display order for Common Disorders
  *
  * @param $subspecialty
  * @return mixed
  */
 public function getNextDisplayOrderForSubspecialty($subspecialty)
 {
     if (!array_key_exists($subspecialty->id, $this->display_order)) {
         $criteria = new CDbCriteria();
         $criteria->addCondition('subspecialty_id = :si');
         $criteria->params[':si'] = $subspecialty->id;
         $criteria->order = 'display_order desc';
         $criteria->limit = 1;
         if ($cod = CommonOphthalmicDisorder::model()->find($criteria)) {
             $this->display_order[$subspecialty->id] = $cod->display_order;
         } else {
             $this->display_order[$subspecialty->id] = 0;
         }
     }
     return ++$this->display_order[$subspecialty->id];
 }
Ejemplo n.º 3
0
					<?php 
    echo $error;
    ?>
				</li>
			</ul>
		</div>
	<?php 
}
?>

	<section class="element element-data">
		<h3 class="data-title">Principal diagnosis:</h3>
		<div class="row">
			<div class="large-5 column end">
				<?php 
$form->widget('application.widgets.DiagnosisSelection', array('field' => 'disorder_id', 'options' => CommonOphthalmicDisorder::getList(Firm::model()->findByPk($this->selectedFirmId)), 'code' => 130, 'layout' => 'episodeSummary'));
?>
			</div>
		</div>
	</section>

	<?php 
if (!empty($_POST)) {
    $eye_id = @$_POST['eye_id'];
} else {
    $eye_id = $episode->eye_id;
}
?>
	<section class="element element-data">
		<fieldset>
			<legend class="data-title">Principal eye:</legend>
 /**
  * Gets the common ophthalmic disorders for the given firm
  *
  * @param int $firm_id
  * @return array
  */
 public function getCommonOphthalmicDisorders($firm_id)
 {
     if (empty($firm_id)) {
         throw new CException('Firm is required');
     }
     $firm = \Firm::model()->findByPk($firm_id);
     if ($firm) {
         return \CommonOphthalmicDisorder::getListByGroupWithSecondaryTo($firm);
     }
 }
Ejemplo n.º 5
0
									<th>Edit</th>
								</tr>
							</thead>
							<tbody id="Reports_diagnoses">
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>

		<div id="selected_diagnoses">
		</div>

		<?php 
$this->widget('application.widgets.DiagnosisSelection', array('field' => 'disorder_id', 'options' => CommonOphthalmicDisorder::getList(Firm::model()->findByPk($this->selectedFirmId)), 'layout' => 'minimal', 'callback' => 'Reports_AddDiagnosis'));
?>

		<div class="row field-row">
			<div class="large-2 column">
			</div>
			<div class="large-9 column end">
				<input type="radio" name="condition_type" id="condition_or" value="or" checked="checked" />
				<label for="condition_or">
					Match patients with <strong>any</strong> of these diagnoses
				</label>
			</div>
		</div>
		<div class="row field-row">
			<div class="large-2 column">
			</div>
 /**
  * Remmoves the parent list for the given subspecialty if it's not already been removed
  * @param $subspecialty
  */
 public function resetSubspecialty($subspecialty)
 {
     if (!in_array($subspecialty->id, $this->reset_subspecialty_ids)) {
         CommonOphthalmicDisorder::model()->deleteAllByAttributes(array('subspecialty_id' => $subspecialty->id));
         $this->reset_subspecialty_ids[] = $subspecialty->id;
     }
 }
Ejemplo n.º 7
0
					Add Ophthalmic Diagnosis
				</button>
			</div>

			<div id="add_new_ophthalmic_diagnosis" style="display: none;">

				<?php 
    $form = $this->beginWidget('FormLayout', array('id' => 'add-ophthalmic-diagnosis', 'enableAjaxValidation' => false, 'action' => array('patient/adddiagnosis'), 'layoutColumns' => array('label' => 3, 'field' => 9), 'htmlOptions' => array('class' => 'form add-data')));
    ?>

					<fieldset class="field-row">

						<legend><strong>Add ophthalmic diagnosis</strong></legend>

						<?php 
    $form->widget('application.widgets.DiagnosisSelection', array('field' => 'ophthalmic_disorder_id', 'label' => 'Diagnosis', 'options' => CommonOphthalmicDisorder::getList(Firm::model()->findByPk($this->selectedFirmId)), 'code' => 130, 'default' => false, 'layout' => 'patientSummary', 'loader' => 'add_ophthalmic_diagnosis_loader'));
    ?>

						<div class="row field-row hide" id="add_ophthalmic_diagnosis_loader">
							<p class="large-offset-<?php 
    echo $form->layoutColumns['label'];
    ?>
 large-<?php 
    echo $form->layoutColumns['field'];
    ?>
 column end">
								<img class="loader" src="<?php 
    echo Yii::app()->assetManager->createUrl('img/ajax-loader.gif');
    ?>
" />
									searching...
 /**
  * @dataProvider dataProvider_Search
  */
 public function testSearch_WithValidTerms_ReturnsExpectedResults($searchTerms, $numResults, $expectedKeys)
 {
     $disorder = new CommonOphthalmicDisorder();
     $disorder->setAttributes($searchTerms);
     $results = $disorder->search();
     $data = $results->getData();
     $expectedResults = array();
     if (!empty($expectedKeys)) {
         foreach ($expectedKeys as $key) {
             $expectedResults[] = $this->disorders($key);
         }
     }
     $this->assertEquals($numResults, $results->getItemCount());
     $this->assertEquals($expectedResults, $data);
 }
<?php

/**
 * OpenEyes.
 *
 * (C) Moorfields Eye Hospital NHS Foundation Trust, 2008-2011
 * (C) OpenEyes Foundation, 2011-2013
 * 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
 */
?>

<fieldset class="element-fields" id="editDiagnosis">
	<?php 
echo $form->radioButtons($element, 'eye_id', CHtml::listData(Eye::model()->findAll(array('order' => 'display_order asc')), 'id', 'name'));
?>
	<?php 
$form->widget('application.widgets.DiagnosisSelection', array('field' => 'disorder_id', 'element' => $element, 'options' => CommonOphthalmicDisorder::getList(Firm::model()->findByPk($this->selectedFirmId)), 'layoutColumns' => array('label' => $form->layoutColumns['label'], 'field' => 4)));
?>
</fieldset>
Ejemplo n.º 10
0
 /**
  * Returns a JSON response. Empty if the provided disorder id is not in the common list for the
  * current session firm subspecialty. Otherwise, contains details of disorder, and all secondary to disorders
  * configured for the disorder/subspecialty
  *
  * @param $id
  */
 public function actionIsCommonOphthalmicWithSecondary($id)
 {
     $firm = Firm::model()->findByPk(Yii::app()->session['selected_firm_id']);
     $result = array();
     if ($subspecialty_id = $firm->getSubspecialtyID()) {
         if ($cd = CommonOphthalmicDisorder::model()->with(array('disorder', 'secondary_to_disorders'))->findByAttributes(array('disorder_id' => $id, 'subspecialty_id' => $subspecialty_id))) {
             $result['disorder'] = array('id' => $cd->disorder_id, 'term' => $cd->disorder->term);
             if ($sts = $cd->secondary_to_disorders) {
                 $result['secondary_to'] = array();
                 foreach ($sts as $st) {
                     $result['secondary_to'][] = array('id' => $st->id, 'term' => $st->term);
                 }
             }
             echo CJSON::encode($result);
         } elseif ($sts = SecondaryToCommonOphthalmicDisorder::model()->with(array('disorder', 'parent'))->findAll('t.disorder_id = :disorder_id AND parent.subspecialty_id = :subspecialty_id', array(":disorder_id" => $id, ":subspecialty_id" => $subspecialty_id))) {
             $result['disorder'] = array('id' => $sts[0]->disorder_id, 'term' => $sts[0]->disorder->term);
             $result['owned_by'] = array();
             foreach ($sts as $st) {
                 $result['owned_by'][] = array('id' => $st->parent->disorder_id);
             }
             echo CJSON::encode($result);
         }
     }
 }