Inheritance: extends PHPUnit_Framework_TestCase
 public function createAction()
 {
     $test = new Tests();
     $test->setTestName('First test');
     $test->setPublished(true);
     $em = $this->getDoctrine()->getEntityManager();
     $em->persist($test);
     $em->flush();
     return new Response('Created new test ' . $test->getTestName());
 }
示例#2
0
 /**
  * Добавление/обновление вакансии
  * @return void
  */
 public function editAction()
 {
     if ($this->_authorize('vacancies', 'edit')) {
         $form = new Form_Vacancy_Edit();
         // выбираем из базы данные о редактируемой вакансии
         $objTest = new Tests();
         $tests = $objTest->fetchAll()->toArray();
         $objVT = new VacanciesTest();
         //Добавляет тесты на форму
         $form->addElementsForm($tests);
         if ($this->getRequest()->isPost()) {
             if ($form->isValid($_POST)) {
                 // Выполняем update (insert/update данных о вакансии)
                 $objVacancies = new Vacancies();
                 $vacancyId = $form->vacancyId->getValue();
                 $objVacancy = $objVacancies->getObjectById($vacancyId);
                 if (!$objVacancy instanceof Vacancy) {
                     $objVacancy = $objVacancies->createRow();
                 }
                 $objVacancy->name = $form->Name->getValue();
                 $objVacancy->num = $form->Num->getValue();
                 $objVacancy->duties = $form->Duties->getValue();
                 $objVacancy->requirements = $form->Requirements->getValue();
                 $idSaveVacancy = $objVacancy->save();
                 $test = $this->keyReplace($form->getValues(), 'test_');
                 $objVT->delete('vacancy_id = ' . $idSaveVacancy);
                 foreach ($test as $testId => $val) {
                     if ($val) {
                         $newRow = $objVT->createRow(array('vacancy_id' => $idSaveVacancy, 'test_id' => $testId));
                         $newRow->save();
                     }
                 }
                 $this->_helper->redirector('index', 'vacancy');
             }
         } else {
             $vacancyId = (int) $this->getRequest()->getParam('vacancyId');
             if ($vacancyId != '') {
                 // выбираем из базы данные о редактируемой вакансии
                 $vacancies = new Vacancies();
                 $objVacancy = $vacancies->getObjectById($vacancyId);
                 if ($objVacancy instanceof Vacancy) {
                     $this->view->objVacancy = $objVacancy;
                     $form->populate(array('Name' => $objVacancy->name, 'Num' => $objVacancy->num, 'Duties' => $objVacancy->duties, 'Requirements' => $objVacancy->requirements, 'vacancyId' => $objVacancy->id));
                 }
                 $testIds = $objVT->getTestIds($vacancyId);
                 // отмечаем выбранные тесты
                 foreach ($testIds as $id) {
                     $form->populate(array('test_' . $id => 1));
                 }
             }
         }
         $this->view->objVacancyEditForm = $form;
     }
 }
示例#3
0
 public function setUp()
 {
     self::$title = self::text(20);
     $this->Meta = new Meta(['title_limit' => 70, 'description_limit' => 200, 'image_limit' => 5]);
 }
示例#4
0
<?php

require_once '../tst.class.php';
if (Tst::access(array(1, 3))) {
    require_once Tst::$tests . 'files/classes/tests.class.php';
    $tests = new Tests();
    $table = '';
    foreach ($_POST['logs'] as $log) {
        $table .= json_encode($tests->createTable($tests->getJSONResults(1, 1, $log)));
    }
    echo $table;
} else {
    echo 'This is not enabled';
}
示例#5
0
<?php

// Script to run all tests, intended for cronjob
require_once 'tst.class.php';
Tst::access(array(2), 1);
require_once Tst::$tests . 'files/classes/tests.class.php';
$tests = new Tests();
$suite = array(Tst::$tests . '/suite');
// Run suite and store logs, but don't return anything
$output = json_encode($tests->runTests($suite, 1, 0, 0));
echo $output;
<?php

require_once '../tst.class.php';
Tst::access(array(2, 3), 1);
require_once Tst::$tests . 'files/classes/tests.class.php';
$tests = new Tests();
$loglist = $tests->deleteLogs($_POST['logs']);
<?php

require_once '../tst.class.php';
require_once Tst::$tests . 'files/classes/tests.class.php';
$tests = new Tests();
$loglist = $tests->displayLogList(1, $_POST['howMany']);
if (!empty($loglist)) {
    foreach ($loglist as $v) {
        echo $v;
    }
} else {
    echo 'There aren\'t any logs yet.';
}
示例#8
0
<?php

require_once "../../init.php";
extract($_POST);
if ($category_register && $title_register && $template_register && $code_register) {
    $test = new Tests();
    $test->title = $title_register;
    $test->category = $category_register;
    $test->template = $template_register;
    $test->code = $code_register;
    $test->enabled = true;
    $insertid = $test->insert();
}
echo $insertid ? $insertid : 0;
示例#9
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Tests $value A Tests object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Tests $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
示例#10
0
 public function dashboard()
 {
     $user_id = Session::get('user_id');
     $practice_id = Session::get('practice_id');
     $data['practiceinfo'] = Practiceinfo::find($practice_id);
     $result = User::find($user_id);
     $data['displayname'] = $result->displayname;
     $displayname = $result->displayname;
     $fax_query = Received::where('practice_id', '=', $practice_id)->count();
     $from = $displayname . ' (' . $user_id . ')';
     if (Session::get('group_id') == '2') {
         $data['number_messages'] = Messaging::where('mailbox', '=', $user_id)->count();
         $data['number_documents'] = Scans::where('practice_id', '=', $practice_id)->count() + $fax_query;
         $data['number_appts'] = $this->getNumberAppts($user_id);
         $query1 = DB::table('t_messages')->join('demographics', 't_messages.pid', '=', 'demographics.pid')->where('t_messages.t_messages_from', '=', $from)->where('t_messages.t_messages_signed', '=', 'No')->count();
         $query2 = DB::table('encounters')->join('demographics', 'encounters.pid', '=', 'demographics.pid')->where('encounters.encounter_provider', '=', $displayname)->where('encounters.encounter_signed', '=', 'No')->count();
         $data['number_drafts'] = $query1 + $query2;
         $data['number_reminders'] = DB::table('alerts')->join('demographics', 'alerts.pid', '=', 'demographics.pid')->where('alerts.alert_provider', '=', $user_id)->where('alerts.alert_date_complete', '=', '0000-00-00 00:00:00')->where('alerts.alert_reason_not_complete', '=', '')->where(function ($query_array) {
             $query_array->where('alerts.alert', '=', 'Laboratory results pending')->orWhere('alerts.alert', '=', 'Radiology results pending')->orWhere('alerts.alert', '=', 'Cardiopulmonary results pending')->orWhere('alerts.alert', '=', 'Referral pending')->orWhere('alerts.alert', '=', 'Reminder')->orWhere('alerts.alert', '=', 'REMINDER');
         })->count();
         $data['number_bills'] = Encounters::where('bill_submitted', '=', 'No')->where('user_id', '=', $user_id)->count();
         $data['number_tests'] = Tests::whereNull('pid')->where('practice_id', '=', $practice_id)->count();
         if ($data['practiceinfo']->mtm_extension == 'y') {
             $mtm_users_array = explode(",", $data['practiceinfo']->mtm_alert_users);
             if (in_array($user_id, $mtm_users_array)) {
                 $data['mtm_alerts'] = Alerts::where('alert_date_complete', '=', '0000-00-00 00:00:00')->where('alert_reason_not_complete', '=', '')->where('alert', '=', 'Medication Therapy Management')->where('practice_id', '=', $practice_id)->count();
                 $data['mtm_alerts_status'] = "y";
             } else {
                 $data['mtm_alerts_status'] = "n";
             }
         } else {
             $data['mtm_alerts_status'] = "n";
         }
         $data['vaccine_supplement_alert'] = $this->vaccine_supplement_alert($practice_id);
     }
     if (Session::get('group_id') == '3') {
         $data['number_messages'] = Messaging::where('mailbox', '=', $user_id)->count();
         $data['number_documents'] = Scans::where('practice_id', '=', $practice_id)->count() + $fax_query;
         $data['number_drafts'] = DB::table('t_messages')->join('demographics', 't_messages.pid', '=', 'demographics.pid')->where('t_messages.t_messages_from', '=', $from)->where('t_messages.t_messages_signed', '=', 'No')->count();
         $data['number_reminders'] = DB::table('alerts')->join('demographics', 'alerts.pid', '=', 'demographics.pid')->where('alerts.alert_provider', '=', $user_id)->where('alerts.alert_date_complete', '=', '0000-00-00 00:00:00')->where('alerts.alert_reason_not_complete', '=', '')->where(function ($query_array) {
             $query_array->where('alerts.alert', '=', 'Laboratory results pending')->orWhere('alerts.alert', '=', 'Radiology results pending')->orWhere('alerts.alert', '=', 'Cardiopulmonary results pending')->orWhere('alerts.alert', '=', 'Referral pending')->orWhere('alerts.alert', '=', 'Reminder')->orWhere('alerts.alert', '=', 'REMINDER');
         })->count();
         $data['number_bills'] = Encounters::where('bill_submitted', '=', 'No')->where('practice_id', '=', $practice_id)->count();
         $data['number_tests'] = Tests::whereNull('pid')->where('practice_id', '=', $practice_id)->count();
         $data['vaccine_supplement_alert'] = $this->vaccine_supplement_alert($practice_id);
     }
     if (Session::get('group_id') == '4') {
         $data['number_messages'] = Messaging::where('mailbox', '=', $user_id)->count();
         $data['number_bills'] = Encounters::where('bill_submitted', '=', 'No')->where('practice_id', '=', $practice_id)->count();
         $data['number_documents'] = Scans::where('practice_id', '=', $practice_id)->count() + $fax_query;
     }
     if (Session::get('group_id') == '100') {
         $row = Demographics_relate::where('id', '=', $user_id)->first();
         Session::put('pid', $row->pid);
     }
     if (Session::get('group_id') == '1') {
         if ($practice_id == '1') {
             $data['saas_admin'] = 'y';
         } else {
             $data['saas_admin'] = 'n';
         }
         if (Session::get('patient_centric') != 'y') {
             $users = DB::table('users')->where('group_id', '=', '2')->where('practice_id', '=', Session::get('practice_id'))->first();
             if ($users) {
                 $data['users_needed'] = 'n';
             } else {
                 $data['users_needed'] = 'y';
             }
         } else {
             $data['users_needed'] = 'n';
         }
         if (Session::get('patient_centric') != 'y') {
             $schedule = DB::table('practiceinfo')->where('practice_id', '=', Session::get('practice_id'))->whereNull('minTime')->first();
             if ($schedule) {
                 $data['schedule_needed'] = 'y';
             } else {
                 $data['schedule_needed'] = 'n';
             }
         } else {
             $data['schedule_needed'] = 'n';
         }
     }
     if ($data['practiceinfo']->weekends == '1') {
         $data['weekends'] = 'true';
     } else {
         $data['weekends'] = 'false';
     }
     $data['minTime'] = ltrim($data['practiceinfo']->minTime, "0");
     $data['maxTime'] = ltrim($data['practiceinfo']->maxTime, "0");
     if (Session::get('group_id') == '2') {
         $provider = Providers::find(Session::get('user_id'));
         $data['schedule_increment'] = $provider->schedule_increment;
     } else {
         $data['schedule_increment'] = '15';
     }
     if (!Session::get('encounter_active')) {
         Session::put('encounter_active', 'n');
     }
     if ($data['practiceinfo']->fax_type != "") {
         $data1['fax'] = true;
     } else {
         $data1['fax'] = false;
     }
     $this->layout->style = $this->css_assets();
     $this->layout->script = $this->js_assets('home');
     $this->layout->content = '';
     if (Session::get('group_id') == '1') {
         $this->layout->content .= View::make('search', $this->getSearchData())->render();
         $this->layout->content .= View::make('dashboard', $data)->render();
         $this->layout->content .= View::make('setup')->render();
         $this->layout->content .= View::make('users')->render();
         $this->layout->content .= View::make('extensions', $data)->render();
         $this->layout->content .= View::make('schedule_admin')->render();
         $this->layout->content .= View::make('update')->render();
         $this->layout->content .= View::make('logs')->render();
         $this->layout->content .= View::make('schedule')->render();
     }
     if (Session::get('group_id') == '2' || Session::get('group_id') == '3' || Session::get('group_id') == '4') {
         $this->layout->content .= View::make('search', $this->getSearchData())->render();
         $this->layout->content .= View::make('dashboard', $data)->render();
         $this->layout->content .= View::make('demographics')->render();
         $this->layout->content .= View::make('options')->render();
         $this->layout->content .= View::make('messaging', $data1)->render();
         $this->layout->content .= View::make('schedule')->render();
         $this->layout->content .= View::make('billing')->render();
         $this->layout->content .= View::make('financial')->render();
         $this->layout->content .= View::make('office')->render();
         if (Session::get('patient_centric') == 'yp' && Session::get('group_id') == '2') {
             $this->layout->content .= View::make('setup')->render();
         }
     }
     if (Session::get('group_id') == '100') {
         $this->layout->content .= View::make('dashboard', $data)->render();
         $this->layout->content .= View::make('demographics')->render();
         $this->layout->content .= View::make('messaging', $data1)->render();
         $this->layout->content .= View::make('schedule')->render();
         $this->layout->content .= View::make('issues')->render();
         $this->layout->content .= View::make('encounters')->render();
         $this->layout->content .= View::make('t_messages')->render();
         $this->layout->content .= View::make('medications')->render();
         $this->layout->content .= View::make('supplements')->render();
         $this->layout->content .= View::make('allergies')->render();
         $this->layout->content .= View::make('immunizations')->render();
         $this->layout->content .= View::make('documents')->render();
         $this->layout->content .= View::make('forms')->render();
         $this->layout->content .= View::make('graph')->render();
     }
 }
 public function postTestsImport()
 {
     if (Session::get('group_id') != '2' && Session::get('group_id') != '3') {
         Auth::logout();
         Session::flush();
         header("HTTP/1.1 404 Page Not Found", true, 404);
         exit("You cannot do this.");
     } else {
         $pid = Input::get('pid');
         $tests_id_array = json_decode(Input::get('tests_id_array'));
         $i = 0;
         $results = array();
         foreach ($tests_id_array as $tests_id) {
             $data = array('pid' => $pid, 'test_unassigned' => '');
             DB::table('tests')->where('tests_id', '=', $tests_id)->update($data);
             $this->audit('Update');
             $results[$i] = Tests::find($tests_id)->toArray();
             $provider_id = $results[$i]['test_provider_id'];
             $from = $results[$i]['test_from'];
             $test_type = $results[$i]['test_type'];
             $i++;
         }
         $patient_row = Demographics::find($pid)->toArray();
         $dob_message = date("m/d/Y", strtotime($patient_row['DOB']));
         $patient_name = $patient_row['lastname'] . ', ' . $patient_row['firstname'] . ' (DOB: ' . $dob_message . ') (ID: ' . $pid . ')';
         $practice_row = Practiceinfo::find(Session::get('practice_id'))->toArray();
         $directory = $practice_row['documents_dir'] . $pid;
         $file_path = $directory . '/tests_' . time() . '.pdf';
         $html = $this->page_intro('Test Results', $practice_id);
         $html .= $this->page_results($pid, $results, $patient_name);
         $this->generate_pdf($html, $file_path);
         $documents_date = date("Y-m-d H:i:s", time());
         $test_desc = 'Test results for ' . $patient_name;
         $pages_data = array('documents_url' => $file_path, 'pid' => $pid, 'documents_type' => $test_type, 'documents_desc' => $test_desc, 'documents_from' => $from, 'documents_date' => $documents_date);
         if (Session::get('group_id') == '2') {
             $pages_data['documents_viewed'] = Session::get('displayname');
         }
         $documents_id = DB::table('documents')->insertGetId($pages_data);
         $this->audit('Add');
         if (Session::get('group_id') == '3') {
             $provider_row = User::find($provider_id)->toArray();
             $provider_name = $provider_row['firstname'] . " " . $provider_row['lastname'] . ", " . $provider_row['title'] . " (" . $provider_id . ")";
             $subject = "Test results for " . $patient_name;
             $body = "Test results for " . $patient_name . "\n\n";
             foreach ($results as $results_row1) {
                 $body .= $results_row1['test_name'] . ": " . $results_row1['test_result'] . ", Units: " . $results_row1['test_units'] . ", Normal reference range: " . $results_row1['test_reference'] . ", Date: " . $results_row1['test_datetime'] . "\n";
             }
             $body .= "\n" . $from;
             $data_message = array('pid' => $pid, 'message_to' => $provider_name, 'message_from' => Session::get('user_id'), 'subject' => $subject, 'body' => $body, 'patient_name' => $patient_name, 'status' => 'Sent', 'mailbox' => $provider_id, 'practice_id' => $practice_id, 'documents_id' => $documents_id);
             DB::table('messaging')->insert($data_message);
             $this->audit('Add');
         }
         echo $i;
     }
 }
 public function postTestsView($tests_id, $pid)
 {
     $row = Tests::find($tests_id);
     $row1 = Demographics::find($pid);
     $text = '<strong>Patient:</strong>  ' . $row1->firstname . " " . $row1->lastname . '<br><br><strong>Type:</strong>  ' . $row->test_type . '<br><br><strong>Date:</strong>  ' . date('m/d/Y', $row->test_datetime) . '<br><br><strong>Test</strong>  ' . $row->test_name . '<br><br><strong>Result:</strong> ' . $row->test_result . ' ' . $row->test_units . ' (' . $row->test_reference . ')<br><br><strong>From:</strong> ' . $row->test_from;
     echo $text;
 }
示例#13
0
文件: go.php 项目: khandieyea/timegap
        $x->setString('weeks, days, hours, minutes, seconds');
        $x->setLimit(2);
        $this->assertEquals($x->output(), '2 days, 12 hours');
        //30 minutes;
        $x->setThen(time() + 1800);
        $x->setString('years, months, seconds');
        $this->assertEquals($x->output(), '1800 seconds');
        $x->setString('minutes');
        $this->assertEquals($x->output_default, '30 minutes');
        //$x->setString('years');
        $this->assertEquals($x->output_years, '');
        $x->setThen(time() + (3600 + 945));
        $this->assertEquals($x->output_hourscowsminutescowssec_onds, '1 hour, 15 minutes, 45 seconds');
    }
}
$a = new Tests();
$a->testOutputTests();
// $x = new TimeGap\Timegap();
// $x
// 	//->setNow('2013-01-01')
// 	->setThen(time() + 3600)
// 	->setString("months, weeks, days, hours")
// 	->setLimit(3);
// echo $x->output();
// $x = new TimeGap\Timegap();
//    					//2 days + 12 hours, 30 minutes
// $x->setThen(time()+ (172800+43200+1800));
// $x->setString('days, hours, minutes');
// $x->setLimit(2);
//    // $this->assertEquals(
//    echo '<pre>';
<?php

/**
* Runs selected tests and returns specified results, intended for use by GUI
*
*/
require_once '../tst.class.php';
Tst::access(array(2, 3), 1);
require_once Tst::$tests . 'files/classes/tests.class.php';
$tests = new Tests();
$output = json_encode($tests->runTests($_POST['test'], $_POST['logResults'], $_POST['consoleOutput'], $_POST['showLog']));
echo $output;
示例#15
0
 public function __construct()
 {
     parent::__construct();
     $this->_init_language_for_student();
 }
示例#16
0
 /**
  * Добавление/обновление вопроса
  * @return void
  */
 public function editAction()
 {
     if ($this->_authorize('question', 'edit')) {
         $objForm = new Form_Question_Edit();
         $arrParams = $this->getRequest()->getParams();
         $testId = $this->getRequest()->getParam('testId');
         if ($testId != '') {
             // выбираем из базы категории вопросов
             $objCategories = new QuestionCategories();
             $arrCategories = $objCategories->getCategoryShortListByTestId($testId);
             $objForm->setCategoriesSelectOptions($arrCategories);
         }
         if ($this->getRequest()->isPost()) {
             if ($objForm->isValid($_POST)) {
                 // Выполняем update (insert/update данных о вопросе)
                 $strQuestionText = $objForm->questionText->getValue();
                 $intQuestionWeight = $objForm->questionWeight->getValue();
                 $objQuestions = new Questions();
                 $intMaxSortIndex = $objQuestions->getMaxSortIndex($testId);
                 $questionId = $objForm->questionId->getValue();
                 if (!empty($questionId)) {
                     $objQuestion = $objQuestions->getQuestionById($questionId);
                 } else {
                     $objQuestion = $objQuestions->createRow();
                     $questionId = null;
                     $objQuestion->setSortIndex($intMaxSortIndex + 1);
                 }
                 $objQuestion->setText($strQuestionText);
                 $objQuestion->setTestId($testId);
                 $objQuestion->setWeight($intQuestionWeight);
                 if ($arrCategories) {
                     $objQuestion->setCategoryId($objForm->categoryId->getValue());
                 }
                 if (array_key_exists('answer', $arrParams)) {
                     $intAnswerAmount = sizeof($arrParams['answer']);
                     $objQuestion->setAnswerAmount($intAnswerAmount);
                 }
                 $objQuestion->save();
                 if (!$questionId) {
                     $questionId = $objQuestions->getAdapter()->lastInsertId();
                 }
                 // Вносим в базу варианты ответов и обг=новляем их количество,
                 // поскольку не валидные в базу не добавляются и количество
                 // элементов в массиве $arrParams['answer'] может не совпадать
                 // с количеством ответов, фактически внесенных в БД
                 if (array_key_exists('answer', $arrParams) && !empty($arrParams['answer'])) {
                     $intAnswerAmount = $objQuestions->saveAnswerList($questionId, $arrParams['answer']);
                     $objQuestion->setAnswerAmount($intAnswerAmount);
                 }
                 $objQuestion->updateRightAnswersAmount();
                 $objQuestion->save();
                 $this->_helper->redirector('edit', 'test', null, array('testId' => $testId));
             } else {
                 if ($testId != '') {
                     // выбираем из базы данные о редактируемом тесте
                     $objTests = new Tests();
                     $objTest = $objTests->getTestById($testId);
                     $this->view->objTest = $objTest;
                 }
                 $arrAnswer = array();
                 if (array_key_exists('questionId', $arrParams) && !empty($arrParams['questionId'])) {
                     $questionId = (int) $arrParams['questionId'];
                     // выбираем из базы данные о редактируемом вопросе
                     $objQuestions = new Questions();
                     $objQuestion = $objQuestions->getQuestionById($questionId);
                     $arrAnswer = $objQuestions->getAnswerListByQuestionId($questionId);
                 }
                 $objForm->addAnswersSubForm($arrAnswer);
                 // @todo: пререформатировать массив answer, полученный через POST для функции addAnswersSubForm()
             }
         } else {
             $arrAnswer = array();
             if (array_key_exists('questionId', $arrParams) && !empty($arrParams['questionId'])) {
                 $questionId = (int) $arrParams['questionId'];
                 // выбираем из базы данные о редактируемом вопросе
                 $objQuestions = new Questions();
                 $objQuestion = $objQuestions->getQuestionById($questionId);
                 $arrAnswer = $objQuestions->getAnswerListByQuestionId($questionId);
                 $objForm->populate(array('questionText' => $objQuestion->tq_text, 'questionId' => $objQuestion->tq_id, 'questionWeight' => $objQuestion->getWeight(), 'categoryId' => $objQuestion->getCategoryId(), 'testId' => $testId));
             }
             $objForm->addAnswersSubForm($arrAnswer);
             if (!empty($testId)) {
                 // выбираем из базы данные о редактируемом тесте
                 $objTests = new Tests();
                 $objTest = $objTests->getTestById($testId);
                 $this->view->objTest = $objTest;
                 $objForm->populate(array('testId' => $testId));
             }
         }
         $this->view->objForm = $objForm;
     }
 }
示例#17
0
 /**
  * Declares an association between this object and a Tests object.
  *
  * @param      Tests $v
  * @return     Pruebas The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setTests(Tests $v = null)
 {
     if ($v === null) {
         $this->setTestsId(NULL);
     } else {
         $this->setTestsId($v->getId());
     }
     $this->aTests = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Tests object, it will not be re-added.
     if ($v !== null) {
         $v->addPruebas($this);
     }
     return $this;
 }
示例#18
0
 /**
  * Пересчитывает количество вопросов в тесте
  * @return void
  */
 public function recalculationAction()
 {
     if ($this->_authorize('test', 'edit')) {
         $testId = (int) $this->getRequest()->getParam('testId');
         if ($testId) {
             $objTests = new Tests();
             $objTests->recalculationQuestions($testId);
             $objQuestions = new Questions();
             $objQuestions->recalculationAnswers($testId);
             //die(''.$testId);
         }
         $this->_helper->redirector('index', 'test');
     }
 }
示例#19
0
 public function dashboard()
 {
     $practice = DB::table('practiceinfo')->where('practice_id', '=', Session::get('practice_id'))->first();
     $user_id = Session::get('user_id');
     $result = User::find($user_id);
     $practice_id = Session::get('practice_id');
     $fax_query = Received::where('practice_id', '=', $practice_id)->count();
     $displayname = $result->displayname;
     $from = $displayname . ' (' . $user_id . ')';
     $data['header'] = $this->mobile_header_build(Session::get('displayname'));
     if (Session::get('group_id') == '2') {
         $data1['number_messages'] = Messaging::where('mailbox', '=', $user_id)->count();
         $data1['number_documents'] = Scans::where('practice_id', '=', $practice_id)->count() + $fax_query;
         $data1['number_appts'] = $this->getNumberAppts($user_id);
         $query1 = DB::table('t_messages')->join('demographics', 't_messages.pid', '=', 'demographics.pid')->where('t_messages.t_messages_from', '=', $from)->where('t_messages.t_messages_signed', '=', 'No')->count();
         $query2 = DB::table('encounters')->join('demographics', 'encounters.pid', '=', 'demographics.pid')->where('encounters.encounter_provider', '=', $displayname)->where('encounters.encounter_signed', '=', 'No')->count();
         $data1['number_drafts'] = $query1 + $query2;
         $data1['number_reminders'] = DB::table('alerts')->join('demographics', 'alerts.pid', '=', 'demographics.pid')->where('alerts.alert_provider', '=', $user_id)->where('alerts.alert_date_complete', '=', '0000-00-00 00:00:00')->where('alerts.alert_reason_not_complete', '=', '')->where(function ($query_array) {
             $query_array->where('alerts.alert', '=', 'Laboratory results pending')->orWhere('alerts.alert', '=', 'Radiology results pending')->orWhere('alerts.alert', '=', 'Cardiopulmonary results pending')->orWhere('alerts.alert', '=', 'Referral pending')->orWhere('alerts.alert', '=', 'Reminder')->orWhere('alerts.alert', '=', 'REMINDER');
         })->count();
         $data1['number_bills'] = Encounters::where('bill_submitted', '=', 'No')->where('user_id', '=', $user_id)->count();
         $data1['number_tests'] = Tests::whereNull('pid')->where('practice_id', '=', $practice_id)->count();
     }
     $data['content'] = View::make('mobile.home_content', $data1)->render();
     $data['form'] = '';
     $left_panel_array = array(array('Schedule', 'mobile_schedule'), array('Inbox', 'mobile_inbox'));
     if (Session::get('group_id') != '100') {
         $left_panel_array[] = array('Drafts', 'mobile_drafts');
         $left_panel_array[] = array('Alerts', 'mobile_alerts');
         if (Session::get('patient_centric') == 'n') {
             $left_panel_array[] = array('Scans', 'mobile_scan');
             if ($practice->fax_type != "") {
                 $left_panel_array[] = array('Faxes', 'mobile_fax');
             }
         }
     }
     $data['left_panel'] = $this->mobile_menu_build($left_panel_array, "left_panel_list", 'mobile_click_home');
     $data['right_panel'] = '';
     $this->layout->style = HTML::style('css/mobile.css');
     $this->layout->style .= HTML::style('css/toastr.min.css');
     $this->layout->script = $this->js_assets('base', true);
     $this->layout->content = View::make('mobile.home', $data);
 }
 public function postChartTest($tests_id)
 {
     $pid = Session::get('pid');
     $demographics = Demographics::find($pid);
     $datenow = date("D, d M y H:i:s O", time());
     $row0 = Tests::find($tests_id);
     $data['patient'] = array();
     $data['yaxis'] = $row0->test_units;
     $data['xaxis'] = 'Date';
     $data['name'] = $row0->test_name;
     $data['title'] = 'Chart of ' . $row0->test_name . ' over time for ' . $demographics->firstname . ' ' . $demographics->lastname . ' as of ' . $datenow;
     $query1 = DB::table('tests')->where('test_name', '=', $row0->test_name)->where('pid', '=', $pid)->orderBy('test_datetime', 'ASC')->get();
     if ($query1) {
         $i = 0;
         foreach ($query1 as $row1) {
             $x = $row1->test_datetime;
             $y = $row1->test_result;
             $data['patient'][$i][] = $x;
             $data['patient'][$i][] = $y;
             $i++;
         }
     }
     echo json_encode($data);
 }
示例#21
0
 function staticGet($p, $k = false)
 {
     $cl = new Tests();
     $cl->get($p, $k);
     return $cl;
 }
示例#22
0
{
    $complement = null;
    switch ($char) {
        case ')':
            $complement = '(';
            break;
        case ']':
            $complement = '[';
            break;
        case '}':
            $complement = '{';
            break;
    }
    return $complement;
}
$test = new Tests('Brackets');
// example1
// example test 1
$A = '{[()()]}';
$result = 1;
$test->run($A, $result);
// example2
// example test 2
$A = '([)()]';
$result = 0;
$test->run($A, $result);
// negative_match
// invalid structures
$A = '{{{{';
$result = 0;
$test->run($A, $result);