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];
23 return "$ " . strrev($tmp);
28 function get_billing_note($pid) {
29 $conn = $GLOBALS['adodb']['db'];
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'];
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
);
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() {
77 // Process click on Delete link.
79 dlgopen('../deleter.php?patient=<?php echo $pid ?>', '_blank', 500, 450);
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();
88 top
.location
.href
= '../main/main_screen.php';
95 <body
<?
echo $top_bg_line;?
> topmargin
=0 rightmargin
=0 leftmargin
=2 bottommargin
=0 marginwidth
=2 marginheight
=0>
98 $result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD");
100 $result_NL = getPatientDataNL($pid);
101 // clean the sessions var for the demographics_full
102 $_SESSION['errormsg'] = '';
104 $result2 = getEmployerData($pid);
106 $thisauth = acl_check('patients', 'demo');
108 if ($result['squad'] && ! acl_check('squads', $result['squad']))
113 echo "<p>(".xl('Demographics not authorized').")</p>\n";
114 echo "</body>\n</html>\n";
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 " <a href='' onclick='return deleteme()'>" .
128 "<font class='more' style='color:red'>(".xl('Delete').")</font></a>";
133 // Get the document ID of the patient ID card if access to it is wanted here.
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%">
149 <td align
="left" valign
="top">
150 <table border
='0' cellpadding
='0' width
='100%'>
152 <td valign
='top' width
='33%'>
153 <span
class='bold'><?php
xl('Name','e'); ?
>: </span
>
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'] . ' ';
161 if ( $GLOBALS['dutchpc'] ) {
162 // we dont use middle name, just put the dutch prefix here
163 echo sutf8(dutch_name($pid));
165 echo $result['fname'] . ' ' . $result['mname'] . ' ' . $result['lname'];
169 if ($document_id) echo "</a>";
172 <span
class='bold'><?
xl('Number','e'); ?
>: </span
><span
class='text'><?
echo $result{"pubpid"}?
></span
>
174 <td valign
='top' width
='33%'>
176 if ($result{"DOB"} && $result{"DOB"} != "0000-00-00") {
178 <span
class='bold'><?
xl('DOB','e'); ?
>: </span
>
185 <?php
if ($result{"ss"} != "") { ?
>
186 <span
class='bold'><?php
xl('S.S.','e'); ?
>: </span
>
188 <span
class='text'><?php
echo $result{"ss"} ?
></span
>
190 <td valign
='top' width
='34%'>
191 <?php
if ($result{"sex"} != "") { ?
>
192 <span
class='bold'><?php
xl('Sex','e'); ?
>: </span
>
194 <span
class='text'><?php
echo $result{"sex"} ?
></span
>
200 if ( $GLOBALS['dutchpc'] ) {
201 // verify if the current patient has a facility associated
204 echo '<span class="text"><b>ID1250</b> ' .get_id('id1250', $pid). '</span>';
211 <?php
if (($result{"street"} != "") ||
($result{"city"} != "") ||
($result{"state"} != "") ||
($result{"country_code"} != "") ||
($result{"postal_code"} != "")) {?
>
212 <span
class='bold'><?
xl('Address','e'); ?
>: </span
>
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"})?
>
217 echo $result{"postal_code"}?
>
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>';
254 if ($result{"status"} != "") {
255 echo "<span class='bold'>".xl('Marital Status').": </span>";
256 echo "<span class='text'>" . $result{"status"} . "</span>";
262 <?php
if (!$GLOBALS['athletic_team']) { ?
>
264 <td colspan
='3' valign
='top'>
266 $opt_out = ($result{"hipaa_mail"} == 'YES') ?
'ALLOWS' : 'DOES NOT ALLOW';
267 echo "<span class='text'>Patient $opt_out Mailed Information </span>";
272 <td colspan
='2' valign
='top'>
274 $opt_out = ($result{"hipaa_voice"} == 'YES') ?
'ALLOWS' : 'DOES NOT ALLOW';
275 echo "<span class='text'>Patient $opt_out Voice Messages </span>";
278 <td colspan
='1' valign
='top'>
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') . ":";
289 <td colspan
='2' valign
='top'>
291 $opt_out = ($result{"hipaa_notice"} == 'YES') ?
'RECEIVED' : 'DID NOT RECEIVE';
292 echo "<span class='text'>Patient $opt_out Notice Information </span>";
295 <td colspan
='1' valign
='top'>
297 if ($result['genericname2'] == 'Billing')
298 echo "<span class='bold'><font color='red'>" .
299 $result['genericval2'] . "</font></span>";
304 <td colspan
='3' valign
='top'>
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>";
312 echo "<span class='text'><b>Leave a message with :</b> " .
313 $result{"hipaa_message"} . "</span>";
321 <td colspan
='3' valign
='top'>
327 <?php
if ($GLOBALS['omit_employers']) { ?
>
330 <td valign
='top' colspan
='2'>
333 <td
><span
class='bold'>Listed Family Members
:</span
></td
>
337 <td
><?php
if ($result{"genericname1"} != "") { ?
><span
class='text'> 
; 
; 
;<?
=$result{"genericname1"}?
></span
><?php
} ?
></td
>
338 <td
><?php
if ($result{"genericval1"} != "") { ?
><span
class='text'> 
; 
; 
;<?
=$result{"genericval1"}?
></span
><?php
} ?
></td
>
341 <td
><?php
if ($result{"genericname2"} != "") { ?
><span
class='text'> 
; 
; 
;<?
=$result{"genericname2"}?
></span
><?php
} ?
></td
>
342 <td
><?php
if ($result{"genericval2"} != "") { ?
><span
class='text'> 
; 
; 
;<?
=$result{"genericval2"}?
></span
><?php
} ?
></td
>
346 <td valign
='top'></td
>
349 <?php
} else { ///// end omit_employers ///// ?>
353 <?php
if ($result{"occupation"} != "") { ?
>
354 <span
class='bold'><?php
xl('Occupation','e'); ?
>: </span
><span
class='text'><?
echo $result{"occupation"}?
></span
><br
>
356 <?php
if ($result2{"name"} != "") { ?
>
357 <span
class='bold'><?php
xl('Employer','e'); ?
>: </span
><span
class='text'><?php
echo $result2{"name"} ?
></span
>
361 <?php
if (($result2{"street"} != "") ||
($result2{"city"} != "") ||
($result2{"state"} != "") ||
($result2{"country"} != "") ||
($result2{"postal_code"} != "")) { ?
>
362 <span
class='bold'><?
xl('Employer Address','e'); ?
>:</span
>
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"} ?
>
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'];
381 sqlStatement("UPDATE patient_data SET fitness = '$fitness' WHERE pid = '$pid'");
383 $fitness = $result['fitness'];
384 if (! $fitness) $fitness = 1;
386 $fitcolor = $fitcolors[$fitness - 1];
388 // larry :: Dutch DBC insert
389 <?php
if( $GLOBALS['dutchpc'] )
391 <form method
='post' action
='demographics_dutch.php'>
394 <form method
='post' action
='demographics.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
>
409 <?php
} // end athletic team ?>
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
><?
} ?
>
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
><?
}?
>
432 <td
><?
if ($result{"genericname1"} != "") {?
><span
class='bold'><?
=$result{"genericname1"}?
></span
>:<?
}?
> </td
>
433 <td
><?
if ($result{"genericval1"} != "") {?
><span
class='text'><?
=$result{"genericval1"}?
></span
><?
}?
></td
>
436 <td
><?
if ($result{"genericname2"} != "") {?
><span
class='bold'><?
=$result{"genericname2"}?
></span
>:<?
}?
> </td
>
437 <td
><?
if ($result{"genericval2"} != "") {?
><span
class='text'><?
=$result{"genericval2"}?
></span
><?
}?
></td
>
443 <?php
} ///// end not omit_employers ///// ?>
446 //////////////////////////////////REFERRAL SECTION
447 if ($result{"referrer"} != "" ||
$result{"referrerID"} != "")
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
>-->
459 /////////////////////////////////INSURANCE SECTION
460 $result3 = getInsuranceData($pid, "primary");
461 if ($result3{"provider"}) {
462 $icobj = new InsuranceCompany($result3['provider']);
463 $adobj = $icobj->get_address();
467 <span
class='bold'><?php
xl('Primary Insurance','e'); ?
>:</span
><br
><span
class='text'>
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();
476 echo "<font color='red'><b>Unassigned</b></font>";
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
>
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"}?
>
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"}?
>
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
>
514 $result4 = getInsuranceData($pid, "secondary");
515 if ($result4{"provider"} != "") {
516 $icobj = new InsuranceCompany($result4['provider']);
517 $adobj = $icobj->get_address();
521 <span
class='bold'><?
xl('Secondary Insurance','e'); ?
>:</span
><br
><span
class='text'>
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();
530 echo "<font color='red'><b>Unassigned</b></font>";
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
>
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"}?
>
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"}?
>
562 <?
if ($result4{"copay"} != "") {?
><span
class='bold'><?
xl('CoPay','e'); ?
>: </span
><span
class='text'><?
=$result4{"copay"}?
></span
><?
}?
>
564 <td valign
='top'></td
>
565 <td valign
='top'></td
>
569 $result5 = getInsuranceData($pid, "tertiary");
570 if ($result5{"provider"}) {
571 $icobj = new InsuranceCompany($result5['provider']);
572 $adobj = $icobj->get_address();
576 <span
class='bold'><?
xl('Tertiary Insurance','e'); ?
>:</span
><br
><span
class='text'>
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();
585 echo "<font color='red'><b>Unassigned</b></font>";
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
>
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"}?
>
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"}?
>
617 <?
if ($result5{"copay"} != "") {?
><span
class='bold'><?
xl('CoPay','e'); ?
>: </span
><span
class='text'><?
=$result5{"copay"}?
></span
><?
}?
>
619 <td valign
='top'></td
>
620 <td valign
='top'></td
>
627 <td valign
="top" class="text">
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 " .
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 " .
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']));
646 $disphour = substr($row['pc_startTime'], 0, 2) +
0;
647 $dispmin = substr($row['pc_startTime'], 3, 2);
648 if ($disphour >= 12) {
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> <br>\n";
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');