# 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 if ($dynamic_fetch == 0) { $patient_list = search_patients_by_addlid($q, $lab_section); } else { $patient_list = search_patients_by_addlid_dyn($q, $result_cap, $result_counter, $lab_section); } } else { if ($a == 3) { # Fetch by daily number if ($dynamic_fetch == 0) { $patient_list = search_patients_by_dailynum("-" . $q, $lab_section); } else { $patient_list = search_patients_by_dailynum_dyn("-" . $q, $result_cap, $result_counter, $lab_section); } } else { if ($a == 9) { # Fetch by db id if ($dynamic_fetch == 0) { $patient_l = getPatientFromBarcode($q); } else { $patient_l = getPatientFromBarcode($q); } $patient_list[0] = $patient_l; } } }
} //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 $patient_list = search_patients_by_addlid($q); } else { if ($a == 3) { # Fetch by daily number $patient_list = search_patients_by_dailynum("-" . $q); } else { if ((count($patient_list) == 0 || $patient_list[0] == null) && $patient != null) { ?> <br> <div class='sidetip_nopos'> <?php echo "A record of the patient has been found in another hospital.<br><br>"; ?> </div> <a rel='facebox' href='viewPatientInfo.php?pid=<?php echo $patient->patientId; ?> &type=national'>View Patient Info>></a><br> <a href='ajax/import_patient.php?patientId=<?php echo $patient->patientId;
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; }