2 include_once("../../globals.php");
3 include_once("$srcdir/patient.inc");
4 include_once("$srcdir/acl.inc");
9 <link rel
=stylesheet href
="<?echo $css_header;?>" type
="text/css">
12 <body
<?
echo $top_bg_line;?
> topmargin
=0 rightmargin
=0 leftmargin
=2 bottommargin
=0 marginwidth
=2 marginheight
=0>
15 $thisauth = acl_check('patients', 'demo');
18 echo "<p>(Demographics not authorized)</p>\n";
19 echo "</body>\n</html>\n";
23 if ($thisauth == 'write') {
24 echo "<p><a href='demographics_full.php' target='Main'>" .
25 "<font class='title'>Demographics</font>" .
26 "<font class='more'>$tmore</font></a></p>\n";
30 <table border
="0" width
="100%">
32 <td align
="left" valign
="top">
33 <table border
='0' cellpadding
='0' width
='100%'>
35 $result = getPatientData($pid);
36 $result2 = getEmployerData($pid);
40 <span
class='bold'>Name
: </span
><span
class='text'><?
echo $result{"title"}?
> <?
echo $result{"fname"}?
> <?
echo $result{"mname"}?
> <?
echo $result{"lname"}?
></span
><br
>
41 <span
class='bold'>Number
: </span
><span
class='text'><?
echo $result{"pubpid"}?
></span
>
45 if ($result{"DOB"} && $result{"DOB"} != "0000-00-00") {
47 <span
class='bold'>DOB
: </span
>
55 <td valign
='top'><?
if ($result{"sex"} != ""){?
><span
class='bold'>Sex
: </span
><?
}?
><span
class='text'><?
echo $result{"sex"}?
></span
></td
>
56 <td valign
='top'><?
if ($result{"ss"} != "") {?
><span
class='bold'>S
.S
.: </span
><?
}?
><span
class='text'><?
echo $result{"ss"}?
></span
></td
>
60 <?
if (($result{"street"} != "") ||
($result{"city"} != "") ||
($result{"state"} != "") ||
($result{"country_code"} != "") ||
($result{"postal_code"} != "")) {?
>
61 <span
class='bold'>Address
: </span
>
63 <br
><span
class='text'><?
echo $result{"street"}?
><br
><?
echo $result{"city"}?
><?
if($result{"city"} != ""){echo ", ";}?
><?
echo $result{"state"};?
>
64 <?
if($result{"country_code"} != ""){ echo ", "; }?
><?
echo $result{"country_code"}?
>
66 echo $result{"postal_code"}?
>
71 if ( ($result{"contact_relationship"} != "") ||
72 ($result{"phone_contact"} != "") ||
73 ($result{"phone_home"} != "") ||
74 ($result{"phone_biz"} != "") ||
75 ($result{"email"} != "") ||
76 ($result{"phone_cell"} != "") ){
78 <span
class='bold'>Emergency Contact
: </span
><?
}?
><span
class='text'><?
echo $result{"contact_relationship"}?
><?
echo " "?
>
80 if ($result{"phone_contact"} != "") {
81 echo " " . $result{"phone_contact"};
83 if ($result{"phone_home"} != "") {
85 echo $result{"phone_home"};
87 if ($result{"phone_biz"} != "") {
89 echo $result{"phone_biz"};
91 if ($result{"phone_cell"} != "") {
93 echo $result{"phone_cell"};
95 if ($result{"email"} != "") {
96 echo "<br>Email: </span>";
97 echo '<a class=link_submit href="mailto:' . $result{"email"} . '">' . $result{"email"} . '</a>';
103 if ($result{"status"} != "") {
104 echo "<span class='bold'>Marital Status: </span>";
105 echo "<span class='text'>" . $result{"status"} . "</span>";
109 <td valign
='top'></td
>
112 <?
if (! $GLOBALS['athletic_team']) { ?
>
114 <td colspan
='4' valign
='top'>
116 $result{"hipaa_mail"}=='NO' ?
$opt_out='DOES NOT ALLOW' : $opt_out='ALLOWS' ;
117 echo "<span class='text'>Patient $opt_out Mailed Information </span>";
122 <td colspan
='4' valign
='top'>
124 $result{"hipaa_voice"}=='NO' ?
$opt_out='DOES NOT ALLOW' : $opt_out='ALLOWS' ;
125 echo "<span class='text'>Patient $opt_out Voice Messages </span>";
131 <td colspan
='4' valign
='top'>
139 <?
if ($result{"occupation"} != "") {?
><span
class='bold'>Occupation
: </span
><span
class='text'><?
echo $result{"occupation"}?
></span
><br
><?
}?
>
140 <?
if ($result2{"name"} != "") {?
><span
class='bold'>Employer
: </span
><span
class='text'><?
echo $result2{"name"}?
></span
><?
}?
>
143 <?
if (($result2{"street"} != "") ||
($result2{"city"} != "") ||
($result2{"state"} != "") ||
($result2{"country"} != "") ||
($result2{"postal_code"} != "")) {?
>
144 <span
class='bold'>Employer Address
:</span
>
148 <?
echo $result2{"street"}?
><br
><?
echo $result2{"city"}?
><?
if($result2{"city"} != ""){echo ", ";}?
><?
echo $result2{"state"}?
>
149 <?
if($result2{"country"} != ""){echo ", ";}?
><?
echo $result2{"country"}?
>
150 <?
if($result2{"postal_code"} != ""){echo " ";}?
>
151 <?
echo $result2{"postal_code"}?
>
156 // This stuff only applies to athletic team use of OpenEMR:
157 if ($GLOBALS['athletic_team']) {
158 $fitcolors = array('#00ff00', '#ffff00', '#ff8800', '#ff3333');
159 $fitcolor = $fitcolors[0];
160 $fitness = $_POST['form_fitness'];
162 sqlStatement("UPDATE patient_data SET fitness = '$fitness' WHERE pid = '$pid'");
164 $fitness = $result['fitness'];
165 if (! $fitness) $fitness = 1;
167 $fitcolor = $fitcolors[$fitness - 1];
169 <form method
='post' action
='demographics.php'>
170 <span
class='bold'>Fitness to Play
:</span
><br
>
171 <select name
='form_fitness' onchange
='document.forms[0].submit()' style
='background-color:<? echo $fitcolor ?>'>
172 <option value
='1'<?
if ($fitness == 1) echo ' selected' ?
>>Full Play
</option
>
173 <option value
='2'<?
if ($fitness == 2) echo ' selected' ?
>>Full Training
</option
>
174 <option value
='3'<?
if ($fitness == 3) echo ' selected' ?
>>Restricted Training
</option
>
175 <option value
='4'<?
if ($fitness == 4) echo ' selected' ?
>>Injured Out
</option
>
180 <td valign
='top'></td
>
184 <?
if ($result{"ethnoracial"} != "") {?
><span
class='bold'>Race
/Ethnicity
: </span
><span
class='text'><?
echo $result{"ethnoracial"};?
></span
><br
><?
}?
>
185 <?
if ($result{"language"} != "") {?
><span
class='bold'>Language
: </span
><span
class='text'><?
echo ucfirst($result{"language"});?
></span
><br
><?
}?
>
186 <?
if ($result{"interpretter"} != "") {?
><span
class='bold'>Interpretter
: </span
><span
class='text'><?
echo $result{"interpretter"};?
></span
><br
><?
}?
>
187 <?
if ($result{"family_size"} != "") {?
><span
class='bold'>Family Size
: </span
><span
class='text'><?
echo $result{"family_size"};?
></span
><br
><?
}?
>
191 function print_as_money($money) {
192 preg_match("/(\d*)\.?(\d*)/",$money,$moneymatches);
193 $tmp = wordwrap(strrev($moneymatches[1]),3,",",1);
194 $ccheck = strrev($tmp);
195 if ($ccheck[0] == ",") {
196 $tmp = substr($ccheck,1,strlen($ccheck)-1);
198 if ($moneymatches[2] != "") {
199 return "$ " . strrev($tmp) . "." . $moneymatches[2];
201 return "$ " . strrev($tmp);
205 <?
if ($result{"financial_review"} != "0000-00-00 00:00:00") {?
><span
class='bold'>Financial Review Date
: </span
><span
class='text'><?
echo date("n/j/Y",strtotime($result{"financial_review"}));?
></span
><br
><?
}?
>
206 <?
if ($result{"monthly_income"} != "") {?
><span
class='bold'>Monthly Income
: </span
><span
class='text'><?
echo print_as_money($result{"monthly_income"});?
></span
><br
><?
}?
>
207 <?
if ($result{"migrantseasonal"} != "") {?
><span
class='bold'>Migrant
/Seasonal
: </span
><span
class='text'><?
echo $result{"migrantseasonal"};?
></span
><br
><?
}?
>
208 <?
if ($result{"homeless"} != "") {?
><span
class='bold'>Homeless
, etc
.: </span
><span
class='text'><?
echo $result{"homeless"};?
></span
><br
><?
}?
>
213 <td
><?
if ($result{"genericname1"} != "") {?
><span
class='bold'><?
=$result{"genericname1"}?
></span
>:<?
}?
> </td
>
214 <td
><?
if ($result{"genericval1"} != "") {?
><span
class='text'><?
=$result{"genericval1"}?
></span
><?
}?
></td
>
217 <td
><?
if ($result{"genericname2"} != "") {?
><span
class='bold'><?
=$result{"genericname2"}?
></span
>:<?
}?
> </td
>
218 <td
><?
if ($result{"genericval2"} != "") {?
><span
class='text'><?
=$result{"genericval2"}?
></span
><?
}?
></td
>
222 <td valign
='top'></td
>
225 //////////////////////////////////REFERRAL SECTION
226 if ($result{"referrer"} != "" ||
$result{"referrerID"} != "")
231 <span
class='bold'>Primary Provider
: </span
><span
class='text'><?
=getProviderName($result['providerID'])?
></span
><br
>
232 <!--<span
class='bold'>Primary Provider ID
: </span
><span
class='text'><?
=$result{"referrerID"}?
></span
>-->
234 <td valign
='top'></td
>
235 <td valign
='top'></td
>
236 <td valign
='top'></td
>
241 /////////////////////////////////INSURANCE SECTION
242 $result3 = getInsuranceData($pid, "primary");
243 if ($result3{"provider"}) {
247 <span
class='bold'>Primary Insurance Provider
:</span
><br
><span
class='text'><?
echo $result3{"provider_name"}?
></span
><br
>
248 <span
class='text'>Policy Number
: <?
echo $result3{"policy_number"}?
><br
>
249 Plan Name
: <?
=$result3{"plan_name"}?
><br
>
250 Group Number
: <?
echo $result3{"group_number"}?
></span
>
253 <span
class='bold'>Subscriber
: </span
><br
><span
class='text'><?
=$result3{"subscriber_fname"}?
> <?
=$result3{"subscriber_mname"}?
> <?
=$result3{"subscriber_lname"}?
> <?
if ($result3{"subscriber_relationship"} != "") {echo "(".$result3{"subscriber_relationship"}.")";}?
><br
>
254 S
.S
.: <?
echo $result3{"subscriber_ss"}?
> D
.O
.B
.: <?
if ($result3{"subscriber_DOB"} != "0000-00-00 00:00:00") {echo $result3{"subscriber_DOB"};}?
><br
>
255 Phone
: <?
echo $result3{"subscriber_phone"}?
>
259 <span
class='bold'>Subscriber Address
: </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
>
262 <span
class='bold'>Subscriber Employer
: </span
><br
><span
class='text'><?
echo $result3{"subscriber_employer"}?
><br
><?
echo $result3{"subscriber_employer_street"}?
><br
><?
echo $result3{"subscriber_employer_city"}?
><?
if($result3{"subscriber_employer_city"} != ""){echo ", ";}?
><?
echo $result3{"subscriber_employer_state"}?
><?
if($result3{"subscriber_employer_country"} != ""){echo ", ";}?
><?
echo $result3{"subscriber_employer_country"}?
> <?
echo " ".$result3{"subscriber_employer_postal_code"}?
></span
>
266 <td
><?
if ($result3{"copay"} != "") {?
><span
class='bold'>CoPay
: </span
><span
class='text'><?
=$result3{"copay"}?
></span
><?
}?
></td
>
267 <td valign
='top'></td
>
268 <td valign
='top'></td
>
269 <td valign
='top'></td
>
273 $result4 = getInsuranceData($pid, "secondary");
274 if ($result4{"provider"} != "") {
278 <span
class='bold'>Secondary Insurance Provider
:</span
><br
><span
class='text'><?
echo $result4{"provider_name"}?
></span
><br
>
279 <span
class='text'>Policy Number
: <?
echo $result4{"policy_number"}?
><br
>
280 Plan Name
: <?
=$result4{"plan_name"}?
><br
>
281 Group Number
: <?
echo $result4{"group_number"}?
></span
>
284 <span
class='bold'>Subscriber
: </span
><br
><span
class='text'><?
=$result4{"subscriber_fname"}?
> <?
=$result4{"subscriber_mname"}?
> <?
=$result4{"subscriber_lname"}?
> <?
if ($result4{"subscriber_relationship"} != "") {echo "(".$result4{"subscriber_relationship"}.")";}?
><br
>
285 S
.S
.: <?
echo $result4{"subscriber_ss"}?
> D
.O
.B
.: <?
if ($result4{"subscriber_DOB"} != "0000-00-00 00:00:00") {echo $result4{"subscriber_DOB"};}?
><br
>
286 Phone
: <?
echo $result4{"subscriber_phone"}?
>
290 <span
class='bold'>Subscriber Address
: </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
>
293 <span
class='bold'>Subscriber Employer
: </span
><br
><span
class='text'><?
echo $result4{"subscriber_employer"}?
><br
><?
echo $result4{"subscriber_employer_street"}?
><br
><?
echo $result4{"subscriber_employer_city"}?
><?
if($result4{"subscriber_employer_city"} != ""){echo ", ";}?
><?
echo $result4{"subscriber_employer_state"}?
><?
if($result4{"subscriber_employer_country"} != ""){echo ", ";}?
><?
echo $result4{"subscriber_employer_country"}?
> <?
echo " ".$result4{"subscriber_employer_postal_code"}?
></span
>
298 <?
if ($result4{"copay"} != "") {?
><span
class='bold'>CoPay
: </span
><span
class='text'><?
=$result4{"copay"}?
></span
><?
}?
>
300 <td valign
='top'></td
>
301 <td valign
='top'></td
>
302 <td valign
='top'></td
>
306 $result5 = getInsuranceData($pid, "tertiary");
307 if ($result5{"provider"}) {
311 <span
class='bold'>Tertiary Insurance Provider
:</span
><br
><span
class='text'><?
echo $result5{"provider_name"}?
></span
><br
>
312 <span
class='text'>Policy Number
: <?
echo $result5{"policy_number"}?
><br
>
313 Plan Name
: <?
=$result5{"plan_name"}?
><br
>
314 Group Number
: <?
echo $result5{"group_number"}?
></span
>
317 <span
class='bold'>Subscriber
: </span
><br
><span
class='text'><?
=$result5{"subscriber_fname"}?
> <?
=$result5{"subscriber_mname"}?
> <?
=$result5{"subscriber_lname"}?
> <?
if ($result5{"subscriber_relationship"} != "") {echo "(".$result5{"subscriber_relationship"}.")";}?
><br
>
318 S
.S
.: <?
echo $result5{"subscriber_ss"}?
> D
.O
.B
.: <?
if ($result5{"subscriber_DOB"} != "0000-00-00 00:00:00") {echo $result5{"subscriber_DOB"};}?
><br
>
319 Phone
: <?
echo $result5{"subscriber_phone"}?
>
323 <span
class='bold'>Subscriber Address
: </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
>
326 <span
class='bold'>Subscriber Employer
: </span
><br
><span
class='text'><?
echo $result5{"subscriber_employer"}?
><br
><?
echo $result5{"subscriber_employer_street"}?
><br
><?
echo $result5{"subscriber_employer_city"}?
><?
if($result5{"subscriber_employer_city"} != ""){echo ", ";}?
><?
echo $result5{"subscriber_employer_state"}?
><?
if($result5{"subscriber_employer_country"} != ""){echo ", ";}?
><?
echo $result5{"subscriber_employer_country"}?
> <?
echo " ".$result5{"subscriber_employer_postal_code"}?
></span
>
331 <?
if ($result5{"copay"} != "") {?
><span
class='bold'>CoPay
: </span
><span
class='text'><?
=$result5{"copay"}?
></span
><?
}?
>
333 <td valign
='top'></td
>
334 <td valign
='top'></td
>
335 <td valign
='top'></td
>
342 <td align
="right" valign
="top">
344 // I can't believe this crap. It generates a whole new document with
345 // <html> tag and everything, and then terminates our script prematurely!
346 // So I disabled it. BTW the comments below re postnuke are not mine.
349 if (false && isset($pid)) { // was: if (isset($pid)) {
350 //postnuke doesn't make it easy to set globals/get/post
351 //didn't want to use an ifram here so I had to fake a page
352 //load environment by setting the things that would have
353 //been passed in the querystring
355 include_once("$srcdir/calendar.inc");
360 $_GET['module'] = "PostCalendar";
361 $_GET['func'] = "search";
362 $_GET['Date'] = pc_getDate();
364 $_GET['patient_id'] = intval($pid);
365 $_GET['submit'] = "listapps";
366 global $func,$Date,$module;
367 $module = "PostCalendar";
369 $Date = $_GET['Date'];
370 $submit = "listapps";
372 $patient_id = $_GET['patient_id'];
374 //now that the environment is set, include the page, it will
375 //behave as though it was loaded in an iframe with the querystring
377 chdir("../../main/calendar");
378 include("index.php");