/** * Create Form with check for the cvi existing events count * @throws \Exception */ public function actionCreate() { $create_new_cvi = $this->request->getParam('createnewcvi', null); if ($create_new_cvi !== null) { $cancel_url = $this->episode ? '/patient/episode/' . $this->episode->id : '/patient/episodes/' . $this->patient->id; if ($create_new_cvi == 1) { if (!$this->getManager()->canCreateEventForPatient($this->patient)) { $this->getApp()->user->setFlash('warning.cvi_create', 'You cannot create another CVI whilst one exists that has not been issued.'); $this->redirect(array($cancel_url)); } else { parent::actionCreate(); } } else { $this->redirect(array($cancel_url)); } } else { $cvi_events = $this->getApp()->moduleAPI->get('OphCoCvi'); $current_cvis = $cvi_events->getEvents($this->patient); if (count($current_cvis) >= $this->cvi_limit) { $this->render('select_event', array('current_cvis' => $current_cvis, 'can_create' => $this->getManager()->canCreateEventForPatient($this->patient)), false); } else { parent::actionCreate(); } } }
/** * 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)); } }
public function actionCreate() { $this->setCurrentSet(); if (Yii::app()->request->getPost('patientticketing__notes', null) != null) { $_POST['patientticketing__notes'] = htmlspecialchars(Yii::app()->request->getPost('patientticketing__notes', null)); } parent::actionCreate(); }
/** * Manage picking an extant booking for setting consent form defaults. * * (non-phpdoc) * * @see BaseEventTypeController::actionCreate() */ public function actionCreate() { $errors = array(); if (!empty($_POST)) { // Save and print clicked, stash print flag if (isset($_POST['saveprint'])) { Yii::app()->session['printConsent'] = 1; } if (@$_POST['SelectBooking'] == 'unbooked') { $this->redirect(array('/OphTrConsent/Default/create?patient_id=' . $this->patient->id . '&unbooked=1')); } elseif (preg_match('/^booking([0-9]+)$/', @$_POST['SelectBooking'], $m)) { $this->redirect(array('/OphTrConsent/Default/create?patient_id=' . $this->patient->id . '&booking_event_id=' . $m[1])); } $errors = array('Consent form' => array('Please select a booking or Unbooked procedures')); } if ($this->booking_event || $this->unbooked) { parent::actionCreate(); } else { $bookings = array(); if ($api = Yii::app()->moduleAPI->get('OphTrOperationbooking')) { if ($episode = $this->patient->getEpisodeForCurrentSubspecialty()) { $bookings = $api->getOperationsForEpisode($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::button('Cancel', Yii::app()->createUrl($cancel_url), array('level' => 'cancel'), array('id' => 'et_cancel'))); $this->processJsVars(); $this->render('select_event', array('errors' => $errors, 'bookings' => $bookings), false, true); } }
public function actionCreate() { parent::actionCreate(); }
/** * 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)); } }