//$_SESSION["category"] = $_POST["category"]; $category = $_POST["category"]; } if (isset($_POST["mode"]) && $_POST["mode"] == "findpatient") { $_SESSION["findby"] = $_POST["findBy"]; $_SESSION["lastname"] = $_POST["lastname"]; $_SESSION["firstname"] = $_POST["firstname"]; $category = $_POST["category"]; } $findby = $_SESSION["findby"]; $lastname = $_SESSION["lastname"]; $firstname = $_SESSION["firstname"]; // do the search, if we have some good criteria if (isset($lastname) && $lastname != "") { if ($findby == "Last") { $result = getPatientLnames("{$lastname}", "*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS"); } elseif ($findby == "ID") { $result = getPatientId("{$lastname}", "*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS"); } elseif ($findby == "DOB") { $result = getPatientDOB("{$lastname}", "*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS"); } elseif ($findby == "SSN") { $result = getPatientSSN("{$lastname}", "*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS"); } elseif ($searchby == "Phone") { //(CHEMED) Search by phone number $result = getPatientPhone("{$searchparm}", "*"); } } ?> <html> <head>
$sanitize_all_escapes = true; // //STOP FAKE REGISTER GLOBALS $fake_register_globals = false; // include_once "../../globals.php"; include_once "{$srcdir}/patient.inc"; include_once "{$srcdir}/formdata.inc.php"; $info_msg = ""; // If we are searching, search. // if ($_REQUEST['searchby'] && $_REQUEST['searchparm']) { $searchby = $_REQUEST['searchby']; $searchparm = trim($_REQUEST['searchparm']); if ($searchby == "Last") { $result = getPatientLnames("{$searchparm}", "*"); } elseif ($searchby == "Phone") { //(CHEMED) Search by phone number $result = getPatientPhone("{$searchparm}", "*"); } elseif ($searchby == "ID") { $result = getPatientId("{$searchparm}", "*"); } elseif ($searchby == "DOB") { $result = getPatientDOB("{$searchparm}", "*"); } elseif ($searchby == "SSN") { $result = getPatientSSN("{$searchparm}", "*"); } } ?> <html> <head>
} $sql = "SELECT {$given} FROM patient_data " . "WHERE {$where} ORDER BY {$orderby} LIMIT {$fstart}, {$sqllimit}"; $rez = sqlStatement($sql); $result = array(); while ($row = sqlFetchArray($rez)) { $result[] = $row; } _set_patient_inc_count($sqllimit, count($result), $where); } else { $patient = formData("patient", "R"); $findBy = $_REQUEST['findBy']; $searchFields = $_REQUEST['searchFields']; echo "<input type='hidden' name='patient' value='{$patient}' />\n"; echo "<input type='hidden' name='findBy' value='{$findBy}' />\n"; if ($findBy == "Last") { $result = getPatientLnames("{$patient}", $given, $orderby, $sqllimit, $fstart); } else { if ($findBy == "ID") { $result = getPatientId("{$patient}", $given, "id ASC, " . $orderby, $sqllimit, $fstart); } else { if ($findBy == "DOB") { $result = getPatientDOB("{$patient}", $given, "DOB ASC, " . $orderby, $sqllimit, $fstart); } else { if ($findBy == "SSN") { $result = getPatientSSN("{$patient}", $given, "ss ASC, " . $orderby, $sqllimit, $fstart); } elseif ($findBy == "Phone") { //(CHEMED) Search by phone number $result = getPatientPhone("{$patient}", $given, $orderby, $sqllimit, $fstart); } else { if ($findBy == "Any") { $result = getByPatientDemographics("{$patient}", $given, $orderby, $sqllimit, $fstart);
</span> </td><td> <span class=bold><?php xl('DOB', 'e'); ?> </span> </td><td> <span class=bold><?php xl('ID', 'e'); ?> </span> </td></tr> <?php $count = 0; $total = 0; if ($findBy == "Last" && ($result = getPatientLnames("{$patient}", "*,DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS"))) { foreach ($result as $iter) { if ($total >= $M) { break; } print "<tr><td><a class=text target=_top href='browse.php?browsenum={$browsenum}&set_pid=" . $iter["pid"] . "'>" . $iter["lname"] . ", " . $iter["fname"] . "</td></a>\n"; print "<td><a class=text target=_top href='browse.php?browsenum={$browsenum}&set_pid=" . $iter["pid"] . "'>" . $iter["ss"] . "</a></td>"; if ($iter["DOB"] != "0000-00-00 00:00:00") { print "<td><a class=text target=_top href='browse.php?browsenum={$browsenum}&set_pid=" . $iter["pid"] . "'>" . $iter["DOB_TS"] . "</a></td>"; } else { print "<td><a class=text target=_top href='browse.php?browsenum={$browsenum}&set_pid=" . $iter["pid"] . "'> </a></td>"; } print "<td><a class=text target=_top href='browse.php?browsenum={$browsenum}&set_pid=" . $iter["pid"] . "'>" . $iter["pubpid"] . "</a></td>"; $total++; } }