changes for new flexible frame-based layout - not yet complete
[openemr.git] / interface / main / finder / patient_select.php
blob877b834a3ccb447c88acc1d26c1009612f12634f
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"><?php echo xl('Select Patient') . ' ' . $patient . ' ' . xl('by') . ' ' . xl($findBy); ?></a>
24 <br>
26 <table border='0' cellpadding='5' cellspacing='0'>
27 <tr>
28 <td>
29 <span class='bold'><?php xl('Name','e');?></span>
30 </td><td>
31 <span class='bold'><?php xl('SS','e');?></span>
32 </td><td>
33 <span class='bold'><?php xl('DOB','e');?></span>
34 </td><td>
35 <span class='bold'><?php xl('ID','e');?></span>
36 </td></tr>
38 <?php
40 $total=0;
42 if ($findBy == "Last")
43 $result = getPatientLnames("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
44 else if ($findBy == "ID")
45 $result = getPatientId("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
46 else if ($findBy == "DOB")
47 $result = getPatientDOB("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
48 else if ($findBy == "SSN")
49 $result = getPatientSSN("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS");
51 if ($result) {
52 foreach ($result as $iter) {
53 if ($total >= $M) break;
54 // For the old layout we load a frameset that also sets up the new pid.
55 // The new layout loads just the demographics frame here, which in turn
56 // will set the pid and load all the other frames.
57 if ($GLOBALS['concurrent_layout']) {
58 $anchor = "<a href='../../patient_file/summary/demographics.php?set_pid=" . $iter['pid'] . "'>";
59 } else {
60 $anchor = "<a class='text' target='_top' " .
61 "href='../../patient_file/patient_file.php?set_pid=" .
62 $iter['pid'] . "'>";
64 print "<tr><td>$anchor" . $iter['lname'] . ", " . $iter['fname'] . "</a></td>\n";
65 print "<td>$anchor" . $iter['ss'] . "</a></td>";
66 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
67 print "<td>$anchor" . $iter['DOB_TS'] . "</a></td>";
68 } else {
69 print "<td>$anchor&nbsp;</a></td>";
71 print "<td>$anchor" . $iter['pubpid'] . "</a></td>";
72 $total++;
77 /****
78 if ($findBy == "Last" && $result = getPatientLnames("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
79 foreach ($result as $iter) {
81 if ($total >= $M) {
82 break;
84 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";
85 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
86 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
87 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter["DOB_TS"]."</a></td>";
88 } else {
89 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
91 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
93 $total++;
97 if ($findBy == "ID" && $result = getPatientId("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
98 foreach ($result as $iter) {
100 if ($total >= $M) {
101 break;
103 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";
104 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
105 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
106 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter["DOB_TS"]."</a></td>";
107 } else {
108 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
110 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
112 $total++;
116 if ($findBy == "DOB" && $result = getPatientDOB("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
117 foreach ($result as $iter) {
119 if ($total >= $M) {
120 break;
122 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";
123 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
124 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
125 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter["DOB_TS"]."</a></td>";
126 } else {
127 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
129 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
131 $total++;
135 if ($findBy == "SSN" && $result = getPatientSSN("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
136 foreach ($result as $iter) {
138 if ($total >= $M) {
139 break;
141 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";
142 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
143 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
144 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter["DOB_TS"]."</a></td>";
145 } else {
146 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
148 print "<td><a class=text target=_top href='../../patient_file/patient_file.php?set_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
150 $total++;
154 ****/
158 </table>
160 </body>
161 </html>