<commit_before><?php
/*
_____________________________________________________________________________
(C) Moorfields Eye Hospital NHS Foundation Trust, 2008-2011
(C) OpenEyes Foundation, 2011
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/>.
_____________________________________________________________________________
http://www.openeyes.org.uk	 <EMAIL>
--
*/

$disorderId = '';
$value = '';
$eye = '';
$hasDiagnosis = false;

if (empty($model->event_id)) {
	// It's a new event so fetch the most recent element_diagnosis
	$diagnosis = $model->getNewestDiagnosis();

	if (empty($diagnosis->disorder)) {
		// There is no diagnosis for this episode, or no episode, or the diagnosis has no disorder (?)
		$diagnosis = $model;
	} else {
		// There is a diagnosis for this episode
		$value = $diagnosis->disorder->term;
		$eye = $diagnosis->eye;
		$disorderId = $diagnosis->disorder->id;
		$hasDiagnosis = true;
	}
} else {
	if (isset($model->disorder)) {
		$value = $model->disorder->term;
		$eye = $model->eye;
		$disorderId = $model->disorder->id;
		$hasDiagnosis = true;
	}

	$diagnosis = $model;
}
?>
					<!-- Reminder -->
					<?/*<div class="patientReminder">
						<span class="type"><img src="/img/_elements/icons/event_op_unscheduled.png" alt="op" width="16" height="16" /></span>
						<span class="patient"><strong><?php echo $patient->first_name?></strong> <?php echo $patient->last_name?> (<?php echo $patient->hos_num?>)</span>
					</div>*/?>
					<!-- Details -->
					<?php if (empty($model->event_id)) {?>
						<h3 class="withEventIcon" style="background:transparent url(/img/_elements/icons/event/medium/treatment_laser.png) center left no-repeat;">Book Operation</h3>
					<?php }else{?>
						<h3 class="withEventIcon" style="background:transparent url(/img/_elements/icons/event/medium/treatment_laser.png) center left no-repeat;">Edit Operation</h3>
					<?php }?>
					<h4>Select diagnosis</h4>
 
					<div id="editEyeSelection" class="eventDetail">
						<div class="label">Eye(s):</div>
						<div class="data">
							<input id="ytElementDiagnosis_eye" type="hidden" value="" name="ElementDiagnosis[eye]" />
							<span class="group">
							<input id="ElementDiagnosis_eye_1" value="0"<?php if (empty($diagnosis->eye)) {?> checked="checked"<?php }?> type="radio" name="ElementDiagnosis[eye]" />
							<label for="ElementDiagnosis_eye_1">Left</label>
							</span>
							<span class="group">
							<input id="ElementDiagnosis_eye_2" value="2"<?php if ($diagnosis->eye == '2') {?> checked="checked"<?php }?> type="radio" name="ElementDiagnosis[eye]" />
							<label for="ElementDiagnosis_eye_2">Both</label>
							</span>
							<span class="group">
							<input id="ElementDiagnosis_eye_0" value="1"<?php if ($diagnosis->eye == '1') {?> checked="checked"<?php }?> type="radio" name="ElementDiagnosis[eye]" />
							<label for="ElementDiagnosis_eye_0">Right</label>
							</span>
						</div>
					</div>
 
					<div id="editDiagnosis" class="eventDetail"><commit_msg>Fix bad comment tag<commit_after><?php
/*
_____________________________________________________________________________
(C) Moorfields Eye Hospital NHS Foundation Trust, 2008-2011
(C) OpenEyes Foundation, 2011
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/>.
_____________________________________________________________________________
http://www.openeyes.org.uk	 <EMAIL>
--
*/

$disorderId = '';
$value = '';
$eye = '';
$hasDiagnosis = false;

if (empty($model->event_id)) {
	// It's a new event so fetch the most recent element_diagnosis
	$diagnosis = $model->getNewestDiagnosis();

	if (empty($diagnosis->disorder)) {
		// There is no diagnosis for this episode, or no episode, or the diagnosis has no disorder (?)
		$diagnosis = $model;
	} else {
		// There is a diagnosis for this episode
		$value = $diagnosis->disorder->term;
		$eye = $diagnosis->eye;
		$disorderId = $diagnosis->disorder->id;
		$hasDiagnosis = true;
	}
} else {
	if (isset($model->disorder)) {
		$value = $model->disorder->term;
		$eye = $model->eye;
		$disorderId = $model->disorder->id;
		$hasDiagnosis = true;
	}

	$diagnosis = $model;
}
?>
					<!-- Reminder -->
					<?php /*<div class="patientReminder">
						<span class="type"><img src="/img/_elements/icons/event_op_unscheduled.png" alt="op" width="16" height="16" /></span>
						<span class="patient"><strong><?php echo $patient->first_name?></strong> <?php echo $patient->last_name?> (<?php echo $patient->hos_num?>)</span>
					</div>*/?>
					<!-- Details -->
					<?php if (empty($model->event_id)) {?>
						<h3 class="withEventIcon" style="background:transparent url(/img/_elements/icons/event/medium/treatment_laser.png) center left no-repeat;">Book Operation</h3>
					<?php }else{?>
						<h3 class="withEventIcon" style="background:transparent url(/img/_elements/icons/event/medium/treatment_laser.png) center left no-repeat;">Edit Operation</h3>
					<?php }?>
					<h4>Select diagnosis</h4>
 
					<div id="editEyeSelection" class="eventDetail">
						<div class="label">Eye(s):</div>
						<div class="data">
							<input id="ytElementDiagnosis_eye" type="hidden" value="" name="ElementDiagnosis[eye]" />
							<span class="group">
							<input id="ElementDiagnosis_eye_1" value="0"<?php if (empty($diagnosis->eye)) {?> checked="checked"<?php }?> type="radio" name="ElementDiagnosis[eye]" />
							<label for="ElementDiagnosis_eye_1">Left</label>
							</span>
							<span class="group">
							<input id="ElementDiagnosis_eye_2" value="2"<?php if ($diagnosis->eye == '2') {?> checked="checked"<?php }?> type="radio" name="ElementDiagnosis[eye]" />
							<label for="ElementDiagnosis_eye_2">Both</label>
							</span>
							<span class="group">
							<input id="ElementDiagnosis_eye_0" value="1"<?php if ($diagnosis->eye == '1') {?> checked="checked"<?php }?> type="radio" name="ElementDiagnosis[eye]" />
							<label for="ElementDiagnosis_eye_0">Right</label>
							</span>
						</div>
					</div>
 
					<div id="editDiagnosis" class="eventDetail">
{'fraction_non_alphanumeric': 0.15646635281085572, 'fraction_numerical': 0.009415674328440876, 'mean_word_length': 4.30712711241734, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 157, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5826784', 'n_tokens_mistral': 2640, 'n_tokens_neox': 2145, 'n_words': 591}