public function getFollowUpFromAutoSave($patient_id, $current_queue_id)
 {
     if ($data = AutoSaveTicket::getFormData($patient_id, $current_queue_id)) {
         if ($data['validated']) {
             if (isset($data['patientticketing_glreview'])) {
                 return $data['patientticketing_glreview'];
             }
         }
     }
 }
Example #2
0
 public function testAutoSaveClear()
 {
     $first_patient_id = 1;
     $second_patient_id = 2;
     $first_queue_id = 1;
     $second_queue_id = 1;
     $data = array('key' => 'value');
     AutoSaveTicket::saveFormData($first_patient_id, $first_queue_id, $data);
     AutoSaveTicket::saveFormData($second_patient_id, $second_queue_id, $data);
     $this->assertNotNull(AutoSaveTicket::getFormData($first_patient_id, $first_queue_id));
     $this->assertNotNull(AutoSaveTicket::getFormData($first_patient_id, $second_queue_id));
     AutoSaveTicket::clear();
     $this->assertNull(AutoSaveTicket::getFormData($first_patient_id, $first_queue_id));
     $this->assertNull(AutoSaveTicket::getFormData($first_patient_id, $second_queue_id));
 }
Example #3
0
 public function run()
 {
     $cls_name = explode('\\', get_class($this));
     $this->shortName = array_pop($cls_name);
     if (file_exists(dirname(__FILE__) . '/js/' . $this->shortName . '.js')) {
         $this->assetFolder = Yii::app()->getAssetManager()->publish(dirname(__FILE__) . '/js/');
         Yii::app()->getClientScript()->registerScriptFile($this->assetFolder . '/' . $this->shortName . '.js');
     }
     if ($this->queue_id) {
         $queue = models\Queue::model()->findByPk($this->queue_id);
     } else {
         $queue = null;
     }
     $form_fields = $queue->getFormFields();
     $auto_save = false;
     if (isset($_POST[$form_fields[0]['form_name']])) {
         // if post contains patient ticket data
         $form_data = $_POST;
     } elseif ($form_data = AutoSaveTicket::getFormData($this->patient_id, $this->current_queue_id)) {
         $auto_save = true;
     }
     //if this is the outcome widget and a correspondence has been created
     //display the print letter button
     $print_letter_event = false;
     foreach ($form_fields as $fld) {
         if (@$fld['widget_name'] == 'TicketAssignAppointment') {
             if ($api = \Yii::app()->moduleAPI->get('OphCoCorrespondence')) {
                 if ($episode = $this->ticket->patient->getEpisodeForCurrentSubspecialty()) {
                     if ($event = $api->getLatestEvent($episode)) {
                         if ($event->created_date > $this->ticket->created_date) {
                             $print_letter_event = $event;
                         }
                     }
                 }
             }
         }
     }
     $this->render('QueueAssign', array('queue' => $queue, 'form_fields' => $form_fields, 'form_data' => $form_data, 'auto_save' => $auto_save, 'print_letter_event' => $print_letter_event));
 }
Example #4
0
 private static function autoSaveTicket($data)
 {
     unset($data['YII_CSRF_TOKEN']);
     unset($data['queue']);
     AutoSaveTicket::saveFormData($_POST['patient_id'], $_POST['from_queue_id'], $data);
 }
 public function getAutoSaveData()
 {
     return AutoSaveTicket::getFormData($this->ticket->patient_id, $this->ticket->current_queue->id);
 }