Exemplo n.º 1
1
 /**
  * @see ViewQuickcreate::display()
  */
 public function display()
 {
     $userPref = $GLOBALS['current_user']->getPreference('email_link_type');
     $defaultPref = $GLOBALS['sugar_config']['email_default_client'];
     if ($userPref != '') {
         $client = $userPref;
     } else {
         $client = $defaultPref;
     }
     if ($client == 'sugar') {
         $eUi = new EmailUI();
         if (!empty($this->bean->id) && !in_array($this->bean->object_name, array('EmailMan'))) {
             $fullComposeUrl = "index.php?module=Emails&action=Compose&parent_id={$this->bean->id}&parent_type={$this->bean->module_dir}";
             $composeData = array('parent_id' => $this->bean->id, 'parent_type' => $this->bean->module_dir);
         } else {
             $fullComposeUrl = "index.php?module=Emails&action=Compose";
             $composeData = array('parent_id' => '', 'parent_type' => '');
         }
         $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreate($composeData, $fullComposeUrl);
         $json_obj = getJSONobj();
         $opts = $json_obj->decode($j_quickComposeOptions);
         $opts['menu_id'] = 'dccontent';
         $ss = new Sugar_Smarty();
         $ss->assign('json_output', $json_obj->encode($opts));
         $ss->display('modules/Emails/templates/dceMenuQuickCreate.tpl');
     } else {
         $emailAddress = '';
         if (!empty($this->bean->id) && !in_array($this->bean->object_name, array('EmailMan')) && !is_null($this->bean->emailAddress)) {
             $emailAddress = $this->bean->emailAddress->getPrimaryAddress($this->bean);
         }
         echo "<script>document.location.href='mailto:{$emailAddress}';lastLoadedMenu=undefined;DCMenu.closeOverlay();</script>";
         die;
     }
 }
Exemplo n.º 2
1
 function display()
 {
     $db = DBManagerFactory::getInstance();
     /* <<<<<<< HEAD
     		$sql = "SELECT p.id,p.first_name,p.last_name,p.dob FROM reg_patient p WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.next_pmp_review_due_c is not null) ORDER By p.last_name, p.first_name";
     ======= */
     $sql = "SELECT p.id,p.first_name,p.last_name,p.dob, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null) ORDER By p.last_name, p.first_name";
     // >>>>>>> 3097a71433de82fec730df252659026274347e46
     $resultb = $db->query($sql, true);
     $final = array();
     while ($row = $db->fetchByAssoc($resultb)) {
         $final[] = $row;
     }
     $sql1 = "SELECT p.id, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null) GROUP BY provname ORDER By p.last_name, p.first_name";
     $resultb1 = $db->query($sql1, true);
     $final1 = array();
     while ($row1 = $db->fetchByAssoc($resultb1)) {
         $final1[] = $row1;
     }
     $sugarSmarty = new Sugar_Smarty();
     $sugarSmarty->assign("data", $final);
     $sugarSmarty->assign("data1", $final1);
     $sugarSmarty->assign("title", "Patients who do not have PMP");
     $sugarSmarty->display('custom/modules/REG_Patient/tpls/Report1REG_Patient.tpl');
     //        parent::display();
 }
Exemplo n.º 3
0
 function display()
 {
     global $mod_strings, $app_strings;
     require_once 'include/connectors/utils/ConnectorUtils.php';
     require_once 'include/connectors/sources/SourceFactory.php';
     $sugar_smarty = new Sugar_Smarty();
     $sugar_smarty->assign('mod', $mod_strings);
     $sugar_smarty->assign('APP', $app_strings);
     $connectors = ConnectorUtils::getConnectors(true);
     $required_fields = array();
     //Get required fields for first connector only
     foreach ($connectors as $id => $entry) {
         $s = SourceFactory::getSource($id);
         $connector_strings = ConnectorUtils::getConnectorStrings($id);
         $fields = $s->getRequiredConfigFields();
         foreach ($fields as $field_id) {
             $label = isset($connector_strings[$field_id]) ? $connector_strings[$field_id] : $field_id;
             $required_fields[$id][$field_id] = $label;
         }
         break;
     }
     $sugar_smarty->assign('SOURCES', $connectors);
     $sugar_smarty->assign('REQUIRED_FIELDS', $required_fields);
     echo get_module_title('Connectors', $mod_strings['LBL_MODIFY_PROPERTIES_PAGE_TITLE'], true);
     $sugar_smarty->display('modules/Connectors/tpls/modify_properties.tpl');
 }
Exemplo n.º 4
0
 function display()
 {
     /* get sort order from session */
     //session_start(); // Make a reference to the current session object,set order
     //$_SESSION['regnamesort']= 'test' ; Set a value in a session variable
     //$GLOBALS['log']->fatal('start display');
     //var_dump($this->bean);
     $smarty = new Sugar_Smarty();
     //parent::display();
     $db = DBManagerFactory::getInstance();
     $myquery = "SELECT tab4a.first_name fname, tab4a.last_name lname,  tab5a.mrn_c mrn, tab4a.gender gender,location_c FROM reg_patient  tab4a , reg_patient_cstm tab5a WHERE tab4a.id = tab5a.id_c AND tab4a.id = '" . $_REQUEST['patid'] . "'";
     $result = $db->query($myquery);
     $patdata = null;
     $row = $db->fetchRow($result);
     $smarty->assign("patdata", $row);
     $risk = new RiskEvaluation();
     //when week filter need to add week interval
     //get patient risk if exists
     //if ($_POST['mysort'] == 'week')
     if (!empty($_REQUEST['patid'])) {
         $risk->getRisk($_REQUEST['patid']);
         $smarty->assign("pid", $_REQUEST['patid']);
     }
     //echo 'request'.$_REQUEST['patid'];
     //else return false; //param not found
     //var_dump($risk);
     //print "<pre>";
     //print_r($risk);
     $smarty->assign("myrisk", $risk);
     global $current_user;
     $smarty->assign("myuser", $current_user);
     $smarty->assign("test", "test");
     $smarty->display('custom/modules/REG_Patient/tpls/RiskEvaluationREG_Patient.tpl');
 }
Exemplo n.º 5
0
 function display()
 {
     global $app_strings, $current_user, $mod_strings, $app_list_strings;
     $smarty = new Sugar_Smarty();
     require_once 'include/JSON.php';
     //Load the field list from the target module
     $selected_lang = $_SESSION['authenticated_user_language'];
     $vardef = array();
     //Copy app strings
     $my_list_strings = array_merge($app_list_strings);
     $child = $_REQUEST['field'];
     //if we are using ModuleBuilder then process the following
     if (!empty($_REQUEST['package']) && $_REQUEST['package'] != 'studio') {
         require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php';
         $mb = new ModuleBuilder();
         $this->module = $mb->getPackageModule($_REQUEST['package'], $_REQUEST['view_module']);
         $vardef = $this->module->getVardefs();
         $this->module->mblanguage->generateAppStrings(false);
         $my_list_strings = array_merge($my_list_strings, $this->module->mblanguage->appListStrings[$selected_lang . '.lang.php']);
     } else {
         $vardef = BeanFactory::getBean($_REQUEST['view_module'])->field_defs;
     }
     foreach ($my_list_strings as $key => $value) {
         if (!is_array($value)) {
             unset($my_list_strings[$key]);
         }
     }
     $parents = $this->getParentDDs($vardef, $child, $my_list_strings);
     $visibility_grid = !empty($vardef[$child]['visibility_grid']) ? $vardef[$child]['visibility_grid'] : array();
     $smarty->assign('app_strings', $app_strings);
     $smarty->assign('mod', $mod_strings);
     $smarty->assign('parents', JSON::encode($parents));
     $smarty->assign('visibility_grid', JSON::encode($visibility_grid));
     $smarty->display('modules/ExpressionEngine/tpls/ddEditor.tpl');
 }
Exemplo n.º 6
0
 function display()
 {
     global $app_strings, $current_user, $mod_strings, $theme;
     if (is_dir("themes/{$theme}/ext/resources/css")) {
         $cssDir = opendir("themes/{$theme}/ext/resources/css");
     }
     $smarty = new Sugar_Smarty();
     $type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : 'main';
     $mbt = false;
     $admin = false;
     $mb = strtolower($type);
     $smarty->assign('TYPE', $type);
     $smarty->assign('app_strings', $app_strings);
     $smarty->assign('mod', $mod_strings);
     //Replaced by javascript function "setMode"
     switch ($type) {
         case 'studio':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
             require_once 'modules/ModuleBuilder/Module/StudioTree.php';
             $mbt = new StudioTree();
             break;
         case 'mb':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=")');
             require_once 'modules/ModuleBuilder/MB/MBPackageTree.php';
             $mbt = new MBPackageTree();
             break;
         case 'dropdowns':
             // $admin = is_admin($current_user);
             require_once 'modules/ModuleBuilder/Module/DropDownTree.php';
             $mbt = new DropDownTree();
             break;
         default:
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=home")');
             require_once 'modules/ModuleBuilder/Module/MainTree.php';
             $mbt = new MainTree();
     }
     $smarty->assign('TEST_STUDIO', displayStudioForCurrentUser());
     $smarty->assign('ADMIN', is_admin($current_user));
     $smarty->display('modules/ModuleBuilder/tpls/includes.tpl');
     if ($mbt) {
         $smarty->assign('TREE', $mbt->fetch());
         $smarty->assign('TREElabel', $mbt->getName());
     }
     $userPref = $current_user->getPreference('mb_assist', 'Assistant');
     if (!$userPref) {
         $userPref = "na";
     }
     $smarty->assign('userPref', $userPref);
     ///////////////////////////////////
     require_once 'include/SugarTinyMCE.php';
     $tiny = new SugarTinyMCE();
     $tiny->defaultConfig['width'] = 300;
     $tiny->defaultConfig['height'] = 300;
     $tiny->buttonConfig = "code,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,\n\t                         justifyfull,separator,forecolor,backcolor,\n\t                         ";
     $tiny->buttonConfig2 = "pastetext,pasteword,fontselect,fontsizeselect,";
     $tiny->buttonConfig3 = "";
     $ed = $tiny->getInstance();
     $smarty->assign("tiny", $ed);
     $smarty->display('modules/ModuleBuilder/tpls/index.tpl');
 }
Exemplo n.º 7
0
 function display()
 {
     $template = new Sugar_Smarty();
     $template->assign('subpanel_tabs', $this->tabs);
     $template->assign('subpanel_tabs_count', count($this->tabs));
     $template->assign('jscallback', $this->jscallback);
     $template->assign('subpanel_current_key', $this->current_key);
     return $template->display('include/tabs.tpl');
 }
Exemplo n.º 8
0
 function display()
 {
     global $mod_strings, $app_strings;
     echo get_module_title('Connectors', $mod_strings['LBL_ADMINISTRATION_MAIN'], true);
     $sugar_smarty = new Sugar_Smarty();
     $sugar_smarty->assign('mod', $mod_strings);
     $sugar_smarty->assign('app', $app_strings);
     $sugar_smarty->assign('IMG', 'themes/default/images/');
     $sugar_smarty->display('modules/Connectors/tpls/administration.tpl');
 }
Exemplo n.º 9
0
 function display()
 {
     require_once "include/Expressions/Dependency.php";
     require_once "include/TemplateHandler/TemplateHandler.php";
     $th = new TemplateHandler();
     $depScript = $th->createDependencyJavascript(array('phone_office' => array('calculated' => true, "formula" => 'add(strlen($name), $employees)', "enforced" => true)), array(), "EditView");
     $smarty = new Sugar_Smarty();
     $smarty->assign("dependencies", $depScript);
     $smarty->display('modules/ExpressionEngine/tpls/cfTest.tpl');
 }
Exemplo n.º 10
0
 function display()
 {
     global $app_strings, $current_user, $mod_strings, $theme, $beanList, $beanFiles;
     $smarty = new Sugar_Smarty();
     $json = new JSON();
     require_once 'include/JSON.php';
     //Load the field list from the target module
     if (!empty($_REQUEST['targetModule']) && $_REQUEST['targetModule'] != 'undefined') {
         $module = $_REQUEST['targetModule'];
         if (isset($_REQUEST['package']) && $_REQUEST['package'] != 'studio' && $_REQUEST['package'] != '') {
             //Get the MB Parsers
             require_once 'modules/ModuleBuilder/MB/MBPackage.php';
             $pak = new MBPackage($_REQUEST['package']);
             $defs = $pak->modules[$module]->getVardefs();
             $fields = FormulaHelper::cleanFields(array_merge($pak->modules[$module]->getLinkFields(), $defs['fields']));
         } else {
             $seed = BeanFactory::getBean($module);
             $fields = FormulaHelper::cleanFields($seed->field_defs);
         }
         $smarty->assign('Field_Array', $json->encode($fields));
     } else {
         $fields = array(array('income', 'number'), array('employed', 'boolean'), array('first_name', 'string'), array('last_name', 'string'));
         $smarty->assign('Field_Array', $json->encode($fields));
     }
     if (!empty($_REQUEST['targetField'])) {
         $smarty->assign("target", $_REQUEST['targetField']);
     }
     if (isset($_REQUEST['returnType'])) {
         $smarty->assign("returnType", $_REQUEST['returnType']);
     }
     //Assign any requested Javascript event actions
     foreach (array('onSave', 'onLoad', 'onClose') as $e) {
         if (!empty($_REQUEST[$e])) {
             $smarty->assign($e, html_entity_decode($_REQUEST[$e], ENT_QUOTES));
         } else {
             $smarty->assign($e, 'function(){}');
         }
     }
     //Check if we need to load Ext ourselves
     if (!isset($_REQUEST['loadExt']) || $_REQUEST['loadExt'] && $_REQUEST['loadExt'] != "false") {
         $smarty->assign('loadExt', true);
     } else {
         $smarty->assign('loadExt', false);
     }
     if (!empty($_REQUEST['formula'])) {
         $smarty->assign('formula', $json->decode(htmlspecialchars_decode($_REQUEST['formula'])));
     }
     if (isset($_REQUEST['returnType'])) {
         $smarty->assign('returnType', $_REQUEST['returnType']);
     }
     $smarty->assign('app_strings', $app_strings);
     $smarty->assign('mod', $mod_strings);
     $smarty->display('modules/ExpressionEngine/tpls/formulaBuilder.tpl');
 }
Exemplo n.º 11
0
 function display()
 {
     global $app_strings, $current_user, $mod_strings, $theme;
     if (is_dir("themes/{$theme}/ext/resources/css")) {
         $cssDir = opendir("themes/{$theme}/ext/resources/css");
     }
     $smarty = new Sugar_Smarty();
     $type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : 'main';
     $mbt = false;
     $admin = false;
     $mb = strtolower($type);
     $smarty->assign('TYPE', $type);
     $smarty->assign('app_strings', $app_strings);
     $smarty->assign('mod', $mod_strings);
     //Replaced by javascript function "setMode"
     switch ($type) {
         case 'studio':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
             require_once 'modules/ModuleBuilder/Module/StudioTree.php';
             $mbt = new StudioTree();
             break;
         case 'mb':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=")');
             require_once 'modules/ModuleBuilder/MB/MBPackageTree.php';
             $mbt = new MBPackageTree();
             break;
         case 'sugarportal':
             require_once 'modules/ModuleBuilder/Module/SugarPortalTree.php';
             $mbt = new SugarPortalTree();
             break;
         case 'dropdowns':
             // $admin = is_admin($current_user);
             require_once 'modules/ModuleBuilder/Module/DropDownTree.php';
             $mbt = new DropDownTree();
             break;
         default:
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=home")');
             require_once 'modules/ModuleBuilder/Module/MainTree.php';
             $mbt = new MainTree();
     }
     $smarty->assign('TEST_STUDIO', displayStudioForCurrentUser());
     $smarty->assign('ADMIN', is_admin($current_user));
     $smarty->display('modules/ModuleBuilder/tpls/includes.tpl');
     if ($mbt) {
         $smarty->assign('TREE', $mbt->fetch());
         $smarty->assign('TREElabel', $mbt->getName());
     }
     $userPref = $current_user->getPreference('mb_assist', 'Assistant');
     if (!$userPref) {
         $userPref = "na";
     }
     $smarty->assign('userPref', $userPref);
     $smarty->display('modules/ModuleBuilder/tpls/index.tpl');
 }
Exemplo n.º 12
0
 function display()
 {
     require_once 'include/connectors/utils/ConnectorUtils.php';
     require_once 'include/connectors/sources/SourceFactory.php';
     global $mod_strings, $app_strings;
     $sugar_smarty = new Sugar_Smarty();
     $sugar_smarty->assign('mod', $mod_strings);
     $sugar_smarty->assign('APP', $app_strings);
     $connectors = ConnectorUtils::getConnectors(true);
     $sugar_smarty->assign('SOURCES', $connectors);
     echo get_module_title('Connectors', $mod_strings['LBL_MODIFY_MAPPING_PAGE_TITLE'], true);
     $sugar_smarty->display('modules/Connectors/tpls/modify_mapping.tpl');
 }
Exemplo n.º 13
0
 function display()
 {
     echo "TESTING ONLY";
     $pm = new PatientMedList('123');
     $pm->GetMedsDB();
     echo "there";
     $sugarSmarty = new Sugar_Smarty();
     $sugarSmarty->assign("duration", $duration);
     $sugarSmarty->assign("med", $pm->medlist);
     $sugarSmarty->assign("patid", $pm->patid);
     $sugarSmarty->assign("title", "Test med");
     $sugarSmarty->display('custom/modules/REG_Patient/tpls/testmed.tpl');
     //        parent::display();
 }
Exemplo n.º 14
0
 function display()
 {
     //$provlist = Array();
     $smarty = new Sugar_Smarty();
     //parent::display();
     $db = DBManagerFactory::getInstance();
     $queryprov = "SELECT p1b.id provid, p1b.name provname  from reg_provider p1b ORDER BY provname";
     $sql = $db->query($queryprov);
     while (($a = $db->fetchByAssoc($sql)) != null) {
         $provlist[] = array("provid" => $a["provid"], "provname" => $a["provname"]);
     }
     echo "here";
     $smarty->assign("provlist", $provlist);
     $smarty->display('custom/modules/REG_Patient/tpls/ReportMain.tpl');
 }
Exemplo n.º 15
0
 function display()
 {
     $smarty = new Sugar_Smarty();
     parent::display();
     $db = DBManagerFactory::getInstance();
     //$myquery = 'SELECT tab4.first_name fname, tab4.last_name lname,  tab5.mrn_c mrn, tab4.id patid, tab5.location_c location, tab5.active_c active, ( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink  FROM reg_patient_reg_encounter_c tab1 WHERE  tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE  enc1.reg_patient_reg_encounterreg_patient_ida = patid) )  enclink, ( SELECT DATE_FORMAT(tab3.next_rx_refill_due_c,"%m/%d/%Y") ref1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  refill,  ( SELECT DATE_FORMAT(tab3.last_uts_c,"%m/%d/%Y") uts1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) last_uts , ( SELECT DATE_FORMAT(tab3.next_uts_due_c,"%m/%d/%Y") uts11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  uts ,  (SELECT DATE_FORMAT(tab3.next_pcp_visit_c,"%m/%d/%Y") pcp11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  next_pcp,  (SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname, ( SELECT risklvl_c risk1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  risk FROM reg_patient tab4, reg_patient_cstm tab5, reg_patient_reg_encounter_c tab1, ( SELECT max( date_modified ) dat, reg_patient_reg_encounterreg_patient_ida pat FROM reg_patient_reg_encounter_c GROUP BY reg_patient_reg_encounterreg_patient_ida) tab2, reg_encounter_cstm tab3 WHERE  tab5.id_c = tab4.id  AND tab1.date_modified = tab2.dat AND tab1.reg_patient_reg_encounterreg_patient_ida = tab2.pat AND tab3.id_c = tab1.reg_patient_reg_encounterreg_encounter_idb  AND tab4.id = tab2.pat';
     $myquery = 'SELECT tab4.first_name fname, tab4.last_name lname,  tab5.mrn_c mrn, tab4.id patid, tab5.location_c location, tab5.active_c active, ( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink  FROM reg_patient_reg_encounter_c tab1 WHERE  tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE  enc1.reg_patient_reg_encounterreg_patient_ida = patid) )  enclink, ( SELECT DATE_FORMAT(tab3.next_rx_refill_due_c,"%m/%d/%Y") ref1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  refill,  ( SELECT DATE_FORMAT(tab3.last_uts_c,"%m/%d/%Y") uts1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) last_uts , ( SELECT DATE_FORMAT(tab3.next_uts_due_c,"%m/%d/%Y") uts11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  uts ,  (SELECT DATE_FORMAT(tab3.next_pcp_visit_c,"%m/%d/%Y") pcp11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  next_pcp,  (SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname, ( SELECT risklvl_c risk1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  risk FROM reg_patient tab4, reg_patient_cstm tab5 WHERE  tab5.id_c = tab4.id ';
     $result = $db->query($myquery);
     $mydata = null;
     while ($row = $db->fetchRow($result)) {
         $mydata[] = $row;
     }
     global $cal_strings, $current_language;
     $cal_strings = return_module_language($current_language, 'Calendar');
     if (empty($_REQUEST['view'])) {
         $_REQUEST['view'] = SugarConfig::getInstance()->get('calendar.default_view', 'week');
     }
     $cal = new Calendar($_REQUEST['view']);
     if (in_array($cal->view, array('day', 'week', 'month'))) {
         $cal->add_activities($GLOBALS['current_user']);
     } else {
         if ($cal->view == 'shared') {
             $cal->init_shared();
             global $shared_user;
             $shared_user = new User();
             foreach ($cal->shared_ids as $member) {
                 $shared_user->retrieve($member);
                 $cal->add_activities($shared_user);
             }
         }
     }
     if (in_array($cal->view, array("day", "week", "month", "shared"))) {
         $cal->load_activities();
     }
     if (!empty($_REQUEST['print']) && $_REQUEST['print'] == 'true') {
         $cal->setPrint(true);
     }
     $display = new CalendarDisplay($cal);
     $smarty->assign("mydata", $mydata);
     echo "<table><tr><td>";
     $smarty->display($this->lv->tpl);
     echo "</td>";
     echo "<td style='width:100%;vertical-align:top'>";
     $caltest = new caltest();
     $caltest->test();
     echo "</td></tr></table>";
 }
Exemplo n.º 16
0
 function display()
 {
     $db = DBManagerFactory::getInstance();
     $sql = "SELECT pc.mrn_c pmrn, p.id patid,  (SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname, last_name,first_name  FROM reg_patient p, reg_patient_cstm pc WHERE  p.id=pc.id_c ";
     $resultb = $db->query($sql, true);
     $final = array();
     while ($row = $db->fetchByAssoc($resultb)) {
         $final[] = $row;
     }
     $sugarSmarty = new Sugar_Smarty();
     //$sugarSmarty->assign("duration",$duration);
     $sugarSmarty->assign("mydata", $final);
     $sugarSmarty->assign("title", "UTS Entry");
     $snip = new REG_PatientViewTestMed();
     //echo $snip->snippy();
     $sugarSmarty->assign("snippet", $snip->snippet());
     $sugarSmarty->display('custom/modules/REG_Patient/tpls/utsentryREG_Patient.tpl');
     //        parent::display();
 }
Exemplo n.º 17
0
 function display()
 {
     $smarty = new Sugar_Smarty();
     parent::display();
     $db = DBManagerFactory::getInstance();
     $restrict_query = "";
     global $current_user;
     //var_dump(get_defined_vars());
     //if(isset($current_user) AND $current_user->check_role_membership('WASSER_PATIENTS')) { echo "This user is in role"; $location_query = " AND location_c  IN ('BMC_WALLEY') ";}
     //elseif (isset($current_user) AND $current_user->check_role_membership('ALL_PATIENTS')) { echo "Super user"; $location_query = "  ";}
     //else { echo "This user is not in role"; $location_query = " AND location_c  NOT IN ('BMC_WALLEY') ";}
     if (isset($current_user) and $current_user->check_role_membership('PRESCRIBER_ONLY')) {
         $provider = GetProviders();
         //echo "GOT providers";
         $restrict_query = " AND provpat.reg_provider_reg_patientreg_provider_ida IN (" . $provider . ") ";
     }
     if (isset($current_user) and $current_user->check_role_membership('MULTI_LOCATION')) {
         $location = GetLocations();
         $restrict_query = " AND tab5.location_c IN ({$location}) ";
     }
     if (isset($current_user) and $current_user->check_role_membership('ALL_LOCATIONS')) {
         $restrict_query = "  ";
     }
     echo "restrict is " . $restrict_query . "<<<<";
     //$myquery = 'SELECT tab4.first_name fname, tab4.last_name lname,  tab5.mrn_c mrn, tab4.id patid, tab5.location_c location, tab5.active_c active, ( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink  FROM reg_patient_reg_encounter_c tab1 WHERE  tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE  enc1.reg_patient_reg_encounterreg_patient_ida = patid) )  enclink, ( SELECT DATE_FORMAT(tab3.next_rx_refill_due_c,"%m/%d/%Y") ref1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  refill,  ( SELECT DATE_FORMAT(tab3.last_uts_c,"%m/%d/%Y") uts1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) last_uts , ( SELECT DATE_FORMAT(tab3.next_uts_due_c,"%m/%d/%Y") uts11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  uts ,  (SELECT DATE_FORMAT(tab3.next_pcp_visit_c,"%m/%d/%Y") pcp11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  next_pcp,  (SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname, ( SELECT risklvl_c risk1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  risk FROM reg_patient tab4, reg_patient_cstm tab5, reg_patient_reg_encounter_c tab1, ( SELECT max( date_modified ) dat, reg_patient_reg_encounterreg_patient_ida pat FROM reg_patient_reg_encounter_c GROUP BY reg_patient_reg_encounterreg_patient_ida) tab2, reg_encounter_cstm tab3 WHERE  tab5.id_c = tab4.id  AND tab1.date_modified = tab2.dat AND tab1.reg_patient_reg_encounterreg_patient_ida = tab2.pat AND tab3.id_c = tab1.reg_patient_reg_encounterreg_encounter_idb  AND tab4.id = tab2.pat';
     // <<<<<<< HEAD
     //02/25//$myquery = 'SELECT tab4.first_name fname, tab4.last_name lname,  tab5.mrn_c mrn, tab4.id patid, tab5.location_c location, tab5.active_c active, ( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink  FROM reg_patient_reg_encounter_c tab1 WHERE  tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE  enc1.reg_patient_reg_encounterreg_patient_ida = patid) )  enclink, ( SELECT DATE_FORMAT(tab3.next_rx_refill_due_c,"%m/%d/%Y") ref1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  refill,  ( SELECT DATE_FORMAT(tab3.last_uts_c,"%m/%d/%Y") uts1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) last_uts , ( SELECT DATE_FORMAT(tab3.next_uts_due_c,"%m/%d/%Y") uts11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  uts ,  (SELECT DATE_FORMAT(tab3.next_pcp_visit_c,"%m/%d/%Y") pcp11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  next_pcp,  (SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid AND p2b.deleted = 0) provname, ( SELECT risklvl_c risk1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  risk FROM reg_patient tab4, reg_patient_cstm tab5 WHERE  tab5.id_c = tab4.id ';
     $myquery = 'SELECT tab4.first_name fname, tab4.last_name lname, DATE_FORMAT(tab4.dob,"%m/%d/%Y")  dob, tab4.primary_address_postalcode zip, tab5.mrn_c mrn, tab5.audit_flag_c audit_flag, tab5.reg_patient_status_c status, tab4.id patid, tab5.location_c location, tab5.active_c active, DATE_FORMAT(tab5.pmp_date_c,"%m/%d/%Y")  pmp_date, ( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink  FROM reg_patient_reg_encounter_c tab1 WHERE  tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE  enc1.reg_patient_reg_encounterreg_patient_ida = patid)  LIMIT 1 )  enclink, ( SELECT DATE_FORMAT(tab3.next_rx_refill_due_c,"%m/%d/%Y") ref1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  refill, ( SELECT DATE_FORMAT(MAX(tabuts.test_date),"%m/%d/%Y") uts1 FROM reg_patient_uts_import tabuts where tabuts.patient_mrn = mrn )  last_uts,  (SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid AND p2b.deleted = 0) provname, ( SELECT finalscore from reg_patient_risk where pid = tab4.id LIMIT 1 )  risk FROM reg_patient tab4, reg_patient_cstm tab5, reg_provider_reg_patient_c provpat  WHERE  tab5.id_c = tab4.id AND provpat.reg_provider_reg_patientreg_patient_idb = tab4.id ' . $restrict_query;
     // =======
     /* 		$myquery = 'SELECT tab4.first_name fname, tab4.last_name lname,  tab5.mrn_c mrn, tab4.id patid, tab5.location_c location, tab5.active_c active, ( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink  FROM reg_patient_reg_encounter_c tab1 WHERE  tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE  enc1.reg_patient_reg_encounterreg_patient_ida = patid) )  enclink, ( SELECT DATE_FORMAT(tab3.next_rx_refill_due_c,"%m/%d/%Y") ref1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  refill,  ( SELECT DATE_FORMAT(tab3.last_uts_c,"%m/%d/%Y") uts1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) last_uts , ( SELECT DATE_FORMAT(tab3.next_uts_due_c,"%m/%d/%Y") uts11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  uts ,  (SELECT DATE_FORMAT(tab3.next_pcp_visit_c,"%m/%d/%Y") pcp11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  next_pcp,  (SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname, ( SELECT finalscore risk1 FROM reg_patient_risk where pid = patid )  risk FROM reg_patient tab4, reg_patient_cstm tab5 WHERE  tab5.id_c = tab4.id ';   */
     // >>>>>>> 3097a71433de82fec730df252659026274347e46
     $start = microtime(true);
     $result = $db->query($myquery);
     $mydata = null;
     while ($row = $db->fetchRow($result)) {
         $mydata[] = $row;
     }
     $smarty->assign("mydata", $mydata);
     $smarty->display($this->lv->tpl);
     printf("Total time cached query: %.6fs\n", microtime(true) - $start);
 }
Exemplo n.º 18
0
 /**
  * display
  * Override the display method to support customization for the buttons that display
  * a popup and allow you to copy the account's address into the selected contacts.
  * The custom_code_billing and custom_code_shipping Smarty variables are found in
  * include/SugarFields/Fields/Address/DetailView.tpl (default).  If it's a English U.S.
  * locale then it'll use file include/SugarFields/Fields/Address/en_us.DetailView.tpl.
  */
 function display()
 {
     global $app_strings, $app_list_strings;
     global $mod_strings;
     $this->dv->ss->assign('RESPONSES', $this->bean->get_responses());
     parent::display();
     $smarty = new Sugar_Smarty();
     $smarty->assign('APP', $app_strings);
     $smarty->assign('MOD', $mod_strings);
     $smarty->assign('RECORD', $this->bean->id);
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'xeBayMessageReply', 'field_to_name_array' => array('description' => 'response'));
     $json = getJSONobj();
     $smarty->assign('ENCODED_TEMPLATES_POPUP_REQUEST_DATA', $json->encode($popup_request_data));
     $smarty->assign("TEMPLATE_SELECT", SugarThemeRegistry::current()->getImage('id-ff-select', '', null, null, '.png', $mod_strings['LBL_SELECT']));
     $smarty->assign("TEMPLATE_CLEAR", SugarThemeRegistry::current()->getImage('id-ff-clear', '', null, null, '.gif', $mod_strings['LBL_ID_FF_CLEAR']));
     $smarty->assign('SALUTATION', str_replace("\n", "<br>", $this->bean->get_salutation()));
     $smarty->assign('RESPONSE', $this->bean->get_template());
     $smarty->assign('SIGNATURE', str_replace("\n", "<br>", $this->bean->get_signature()));
     $smarty->display("modules/xeBayMessages/tpls/reply.tpl");
     $this->bean->read_status_update($this->bean->id, true);
 }
Exemplo n.º 19
0
 function display()
 {
     $db = DBManagerFactory::getInstance();
     $sql = "SELECT p.id patid,p.first_name,p.last_name,p.dob, rec.mrn_c as mrn, ( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink  FROM reg_patient_reg_encounter_c tab1 WHERE  tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE  enc1.reg_patient_reg_encounterreg_patient_ida = patid) )  enclink, ( SELECT DATE_FORMAT(tab3.next_rx_refill_due_c,'%m/%d/%Y') ref1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  refill, ( SELECT DATE_FORMAT(tab4.next_pill_ct_c,'%m/%d/%Y') ref1 FROM reg_encounter_cstm tab4 where tab4.id_c = enclink )  next_pill_count, ( SELECT risklvl_c risk1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  risk,(SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON  rec.id_c=p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND (next_pill_ct_c is not null)) ORDER BY p.last_name, p.first_name";
     $resultb = $db->query($sql, true);
     $final = array();
     while ($row = $db->fetchByAssoc($resultb)) {
         $final[] = $row;
     }
     $sql1 = "SELECT p.id patid,( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink  FROM reg_patient_reg_encounter_c tab1 WHERE  tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE  enc1.reg_patient_reg_encounterreg_patient_ida = patid) )  enclink,(SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON  rec.id_c=p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND (next_pill_ct_c is not null)) GROUP BY provname ORDER BY p.last_name, p.first_name";
     $resultb1 = $db->query($sql1, true);
     $final1 = array();
     while ($row1 = $db->fetchByAssoc($resultb1)) {
         $final1[] = $row1;
     }
     $sugarSmarty = new Sugar_Smarty();
     $sugarSmarty->assign("data", $final);
     $sugarSmarty->assign("data1", $final1);
     $sugarSmarty->assign("title", "Patients who not have Next Pill Count");
     $sugarSmarty->display('custom/modules/REG_Patient/tpls/Report5REG_Patient.tpl');
     //        parent::display();
 }
Exemplo n.º 20
0
 function display()
 {
     $db = DBManagerFactory::getInstance();
     $sql = "SELECT tab4.first_name fname, tab4.last_name lname,  tab5.mrn_c mrn,tab5.date_inactive_c as date_inactive, tab4.id patid, tab5.location_c location, (SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname FROM reg_patient tab4, reg_patient_cstm tab5 WHERE  tab5.id_c = tab4.id AND (tab5.active_c!=1 OR tab5.active_c is NULL) ORDER BY tab4.last_name, tab4.first_name";
     $resultb = $db->query($sql, true);
     $final = array();
     while ($row = $db->fetchByAssoc($resultb)) {
         $final[] = $row;
     }
     $sql1 = "SELECT  tab4.id patid,(SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname FROM reg_patient tab4, reg_patient_cstm tab5 WHERE  tab5.id_c = tab4.id AND (tab5.active_c!=1 OR tab5.active_c is NULL) GROUP BY provname ORDER BY tab4.last_name, tab4.first_name";
     $resultb1 = $db->query($sql1, true);
     $final1 = array();
     while ($row1 = $db->fetchByAssoc($resultb1)) {
         $final1[] = $row1;
     }
     $sugarSmarty = new Sugar_Smarty();
     $sugarSmarty->assign("data", $final);
     $sugarSmarty->assign("data1", $final1);
     $sugarSmarty->assign("title", "Patients who are Inactive");
     $sugarSmarty->display('custom/modules/REG_Patient/tpls/Report4REG_Patient.tpl');
     //        parent::display();
 }
Exemplo n.º 21
0
 function display()
 {
     $db = DBManagerFactory::getInstance();
     $sql = "SELECT p.id,p.first_name,p.last_name,p.dob,e.id_c, max(e.last_pmp_review_done_c) as last_pmp_review, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id,`reg_patient_reg_encounter_c` pe,reg_encounter_cstm e WHERE p.id=pe.reg_patient_reg_encounterreg_patient_ida AND pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null group by p.id ORDER By p.last_name, p.first_name";
     $resultb = $db->query($sql, true);
     $final = array();
     while ($row = $db->fetchByAssoc($resultb)) {
         $final[] = $row;
     }
     $sql1 = "SELECT p.id,e.id_c, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id,`reg_patient_reg_encounter_c` pe,reg_encounter_cstm e WHERE p.id=pe.reg_patient_reg_encounterreg_patient_ida AND pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null group by provname ORDER By p.last_name, p.first_name";
     $resultb1 = $db->query($sql1, true);
     $final1 = array();
     while ($row1 = $db->fetchByAssoc($resultb1)) {
         $final1[] = $row1;
     }
     $sugarSmarty = new Sugar_Smarty();
     $sugarSmarty->assign("data", $final);
     $sugarSmarty->assign("data1", $final1);
     $sugarSmarty->assign("title", "Patients with last PMP");
     $sugarSmarty->display('custom/modules/REG_Patient/tpls/Report2REG_Patient.tpl');
     //        parent::display();
 }
Exemplo n.º 22
0
 function display()
 {
     $smarty = new Sugar_Smarty();
     parent::display();
     $db = DBManagerFactory::getInstance();
     $myquery = 'SELECT tab4.first_name fname, tab4.last_name lname, tab1.date_modified, tab3.next_rx_refill_due_c refill, tab2.pat patid, tab5.mrn_c mrn FROM reg_patient_reg_encounter_c tab1, ( SELECT max( date_modified ) dat, reg_patient_reg_encounterreg_patient_ida pat FROM reg_patient_reg_encounter_c GROUP BY reg_patient_reg_encounterreg_patient_ida) tab2, reg_encounter_cstm tab3, reg_patient tab4, reg_patient_cstm tab5 WHERE tab1.date_modified = tab2.dat AND tab1.reg_patient_reg_encounterreg_patient_ida = tab2.pat AND tab3.id_c = tab1.reg_patient_reg_encounterreg_encounter_idb AND tab4.id = tab2.pat AND tab5.id_c = tab4.id UNION SELECT tab4a.first_name fname, tab4a.last_name lname, null datemod, null refill, tab4a.id patid, tab5a.mrn_c mrn FROM reg_patient  tab4a , reg_patient_cstm tab5a where tab4a.id not in (select reg_patient_reg_encounterreg_patient_ida pat FROM reg_patient_reg_encounter_c )and tab4a.id = tab5a.id_c ORDER BY refill DESC';
     if ($_POST['mysort'] == 'week') {
         $myquery = 'SELECT tab4.first_name fname, tab4.last_name lname, tab1.date_modified, tab3.next_rx_refill_due_c refill, tab2.pat patid, tab5.mrn_c mrn FROM reg_patient_reg_encounter_c tab1, ( SELECT max( date_modified ) dat, reg_patient_reg_encounterreg_patient_ida pat FROM reg_patient_reg_encounter_c GROUP BY reg_patient_reg_encounterreg_patient_ida) tab2, reg_encounter_cstm tab3, reg_patient tab4, reg_patient_cstm tab5 WHERE tab1.date_modified = tab2.dat AND tab1.reg_patient_reg_encounterreg_patient_ida = tab2.pat AND tab3.id_c = tab1.reg_patient_reg_encounterreg_encounter_idb AND tab4.id = tab2.pat AND tab5.id_c = tab4.id  AND tab3.next_rx_refill_due_c BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 7 DAY) ';
     }
     $result = $db->query($myquery);
     while ($row = $db->fetchRow($result)) {
         $mydata[] = $row;
     }
     $smarty->assign("mydata", $mydata);
     $db1 = DBManagerFactory::getInstance();
     $provquery = 'SELECT p1b.name provname  from reg_provider p1b';
     $resultprov = $db1->query($provquery);
     while ($provrow = $db1->fetchRow($resultprov)) {
         $provdata[] = $provrow;
     }
     $smarty->assign("provdata", $provdata);
     $smarty->display($this->lv->tpl);
 }
Exemplo n.º 23
0
 function display()
 {
     $db = DBManagerFactory::getInstance();
     $sql = "SELECT * FROM (SELECT p.id, p.first_name, p.last_name, p.dob, rec.mrn_c AS mrn, (SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname, (SELECT e.narcotic_contract_in_chart_c FROM reg_patient_reg_encounter_c pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb = e.id_c AND pe.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE enc1.reg_patient_reg_encounterreg_patient_ida = p.id ))narc FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id ORDER BY provname, p.last_name, p.first_name)rep WHERE NARC <> '1' || NARC IS NULL";
     $resultb = $db->query($sql, true);
     $final = array();
     while ($row = $db->fetchByAssoc($resultb)) {
         $final[] = $row;
     }
     $db = DBManagerFactory::getInstance();
     $sql1 = "SELECT * FROM (SELECT p.id, (SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id ORDER BY provname, p.last_name, p.first_name)rep GROUP BY provname";
     $resultb1 = $db->query($sql1, true);
     $provname = array();
     while ($row1 = $db->fetchByAssoc($resultb1)) {
         $provname[] = $row1;
     }
     $sugarSmarty = new Sugar_Smarty();
     $sugarSmarty->assign("data", $final);
     $sugarSmarty->assign("data1", $provname);
     $sugarSmarty->assign("title", "Patients who do not have TX Contracts");
     $sugarSmarty->display('custom/modules/REG_Patient/tpls/Report3REG_Patient.tpl');
     //        parent::display();
 }
Exemplo n.º 24
0
 function display()
 {
     $db = DBManagerFactory::getInstance();
     if (isset($_POST['duration']) && $_POST['duration'] != "") {
         $duration = $_POST['duration'];
     } else {
         $duration = 1;
     }
     if ($duration == 1) {
         $where_duration = " AND test_date= SUBDATE(CURDATE(),1)";
     } else {
         if ($duration == 2) {
             $where_duration = " AND test_date between (CURRENT_DATE() - INTERVAL 1 WEEK) AND CURRENT_DATE() ";
         } else {
             if ($duration == 3) {
                 $where_duration = " AND test_date between (CURRENT_DATE() - INTERVAL 1 MONTH) AND CURRENT_DATE() ";
             } else {
                 if ($duration == 4) {
                     $where_duration = " ";
                 }
             }
         }
     }
     $sql = "SELECT DISTINCT DATE_FORMAT(test_date,'%m/%d/%Y') thisdate1, test_date thisdate, patient_mrn pmrn,p.id patid, ( SELECT DISTINCT test_results_code FROM  reg_patient_uts_import WHERE  patient_mrn = pmrn AND test_date = thisdate AND test_type = 'OXYCODONE' AND test_results_code <> 'PEN' limit 1) oxy,( SELECT DISTINCT test_results_code FROM  reg_patient_uts_import WHERE  patient_mrn = pmrn AND test_date = thisdate AND test_type = 'OPIATE URINE' AND test_results_code <> 'PEN' limit 1) opiate,( SELECT DISTINCT test_results_code FROM  reg_patient_uts_import WHERE  patient_mrn = pmrn AND test_date = thisdate AND test_type = 'METHADONE' AND test_results_code <> 'PEN' limit 1) methadone,( SELECT DISTINCT test_results_code FROM  reg_patient_uts_import WHERE  patient_mrn = pmrn AND test_date = thisdate AND test_type = 'COCAIN METAB' AND test_results_code <> 'PEN' limit 1) cocaine,( SELECT DISTINCT test_results_code FROM  reg_patient_uts_import WHERE  patient_mrn = pmrn AND test_date = thisdate AND test_type = 'BUPRENO UR' AND test_results_code <> 'PEN' limit 1) bupreno,( SELECT DISTINCT test_results_code FROM  reg_patient_uts_import WHERE  patient_mrn = pmrn AND test_date = thisdate AND test_type = 'BENZODIAZ UR' AND test_results_code <> 'PEN' limit 1) benzo,( SELECT DISTINCT test_results_code FROM  reg_patient_uts_import WHERE  patient_mrn = pmrn AND test_date = thisdate AND test_type = 'BARBITURA UR' AND test_results_code <> 'PEN' limit 1) barbi,( SELECT DISTINCT test_results_code FROM  reg_patient_uts_import WHERE  patient_mrn = pmrn AND test_date = thisdate AND test_type = 'AMPHETAMI UR' AND test_results_code <> 'PEN' limit 1) amph, (SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname, last_name,first_name  FROM reg_patient_uts_import uts, reg_patient p, reg_patient_cstm pc WHERE  p.id=pc.id_c AND pc.mrn_c=uts.patient_mrn {$where_duration} ORDER BY test_date DESC";
     $resultb = $db->query($sql, true);
     $final = array();
     while ($row = $db->fetchByAssoc($resultb)) {
         $final[] = $row;
     }
     $sugarSmarty = new Sugar_Smarty();
     $sugarSmarty->assign("duration", $duration);
     $sugarSmarty->assign("mydata", $final);
     $sugarSmarty->assign("title", "UTS Report");
     $sugarSmarty->display('custom/modules/REG_Patient/tpls/ReportutsREG_Patient.tpl');
     //        parent::display();
 }
Exemplo n.º 25
0
 function display()
 {
     $provid = '0';
     $provname = "";
     //var_dump($_GET);
     if (isset($_GET['provid']) && !empty($_GET['provid'])) {
         $provid = $_GET['provid'];
     }
     $datalist = array();
     $smarty = new Sugar_Smarty();
     //parent::display();
     $db = DBManagerFactory::getInstance();
     $queryprov = "select prov.name provname, p1.last_name lname, p1.first_name, p1c.mrn_c, p1.phone_home, r.finalscore,  r.ortsum ortsum, r.short_opioid, prov.name, r.medd, r.short_opioid sop, r.long_opioid lop \n\t\tFROM reg_provider prov, reg_provider_reg_patient_c provpat, \n\t\treg_patient p1, reg_patient_cstm p1c, reg_patient_risk r\n\t\tWHERE prov.id = '{$provid}' AND\n\t\tprov.id = provpat.reg_provider_reg_patientreg_provider_ida AND\n\t\tp1.id = provpat.reg_provider_reg_patientreg_patient_idb AND\n\t\tp1.id = p1c.id_c AND p1c.active_c = '1' AND\n\t\tp1.id = r.pid AND r.medd in ('0-3', '4-7', 'gt7')\n\t\tORDER BY r.medd, p1.last_name, p1.first_name";
     $sql = $db->query($queryprov);
     while (($a = $db->fetchByAssoc($sql)) != null) {
         $provname = $a["provname"];
         $datalist[] = array("lname" => $a["lname"], "fname" => $a["first_name"], "mrn" => $a["mrn_c"], "phone" => $a["phone_home"], "ncm" => $a["finalscore"], "medd" => $a["medd"], "ortsum" => $a["ortsum"], "lop" => $a["lop"], "sop" => $a["sop"]);
     }
     //echo "here with provid " . $provid;
     //echo "<p>".$queryprov."</p>";
     $smarty->assign("datalist", $datalist);
     $smarty->assign("provname", $provname);
     $smarty->display('custom/modules/REG_Patient/tpls/ReportMedd.tpl');
 }
    $res = $db->query($query);
    while ($row = $db->fetchByAssoc($res)) {
        $values[$row['name']] = $row['aclaccess'];
        $ids[$row['name']] = $row['id'];
    }
    $i = 0;
    $acl_fields = array();
    foreach ($focus->field_name_map as $field) {
        $lbl = $field['vname'];
        if (!empty($lbl) && !ereg("subpanel", $field['name'])) {
            $acl_fields[$i]['field'] = $field['name'];
            $acl_fields[$i]['label'] = translate($lbl, $category);
            $acl_fields[$i]['inputname'] = 'new_' . $field['name'];
            $acl_fields[$i]['prevname'] = 'prev_' . $field['name'];
            $acl_fields[$i]['idname'] = 'id_' . $field['name'];
            $acl_fields[$i]['value'] = $values[$field['name']];
            $acl_fields[$i]['id'] = $ids[$field['name']];
        }
        $i++;
    }
}
$smarty->assign('roles_list', $app_list_strings['roles_list']);
$smarty->assign('moduleList', $app_list_strings['moduleList']);
$smarty->assign('role', $_REQUEST['role']);
$smarty->assign('roleName', $app_list_strings['roles_list'][$_REQUEST['role']]);
$smarty->assign('category', $_REQUEST['category']);
$smarty->assign('moduleName', $app_list_strings['moduleList'][$_REQUEST['category']]);
$smarty->assign('fields_access_list', $app_list_strings['fields_access_list']);
$smarty->assign('acl_fields', $acl_fields);
$smarty->display("modules/acl_fields/templates/EditAclFields.tpl.html");
Exemplo n.º 27
0
if (!array_key_exists('aod', $cfg->config)) {
    $cfg->config['aod'] = array('enable_aod' => '');
}
if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'save') {
    $cfg->config['aod']['enable_aod'] = !empty($_REQUEST['enable_aod']);
    $cfg->saveConfig();
    header('Location: index.php?module=Administration&action=index');
    exit;
}
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$sugar_smarty->assign('APP_LIST', $app_list_strings);
$sugar_smarty->assign('LANGUAGES', get_languages());
$sugar_smarty->assign("JAVASCRIPT", get_set_focus_js());
$sugar_smarty->assign('config', $cfg->config['aod']);
$sugar_smarty->assign('error', $errors);
$buttons = <<<EOQ
    <input title="{$app_strings['LBL_SAVE_BUTTON_TITLE']}"
                       accessKey="{$app_strings['LBL_SAVE_BUTTON_KEY']}"
                       class="button primary"
                       type="submit"
                       name="save"
                       onclick="return check_form('ConfigureSettings');"
                       value="  {$app_strings['LBL_SAVE_BUTTON_LABEL']}  " >
                &nbsp;<input title="{$mod_strings['LBL_CANCEL_BUTTON_TITLE']}"  onclick="document.location.href='index.php?module=Administration&action=index'" class="button"  type="button" name="cancel" value="  {$app_strings['LBL_CANCEL_BUTTON_LABEL']}  " >
EOQ;
$sugar_smarty->assign("BUTTONS", $buttons);
$sugar_smarty->display('custom/modules/Administration/AODAdmin.tpl');
$javascript = new javascript();
$javascript->setFormName('ConfigureSettings');
echo $javascript->getScript();
Exemplo n.º 28
0
    $sugar_smarty->assign("MANUALFIXFILES", implode("\n", $rlf->manualFixFiles));
    $sugar_smarty->assign("MODIFIEDFILES", implode("\n", $rlf->modifiedFiles));
    $sugar_smarty->assign("INDEXCHANGES", implode("\n", $rlf->indexChanges));
    $sugar_smarty->assign("REMOVEDFILES", implode("\n", $rlf->removedFiles));
    $sugar_smarty->assign("REMOVEDMODULES", implode("\n", $rlf->removedModules));
    $sugar_smarty->display("custom/modules/Administration/fixLanguageFilesResult.tpl");
    unlink("custom/fixLanguageFiles_Progress.php");
} else {
    $title = getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>", translate('LBL_FIXLANGUAGEFILES')), false);
    global $currentModule;
    $GLOBALS['log']->info("Administration: fixLanguageFiles");
    $sugar_smarty = new Sugar_Smarty();
    $sugar_smarty->assign("MOD", $mod_strings);
    $sugar_smarty->assign("APP", $app_strings);
    $sugar_smarty->assign("TITLE", $title);
    $sugar_smarty->display("custom/modules/Administration/fixLanguageFiles.tpl");
}
class fixLanguageFiles
{
    const TYPE_EMPTY = 0;
    const TYPE_DYNAMIC = 1;
    const TYPE_STATIC = 2;
    const TYPE_UNREADABLE = 3;
    const TYPE_UNWRITABLE = 4;
    const TYPE_SYNTAXERROR = 5;
    const SEV_HIGH = 2;
    const SEV_MEDIUM = 1;
    const SEV_LOW = 0;
    public $customLanguageFileList = array();
    public $customOtherFileList = array();
    public $customListNames = array();
Exemplo n.º 29
0
$buttons = array();
$buttons[] = array('text' => $GLOBALS['mod_strings']['LBL_BTN_SAVEPUBLISH'], 'actionScript' => "onclick='studiotabs.generateForm(\"edittabs\");document.edittabs.submit()'");
$html = "";
foreach ($buttons as $button) {
    $html .= "<td><input type='button' valign='center' class='button' style='cursor:pointer' onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}' ></td>";
}
$smarty->assign('buttons', $html);
$smarty->assign('title', $title);
$smarty->assign('dropdown_lang', $selected_lang);
$editImage = SugarThemeRegistry::current()->getImage('edit_inline', '', null, null, '.gif', $mod_strings['LBL_EDIT']);
$smarty->assign('editImage', $editImage);
$deleteImage = SugarThemeRegistry::current()->getImage('delete_inline', '', null, null, '.gif', $mod_strings['LBL_MB_DELETE']);
$recycleImage = SugarThemeRegistry::current()->getImage('icon_Delete', '', 48, 48, '.gif', $mod_strings['LBL_MB_DELETE']);
$smarty->assign('deleteImage', $deleteImage);
$smarty->assign('recycleImage', $recycleImage);
//#30205
global $sugar_config;
if (isset($sugar_config['other_group_tab_displayed'])) {
    if ($sugar_config['other_group_tab_displayed']) {
        $value = 'checked';
    } else {
        $value = null;
    }
    $smarty->assign('other_group_tab_displayed', $value);
} else {
    $smarty->assign('other_group_tab_displayed', 'checked');
}
$smarty->assign('tabGroupSelected_lang', $tabGroupSelected_lang);
$smarty->assign('available_languages', get_languages());
$smarty->display("modules/Studio/TabGroups/EditViewTabs.tpl");
Exemplo n.º 30
0
function cleanAllBeans()
{
}
////	END UTILITIES
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
////	PAGE OUTPUT
if (isset($runSilent) && $runSilent == true) {
    // if called from Scheduler
    cleanAllBeans();
} else {
    $hide = array('Activities', 'Home', 'iFrames', 'Calendar', 'Dashboard');
    sort($moduleList);
    $options = array();
    $options[] = $app_strings['LBL_NONE'];
    $options['all'] = "--{$app_strings['LBL_TABGROUP_ALL']}--";
    foreach ($moduleList as $module) {
        if (!in_array($module, $hide)) {
            $options[$module] = $module;
        }
    }
    $options = get_select_options_with_id($options, '');
    $beanDropDown = "<select onchange='SUGAR.Administration.RepairXSS.refreshEstimate(this);' id='repairXssDropdown'>{$options}</select>";
    echo getClassicModuleTitle('Administration', array($mod_strings['LBL_REPAIRXSS_TITLE']), false);
    echo "<script>var done = '{$mod_strings['LBL_DONE']}';</script>";
    $smarty = new Sugar_Smarty();
    $smarty->assign("mod", $mod_strings);
    $smarty->assign("beanDropDown", $beanDropDown);
    $smarty->display("modules/Administration/templates/RepairXSS.tpl");
}
// end else