2 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 include_once("../../globals.php");
10 include_once("$srcdir/patient.inc");
14 // If we are searching, search.
16 if ($_REQUEST['searchby'] && $_REQUEST['searchparm']) {
17 $searchby = $_REQUEST['searchby'];
18 $searchparm = $_REQUEST['searchparm'];
20 if ($searchby == "Last") {
21 $result = getPatientLnames("$searchparm","*");
22 } elseif ($searchby == "ID") {
23 $result = getPatientId("$searchparm","*");
24 } elseif ($searchby == "DOB") {
25 $result = getPatientDOB("$searchparm","*");
26 } elseif ($searchby == "SSN") {
27 $result = getPatientSSN("$searchparm","*");
33 <title
>Patient Finder
</title
>
34 <link rel
=stylesheet href
='<? echo $css_header ?>' type
='text/css'>
37 td
{ font
-size
:10pt
; }
40 <script language
="JavaScript">
42 function selpid(pid
, lname
, fname
, dob
) {
43 if (opener
.closed ||
! opener
.setpatient
)
44 alert('The destination form was closed; I cannot act on your selection.');
46 opener
.setpatient(pid
, lname
, fname
, dob
);
55 <body
<?
echo $top_bg_line;?
>>
58 <form method
='post' name
='theform' action
='find_patient_popup.php?'>
61 <table border
='0' cellpadding
='5' cellspacing
='0'>
68 <tr bgcolor
='#ddddff'>
72 <select name
='searchby'>
73 <option value
="Last"><?
xl ('Name','e'); ?
></option
>
74 <option value
="ID"<?
if ($searchby == 'ID') echo ' selected' ?
>><?
xl ('ID','e'); ?
></option
>
75 <option value
="SSN"<?
if ($searchby == 'SSN') echo ' selected' ?
>><?
xl ('SSN','e'); ?
></option
>
76 <option value
="DOB"<?
if ($searchby == 'DOB') echo ' selected' ?
>><?
xl ('DOB','e'); ?
></option
>
79 <input type
='text' name
='searchparm' size
='12' value
='<? echo $_REQUEST['searchparm
']; ?>'
80 title
='If name, any part of lastname or lastname,firstname'>
82 <input type
='submit' value
='Search'>
83 <!--  
; <input type
='button' value
='Close' onclick
='window.close()' /> -->
95 <?
if (isset($result)) { ?
>
99 <td
><b
><?
xl ('Name','e'); ?
></b
></td
>
100 <td
><b
><?
xl ('SS','e'); ?
></b
></td
>
101 <td
><b
><?
xl ('DOB','e'); ?
></b
></td
>
102 <td
><b
><?
xl ('ID','e'); ?
></b
></td
>
105 foreach ($result as $iter) {
106 $iterpid = $iter['pid'];
107 $iterlname = addslashes($iter['lname']);
108 $iterfname = addslashes($iter['fname']);
109 $iterdob = $iter['DOB'];
110 $anchor = "<a href='' " .
111 "onclick='return selpid($iterpid, \"$iterlname\", \"$iterfname\", \"$iterdob\")'>";
113 echo " <td>$anchor$iterlname, $iterfname</a></td>\n";
114 echo " <td>$anchor" . $iter['ss'] . "</a></td>\n";
115 echo " <td>$anchor" . $iter['DOB'] . "</a></td>\n";
116 echo " <td>$anchor" . $iter['pubpid'] . "</a></td>\n";