replaced call no nonexistent function
[openemr.git] / interface / patient_file / summary / browse.php
blob5f56c8e560ab18bb0bcb88caed1a5aa89c89c057
1 <?php
2 include_once("../../globals.php");
3 include_once("$srcdir/patient.inc");
5 //the maximum number of patient records to display:
6 $M = 100;
8 $browsenum = (is_numeric($_REQUEST['browsenum'])) ? $_REQUEST['browsenum'] : 1;
9 ?>
10 <html>
11 <head>
12 <link rel='stylesheet' href="<?php echo $css_header;?>" type="text/css">
13 </head>
15 <body <?php echo $top_bg_line;?> topmargin=0 rightmargin=0 leftmargin=2 bottommargin=0 marginwidth=2 marginheight=0>
17 <a href="javascript:window.close();"><font class=title><?php xl('Browse for Record','e'); ?></font><font class=back><?php echo $tback;?></font></a>
19 <form border='0' method='post' name="find_patient" action="browse.php?browsenum=<?php echo $browsenum?>">
21 <?php //<a href="javascript:document.find_patient.action='finder/patient_finder_keyboard.php';document.find_patient.submit();" class=link>Find Patient:</a>?>
22 <input type='entry' size='10' name='patient'>
23 <select name="findBy" size='1'>
24 <option value="ID"><?php xl('ID','e'); ?></option>
25 <option value="Last" selected><?php xl('Last Name','e'); ?></option>
26 <option value="SSN"><?php xl('SSN','e'); ?></option>
27 <option value="DOB"><?php xl('DOB','e'); ?></option>
28 </select>
29 <a href="javascript:document.find_patient.submit();" class=link><?php xl('Find','e'); ?></a>&nbsp;&nbsp;
30 <a href="javascript:auto_populate_employer_address();" class=link_submit><?php xl('Copy Values','e'); ?></a>
31 </form>
33 <?php
34 if (isset($_GET{set_pid})) {
35 if (!isset($_POST{insurance})){
36 $insurance = "primary";
37 } else {
38 $insurance = $_POST{insurance};
40 $result = getPatientData($_GET{set_pid});
41 // $result2 = getEmployerData($_GET{set_pid}); // not used!
42 $result3 = getInsuranceData($_GET{set_pid},$insurance);
45 <script language=javascript>
46 <!--
47 function auto_populate_employer_address(){
48 var df = opener.document.demographics_form;
49 df.i<?=$browsenum?>subscriber_fname.value='<?echo $result3{subscriber_fname};?>';
50 df.i<?=$browsenum?>subscriber_mname.value='<?echo $result3{subscriber_mname};?>';
51 df.i<?=$browsenum?>subscriber_lname.value='<?echo $result3{subscriber_lname};?>';
52 df.i<?=$browsenum?>subscriber_street.value='<?echo $result3{subscriber_street};?>';
53 df.i<?=$browsenum?>subscriber_city.value='<?echo $result3{subscriber_city};?>';
54 df.i<?=$browsenum?>subscriber_state.value='<?echo $result3{subscriber_state};?>';
55 df.i<?=$browsenum?>subscriber_postal_code.value='<?echo $result3{subscriber_postal_code};?>';
56 if (df.i<?=$browsenum?>subscriber_country) // in case this is commented out
57 df.i<?=$browsenum?>subscriber_country.value='<?echo $result3{subscriber_country};?>';
58 df.i<?=$browsenum?>subscriber_phone.value='<?echo $result3{subscriber_phone};?>';
59 df.i<?=$browsenum?>subscriber_DOB.value='<?=$result3{subscriber_DOB};?>';
60 df.i<?=$browsenum?>subscriber_ss.value='<?echo $result3{subscriber_ss};?>';
61 df.i<?=$browsenum?>subscriber_sex.value='<?echo $result3{subscriber_sex};?>';
63 df.i<?=$browsenum?>plan_name.value='<?echo $result3{plan_name};?>';
64 df.i<?=$browsenum?>policy_number.value='<?echo $result3{policy_number};?>';
65 df.i<?=$browsenum?>group_number.value='<?echo $result3{group_number};?>';
66 df.i<?=$browsenum?>provider.value='<?echo $result3{provider};?>';
68 // One clinic comments out the subscriber employer stuff.
69 if (df.i<?=$browsenum?>subscriber_employer) {
70 df.i<?=$browsenum?>subscriber_employer.value='<?echo $result3{subscriber_employer};?>';
71 df.i<?=$browsenum?>subscriber_employer_street.value='<?echo $result3{subscriber_employer_street};?>';
72 df.i<?=$browsenum?>subscriber_employer_city.value='<?echo $result3{subscriber_employer_city};?>';
73 df.i<?=$browsenum?>subscriber_employer_state.value='<?echo $result3{subscriber_employer_state};?>';
74 df.i<?=$browsenum?>subscriber_employer_postal_code.value='<?echo $result3{subscriber_employer_postal_code};?>';
75 df.i<?=$browsenum?>subscriber_employer_country.value='<?echo $result3{subscriber_employer_country};?>';
78 //-->
79 </script>
81 <form method=post name=insurance_form action=browse.php?browsenum=<?=$browsenum?>&set_pid=<?php echo $_GET{set_pid};?>>
82 <input type="hidden" name="browsenum" value="<?=$browsenum?>">
83 <span class=bold> <?php xl('Insurance Provider','e'); ?>:</span>
84 <select name=insurance onchange="javascript:document.insurance_form.submit();">
85 <option value="primary"><?php xl('Primary','e'); ?></option>
86 <option value="secondary"><?php xl('Secondary','e'); ?></option>
87 <option value="tertiary"><?php xl('Tertiary','e'); ?></option>
88 </select>
90 </form>
91 <table>
92 <tr>
93 <td><span class=text><?php xl('First Name','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_fname};?></span></td>
94 </tr>
95 <tr>
96 <td><span class=text><?php xl('Middle Name','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_mname};?></span></td>
97 </tr>
98 <tr>
99 <td><span class=text><?php xl('Last Name','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_lname};?></span></td>
100 </tr>
101 <tr>
102 <td><span class=text><?php xl('Address','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_street};?></span></td>
103 </tr>
104 <tr>
105 <td><span class=text><?php xl('City','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_city};?></span></td>
106 </tr>
107 <tr>
108 <td><span class=text><?php xl('State','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_state};?></span></td>
109 </tr>
110 <tr>
111 <td><span class=text><?php xl('Zip Code','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_postal_code};?></span></td>
112 </tr>
113 <tr>
114 <td><span class=text><?php xl('Country','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_country};?></span></td>
115 </tr>
116 <tr>
117 <td><span class=text><?php xl('Phone','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_phone};?></span></td>
118 </tr>
119 <tr>
120 <td><span class=text><?php xl('DOB','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_DOB};?></span></td>
121 </tr>
122 <tr>
123 <td><span class=text><?php xl('SS','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_ss};?></span></td>
124 </tr>
125 <tr>
126 <td><span class=text><?php xl('Primary Insurance Provider','e'); ?>:</span></td><td><span class=text><?php echo $result3{provider_name};?></span></td>
127 </tr>
128 <tr>
129 <td><span class=text><?php xl('Plan Name','e'); ?>:</span></td><td><span class=text><?php echo $result3{plan_name};?></span></td>
130 </tr>
131 <tr>
132 <td><span class=text><?php xl('Group Number','e'); ?>:</span></td><td><span class=text><?php echo $result3{group_number};?></span></td>
133 </tr>
134 <tr>
135 <tr>
136 <td><span class=text><?php xl('Policy Number','e'); ?>:</span></td><td><span class=text><?php echo $result3{policy_number};?></span></td>
137 </tr>
139 <?php if (empty($GLOBALS['omit_employers'])) { ?>
141 <tr>
142 <td><span class=text><?php xl('Subscriber Employer','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_employer};?></span></td>
143 </tr>
144 <tr>
145 <td><span class=text><?php xl('Subscriber Employer Address','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_employer_street};?></span></td>
146 </tr>
147 <tr>
148 <td><span class=text><?php xl('Subscriber Employer Zip Code','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_employer_postal_code};?></span></td>
149 </tr>
150 <tr>
151 <td><span class=text><?php xl('Subscriber Employer City','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_employer_city};?></span></td>
152 </tr>
153 <tr>
154 <td><span class=text><?php xl('Subscriber Employer State','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_employer_state};?></span></td>
155 </tr>
156 <tr>
157 <td><span class=text><?php xl('Subscriber Employer Country','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_employer_country};?></span></td>
158 </tr>
160 <?php } ?>
162 <tr>
163 <td><span class=text><?php xl('Subscriber Sex','e'); ?>:</span></td><td><span class=text><?php echo $result3{subscriber_sex};?></span></td>
164 </tr>
165 </table>
167 <br>
168 <a href="javascript:auto_populate_employer_address();" class=link_submit>Copy Values</a>
170 <?php
171 } else {
174 <table border=0 cellpadding=5 cellspacing=0>
175 <tr>
176 <td>
177 <span class=bold><?php xl('Name','e'); ?></span>
178 </td><td>
179 <span class=bold><?php xl('SS','e'); ?></span>
180 </td><td>
181 <span class=bold><?php xl('DOB','e'); ?></span>
182 </td><td>
183 <span class=bold><?php xl('ID','e'); ?></span>
184 </td></tr>
185 <?php
187 $count=0;
188 $total=0;
190 if ($findBy == "Last" && $result = getPatientLnames("$patient","*,DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
191 foreach ($result as $iter) {
193 if ($total >= $M) {
194 break;
196 print "<tr><td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"lname"}.", ".$iter{"fname"}."</td></a>\n";
197 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
198 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
199 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"DOB_TS"}."</a></td>";
200 } else {
201 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
203 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
205 $total++;
209 if ($findBy == "ID" && $result = getPatientId("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
210 foreach ($result as $iter) {
212 if ($total >= $M) {
213 break;
215 print "<tr><td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"lname"}.", ".$iter{"fname"}."</td></a>\n";
216 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
217 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
218 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"DOB_TS"}."</a></td>";
219 } else {
220 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
222 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&vset_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
224 $total++;
228 if ($findBy == "DOB" && $result = getPatientDOB("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
229 foreach ($result as $iter) {
231 if ($total >= $M) {
232 break;
234 print "<tr><td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"lname"}.", ".$iter{"fname"}."</td></a>\n";
235 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
236 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
237 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"DOB_TS"}."</a></td>";
238 } else {
239 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
241 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
243 $total++;
247 if ($findBy == "SSN" && $result = getPatientSSN("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) {
248 foreach ($result as $iter) {
250 if ($total >= $M) {
251 break;
253 print "<tr><td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"lname"}.", ".$iter{"fname"}."</td></a>\n";
254 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"ss"}."</a></td>";
255 if ($iter{"DOB"} != "0000-00-00 00:00:00") {
256 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"DOB_TS"}."</a></td>";
257 } else {
258 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>&nbsp;</a></td>";
260 print "<td><a class=text target=_top href='browse.php?browsenum=$browsenum&set_pid=".$iter{"pid"}."'>".$iter{"pubpid"}."</a></td>";
262 $total++;
266 </table>
267 <?php
270 </body>
271 </html>