and font type
[openemr.git] / interface / patient_file / summary / demographics.php
blobff12c02f71a28ad650c0ed6d3cd3766d5b1d190e
1 <?
2 include_once("../../globals.php");
4 include_once("$srcdir/patient.inc");
6 ?>
8 <html>
9 <head>
12 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
15 </head>
16 <body <?echo $top_bg_line;?> topmargin=0 rightmargin=0 leftmargin=2 bottommargin=0 marginwidth=2 marginheight=0>
18 <a href="demographics_full.php" target=Main><font class=title>Demographics</font><font class=more><?echo $tmore;?></font></a>
19 <table border="0" width="100%">
20 <tr>
21 <td align="left" valign="top">
24 <table border=0 cellpadding=0>
27 $result = getPatientData($pid);
28 $result2 = getEmployerData($pid);
31 <tr>
32 <td valign=top><span class=bold>Name: </span><span class=text><?echo $result{"title"}?> <?echo $result{"fname"}?> <?echo $result{"mname"}?> <?echo $result{"lname"}?></span><br>
33 <span class=bold>Number: </span><span class=text><?echo $result{"pubpid"}?></span>
34 </td>
35 <td valign=top>
37 if ($result{"DOB"} != "0000-00-00") {
39 <span class=bold>DOB: </span>
40 <span class=text>
42 echo $result{"DOB_TS"};
45 </span></td>
46 <td valign=top><? if ($result{"sex"} != ""){?><span class=bold>Sex: </span><?}?><span class=text><?echo $result{"sex"}?></span></td>
47 <td valign=top><? if ($result{"ss"} != "") {?><span class=bold>S.S.: </span><?}?><span class=text><?echo $result{"ss"}?></span></td>
48 </tr>
50 <tr>
51 <td valign=top>
52 <? if (($result{"street"} != "") || ($result{"city"} != "") || ($result{"state"} != "") || ($result{"country_code"} != "") || ($result{"postal_code"} != "")) {?>
53 <span class=bold>Address: </span>
54 <?}?>
55 <br><span class=text><?echo $result{"street"}?><br><?echo $result{"city"}?><?if($result{"city"} != ""){echo ", ";}?><?echo $result{"state"};?>
56 <? if($result{"country_code"} != ""){ echo ", "; }?><?echo $result{"country_code"}?>
57 <?echo " ";
58 echo $result{"postal_code"}?>
59 </span></td>
60 <td valign=top>
62 if ( ($result{"contact_relationship"} != "") ||
63 ($result{"phone_contact"} != "") ||
64 ($result{"phone_home"} != "") ||
65 ($result{"phone_biz"} != "") ||
66 ($result{"email"} != "") ||
67 ($result{"phone_cell"} != "") ){
69 <span class=bold>Emergency Contact: </span><?}?><span class=text><?echo $result{"contact_relationship"}?><?echo " "?>
72 if ($result{"phone_contact"} != "") {
73 echo " " . $result{"phone_contact"};
75 if ($result{"phone_home"} != "") {
76 echo "<br>Home: ";
77 echo $result{"phone_home"};
79 if ($result{"phone_biz"} != "") {
80 echo "<br>Work: ";
81 echo $result{"phone_biz"};
83 if ($result{"phone_cell"} != "") {
84 echo "<br>Mobile: ";
85 echo $result{"phone_cell"};
87 if ($result{"email"} != "") {
88 echo "<br>Email: </span>";
89 echo '<a class=link_submit href="mailto:' . $result{"email"} . '">' . $result{"email"} . '</a>';
94 </td>
95 <td valign=top>
97 if ($result{"status"} != "") {
98 echo "<span class=bold>Marital Status: </span>";
99 echo "<span class=text>" . $result{"status"} . "</span>";
102 </td>
103 <td valign=top></td>
104 </tr>
105 <tr>
106 <td colspan=2 valign=top>
108 $result{"hipaa_mail"}=='NO' ? $opt_out='DOES NOT ALLOW' : $opt_out='ALLOWS' ;
109 echo "<span class=text>Patient $opt_out Mailed Information </span>";
111 </td>
112 <td colspan=2 valign=top>
114 $result{"hipaa_voice"}=='NO' ? $opt_out='DOES NOT ALLOW' : $opt_out='ALLOWS' ;
115 echo "<span class=text>Patient $opt_out Voice Messages </span>";
117 </td>
118 </tr>
119 <tr>
120 <td valign=top>
121 <? if ($result{"occupation"} != "") {?><span class=bold>Occupation: </span><span class=text><?echo $result{"occupation"}?></span><br><?}?>
122 <? if ($result2{"name"} != "") {?><span class=bold>Employer: </span><span class=text><?echo $result2{"name"}?></span><?}?>
123 </td>
124 <td valign=top>
125 <? if (($result2{"street"} != "") || ($result2{"city"} != "") || ($result2{"state"} != "") || ($result2{"country"} != "") || ($result2{"postal_code"} != "")) {?>
126 <span class=bold>Employer Address:</span>
130 <br>
131 <span class=text>
132 <?echo $result2{"street"}?><br><?echo $result2{"city"}?><?if($result2{"city"} != ""){echo ", ";}?><?echo $result2{"state"}?>
133 <?if($result2{"country"} != ""){echo ", ";}?><?echo $result2{"country"}?>
134 <?if($result2{"postal_code"} != ""){echo " ";}?>
135 <?echo $result2{"postal_code"}?>
136 </span>
137 </td>
138 <td valign=top></td>
139 </tr>
142 <tr>
143 <td valign=top>
144 <? if ($result{"ethnoracial"} != "") {?><span class=bold>Race/Ethnicity: </span><span class=text><?echo $result{"ethnoracial"};?></span><br><?}?>
145 <? if ($result{"language"} != "") {?><span class=bold>Language: </span><span class=text><?echo ucfirst($result{"language"});?></span><br><?}?>
146 <? if ($result{"interpretter"} != "") {?><span class=bold>Interpretter: </span><span class=text><?echo $result{"interpretter"};?></span><br><?}?>
147 <? if ($result{"family_size"} != "") {?><span class=bold>Family Size: </span><span class=text><?echo $result{"family_size"};?></span><br><?}?>
150 </td>
151 <td valign=top>
153 function print_as_money($money) {
154 preg_match("/(\d*)\.?(\d*)/",$money,$moneymatches);
155 $tmp = wordwrap(strrev($moneymatches[1]),3,",",1);
156 $ccheck = strrev($tmp);
157 if ($ccheck[0] == ",") {
158 $tmp = substr($ccheck,1,strlen($ccheck)-1);
160 if ($moneymatches[2] != "") {
161 return "$ " . strrev($tmp) . "." . $moneymatches[2];
162 } else {
163 return "$ " . strrev($tmp);
167 <? 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><?}?>
168 <? if ($result{"monthly_income"} != "") {?><span class=bold>Monthly Income: </span><span class=text><?echo print_as_money($result{"monthly_income"});?></span><br><?}?>
169 <? if ($result{"migrantseasonal"} != "") {?><span class=bold>Migrant/Seasonal: </span><span class=text><?echo $result{"migrantseasonal"};?></span><br><?}?>
170 <? if ($result{"homeless"} != "") {?><span class=bold>Homeless, etc.: </span><span class=text><?echo $result{"homeless"};?></span><br><?}?>
171 </td>
172 <td valign=top>
173 <table>
174 <tr>
175 <td><? if ($result{"genericname1"} != "") {?><span class=bold><?=$result{"genericname1"}?></span>:<?}?> </td>
176 <td><? if ($result{"genericval1"} != "") {?><span class=text><?=$result{"genericval1"}?></span><?}?></td>
177 </tr>
178 <tr>
179 <td><? if ($result{"genericname2"} != "") {?><span class=bold><?=$result{"genericname2"}?></span>:<?}?> </td>
180 <td><? if ($result{"genericval2"} != "") {?><span class=text><?=$result{"genericval2"}?></span><?}?></td>
181 </tr>
183 </table>
185 </td>
186 </tr>
189 <?php
190 //////////////////////////////////REFERRAL SECTION
191 if ($result{"referrer"} != "" || $result{"referrerID"} != "")
194 <tr>
195 <td valign=top>
196 <span class=bold>Primary Provider: </span><span class=text><?=getProviderName($result['providerID'])?></span><br>
197 <!--<span class=bold>Primary Provider ID: </span><span class=text><?=$result{"referrerID"}?></span>-->
198 </td>
199 </tr>
200 <?php
203 /////////////////////////////////INSURANCE SECTION
204 $result3 = getInsuranceData($pid, "primary");
205 if ($result3{"provider"}) {
207 <tr>
208 <td valign=top>
209 <span class=bold>Primary Insurance Provider:</span><br><span class=text><?echo $result3{"provider_name"}?></span><br>
210 <span class=text>Policy Number: <?echo $result3{"policy_number"}?><br>
211 Plan Name: <?=$result3{"plan_name"}?><br>
212 Group Number: <?echo $result3{"group_number"}?></span>
213 </td>
215 <td valign=top>
216 <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>
217 S.S.: <?echo $result3{"subscriber_ss"}?> D.O.B.: <?if ($result3{"subscriber_DOB"} != "0000-00-00 00:00:00") {echo $result3{"subscriber_DOB"};}?><br>
218 Phone: <? echo $result3{"subscriber_phone"}?>
219 </span>
220 </td>
222 <td valign=top>
223 <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>
225 </td>
227 <td valign=top>
228 <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>
230 </td>
232 </tr>
233 <tr><td><? if ($result3{"copay"} != "") {?><span class=bold>CoPay: </span><span class=text><?=$result3{"copay"}?></span><?}?></td></tr>
241 $result4 = getInsuranceData($pid, "secondary");
242 if ($result4{"provider"} != "") {
244 <tr>
245 <td valign=top>
246 <span class=bold>Secondary Insurance Provider:</span><br><span class=text><?echo $result4{"provider_name"}?></span><br>
247 <span class=text>Policy Number: <?echo $result4{"policy_number"}?><br>
248 Plan Name: <?=$result4{"plan_name"}?><br>
249 Group Number: <?echo $result4{"group_number"}?></span>
250 </td>
252 <td valign=top>
253 <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>
254 S.S.: <?echo $result4{"subscriber_ss"}?> D.O.B.: <?if ($result4{"subscriber_DOB"} != "0000-00-00 00:00:00") {echo $result4{"subscriber_DOB"};}?><br>
255 Phone: <? echo $result4{"subscriber_phone"}?>
256 </span>
257 </td>
259 <td valign=top>
260 <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>
262 </td>
264 <td valign=top>
265 <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>
267 </td>
269 </tr>
270 <tr><td><? if ($result4{"copay"} != "") {?><span class=bold>CoPay: </span><span class=text><?=$result4{"copay"}?></span><?}?></td></tr>
279 $result5 = getInsuranceData($pid, "tertiary");
280 if ($result5{"provider"}) {
282 <tr>
283 <td valign=top>
284 <span class=bold>Tertiary Insurance Provider:</span><br><span class=text><?echo $result5{"provider_name"}?></span><br>
285 <span class=text>Policy Number: <?echo $result5{"policy_number"}?><br>
286 Plan Name: <?=$result5{"plan_name"}?><br>
287 Group Number: <?echo $result5{"group_number"}?></span>
288 </td>
290 <td valign=top>
291 <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>
292 S.S.: <?echo $result5{"subscriber_ss"}?> D.O.B.: <?if ($result5{"subscriber_DOB"} != "0000-00-00 00:00:00") {echo $result5{"subscriber_DOB"};}?><br>
293 Phone: <? echo $result5{"subscriber_phone"}?>
294 </span>
295 </td>
297 <td valign=top>
298 <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>
300 </td>
302 <td valign=top>
303 <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>
305 </td>
307 </tr>
308 <tr><td><? if ($result5{"copay"} != "") {?><span class=bold>CoPay: </span><span class=text><?=$result5{"copay"}?></span><?}?></td></tr>
317 </table>
319 </td>
322 <td align="right" valign="top">
323 <?php
324 if (isset($pid)) {
325 //postnuke doesn't make it easy to set globals/get/post
326 //didn't want to use an ifram here so I had to fake a page
327 //load environment by setting the things that would have
328 //been passed in the querystring
330 include_once("$srcdir/calendar.inc");
332 unset($func);
333 unset($module);
334 unset($Date);
335 $_GET['module'] = "PostCalendar";
336 $_GET['func'] = "search";
337 $_GET['Date'] = pc_getDate();
338 $_GET['no_nav'] = 2;
339 $_GET['patient_id'] = intval($pid);
340 $_GET['submit'] = "listapps";
341 global $func,$Date,$module;
342 $module = "PostCalendar";
343 $func = "search";
344 $Date = $_GET['Date'];
345 $submit = "listapps";
346 $no_nav = 2;
347 $patient_id = $_GET['patient_id'];
349 //now that the environment is set, include the page, it will
350 //behave as though it was loaded in an iframe with the querystring
351 //variables set
352 chdir("../../main/calendar");
353 include("index.php");
359 </td>
361 </tr></table>
364 <br><br>
368 <br><br>
370 </body>
371 </html>