initial support for multiple browser windows
[openemr.git] / interface / main / finder / patient_select.php
blobff2e89d651aefea8bfeb997a7775b6235c7f934f
1 <?php
2 include_once("../../globals.php");
3 include_once("$srcdir/patient.inc");
5 //the maximum number of patient records to display:
6 $M = 2000;
8 // this is a quick fix so it doesn't go to thousands records.
9 // the searching functions on patient.inc need improvement.
10 if ($patient=='') $patient=xl('Please enter some information','e');
13 <html>
14 <head>
16 <link rel=stylesheet href="<?php echo $css_header;?>" type="text/css">
18 </head>
19 <body <?php echo $top_bg_line; ?> topmargin='0' rightmargin='0' leftmargin='2'
20 bottommargin='0' marginwidth='2' marginheight='0'>
22 <a class="title" href="../main_screen.php" target="_top" onclick="top.restoreSession()">
23 <?php echo xl('Select Patient') . ' ' . $patient . ' ' . xl('by') . ' ' . xl($findBy); ?></a>
25 <br>
27 <table border='0' cellpadding='5' cellspacing='0'>
28 <tr>
29 <td>
30 <span class='bold'><?php xl('Name','e');?></span>
31 </td><td>
32 <span class='bold'><?php xl('SS','e');?></span>
33 </td><td>
34 <span class='bold'><?php xl('DOB','e');?></span>
35 </td><td>
36 <span class='bold'><?php xl('ID','e');?></span>
37 </td></tr>
39 <?php
41 $total=0;
43 if ($findBy == "Last")
44 $result = getPatientLnames("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
45 else if ($findBy == "ID")
46 $result = getPatientId("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
47 else if ($findBy == "DOB")
48 $result = getPatientDOB("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
49 else if ($findBy == "SSN")
50 $result = getPatientSSN("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
52 if ($result) {
53 foreach ($result as $iter) {
54 if ($total >= $M) break;
55 // For the old layout we load a frameset that also sets up the new pid.
56 // The new layout loads just the demographics frame here, which in turn
57 // will set the pid and load all the other frames.
58 if ($GLOBALS['concurrent_layout']) {
59 $anchor = "<a href='../../patient_file/summary/demographics.php?set_pid=" .
60 $iter['pid'] . "' class='text' onclick='top.restoreSession()'>";
61 } else {
62 $anchor = "<a class='text' target='_top' " .
63 "href='../../patient_file/patient_file.php?set_pid=" .
64 $iter['pid'] . "' onclick='top.restoreSession()'>";
66 print "<tr><td>$anchor" . $iter['lname'] . ", " . $iter['fname'] . "</a></td>\n";
67 print "<td>$anchor" . $iter['ss'] . "</a></td>";
68 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
69 print "<td>$anchor" . $iter['DOB_TS'] . "</a></td>";
70 } else {
71 print "<td>$anchor&nbsp;</a></td>";
73 print "<td>$anchor" . $iter['pubpid'] . "</a></td>";
74 $total++;
79 /****
80 if ($findBy == "Last" && $result = getPatientLnames("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
81 foreach ($result as $iter) {
83 if ($total >= $M) {
84 break;
86 print "<tr><td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"lname"}.", ".$iter{"fname"}."</td></a>\n";
87 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
88 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
89 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter["DOB_TS"]."</a></td>";
90 } else {
91 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
93 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
95 $total++;
99 if ($findBy == "ID" && $result = getPatientId("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
100 foreach ($result as $iter) {
102 if ($total >= $M) {
103 break;
105 print "<tr><td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"lname"}.", ".$iter{"fname"}."</td></a>\n";
106 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
107 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
108 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter["DOB_TS"]."</a></td>";
109 } else {
110 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
112 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
114 $total++;
118 if ($findBy == "DOB" && $result = getPatientDOB("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
119 foreach ($result as $iter) {
121 if ($total >= $M) {
122 break;
124 print "<tr><td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"lname"}.", ".$iter{"fname"}."</td></a>\n";
125 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
126 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
127 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter["DOB_TS"]."</a></td>";
128 } else {
129 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
131 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
133 $total++;
137 if ($findBy == "SSN" && $result = getPatientSSN("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
138 foreach ($result as $iter) {
140 if ($total >= $M) {
141 break;
143 print "<tr><td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"lname"}.", ".$iter{"fname"}."</td></a>\n";
144 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
145 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
146 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter["DOB_TS"]."</a></td>";
147 } else {
148 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
150 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
152 $total++;
156 ****/
160 </table>
162 </body>
163 </html>