$saved_db = ""; $lab_config = null; $q = $_REQUEST['q']; $q = strip_tags($q); if (isset($_REQUEST['l'])) { # Save context $lab_config = LabConfig::getById($_REQUEST['l']); $saved_db = DbUtil::switchToLabConfig($_REQUEST['l']); } else { $lab_config = LabConfig::getById($_SESSION['lab_config_id']); } $patient_list = array(); # Fetch list from DB if ($a == 0) { # Fetch by patient ID $patient_list = search_patients_by_id($q); } else { if ($a == 1) { # Fetch by patient name if ($dynamic_fetch == 0) { $patient_list = search_patients_by_name($q); } else { $patient_list = search_patients_by_name_dyn($q, $result_cap, $result_counter); } //DB Merging - Currently Disabled # See if there's a patient by the exact same name in another lab //$patient = searchPatientByName($q); /*if($patient != null) { # See if there's a patient by the exact same name in current lab as well as another lab and if yes automatically add enteries to current database autoImportPatientEntry($patient, $q); }*/
$c = $_REQUEST['c']; // lab section fetch $lab_section = $_REQUEST['lab_section']; if (isset($_REQUEST['l'])) { # Save context $lab_config = LabConfig::getById($_REQUEST['l']); $saved_db = DbUtil::switchToLabConfig($_REQUEST['l']); } else { $lab_config = LabConfig::getById($_SESSION['lab_config_id']); } $patient_list = array(); # Fetch list from DB if ($a == 0) { # Fetch by patient ID if ($dynamic_fetch == 0) { $patient_list = search_patients_by_id($q, $lab_section); } else { $patient_list = search_patients_by_id_dyn($q, $result_cap, $result_counter, $lab_section); } } else { if ($a == 1) { //echo "Fetch By Name"; # Fetch by patient name if ($dynamic_fetch == 0) { $patient_list = search_patients_by_name($q, $lab_section, $c); } else { //echo "Fetch By Name section is ".$lab_section; $patient_list = search_patients_by_name_dyn($q, $result_cap, $result_counter, $lab_section, $c); } //DB Merging - Currently Disabled # See if there's a patient by the exact same name in another lab
</script> <?php if (isset($_REQUEST['l'])) { # Save context $lab_config = LabConfig::getById($_REQUEST['l']); $saved_db = DbUtil::switchToLabConfig($_REQUEST['l']); } else { $lab_config = LabConfig::getById($_SESSION['lab_config_id']); } $patient_list = array(); $patient_list_all = array(); # Fetch list from DB if ($a == 0) { # Fetch by patient ID $patient_list_all = search_patients_by_id($q); } else { if ($a == 1) { # Fetch by patient name $patient_list_all = search_patients_by_name($q, 0, $c); //print_r($patient_list_all);exit; //DB Merging - Currently Disabled # See if there's a patient by the exact same name in another lab //$patient = searchPatientByName($q); /*if($patient != null) { # See if there's a patient by the exact same name in current lab as well as another lab and if yes automatically add enteries to current database autoImportPatientEntry($patient, $q); }*/ } else { if ($a == 2) { # Fetch by additional ID
public function search_patients($by, $str) { //by 1 = name, 2 = id, 3 = number global $con; $q = mysql_real_escape_string($str, $con); if ($by == 2) { //$count = search_patients_by_id_count($q); $patient_list = search_patients_by_id($q); if (count($patient_list) > 0) { $ret = $patient_list; } else { $ret = 0; } } else { if ($by == 1) { //$count = search_patients_by_name_count($q); $patient_list = search_patients_by_name($q); if (count($patient_list) > 0) { $ret = $patient_list; } else { $ret = 0; } } else { if ($by == 3) { //$count = search_patients_by_dailynum_count($q); $patient_list = search_patients_by_dailynum($q); if (count($patient_list) > 0) { $ret = $patient_list; } else { $ret = 0; } } else { return -1; } } } return $ret; }