Apparently the mysqldump was not acceptable for import.
[openemr.git] / interface / patient_file / summary / demographics_dutch.php
blobfc0fb2230fbb6f868907f346b29409a5e3006652
1 <?php
2 require_once("../../globals.php");
3 require_once("$srcdir/patient.inc");
4 require_once("$srcdir/acl.inc");
5 require_once("$srcdir/classes/Address.class.php");
6 require_once("$srcdir/classes/InsuranceCompany.class.php");
8 if ($GLOBALS['concurrent_layout'] && $_GET['set_pid']) {
9 include_once("$srcdir/pid.inc");
10 setpid($_GET['set_pid']);
13 function print_as_money($money) {
14 preg_match("/(\d*)\.?(\d*)/",$money,$moneymatches);
15 $tmp = wordwrap(strrev($moneymatches[1]),3,",",1);
16 $ccheck = strrev($tmp);
17 if ($ccheck[0] == ",") {
18 $tmp = substr($ccheck,1,strlen($ccheck)-1);
20 if ($moneymatches[2] != "") {
21 return "$ " . strrev($tmp) . "." . $moneymatches[2];
22 } else {
23 return "$ " . strrev($tmp);
27 /****
28 function get_billing_note($pid) {
29 $conn = $GLOBALS['adodb']['db'];
30 $billing_note = "";
31 $sql = "select genericname2, genericval2 " .
32 "from patient_data where pid = '$pid' limit 1";
33 $resnote = $conn->Execute($sql);
34 if($resnote && !$resnote->EOF && $resnote->fields['genericname2'] == 'Billing') {
35 $billing_note = $resnote->fields['genericval2'];
37 return $billing_note;
39 ****/
41 function get_patient_balance($pid) {
42 require_once($GLOBALS['fileroot'] . "/library/classes/WSWrapper.class.php");
43 $conn = $GLOBALS['adodb']['db'];
44 $customer_info['id'] = 0;
45 $sql = "SELECT foreign_id FROM integration_mapping AS im " .
46 "LEFT JOIN patient_data AS pd ON im.local_id = pd.id WHERE " .
47 "pd.pid = '" . $pid . "' AND im.local_table = 'patient_data' AND " .
48 "im.foreign_table = 'customer'";
49 $result = $conn->Execute($sql);
50 if($result && !$result->EOF) {
51 $customer_info['id'] = $result->fields['foreign_id'];
53 $function['ezybiz.customer_balance'] = array(new xmlrpcval($customer_info,"struct"));
54 $ws = new WSWrapper($function);
55 if(is_numeric($ws->value)) {
56 return sprintf('%01.2f', $ws->value);
58 return '';
62 <html>
64 <head>
65 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
66 <script type="text/javascript" src="../../../library/dialog.js"></script>
67 <script language="JavaScript">
69 function oldEvt(eventid) {
70 dlgopen('../../main/calendar/add_edit_event.php?eid=' + eventid, '_blank', 550, 270);
73 function refreshme() {
74 location.reload();
77 // Process click on Delete link.
78 function deleteme() {
79 dlgopen('../deleter.php?patient=<?php echo $pid ?>', '_blank', 500, 450);
80 return false;
83 // Called by the deleteme.php window on a successful delete.
84 function imdeleted() {
85 <?php if ($GLOBALS['concurrent_layout']) { ?>
86 parent.left_nav.clearPatient();
87 <?php } else { ?>
88 top.location.href = '../main/main_screen.php';
89 <?php } ?>
92 </script>
93 </head>
95 <body <?echo $top_bg_line;?> topmargin=0 rightmargin=0 leftmargin=2 bottommargin=0 marginwidth=2 marginheight=0>
97 <?php
98 $result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD");
99 // DBC Dutch System
100 $result_NL = getPatientDataNL($pid);
101 // clean the sessions var for the demographics_full
102 $_SESSION['errormsg'] = '';
103 // EOS DBC
104 $result2 = getEmployerData($pid);
106 $thisauth = acl_check('patients', 'demo');
107 if ($thisauth) {
108 if ($result['squad'] && ! acl_check('squads', $result['squad']))
109 $thisauth = 0;
112 if (!$thisauth) {
113 echo "<p>(".xl('Demographics not authorized').")</p>\n";
114 echo "</body>\n</html>\n";
115 exit();
118 if ($thisauth == 'write') {
119 // DUTCH SWITCH FOR DEMOGRAPHICS FULL
120 $demovar = ( $GLOBALS['dutchpc'] ) ? 'demographics_full_dutch.php' : 'demographics_full.php';
122 echo "<p><a href='$demovar'";
123 if (! $GLOBALS['concurrent_layout']) echo " target='Main'";
124 echo "><font class='title'>" . xl('Demographics') . "</font>" .
125 "<font class='more'>$tmore</font></a>";
126 if (acl_check('admin', 'super')) {
127 echo "&nbsp;&nbsp;<a href='' onclick='return deleteme()'>" .
128 "<font class='more' style='color:red'>(".xl('Delete').")</font></a>";
130 echo "</p>\n";
133 // Get the document ID of the patient ID card if access to it is wanted here.
134 $document_id = 0;
135 if ($GLOBALS['patient_id_category_name']) {
136 $tmp = sqlQuery("SELECT d.id, d.date, d.url FROM " .
137 "documents AS d, categories_to_documents AS cd, categories AS c " .
138 "WHERE d.foreign_id = $pid " .
139 "AND cd.document_id = d.id " .
140 "AND c.id = cd.category_id " .
141 "AND c.name LIKE '" . $GLOBALS['patient_id_category_name'] . "' " .
142 "ORDER BY d.date DESC LIMIT 1");
143 if ($tmp) $document_id = $tmp['id'];
147 <table border="0" width="100%">
148 <tr>
149 <td align="left" valign="top">
150 <table border='0' cellpadding='0' width='100%'>
151 <tr>
152 <td valign='top' width='33%'>
153 <span class='bold'><?php xl('Name','e'); ?>: </span>
154 <span class='text'>
155 <?php
156 if ($document_id) echo "<a href='" . $web_root . "/controller.php?document&retrieve" .
157 "&patient_id=$pid&document_id=$document_id' style='color:#00cc00'>";
158 if (!$GLOBALS['omit_employers']) echo $result['title'] . ' ';
160 // DBC
161 if ( $GLOBALS['dutchpc'] ) {
162 // we dont use middle name, just put the dutch prefix here
163 echo sutf8(dutch_name($pid));
164 } else {
165 echo $result['fname'] . ' ' . $result['mname'] . ' ' . $result['lname'];
167 // EOS DBC
169 if ($document_id) echo "</a>";
171 </span><br>
172 <span class='bold'><? xl('Number','e'); ?>: </span><span class='text'><?echo $result{"pubpid"}?></span>
173 </td>
174 <td valign='top' width='33%'>
176 if ($result{"DOB"} && $result{"DOB"} != "0000-00-00") {
178 <span class='bold'><? xl('DOB','e'); ?>: </span>
179 <span class='text'>
181 echo $result{"DOB"};
184 </span><br>
185 <?php if ($result{"ss"} != "") { ?>
186 <span class='bold'><?php xl('S.S.','e'); ?>: </span>
187 <?php } ?>
188 <span class='text'><?php echo $result{"ss"} ?></span>
189 </td>
190 <td valign='top' width='34%'>
191 <?php if ($result{"sex"} != "") { ?>
192 <span class='bold'><?php xl('Sex','e'); ?>: </span>
193 <?php } ?>
194 <span class='text'><?php echo $result{"sex"} ?></span>
195 </td>
196 </tr>
198 <?php
199 // DBC Dutch SYSTEM
200 if ( $GLOBALS['dutchpc'] ) {
201 // verify if the current patient has a facility associated
203 echo '<tr><td>';
204 echo '<span class="text"><b>ID1250</b> ' .get_id('id1250', $pid). '</span>';
205 echo '</td></tr>';
209 <tr>
210 <td valign='top'>
211 <?php if (($result{"street"} != "") || ($result{"city"} != "") || ($result{"state"} != "") || ($result{"country_code"} != "") || ($result{"postal_code"} != "")) {?>
212 <span class='bold'><? xl('Address','e'); ?>: </span>
213 <?php } ?>
214 <br><span class='text'><?echo $result{"street"}?><br><?echo $result{"city"}?><?if($result{"city"} != ""){echo ", ";}?><?echo $result{"state"};?>
215 <? if($result{"country_code"} != ""){ echo ", "; }?><?echo country_code($result{"country_code"})?>
216 <?echo " ";
217 echo $result{"postal_code"}?>
218 </span>
219 </td>
220 <td valign='top'>
222 if ( ($result{"contact_relationship"} != "") ||
223 ($result{"phone_contact"} != "") ||
224 ($result{"phone_home"} != "") ||
225 ($result{"phone_biz"} != "") ||
226 ($result{"email"} != "") ||
227 ($result{"phone_cell"} != "") ){
229 <span class='bold'><? xl('Emergency Contact','e'); ?>: </span><?}?><span class='text'><?echo $result{"contact_relationship"}?><?echo " "?>
231 if ($result{"phone_contact"} != "") {
232 echo " " . $result{"phone_contact"};
234 if ($result{"phone_home"} != "") {
235 echo "<br><span class='bold'>Home:</span> ";
236 echo $result{"phone_home"};
238 if ($result{"phone_biz"} != "") {
239 echo "<br><span class='bold'>Work:</span> ";
240 echo $result{"phone_biz"};
242 if ($result{"phone_cell"} != "") {
243 echo "<br><span class='bold'>Mobile:</span> ";
244 echo $result{"phone_cell"};
246 if ($result{"email"} != "") {
247 echo "<br><span class='bold'>".xl('Email').": </span>";
248 echo '<a class=link_submit href="mailto:' . $result{"email"} . '">' . $result{"email"} . '</a>';
251 </td>
252 <td valign='top'>
254 if ($result{"status"} != "") {
255 echo "<span class='bold'>".xl('Marital Status').": </span>";
256 echo "<span class='text'>" . $result{"status"} . "</span>";
259 </td>
260 </tr>
262 <?php if (!$GLOBALS['athletic_team']) { ?>
263 <tr>
264 <td colspan='3' valign='top'>
265 <?php
266 $opt_out = ($result{"hipaa_mail"} == 'YES') ? 'ALLOWS' : 'DOES NOT ALLOW';
267 echo "<span class='text'>Patient $opt_out Mailed Information </span>";
269 </td>
270 </tr>
271 <tr>
272 <td colspan='2' valign='top'>
273 <?php
274 $opt_out = ($result{"hipaa_voice"} == 'YES') ? 'ALLOWS' : 'DOES NOT ALLOW';
275 echo "<span class='text'>Patient $opt_out Voice Messages </span>";
277 </td>
278 <td colspan='1' valign='top'>
279 <?php
280 echo "<span class='bold'><font color='#ee6600'>Balance Due: $" .
281 get_patient_balance($pid) . "</font>";
282 if ($result['genericname2'] == 'Billing')
283 echo "<br>" . xl('Billing Note') . ":";
284 echo "</span>";
286 </td>
287 </tr>
288 <tr>
289 <td colspan='2' valign='top'>
290 <?php
291 $opt_out = ($result{"hipaa_notice"} == 'YES') ? 'RECEIVED' : 'DID NOT RECEIVE';
292 echo "<span class='text'>Patient $opt_out Notice Information </span>";
294 </td>
295 <td colspan='1' valign='top'>
296 <?php
297 if ($result['genericname2'] == 'Billing')
298 echo "<span class='bold'><font color='red'>" .
299 $result['genericval2'] . "</font></span>";
301 </td>
302 </tr>
303 <tr>
304 <td colspan='3' valign='top'>
305 <?php
306 if ( $result["hipaa_message"] == "" ) {
307 echo "<span class='text'><b>Leave a message with :</b> " .
308 $result{"fname"} . " " . $result{"mname"} . " " .
309 $result{"lname"} . "</span>";
311 else {
312 echo "<span class='text'><b>Leave a message with :</b> " .
313 $result{"hipaa_message"} . "</span>";
316 </td>
317 </tr>
319 <?php } else { ?>
320 <tr>
321 <td colspan='3' valign='top'>
322 &nbsp;
323 </td>
324 </tr>
325 <?php } ?>
327 <?php if ($GLOBALS['omit_employers']) { ?>
329 <tr>
330 <td valign='top' colspan='2'>
331 <table>
332 <tr>
333 <td><span class='bold'>Listed Family Members:</span></td>
334 <td>&nbsp;</td>
335 </tr>
336 <tr>
337 <td><?php if ($result{"genericname1"} != "") { ?><span class='text'>&nbsp;&nbsp;&nbsp;<?=$result{"genericname1"}?></span><?php } ?></td>
338 <td><?php if ($result{"genericval1"} != "") { ?><span class='text'>&nbsp;&nbsp;&nbsp;<?=$result{"genericval1"}?></span><?php } ?></td>
339 </tr>
340 <tr>
341 <td><?php if ($result{"genericname2"} != "") { ?><span class='text'>&nbsp;&nbsp;&nbsp;<?=$result{"genericname2"}?></span><?php } ?></td>
342 <td><?php if ($result{"genericval2"} != "") { ?><span class='text'>&nbsp;&nbsp;&nbsp;<?=$result{"genericval2"}?></span><?php } ?></td>
343 </tr>
344 </table>
345 </td>
346 <td valign='top'></td>
347 </tr>
349 <?php } else { ///// end omit_employers ///// ?>
351 <tr>
352 <td valign='top'>
353 <?php if ($result{"occupation"} != "") { ?>
354 <span class='bold'><?php xl('Occupation','e'); ?>: </span><span class='text'><?echo $result{"occupation"}?></span><br>
355 <?php } ?>
356 <?php if ($result2{"name"} != "") { ?>
357 <span class='bold'><?php xl('Employer','e'); ?>: </span><span class='text'><?php echo $result2{"name"} ?></span>
358 <?php } ?>
359 </td>
360 <td valign='top'>
361 <?php if (($result2{"street"} != "") || ($result2{"city"} != "") || ($result2{"state"} != "") || ($result2{"country"} != "") || ($result2{"postal_code"} != "")) { ?>
362 <span class='bold'><? xl('Employer Address','e'); ?>:</span>
363 <?php } ?>
364 <br>
365 <span class='text'>
366 <?php echo $result2{"street"}?><br><?php echo $result2{"city"} ?><?php if($result2{"city"} != "") { echo ", "; } ?><?php echo $result2{"state"} ?>
367 <?php if($result2{"country"} != "") { echo ", "; } echo $result2{"country"} ?>
368 <?php if($result2{"postal_code"} != "") {echo " "; } ?>
369 <?php echo $result2{"postal_code"} ?>
370 </span>
371 </td>
372 <td valign='top'>
373 <?php
374 // This stuff only applies to athletic team use of OpenEMR:
375 if ($GLOBALS['athletic_team']) {
376 // blue dk green yellow red orange
377 $fitcolors = array('#6677ff', '#00cc00', '#ffff00', '#ff3333', '#ff8800', '#ffeecc', '#ffccaa');
378 $fitcolor = $fitcolors[0];
379 $fitness = $_POST['form_fitness'];
380 if ($fitness) {
381 sqlStatement("UPDATE patient_data SET fitness = '$fitness' WHERE pid = '$pid'");
382 } else {
383 $fitness = $result['fitness'];
384 if (! $fitness) $fitness = 1;
386 $fitcolor = $fitcolors[$fitness - 1];
388 // larry :: Dutch DBC insert
389 <?php if( $GLOBALS['dutchpc'] )
390 { ?>
391 <form method='post' action='demographics_dutch.php'>
392 <?php } else
393 { ?>
394 <form method='post' action='demographics.php'>
395 <?php } ?>
396 // larry :: end DBC insert
398 <span class='bold'><? xl('Fitness to Play','e'); ?>:</span><br>
399 <select name='form_fitness' onchange='document.forms[0].submit()' style='background-color:<? echo $fitcolor ?>'>
400 <option value='1'<? if ($fitness == 1) echo ' selected' ?>><? xl('Full Play','e'); ?></option>
401 <option value='2'<? if ($fitness == 2) echo ' selected' ?>><? xl('Full Training','e'); ?></option>
402 <option value='3'<? if ($fitness == 3) echo ' selected' ?>><? xl('Restricted Training','e'); ?></option>
403 <option value='4'<? if ($fitness == 4) echo ' selected' ?>><? xl('Injured Out','e'); ?></option>
404 <option value='5'<? if ($fitness == 5) echo ' selected' ?>><? xl('Rehabilitation','e'); ?></option>
405 <option value='6'<? if ($fitness == 6) echo ' selected' ?>><? xl('Illness','e'); ?></option>
406 <option value='7'<? if ($fitness == 7) echo ' selected' ?>><? xl('International Duty','e'); ?></option>
407 </select>
408 </form>
409 <?php } // end athletic team ?>
410 </td>
411 </tr>
412 <tr>
413 <td valign='top'>
414 <?php if (! $GLOBALS['athletic_team']) { ?>
415 <?php if ($result{"ethnoracial"} != "") { ?><span class='bold'><? xl('Race/Ethnicity','e'); ?>: </span><span class='text'><?echo $result{"ethnoracial"};?></span><br><? } ?>
416 <?php if ($result{"language"} != "") { ?><span class='bold'><? xl('Language','e'); ?>: </span><span class='text'><?echo ucfirst($result{"language"});?></span><br><? } ?>
417 <?php if ($result{"interpretter"} != "") { ?><span class='bold'><? xl('Interpreter','e'); ?>: </span><span class='text'><?echo $result{"interpretter"};?></span><br><? } ?>
418 <?php if ($result{"family_size"} != "") { ?><span class='bold'><? xl('Family Size','e'); ?>: </span><span class='text'><?echo $result{"family_size"};?></span><br><? } ?>
419 <?php } ?>
420 </td>
421 <td valign='top'>
422 <?php if (! $GLOBALS['athletic_team']) { ?>
423 <?php if ($result{"financial_review"} != "0000-00-00 00:00:00") {?><span class='bold'><? xl('Financial Review Date','e'); ?>: </span><span class='text'><?echo date("n/j/Y",strtotime($result{"financial_review"}));?></span><br><?}?>
424 <?php if ($result{"monthly_income"} != "") {?><span class='bold'><? xl('Monthly Income','e'); ?>: </span><span class='text'><?echo print_as_money($result{"monthly_income"});?></span><br><?}?>
425 <?php if ($result{"migrantseasonal"} != "") {?><span class='bold'><? xl('Migrant/Seasonal','e'); ?>: </span><span class='text'><?echo $result{"migrantseasonal"};?></span><br><?}?>
426 <?php if ($result{"homeless"} != "") {?><span class='bold'><? xl('Homeless, etc','e'); ?>.: </span><span class='text'><?echo $result{"homeless"};?></span><br><?}?>
427 <?php } ?>
428 </td>
429 <td valign='top'>
430 <table>
431 <tr>
432 <td><? if ($result{"genericname1"} != "") {?><span class='bold'><?=$result{"genericname1"}?></span>:<?}?> </td>
433 <td><? if ($result{"genericval1"} != "") {?><span class='text'><?=$result{"genericval1"}?></span><?}?></td>
434 </tr>
435 <tr>
436 <td><? if ($result{"genericname2"} != "") {?><span class='bold'><?=$result{"genericname2"}?></span>:<?}?> </td>
437 <td><? if ($result{"genericval2"} != "") {?><span class='text'><?=$result{"genericval2"}?></span><?}?></td>
438 </tr>
439 </table>
440 </td>
441 </tr>
443 <?php } ///// end not omit_employers ///// ?>
445 <?php
446 //////////////////////////////////REFERRAL SECTION
447 if ($result{"referrer"} != "" || $result{"referrerID"} != "")
450 <tr>
451 <td valign='top' colspan='3'>
452 <span class='bold'><? xl('Primary Provider','e'); ?>: </span><span class='text'><?=getProviderName($result['providerID'])?></span><br>
453 <!--<span class='bold'>Primary Provider ID: </span><span class='text'><?=$result{"referrerID"}?></span>-->
454 </td>
455 </tr>
456 <?php
459 /////////////////////////////////INSURANCE SECTION
460 $result3 = getInsuranceData($pid, "primary");
461 if ($result3{"provider"}) {
462 $icobj = new InsuranceCompany($result3['provider']);
463 $adobj = $icobj->get_address();
465 <tr>
466 <td valign='top'>
467 <span class='bold'><?php xl('Primary Insurance','e'); ?>:</span><br><span class='text'>
468 <?php
469 if (trim($result3['provider_name'])) {
470 echo $result3['provider_name'] . '<br>';
471 if (trim($adobj->get_line1())) {
472 echo $adobj->get_line1() . '<br>';
473 echo $adobj->get_city() . ', ' . $adobj->get_state() . ' ' . $adobj->get_zip();
475 } else {
476 echo "<font color='red'><b>Unassigned</b></font>";
479 </span><br>
480 <span class='text'><? xl('Policy Number','e'); ?>: <?echo $result3{"policy_number"}?><br>
481 Plan Name: <?=$result3{"plan_name"}?><br>
482 Group Number: <?echo $result3{"group_number"}?></span>
483 </td>
484 <td valign='top'>
485 <span class='bold'><? xl('Subscriber','e'); ?>: </span><br><span class='text'><?=$result3{"subscriber_fname"}?> <?=$result3{"subscriber_mname"}?> <?=$result3{"subscriber_lname"}?> <?if ($result3{"subscriber_relationship"} != "") {echo "(".$result3{"subscriber_relationship"}.")";}?><br>
486 S.S.: <?echo $result3{"subscriber_ss"}?><br>
487 <?php xl('D.O.B.','e'); ?>: <?if ($result3{"subscriber_DOB"} != "0000-00-00 00:00:00") {echo $result3{"subscriber_DOB"};}?><br>
488 Phone: <? echo $result3{"subscriber_phone"}?>
489 </span>
490 </td>
491 <td valign='top'>
492 <span class='bold'><? xl('Subscriber Address','e'); ?>: </span><br><span class='text'><?echo $result3{"subscriber_street"}?><br><?echo $result3{"subscriber_city"}?><?if($result3{"subscriber_state"} != ""){echo ", ";}?><?echo $result3{"subscriber_state"}?><?if($result3{"subscriber_country"} != ""){echo ", ";}?><?echo $result3{"subscriber_country"}?> <?echo " ".$result3{"subscriber_postal_code"}?></span>
494 <?php if (trim($result3['subscriber_employer'])) { ?>
495 <br><span class='bold'><?php xl('Subscriber Employer','e'); ?>: </span><br>
496 <span class='text'><?php echo $result3{"subscriber_employer"}?><br>
497 <?php echo $result3{"subscriber_employer_street"}?><br>
498 <?php echo $result3{"subscriber_employer_city"}?>
499 <?php if($result3{"subscriber_employer_city"} != ""){echo ", ";} echo $result3{"subscriber_employer_state"}?>
500 <?php if($result3{"subscriber_employer_country"} != ""){echo ", ";} echo $result3{"subscriber_employer_country"}?>
501 <?php echo " ".$result3{"subscriber_employer_postal_code"}?>
502 </span>
503 <?php } ?>
505 </td>
506 </tr>
507 <tr>
508 <td><? if ($result3{"copay"} != "") {?><span class='bold'><? xl('CoPay','e'); ?>: </span><span class='text'><?=$result3{"copay"}?></span><?}?></td>
509 <td valign='top'></td>
510 <td valign='top'></td>
511 </tr>
512 <? } ?>
514 $result4 = getInsuranceData($pid, "secondary");
515 if ($result4{"provider"} != "") {
516 $icobj = new InsuranceCompany($result4['provider']);
517 $adobj = $icobj->get_address();
519 <tr>
520 <td valign='top'>
521 <span class='bold'><? xl('Secondary Insurance','e'); ?>:</span><br><span class='text'>
522 <?php
523 if (trim($result4['provider_name'])) {
524 echo $result4['provider_name'] . '<br>';
525 if (trim($adobj->get_line1())) {
526 echo $adobj->get_line1() . '<br>';
527 echo $adobj->get_city() . ', ' . $adobj->get_state() . ' ' . $adobj->get_zip();
529 } else {
530 echo "<font color='red'><b>Unassigned</b></font>";
533 </span><br>
534 <span class='text'><? xl('Policy Number','e'); ?>: <?echo $result4{"policy_number"}?><br>
535 Plan Name: <?=$result4{"plan_name"}?><br>
536 Group Number: <?echo $result4{"group_number"}?></span>
537 </td>
538 <td valign='top'>
539 <span class='bold'><? xl('Subscriber','e'); ?>: </span><br><span class='text'><?=$result4{"subscriber_fname"}?> <?=$result4{"subscriber_mname"}?> <?=$result4{"subscriber_lname"}?> <?if ($result4{"subscriber_relationship"} != "") {echo "(".$result4{"subscriber_relationship"}.")";}?><br>
540 S.S.: <?echo $result4{"subscriber_ss"}?> <? xl('D.O.B.','e'); ?>: <?if ($result4{"subscriber_DOB"} != "0000-00-00 00:00:00") {echo $result4{"subscriber_DOB"};}?><br>
541 Phone: <? echo $result4{"subscriber_phone"}?>
542 </span>
543 </td>
544 <td valign='top'>
545 <span class='bold'><? xl('Subscriber Address','e'); ?>: </span><br><span class='text'><?echo $result4{"subscriber_street"}?><br><?echo $result4{"subscriber_city"}?><?if($result4{"subscriber_state"} != ""){echo ", ";}?><?echo $result4{"subscriber_state"}?><?if($result4{"subscriber_country"} != ""){echo ", ";}?><?echo $result4{"subscriber_country"}?> <?echo " ".$result4{"subscriber_postal_code"}?></span>
547 <?php if (trim($result4['subscriber_employer'])) { ?>
548 <br><span class='bold'><?php xl('Subscriber Employer','e'); ?>: </span><br>
549 <span class='text'><?php echo $result4{"subscriber_employer"}?><br>
550 <?php echo $result4{"subscriber_employer_street"}?><br>
551 <?php echo $result4{"subscriber_employer_city"}?>
552 <?php if($result4{"subscriber_employer_city"} != ""){echo ", ";} echo $result4{"subscriber_employer_state"}?>
553 <?php if($result4{"subscriber_employer_country"} != ""){echo ", ";} echo $result4{"subscriber_employer_country"}?>
554 <?php echo " ".$result4{"subscriber_employer_postal_code"}?>
555 </span>
556 <?php } ?>
558 </td>
559 </tr>
560 <tr>
561 <td>
562 <? if ($result4{"copay"} != "") {?><span class='bold'><? xl('CoPay','e'); ?>: </span><span class='text'><?=$result4{"copay"}?></span><?}?>
563 </td>
564 <td valign='top'></td>
565 <td valign='top'></td>
566 </tr>
567 <? } ?>
569 $result5 = getInsuranceData($pid, "tertiary");
570 if ($result5{"provider"}) {
571 $icobj = new InsuranceCompany($result5['provider']);
572 $adobj = $icobj->get_address();
574 <tr>
575 <td valign='top'>
576 <span class='bold'><? xl('Tertiary Insurance','e'); ?>:</span><br><span class='text'>
577 <?php
578 if (trim($result5['provider_name'])) {
579 echo $result5['provider_name'] . '<br>';
580 if (trim($adobj->get_line1())) {
581 echo $adobj->get_line1() . '<br>';
582 echo $adobj->get_city() . ', ' . $adobj->get_state() . ' ' . $adobj->get_zip();
584 } else {
585 echo "<font color='red'><b>Unassigned</b></font>";
588 </span><br>
589 <span class='text'><? xl('Policy Number','e'); ?>: <?echo $result5{"policy_number"}?><br>
590 Plan Name: <?=$result5{"plan_name"}?><br>
591 Group Number: <?echo $result5{"group_number"}?></span>
592 </td>
593 <td valign='top'>
594 <span class='bold'><? xl('Subscriber','e'); ?>: </span><br><span class='text'><?=$result5{"subscriber_fname"}?> <?=$result5{"subscriber_mname"}?> <?=$result5{"subscriber_lname"}?> <?if ($result5{"subscriber_relationship"} != "") {echo "(".$result5{"subscriber_relationship"}.")";}?><br>
595 S.S.: <?echo $result5{"subscriber_ss"}?> <? xl('D.O.B.','e'); ?>: <?if ($result5{"subscriber_DOB"} != "0000-00-00 00:00:00") {echo $result5{"subscriber_DOB"};}?><br>
596 Phone: <? echo $result5{"subscriber_phone"}?>
597 </span>
598 </td>
599 <td valign='top'>
600 <span class='bold'><? xl('Subscriber Address','e'); ?>: </span><br><span class='text'><?echo $result5{"subscriber_street"}?><br><?echo $result5{"subscriber_city"}?><?if($result5{"subscriber_state"} != ""){echo ", ";}?><?echo $result5{"subscriber_state"}?><?if($result5{"subscriber_country"} != ""){echo ", ";}?><?echo $result5{"subscriber_country"}?> <?echo " ".$result5{"subscriber_postal_code"}?></span>
602 <?php if (trim($result5['subscriber_employer'])) { ?>
603 <br><span class='bold'><?php xl('Subscriber Employer','e'); ?>: </span><br>
604 <span class='text'><?php echo $result5{"subscriber_employer"}?><br>
605 <?php echo $result5{"subscriber_employer_street"}?><br>
606 <?php echo $result5{"subscriber_employer_city"}?>
607 <?php if($result5{"subscriber_employer_city"} != ""){echo ", ";} echo $result5{"subscriber_employer_state"}?>
608 <?php if($result5{"subscriber_employer_country"} != ""){echo ", ";} echo $result5{"subscriber_employer_country"}?>
609 <?php echo " ".$result5{"subscriber_employer_postal_code"}?>
610 </span>
611 <?php } ?>
613 </td>
614 </tr>
615 <tr>
616 <td>
617 <? if ($result5{"copay"} != "") {?><span class='bold'><? xl('CoPay','e'); ?>: </span><span class='text'><?=$result5{"copay"}?></span><?}?>
618 </td>
619 <td valign='top'></td>
620 <td valign='top'></td>
621 </tr>
625 </table>
626 </td>
627 <td valign="top" class="text">
628 <?php
629 if (isset($pid)) {
630 /*$query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " .
631 "e.pc_startTime, u.fname, u.lname, u.mname " .
632 "FROM openemr_postcalendar_events AS e, users AS u WHERE " .
633 "e.pc_pid = '$pid' AND e.pc_eventDate >= CURRENT_DATE AND " .
634 "u.id = e.pc_aid " .
635 "ORDER BY e.pc_eventDate, e.pc_startTime";*/
636 $query = "SELECT e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, " .
637 "e.pc_startTime, u.fname, u.lname, u.mname " .
638 "FROM openemr_postcalendar_events AS e, users AS u WHERE " .
639 "e.pc_pid = '$pid' AND e.pc_eventDate >= '2007-01-01' AND " .
640 "u.id = e.pc_aid " .
641 "ORDER BY e.pc_eventDate, e.pc_startTime";
642 $res = sqlStatement($query);
643 while($row = sqlFetchArray($res)) {
644 $dayname = date("l", strtotime($row['pc_eventDate']));
645 $dispampm = "am";
646 $disphour = substr($row['pc_startTime'], 0, 2) + 0;
647 $dispmin = substr($row['pc_startTime'], 3, 2);
648 if ($disphour >= 12) {
649 $dispampm = "pm";
650 if ($disphour > 12) $disphour -= 12;
652 echo "<a href='javascript:oldEvt(" . $row['pc_eid'] .
653 ")'><b>$dayname " . $row['pc_eventDate'] . "</b><br>";
654 echo "$disphour:$dispmin $dispampm " . $row['pc_title'] . "<br>\n";
655 echo $row['fname'] . " " . $row['lname'] . "</a><br>&nbsp;<br>\n";
659 </td>
660 </tr>
661 </table>
663 <?php if ($GLOBALS['concurrent_layout'] && $_GET['set_pid']) { ?>
664 <script language='JavaScript'>
665 parent.left_nav.setPatient(<?php echo "'" . addslashes($result['fname']) . " " . addslashes($result['lname']) . "',$pid,'" . addslashes($result['pubpid']) . "','', ' DOB: ".$result['DOB_YMD']." Age: ".getPatientAge($result['DOB_YMD'])."'"; ?>);
666 parent.left_nav.setRadio(window.name, 'dem');
667 <?php if (!$_GET['is_new']) { // if new pt, do not load other frame ?>
668 var othername = (window.name == 'RTop') ? 'RBot' : 'RTop';
669 parent.left_nav.setRadio(othername, 'sum');
670 parent.left_nav.loadFrame(othername, 'patient_file/summary/summary_bottom.php');
671 <?php } ?>
672 </script>
673 <?php } ?>
675 </body>
676 </html>