function search_patients_by_db_id_count($patient_code, $labsection) { $patient = getPatientFromBarcode($patient_code); $count = 0; if ($labsection == 0) { if ($patient != NULL) { $count = 1; } } else { $query_string = "select count(distinct patient.patient_id) as val from patient, specimen " . "where patient.patient_id like '{$patient->patientId}' and patient.patient_id = specimen.patient_id " . "and specimen.specimen_id in " . "(select specimen_id from specimen where specimen_type_id in " . "(select specimen_type_id from specimen_test where test_type_id in " . "(select test_type_id as lab_section from test_type where test_category_id = {$labsection})))"; $saved_db = DbUtil::switchToLabConfig($_SESSION['lab_config_id']); $resultset = query_associative_one($query_string); DbUtil::switchRestore($saved_db); return $resultset['val']; } return $count; }
} } 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; } } } } } if ((count($patient_list) == 0 || $patient_list[0] == null) && $patient == null) { ?> <br> <div class='sidetip_nopos'> <?php echo LangUtil::$pageTerms['MSG_NOMATCH'] . " -"; if ($a == 0) { echo " " . LangUtil::$generalTerms['PATIENT_ID'] . " ";
function search_patients_by_db_id_count($patient_code) { $patient = getPatientFromBarcode($patient_code); $count = 0; if ($patient != NULL) { $count = 1; } return $count; }