$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 //$patient = searchPatientByName($q); /*if($patient != null) {
$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 if ($dynamic_fetch == 0) { $patient_list = search_patients_by_id($q); } else { $patient_list = search_patients_by_id_dyn($q, $result_cap, $result_counter); } } 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);