Пример #1
0
 /**
  * Handle the selection of a booking for creating an op note.
  *
  * (non-phpdoc)
  *
  * @see parent::actionCreate()
  */
 public function actionCreate()
 {
     $errors = array();
     // if we are after the submit we need to check if any event is selected
     if (preg_match('/^biometry([0-9]+)$/', Yii::app()->request->getPost('SelectBiometry'), $m)) {
         $importedEvent = OphInBiometry_Imported_Events::model()->findByPk($m[1]);
         $this->updateImportedEvent(Event::model()->findByPk($importedEvent->event_id), $importedEvent);
         $this->redirect(array('/OphInBiometry/default/view/' . $importedEvent->event_id . '?autosaved=1'));
     }
     $criteria = new CDbCriteria();
     // we are looking for the unlinked imported events in the database
     $criteria->addCondition('patient_id = :patient_id');
     $criteria->addCondition('is_linked = 0');
     $criteria->addCondition('event.deleted = 0');
     $criteria->params = array(':patient_id' => $this->patient->id);
     $unlinkedEvents = OphInBiometry_Imported_Events::model()->with(array('patient', 'event'))->findAll($criteria);
     // if we have 0 unlinked event we follow the manual process
     if (sizeof($unlinkedEvents) == 0 || Yii::app()->request->getQuery('force_manual') == '1') {
         Yii::app()->user->setFlash('issue.formula', $this->flash_message);
         parent::actionCreate();
     } else {
         // if we have more than 1 event we render the selection screen
         $this->title = 'Please Select a Biometry Report';
         $this->event_tabs = array(array('label' => 'The following Biometry reports are available for this patient:', 'active' => true));
         $cancel_url = $this->episode ? '/patient/episode/' . $this->episode->id : '/patient/episodes/' . $this->patient->id;
         $this->event_actions = array(EventAction::link('Cancel', Yii::app()->createUrl($cancel_url), null, array('class' => 'button small warning')));
         $this->render('select_imported_event', array('errors' => $errors, 'imported_events' => $unlinkedEvents));
     }
 }
Пример #2
0
 * (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
 */
// Event actions
$this->event_actions[] = EventAction::link('Cancel', Yii::app()->createUrl('/patient/episode/' . $episode->id), array('level' => 'cancel'));
$this->event_actions[] = EventAction::button('Save', 'save', array('id' => 'episode_save', 'level' => 'save'));
if ($episode->diagnosis) {
    $eye = $episode->eye ? $episode->eye->name : 'None';
    $diagnosis = $episode->diagnosis ? $episode->diagnosis->term : 'none';
} else {
    $eye = 'No diagnosis';
    $diagnosis = 'No diagnosis';
}
$episode->audit('episode summary', 'view');
$form = $this->beginWidget('BaseEventTypeCActiveForm', array('id' => 'update-episode', 'enableAjaxValidation' => false, 'action' => array('patient/updateepisode/' . $episode->id)));
?>

	<div class="element-data">
		<h2>Summary</h2>
		<h3><?php 
Пример #3
0
 * @copyright Copyright (c) 2016, OpenEyes Foundation
 * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
 */
?>

<div class="admin box">
    <h2>Mapping Items for <?php 
echo $definition->name;
?>
</h2>
    <?php 
echo EventAction::link('Definitions List', '/worklistAdmin/definitions/', array('level' => 'secondary'), array('class' => 'button small'))->toHtml();
?>
    <?php 
if ($this->manager->canUpdateWorklistDefinition($definition)) {
    echo EventAction::link('Add Mapping', '/worklistAdmin/addDefinitionMapping/' . $definition->id, array('level' => 'primary'), array('class' => 'button small'))->toHtml();
}
?>
    <?php 
if ($definition->mappings) {
    ?>
    <form id="mapping-list" method="POST">
        <input type="hidden" name="YII_CSRF_TOKEN" value="<?php 
    echo Yii::app()->request->csrfToken;
    ?>
"/>
        <?php 
    if ($definition->displayed_mappings) {
        ?>
        <h3>Displayed Mapping Items</h3>
        <table class="generic-admin grid">
Пример #4
0
/**
 * OpenEyes.
 *
 * (C) OpenEyes Foundation, 2016
 * 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) 2016, OpenEyes Foundation
 * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
 */
?>

<div class="admin box">
    <h2>Generated Instances for <?php 
echo $definition->name;
?>
</h2>
    <?php 
echo EventAction::link('Definitions List', '/worklistAdmin/definitions/', array('level' => 'secondary'), array('class' => 'button small'))->toHtml();
?>
    <?php 
$this->renderPartial('//admin/worklists/definition_worklists_table', array('definition' => $definition));
?>
</div>
Пример #5
0
 *
 * @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
 */
$this->beginContent('//patient/event_container');
?>

<?php 
// Event actions
if ($this->checkPrintAccess()) {
    $this->event_actions[] = EventAction::button('Print', 'print', null, array('class' => 'button small'));
}
if ($this->editable && ($next_step = $this->getNextStep())) {
    $this->event_actions[] = EventAction::link($next_step->name, Yii::app()->createUrl($this->event->eventType->class_name . '/default/step/' . $this->event->id), null, array('class' => 'button small'));
}
?>

<?php 
if ($this->event->delete_pending) {
    ?>
	<div class="alert-box alert with-icon">
		This event is pending deletion and has been locked.
	</div>
<?php 
}
?>

<?php 
$this->renderOpenElements($this->action->id);
Пример #6
0
 *
 * (C) OpenEyes Foundation, 2016
 * 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) 2016, OpenEyes Foundation
 * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
 */
?>

<div class="admin box">
    <h2>Worklist Patients: <?php 
echo $worklist->name;
?>
 (<?php 
echo $worklist->worklist_definition->name;
?>
)</h2>
<?php 
echo EventAction::link('All Instances', '/worklistAdmin/definitionWorklists/' . $worklist->worklist_definition_id, array('level' => 'secondary'), array('class' => 'button small'))->toHtml();
?>
&nbsp;<?php 
echo EventAction::link('Definition Mappings', '/worklistAdmin/definitionMappings/' . $worklist->worklist_definition_id, array('level' => 'secondary'), array('class' => 'button small'))->toHtml();
echo $this->manager->renderWorklistForDashboard($worklist);
?>
</div>
Пример #7
0
 *
 * @link http://www.openeyes.org.uk
 *
 * @author OpenEyes <*****@*****.**>
 * @copyright Copyright (c) 2016, OpenEyes Foundation
 * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
 */
$this->beginContent('//patient/event_container');
?>

<?php 
// Event actions
if ($this->canMarkRead()) {
    $this->event_actions[] = EventAction::link('Mark Read', Yii::app()->createUrl($this->getModule()->name . '/Default/markRead/' . $this->event->id), null, array('class' => 'warning button small'));
} elseif ($this->canMarkUnread()) {
    $this->event_actions[] = EventAction::link('Mark Unread', Yii::app()->createUrl($this->getModule()->name . '/Default/markUnread/' . $this->event->id), null, array('class' => 'secondary button small'));
}
if ($this->checkPrintAccess()) {
    $this->event_actions[] = EventAction::button('Print', 'print', null, array('class' => 'button small'));
}
?>

<?php 
if ($this->event->delete_pending) {
    ?>
    <div class="alert-box alert with-icon">
        This event is pending deletion and has been locked.
    </div>
<?php 
}
?>
Пример #8
0
 * 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) 2016, OpenEyes Foundation
 * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
 */
?>

<div class="box admin">
    <div class="row">
        <div class="large-10 column">
            <h2>Manage Manual Worklists</h2>
            <?php 
echo EventAction::link('Add Worklist', '/worklist/manualAdd/', array(), array('class' => 'button primary small'))->toHtml();
?>

            <?php 
if ($current_worklists || $available_worklists) {
    ?>
            <div id="draggablelist">
                <?php 
    echo CHtml::beginForm(array('/worklist/manualUpdateDisplayOrder'), 'post');
    ?>
                <?php 
    echo CHtml::hiddenField('item_ids');
    ?>
                <div id="draggablelist-items" class="row">
                    <div class="large-6 column">
                        <h2>Current Worklists</h2>
Пример #9
0
            $preview_button = EventAction::button('Preview Application', null, array('disabled' => true), array('title' => 'Preview unavailable for NICE compliant applications', 'class' => 'button small'));
            $submit_button_text = 'Submit Notification';
        }
        if ($this->checkPrintAccess()) {
            $this->event_actions[] = $preview_button;
        }
        if ($this->checkEditAccess()) {
            $url = '#';
            if ($service->hasEmailRecipients()) {
                $submitButtonStyles = array('class' => 'button small');
                $url = $this->createUrl('processApplication', array('event_id' => $this->event->id));
            } else {
                $submitButtonStyles = array('class' => 'button small noEmailRecipient disabled');
                $warnings[] = 'No application recipient configured for ' . $status . ' application at ' . $service->getSiteName() . ', please contact support to resolve this.';
            }
            $this->event_actions[] = EventAction::link($submit_button_text, $url, null, $submitButtonStyles);
        }
    }
    if ($this->checkPrintAccess()) {
        $this->event_actions[] = EventAction::button('Print', 'print', null, array('class' => 'button small'));
    }
}
$this->beginContent('//patient/event_container');
?>

	<?php 
$this->renderPartial('//base/_messages');
?>

	<?php 
if ($this->event->delete_pending) {
 * 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) 2016, OpenEyes Foundation
 * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
 */
?>

<div class="admin box">
    <h2>Display Context(s) for <?php 
echo $definition->name;
?>
</h2>
    <?php 
echo EventAction::link('Definitions List', '/worklistAdmin/definitions/', array('level' => 'secondary'), array('class' => 'button small'))->toHtml();
?>
    <?php 
echo EventAction::link('View Definition', '/worklistAdmin/definition/' . $definition->id, array('level' => 'secondary'), array('class' => 'button small'))->toHtml();
?>
    <?php 
echo EventAction::link('Add Context', '/worklistAdmin/definitionDisplayContextAdd/' . $definition->id, array('level' => 'primary'), array('class' => 'button small'))->toHtml();
?>
    <?php 
$this->renderPartial('//admin/worklists/definition_display_contexts_table', array('definition' => $definition));
?>
</div>
Пример #11
0
 * 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) 2016, OpenEyes Foundation
 * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
 */
?>

<div class="admin box">
    <h2>Automatic Worklist Definitions</h2>
    <?php 
echo EventAction::link('Add Definition', '/worklistAdmin/definitionUpdate/', array(), array('class' => 'button primary small'))->toHtml();
?>
    <?php 
if ($definitions) {
    ?>
    <form id="definition-list" method="POST">
        <input type="hidden" name="YII_CSRF_TOKEN" value="<?php 
    echo Yii::app()->request->csrfToken;
    ?>
"/>
        <table class="generic-admin grid">
            <thead>
            <tr>
                <th>Order</th>
                <th>Name</th>
                <th>Actions</th>
Пример #12
0
}
?>
/> 5th
			</label>
		</div>
	</fieldset>
	<?php 
echo $form->errorSummary($sequence);
?>
	<div class="field-row row">
		<div class="large-10 large-offset-2 column">
			<?php 
echo EventAction::button('Save', 'save', array('level' => 'save'))->toHtml();
?>
			<?php 
echo EventAction::link('Cancel', Yii::app()->createUrl('OphTrOperationbooking/admin/viewSequences'), array('level' => 'cancel'))->toHtml();
?>
			<?php 
if ($sequence->id) {
    ?>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<?php 
    echo EventAction::button('View sessions', 'view_sessions', array(), array('class' => 'button small'))->toHtml();
    ?>
				<?php 
    echo EventAction::button('Add session', 'add_session_to_sequence', array(), array('class' => 'button small'))->toHtml();
    ?>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<?php 
    echo EventAction::button('Delete sequence', 'delete_sequence', array('level' => 'warning'), array('class' => 'button small'))->toHtml();
    ?>
Пример #13
0
 /**
  * Handle the selection of a booking for creating an op note.
  *
  * (non-phpdoc)
  *
  * @see parent::actionCreate()
  */
 public function actionCreate()
 {
     $errors = array();
     if (!empty($_POST)) {
         if (preg_match('/^booking([0-9]+)$/', @$_POST['SelectBooking'], $m)) {
             $this->redirect(array('/OphTrOperationnote/Default/create?patient_id=' . $this->patient->id . '&booking_event_id=' . $m[1]));
         } elseif (@$_POST['SelectBooking'] == 'emergency') {
             $this->redirect(array('/OphTrOperationnote/Default/create?patient_id=' . $this->patient->id . '&unbooked=1'));
         }
         $errors = array('Operation' => array('Please select a booked operation'));
     }
     if ($this->booking_operation || $this->unbooked) {
         parent::actionCreate();
     } else {
         // set up form for selecting a booking for the Op note
         $bookings = array();
         if ($api = Yii::app()->moduleAPI->get('OphTrOperationbooking')) {
             $bookings = $api->getOpenBookingsForEpisode($this->episode->id);
         }
         $this->title = 'Please select booking';
         $this->event_tabs = array(array('label' => 'Select a booking', 'active' => true));
         $cancel_url = $this->episode ? '/patient/episode/' . $this->episode->id : '/patient/episodes/' . $this->patient->id;
         $this->event_actions = array(EventAction::link('Cancel', Yii::app()->createUrl($cancel_url), null, array('class' => 'button small warning')));
         $this->render('select_event', array('errors' => $errors, 'bookings' => $bookings));
     }
 }
Пример #14
0
 * @link http://www.openeyes.org.uk
 * @author OpenEyes <*****@*****.**>
 * @copyright Copyright (c) 2016, OpenEyes Foundation
 * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
 */
?>

<?php 
if ($this->checkPrintAccess()) {
    $this->event_actions[] = EventAction::button('Print', 'print', null, array('class' => 'small button'));
}
if ($this->checkLabelPrintAccess()) {
    $this->event_actions[] = EventAction::button('Print Labels', 'print_labels', null, array('class' => 'small button'));
}
if ($this->canIssue()) {
    $this->event_actions[] = EventAction::link('Issue', '/OphCoCvi/default/issue/' . $this->event->id, null, array('class' => 'small button secondary'));
}
$this->beginContent('//patient/event_container');
?>

<?php 
if ($this->event->delete_pending) {
    ?>
    <div class="alert-box alert with-icon">
        This event is pending deletion and has been locked.
    </div>
<?php 
}
?>

<?php 
 /**
  * The update action for the given event id
  *
  * @param $id
  * @throws CHttpException
  * @throws SystemException
  * @throws Exception
  */
 public function actionUpdate($id)
 {
     if (!empty($_POST)) {
         // somethings been submitted
         if (isset($_POST['cancel'])) {
             // Cancel button pressed, so just bounce to view
             $this->redirect(array('default/view/' . $this->event->id));
         }
         $errors = $this->setAndValidateElementsFromData($_POST);
         // update the event
         if (empty($errors)) {
             $transaction = Yii::app()->db->beginTransaction();
             try {
                 //TODO: should all the auditing be moved into the saving of the event
                 $success = $this->saveEvent($_POST);
                 if ($success) {
                     //TODO: should not be pasing event?
                     $this->afterUpdateElements($this->event);
                     $this->logActivity('updated event');
                     $this->event->audit('event', 'update');
                     $this->event->user = Yii::app()->user->id;
                     if (!$this->event->save()) {
                         throw new SystemException('Unable to update event: ' . print_r($this->event->getErrors(), true));
                     }
                     OELog::log("Updated event {$this->event->id}");
                     $transaction->commit();
                     $this->redirect(array('default/view/' . $this->event->id));
                 } else {
                     throw new Exception("Unable to save edits to event");
                 }
             } catch (Exception $e) {
                 $transaction->rollback();
                 throw $e;
             }
         }
     } else {
         // get the elements
         $this->setOpenElementsFromCurrentEvent('update');
     }
     $this->editing = true;
     $this->event_tabs = array(array('label' => 'View', 'href' => Yii::app()->createUrl($this->event->eventType->class_name . '/default/view/' . $this->event->id)), array('label' => 'Edit', 'active' => true));
     $this->event_actions = array(EventAction::link('Cancel', Yii::app()->createUrl($this->event->eventType->class_name . '/default/view/' . $this->event->id), array('level' => 'cancel')));
     $this->render($this->action->id, array('errors' => @$errors));
 }
            if (!$element->has_gp || !$element->has_address) {
                $print_letter_options['disabled'] = true;
            }
            $this->event_actions[] = EventAction::button('Print ' . $element->letterType . ' letter', 'print-letter', $print_letter_options, array('id' => 'btn_print-letter', 'class' => 'button small'));
            if ($element->letterType === 'Invitation') {
                $this->event_actions[] = EventAction::button('Print Admission form', 'print_admission_form', null, array('class' => 'small button'));
            }
        }
        if ($this->checkScheduleAccess()) {
            $this->event_actions[] = EventAction::link('Schedule now', Yii::app()->createUrl('/' . $element->event->eventType->class_name . '/booking/schedule/' . $element->event_id), array('level' => 'secondary'), array('id' => 'btn_schedule-now', 'class' => 'button small'));
        }
    } else {
        if ($this->checkPrintAccess()) {
            $print_letter_options = null;
            if (!$element->has_address) {
                $print_letter_options['disabled'] = true;
            }
            $this->event_actions[] = EventAction::button('Print letter', 'print-letter', $print_letter_options, array('id' => 'btn_print-admissionletter', 'class' => 'small button'));
            $this->event_actions[] = EventAction::button('Print admission form', 'print_admission_form', null, array('class' => 'small button'));
        }
        if ($this->checkScheduleAccess()) {
            $this->event_actions[] = EventAction::link('Reschedule now', Yii::app()->createUrl('/' . $element->event->eventType->class_name . '/booking/reschedule/' . $element->event_id), array('level' => 'secondary'), array('id' => 'btn_reschedule-now', 'class' => 'button small'));
        }
        if ($this->checkEditAccess()) {
            $this->event_actions[] = EventAction::link('Reschedule later', Yii::app()->createUrl('/' . $element->event->eventType->class_name . '/booking/rescheduleLater/' . $element->event_id), array('level' => 'secondary'), array('id' => 'btn_reschedule-later', 'class' => 'button small'));
        }
    }
    if ($this->checkEditAccess()) {
        $this->event_actions[] = EventAction::link('Cancel operation', Yii::app()->createUrl('/' . $element->event->eventType->class_name . '/default/cancel/' . $element->event_id), array(), array('id' => 'btn_cancel-operation', 'class' => 'warning button small'));
    }
}
Пример #17
0
    echo $ward->restrictionText;
    ?>
</td>
					</tr>
				<?php 
}
?>
			</tbody>
			<tfoot>
				<tr>
					<td colspan="5">
						<?php 
echo EventAction::link('Add', '#', null, array('class' => 'small button', 'id' => 'et_add_ward'))->toHtml();
?>
						<?php 
echo EventAction::link('Delete', '#', null, array('class' => 'small button', 'id' => 'et_delete_ward'))->toHtml();
?>
					</td>
				</tr>
			</tfoot>
		</table>
	</form>
</div>

<div id="confirm_delete_wards" title="Confirm delete ward" style="display: none;">
	<div id="delete_wards">
		<div class="alert-box alert with-icon">
			<strong>WARNING: This will remove the wards from the system.<br/>This action cannot be undone.</strong>
		</div>
		<p>
			<strong>Are you sure you want to proceed?</strong>