$_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> <?php html_header_show(); ?> <link rel="stylesheet" href="<?php echo $css_header;
// 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> <?php html_header_show(); ?> <title><?php echo htmlspecialchars(xl('Patient Finder'), ENT_NOQUOTES); ?> </title> <link rel="stylesheet" href='<?php echo $css_header;
$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); } else { if ($findBy == "Filter") { $result = getByPatientDemographicsFilter($searchFields, "{$patient}", $given, $orderby, $sqllimit, $fstart); } } } } } }
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++; } } if ($findBy == "SSN" && ($result = getPatientSSN("{$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++; } }