OEModule\PatientTicketing\widgets\PatientAlert::run PHP Method

run() public method

public run ( )
    public function run()
    {
        $t_svc = Yii::app()->service->getService('PatientTicketing_Ticket');
        $tickets = $t_svc->getTicketsForPatient($this->patient);
        $match = false;
        if ($curr_ids = Yii::app()->session['patientticket_ticket_ids']) {
            foreach ($tickets as $ticket) {
                if ($ticket->id == $curr_ids[0]) {
                    $match = true;
                    break;
                }
            }
            if (!$match) {
                // either viewing a different patient, or the ticket has been closed
                Yii::app()->session['patientticket_ticket_ids'] = null;
            }
        } else {
            $curr_ids = array();
        }
        $this->render('PatientAlert', array('tickets' => $tickets, 't_svc' => $t_svc, 'summary_widget' => components\PatientTicketing_API::$TICKET_SUMMARY_WIDGET, 'current_ticket_ids' => $curr_ids));
    }
PatientAlert