a couple of simplification and hipaa options for demographics and prescriptions from...
[openemr.git] / interface / patient_file / summary / demographics_full.php
blob587ab396cd02ba8095a9b55495991cb94f0cff8e
1 <?php
2 include_once("../../globals.php");
3 include_once("$srcdir/acl.inc");
5 // Session pid must be right or bad things can happen when demographics are saved!
6 //
7 include_once("$srcdir/pid.inc");
8 $set_pid = $_GET["set_pid"] ? $_GET["set_pid"] : $_GET["pid"];
9 if ($set_pid && $set_pid != $_SESSION["pid"]) {
10 setpid($set_pid);
13 include_once("$srcdir/patient.inc");
15 $result = getPatientData($pid);
16 $result2 = getEmployerData($pid);
18 // Check authorization.
19 $thisauth = acl_check('patients', 'demo');
20 if ($pid) {
21 if ($thisauth != 'write')
22 die("Updating demographics is not authorized.");
23 if ($result['squad'] && ! acl_check('squads', $result['squad']))
24 die("You are not authorized to access this squad.");
25 } else {
26 if ($thisauth != 'write' && $thisauth != 'addonly')
27 die("Adding demographics is not authorized.");
30 $relats = array('','self','spouse','child','other');
31 $statii = array('married','single','divorced','widowed','separated','domestic partner');
33 $langi = getLanguages();
34 $ethnoraciali = getEthnoRacials();
35 $provideri = getProviderInfo();
36 $insurancei = getInsuranceProviders();
38 <html>
39 <head>
41 <link rel=stylesheet href="<?php echo $css_header; ?>" type="text/css">
43 <script type="text/javascript" src="../../../library/dialog.js"></script>
44 <script type="text/javascript" src="../../../library/textformat.js"></script>
46 <SCRIPT LANGUAGE="JavaScript"><!--
48 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
50 //code used from http://tech.irt.org/articles/js037/
51 function replace(string,text,by) {
52 // Replaces text with by in string
53 var strLength = string.length, txtLength = text.length;
54 if ((strLength == 0) || (txtLength == 0)) return string;
56 var i = string.indexOf(text);
57 if ((!i) && (text != string.substring(0,txtLength))) return string;
58 if (i == -1) return string;
60 var newstr = string.substring(0,i) + by;
62 if (i+txtLength < strLength)
63 newstr += replace(string.substring(i+txtLength,strLength),text,by);
65 return newstr;
68 function upperFirst(string,text) {
69 return replace(string,text,text.charAt(0).toUpperCase() + text.substring(1,text.length));
72 <?php for ($i=1;$i<=3;$i++) { ?>
73 function auto_populate_employer_address<?php echo $i ?>(){
74 if (document.demographics_form.i<?php echo $i?>subscriber_relationship.options[document.demographics_form.i<?php echo $i?>subscriber_relationship.selectedIndex].value == "self") {
75 document.demographics_form.i<?php echo $i?>subscriber_fname.value=document.demographics_form.fname.value;
76 document.demographics_form.i<?php echo $i?>subscriber_mname.value=document.demographics_form.mname.value;
77 document.demographics_form.i<?php echo $i?>subscriber_lname.value=document.demographics_form.lname.value;
78 document.demographics_form.i<?php echo $i?>subscriber_street.value=document.demographics_form.street.value;
79 document.demographics_form.i<?php echo $i?>subscriber_city.value=document.demographics_form.city.value;
80 document.demographics_form.i<?php echo $i?>subscriber_state.value=document.demographics_form.state.value;
81 document.demographics_form.i<?php echo $i?>subscriber_postal_code.value=document.demographics_form.postal_code.value;
82 document.demographics_form.i<?php echo $i?>subscriber_country.value=document.demographics_form.country_code.value;
83 document.demographics_form.i<?php echo $i?>subscriber_phone.value=document.demographics_form.phone_home.value;
84 document.demographics_form.i<?php echo $i?>subscriber_DOB.value=document.demographics_form.dob.value;
85 document.demographics_form.i<?php echo $i?>subscriber_ss.value=document.demographics_form.ss.value;
86 document.demographics_form.i<?php echo $i?>subscriber_sex.selectedIndex = document.demographics_form.sex.selectedIndex;
87 document.demographics_form.i<?php echo $i?>subscriber_employer.value=document.demographics_form.ename.value;
88 document.demographics_form.i<?php echo $i?>subscriber_employer_street.value=document.demographics_form.estreet.value;
89 document.demographics_form.i<?php echo $i?>subscriber_employer_city.value=document.demographics_form.ecity.value;
90 document.demographics_form.i<?php echo $i?>subscriber_employer_state.value=document.demographics_form.estate.value;
91 document.demographics_form.i<?php echo $i?>subscriber_employer_postal_code.value=document.demographics_form.epostal_code.value;
92 document.demographics_form.i<?php echo $i?>subscriber_employer_country.value=document.demographics_form.ecountry.value;
96 <?php } ?>
98 function popUp(URL) {
99 day = new Date();
100 id = day.getTime();
101 eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=300,left = 440,top = 362');");
104 function checkNum () {
105 var re= new RegExp();
106 re = /^\d*\.?\d*$/;
107 str=document.demographics_form.monthly_income.value;
108 if(re.exec(str))
110 }else{
111 alert("Please enter a dollar amount using only numbers and a decimal point.");
115 // Indicates which insurance slot is being updated.
116 var insurance_index = 0;
118 // The OnClick handler for searching/adding the insurance company.
119 function ins_search(ins) {
120 insurance_index = ins;
121 dlgopen('../../practice/ins_search.php', '_blank', 550, 400);
122 return false;
125 // The ins_search.php window calls this to set the selected insurance.
126 function set_insurance(ins_id, ins_name) {
127 var thesel = document.forms[0]['i' + insurance_index + 'provider'];
128 var theopts = thesel.options; // the array of Option objects
129 var i = 0;
130 for (; i < theopts.length; ++i) {
131 if (theopts[i].value == ins_id) {
132 theopts[i].selected = true;
133 return;
136 // no matching option was found so create one, append it to the
137 // end of the list, and select it.
138 theopts[i] = new Option(ins_name, ins_id, false, true);
141 //-->
143 </script>
144 </head>
146 <body <?php echo $top_bg_line; ?> topmargin=0 rightmargin=0 leftmargin=2 bottommargin=0 marginwidth=2 marginheight=0>
148 <form action='demographics_save.php' name='demographics_form' method='post'>
149 <input type=hidden name=mode value=save>
151 <?php if ($GLOBALS['concurrent_layout']) { ?>
152 <a href="demographics.php">
153 <?php } else { ?>
154 <a href="patient_summary.php" target=Main>
155 <?php } ?>
156 <font class=title><?php xl('Demographics','e'); ?></font>
157 <font class=back><?php echo $tback;?></font></a>
159 <table border="0" cellpadding="0" width='100%'>
161 <tr>
162 <td valign="top"><span class=required><?php xl('Name','e'); ?>: </span></td>
163 <td colspan="4" nowrap>
164 <select name=title tabindex="1">
165 <option value="<?php echo $result{"title"} ?>"><?php echo $result{"title"} ?></option>
166 <option value="Mrs."><?php xl('Mrs','e'); ?>.</option>
167 <option value="Ms."><?php xl('Ms','e'); ?>.</option>
168 <option value="Mr."><?php xl('Mr','e'); ?>.</option>
169 <option value="Dr."><?php xl('Dr','e'); ?>.</option>
170 </select>
171 <input tabindex="2" type=entry size=15 name=fname value="<?php echo $result{"fname"} ?>">
172 <input tabindex="3" type=entry size=3 name=mname value="<?php echo $result{"mname"} ?>">
173 <input tabindex="4" type=entry size=15 name=lname value="<?php echo $result{"lname"} ?>">
174 &nbsp;
175 <span class='bold'><?php echo ($GLOBALS['athletic_team']) ? 'OID ' : '' ?><?php xl('Number','e'); ?>: </span>
176 </td>
177 <td><input type='entry' size='10' name='pubpid' value="<?php echo $result{"pubpid"} ?>"></td>
178 </tr>
180 <tr>
181 <td valign='top'><span class='required'><?php xl('DOB','e'); ?>: </span></td>
182 <td>
183 <input tabindex='5' type='entry' size='11' name='dob'
184 value='<?php echo $result['DOB'] ?>' onkeyup='datekeyup(this,mypcc)'
185 onblur='dateblur(this,mypcc)' title='yyyy-mm-dd' />
186 </td>
187 <td rowspan="12">&nbsp;</td>
188 <td><span class='bold'><?php xl('Emergency Contact','e'); ?>: </span></td>
189 <td rowspan="12">&nbsp;</td>
190 <td><input type='entry' size='10' name='contact_relationship' value="<?php echo $result{"contact_relationship"}?>"></td>
191 </tr>
193 <tr>
194 <td><span class=required><?php xl('Sex','e'); ?>: </span></td>
195 <td>
196 <select name=sex tabindex="6">
197 <option value="Female" <?php if ($result{"sex"} == "Female") {echo "selected";};?>><?php xl('Female','e'); ?></option>
198 <option value="Male" <?php if ($result{"sex"} == "Male") {echo "selected";};?>><?php xl('Male','e'); ?></option>
199 </select>
200 </td>
201 <td><span class=bold><?php xl('Emergency Phone','e'); ?>:</span></td>
202 <td><input type='text' size='20' name='phone_contact' value='<?php echo $result['phone_contact'] ?>' onkeyup='phonekeyup(this,mypcc)' /></td>
203 </tr>
205 <tr>
206 <td><span class=bold><?php xl('S.S.','e'); ?>: </span></td>
207 <td><input tabindex="7" type=entry size=11 name=ss value="<?php echo $result{"ss"}?>"></td>
208 <td><span class='bold'><?php xl('Home Phone','e'); ?>: </span></td>
209 <td><input type='text' size='20' name='phone_home' value='<?php echo $result['phone_home'] ?>' onkeyup='phonekeyup(this,mypcc)' /></td>
210 </tr>
212 <tr>
213 <td><span class=required><?php xl('Address','e'); ?>: </span></td>
214 <td><input tabindex="8" type=entry size=25 name=street value="<?php echo $result{"street"}?>"></td>
215 <td><span class=bold><?php xl('Work Phone','e'); ?>:</span></td>
216 <td><input type='text' size='20' name='phone_biz' value='<?php echo $result['phone_biz'] ?>' onkeyup='phonekeyup(this,mypcc)' /></td>
217 </tr>
219 <tr>
220 <td><span class=required><?php xl('City','e'); ?>: </span></td>
221 <td><input tabindex="9" type=entry size=15 name=city value="<?php echo $result{"city"}?>"></td>
222 <td><span class=bold><?php xl('Mobile Phone','e'); ?>: </span></td>
223 <td><input type='text' size='20' name='phone_cell' value='<?php echo $result['phone_cell'] ?>' onkeyup='phonekeyup(this,mypcc)' /></td>
224 </tr>
226 <tr>
227 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? 'State' : 'Locality' ?>: </span></td>
228 <td><input tabindex="10" type=entry size=15 name=state value="<?php echo $result{"state"}?>"></td>
229 <td><span class='bold'><?php xl('License/ID','e'); ?>: </span></td>
230 <td><input tabindex="12" type='entry' size='15' name='drivers_license' value="<?php echo $result{"drivers_license"}?>"></td>
231 </tr>
233 <tr>
234 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? 'Zip' : 'Postal' ?> <?php xl('Code','e'); ?>: </span></td>
235 <td><input tabindex="11" type=entry size=6 name=postal_code value="<?php echo $result{"postal_code"}?>"></td>
236 <td><span class='bold'><?php xl('Contact Email','e'); ?>: </span></td><td><input type=entry size=30 name=email value="<?php echo $result{"email"}?>"></td>
237 </tr>
239 <tr>
240 <td><span class='required'<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
241 <?php xl('Country','e'); ?>: </span></td>
242 <td><input tabindex="13" type='entry' size='10' name='country_code'
243 value="<?php echo $result{"country_code"}?>"
244 <?php if ($GLOBALS['omit_employers']) echo "style='display:none'"; ?>></td>
245 <?php if (!$GLOBALS['weight_loss_clinic']) { ?>
246 <td><span class='bold' colspan='2'>
247 <?php echo $GLOBALS['omit_employers'] ? xl('List Immediate Family Members') : xl('User Defined Fields'); ?>:
248 </span></td>
249 <?php } ?>
250 </tr>
252 <tr>
253 <td><span class=required><?php xl('Marital Status','e'); ?>: </span></td>
254 <td>
255 <select name=status tabindex="14">
256 <?php
257 print "<!-- ".$result["status"]." -->\n";
258 foreach ($statii as $s) {
259 if ($s == "unassigned") {
260 echo "<option value=''";
261 } else {
262 echo "<option value='".$s."'";
265 if ($s == $result["status"])
266 echo " selected";
268 echo ">".ucwords($s)."</option>\n";
271 </select>
272 </td>
274 <?php if ($GLOBALS['weight_loss_clinic']) { ?>
275 <td class='bold'>Starting Weight</td>
276 <td class='bold'>
277 <input name="genericname1" size='4' value="<?php echo $result{"genericname1"} ?>" />
278 &nbsp;Date:
279 <input name="genericval1" size='10' value="<?php echo $result{"genericval1"} ?>" />
280 </td>
281 <?php } else { ?>
282 <td><input name="genericname1" size='20' value="<?php echo $result{"genericname1"} ?>" /></td>
283 <td><input name="genericval1" size='20' value="<?php echo $result{"genericval1"} ?>" /></td>
284 <?php } ?>
286 </tr>
288 <tr>
289 <td><span class=required><?php xl('Provider','e'); ?>: </span></td>
290 <td>
291 <select tabindex="15" name="providerID" onchange="javascript:document.demographics_form.referrer.value=upperFirst(this.options[this.selectedIndex].text,this.options[this.selectedIndex].text);">
292 <option value=''><?php xl('Unassigned','e'); ?></option>
293 <?php
294 foreach ($provideri as $s) {
295 //echo "defined provider is: " .trim($s['fname']." ".$s['lname']). " compared to : " .$result["referrer"] . "<br />";
297 echo "<option value='".$s['id']."'";
299 if ($s['id'] == $result["providerID"])
300 echo " selected";
301 echo ">".ucwords($s['fname']." ".$s['lname'])."</option>\n";
304 </select>
305 </td>
307 <?php if ($GLOBALS['weight_loss_clinic']) { ?>
308 <td class='bold'>Ending Weight</td>
309 <td class='bold'>
310 <input name="genericname2" size='4' value="<?php echo $result{"genericname2"} ?>" />
311 &nbsp;Date:
312 <input name="genericval2" size='10' value="<?php echo $result{"genericval2"} ?>" />
313 </td>
314 <?php } else { ?>
315 <td><input name="genericname2" size='20' value="<?php echo $result{"genericname2"};?>" /></td>
316 <td><input name="genericval2" size='20' value="<?php echo $result{"genericval2"};?>" /></td>
317 <?php } ?>
319 </tr>
321 <tr>
322 <td><span class=bold><?php xl('Pharmacy','e'); ?>: </span></td>
323 <td colspan='5'>
324 <select name='pharmacy_id'>
325 <option value='0'></option>
326 <?php
327 $pres = sqlStatement("SELECT d.id, d.name, a.line1, a.city, " .
328 "p.area_code, p.prefix, p.number FROM pharmacies AS d " .
329 "LEFT OUTER JOIN addresses AS a ON a.foreign_id = d.id " .
330 "LEFT OUTER JOIN phone_numbers AS p ON p.foreign_id = d.id AND p.type = 2 " .
331 "ORDER BY name, area_code, prefix, number");
332 while ($prow = sqlFetchArray($pres)) {
333 $key = $prow['id'];
334 echo " <option value='$key'";
335 if ($result['pharmacy_id'] == $key) echo " selected";
336 echo '>' . $prow['name'] . ' ' . $prow['area_code'] . '-' .
337 $prow['prefix'] . '-' . $prow['number'] . ' / ' .
338 $prow['line1'] . ' / ' . $prow['city'] . "</option>\n";
341 </select>
342 </td>
343 </tr>
345 <tr>
346 <td colspan='6'>
347 <a href="javascript:document.demographics_form.submit();" class='link_submit'>[<?php xl('Save Patient Demographics','e'); ?>]</a>
348 <hr>
349 </td>
350 </tr>
351 </table>
353 <?php if (! $GLOBALS['athletic_team']) { ?>
355 <table width='100%'>
356 <tr>
357 <th colspan='4' align='left' class='bold'><?php xl('HIPAA Choices','e'); ?>:</th>
358 </tr>
359 <tr>
360 <td class='bold' width='10%' nowrap><?php xl('Did you receive a copy of the HIPAA Notice?','e'); ?> </td>
361 <td class='bold'>
362 <select name = "hipaa_notice">
363 <?php
364 echo " <option>NO</option>\n";
365 $opt_sel = ($result['hipaa_notice'] == 'YES' || ($GLOBALS['weight_loss_clinic'] && !$result['hipaa_notice']))
366 ? ' selected' : '';
367 echo " <option$opt_sel>YES</option>\n";
369 </select>
370 </td>
371 <td class='bold' width='10%' nowrap><?php xl('Allow Voice Msg','e'); ?>:</td>
372 <td class='bold'>
373 <select name="hipaa_voice">
374 <?php
375 echo " <option>NO</option>\n";
376 $opt_sel = ($result['hipaa_voice'] == 'YES' || ($GLOBALS['weight_loss_clinic'] && !$result['hipaa_voice']))
377 ? ' selected' : '';
378 echo " <option$opt_sel>YES</option>\n";
380 </select>
381 </td>
382 </tr>
383 <tr>
384 <td class='bold' width='10%' nowrap><?php xl('Allow Mail','e'); ?>:</td>
385 <td class='bold'>
386 <select name="hipaa_mail">
387 <?php
388 echo " <option>NO</option>\n";
389 $opt_sel = ($result['hipaa_mail'] == 'YES' || ($GLOBALS['weight_loss_clinic'] && !$result['hipaa_mail']))
390 ? ' selected' : '';
391 echo " <option$opt_sel>YES</option>\n";
393 </select>
394 </td>
395 <td class='bold' width='10%' nowrap><?php xl('Who may we leave a message with?','e'); ?> </td>
396 <td><input name="hipaa_message" size='20' value="<?php echo $result['hipaa_message']; ?>" /></td>
397 </tr>
398 <tr>
399 <td colspan='4'>
400 <a href="javascript:document.demographics_form.submit();" class=link_submit>[<?php xl('Save Patient Demographics','e'); ?>]</a>
401 <br><hr>
402 </td>
403 </tr>
404 </table>
406 <?php } ?>
408 <table width='100%'<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
409 <tr>
410 <td valign=top>
411 <input type=hidden size=30 name=referrer value="<?php echo ucfirst($result{"referrer"});?>">
412 <input type=hidden size=20 name=referrerID value="<?php echo $result{"referrerID"}?>">
413 <input type=hidden size=20 name=db_id value="<?php echo $result{"id"}?>">
414 <table>
415 <tr>
416 <td><span class=bold><?php xl('Occupation','e'); ?>: </span></td>
417 <td><input type=entry size=20 name=occupation value="<?php echo $result{"occupation"}?>"></td>
418 </tr>
419 <tr>
420 <td class='bold'><?php xl('Employer','e'); ?>:</td>
421 <td><input type=entry size=20 name=ename value="<?php echo $result2{"name"}?>"></td>
422 </tr>
423 <tr>
424 <td colspan='2' class='bold' style='font-weight:normal'>(<?php xl('if unemployed enter Student, PT Student, or leave blank','e'); ?>)</td>
425 </tr>
426 <?php if ($GLOBALS['athletic_team']) { ?>
427 <tr>
428 <td colspan='2' class='bold' style='font-weight:normal'>&nbsp;</td>
429 </tr>
430 <tr>
431 <td><span class='bold'><?php xl('Squad','e'); ?>: </span></td>
432 <td>
433 <select name='squad'>
434 <option value=''>&nbsp;</option>
435 <?php
436 $squads = acl_get_squads();
437 if ($squads) {
438 foreach ($squads as $key => $value) {
439 echo " <option value='$key'";
440 if ($result['squad'] == $key) echo " selected";
441 echo ">" . $value[3] . "</option>\n";
445 </select>
446 </td>
447 </tr>
448 <?php } ?>
449 </table>
450 </td>
451 <td valign=top>
453 <?php if (! $GLOBALS['simplified_demographics']) { ?>
455 <table>
456 <tr>
457 <td><span class=bold><?php xl('Employer Address','e'); ?></span></td><td><span class=bold></span><input type=entry size=25 name=estreet value="<?php echo $result2{"street"}?>"></td>
458 </tr>
459 <tr>
460 <td><span class=bold><?php xl('City','e'); ?>: </span></td><td><input type=entry size=15 name=ecity value="<?php echo $result2{"city"}?>"></td>
461 </tr>
462 <tr>
463 <td><span class=bold><?php echo ($GLOBALS['phone_country_code'] == '1') ? 'State' : 'Locality' ?>: </span></td><td><input type=entry size=15 name=estate value="<?php echo $result2{"state"}?>"></td>
464 </tr>
465 <tr>
466 <td><span class=bold><?php echo ($GLOBALS['phone_country_code'] == '1') ? 'Zip' : 'Postal' ?> <?php xl('Code','e'); ?>: </span></td><td><input type=entry size=10 name=epostal_code value="<?php echo $result2{"postal_code"}?>"></td>
467 </tr>
468 <tr>
469 <td><span class=bold><?php xl('Country','e'); ?>: </span></td><td><input type=entry size=10 name=ecountry value="<?php echo $result2{"country"}?>"></td>
470 </tr>
471 </table>
473 <?php } ?>
475 </td>
476 <td valign=top></td>
477 </tr>
479 <tr>
480 <td colspan=4>
481 <a href="javascript:document.demographics_form.submit();" class=link_submit>[<?php xl('Save Patient Demographics','e'); ?>]</a><hr></td>
482 </tr>
484 <?php if (! $GLOBALS['athletic_team'] && ! $GLOBALS['simplified_demographics']) { ?>
486 <tr>
487 <td valign='top'>
488 <span class='bold'><?php xl('Language','e'); ?>: </span><br>
489 <select onchange="javascript:document.demographics_form.language.value=upperFirst(this.options[this.selectedIndex].value,this.options[this.selectedIndex].value);">
490 <?php
491 foreach ($langi as $s) {
492 if ($s == "unassigned") {
493 echo "<option value=''";
494 } else {
495 echo "<option value='".$s."'";
497 if ($s == strtolower($result["language"]))
498 echo " selected";
499 echo ">".ucwords($s)."</option>\n";
502 </select><br>
503 <input type=entry size=30 name=language value="<?php echo ucfirst($result{"language"});?>"><br><br />
504 <span class=bold><?php xl('Race/Ethnicity','e'); ?>: </span><br>
505 <select onchange="javascript:document.demographics_form.ethnoracial.value=upperFirst(this.options[this.selectedIndex].value,this.options[this.selectedIndex].value);">
506 <?php
507 foreach ($ethnoraciali as $s) {
508 if ($s == "unassigned") {
509 echo "<option value=''";
510 } else {
511 echo "<option value='".$s."'";
513 if ($s == strtolower($result["ethnoracial"]))
514 echo " selected";
515 echo ">".ucwords($s)."</option>\n";
518 </select>
519 <br>
520 <input type=entry size=30 name=ethnoracial value="<?php echo ucfirst($result{"ethnoracial"});?>"><br>
521 </td>
522 <td valign=top>
523 <table>
524 <tr>
525 <td><span class=bold><?php xl('Financial Review Date','e'); ?>: </span></td><td><input type=entry size=11 name=financial_review value="<?php if ($result{"financial_review"} != "0000-00-00 00:00:00") {echo date("m/d/Y",strtotime($result{"financial_review"}));} else {echo "MM/DD/YYYY";}?>"></td>
526 </tr>
527 <tr>
528 <td><span class=bold><?php xl('Family Size','e'); ?>: </span></td><td><input type=entry size=20 name=family_size value="<?php echo $result{"family_size"}?>"></td>
529 </tr>
530 <tr>
531 <td><span class=bold><?php xl('Monthly Income','e'); ?>: </span></td><td><input type=entry size=20 name=monthly_income onblur="javascript:checkNum();" value="<?php echo $result{"monthly_income"}?>"><span class=small>(<?php xl('Numbers only','e'); ?>)</span></td>
532 </tr>
533 <tr>
534 <td><span class=bold><?php xl('Homeless, etc.','e'); ?>: </span></td><td><input type=entry size=20 name=homeless value="<?php echo $result{"homeless"}?>"></td>
535 </tr>
536 <tr>
537 <td><span class=bold><?php xl('Interpreter','e'); ?>: </span></td><td><input type=entry size=20 name=interpretter value="<?php echo $result{"interpretter"}?>"></td>
538 </tr>
539 <tr>
540 <td><span class=bold><?php xl('Migrant/Seasonal','e'); ?>: </span></td><td><input type=entry size=20 name=migrantseasonal value="<?php echo $result{"migrantseasonal"}?>"></td>
541 </tr>
542 </table>
543 </td>
544 <td valign=top></td>
545 </tr>
547 <tr>
548 <td colspan=4>
549 <a href="javascript:document.demographics_form.submit();" class=link_submit>[<?php xl('Save Patient Demographics','e'); ?>]</a>
550 <hr>
551 </td>
552 </tr>
554 <?php } ?>
556 </table>
558 <?php
559 if (! $GLOBALS['simplified_demographics']) {
560 $insurance_headings = array("Primary Insurance Provider:", "Secondary Insurance Provider", "Tertiary Insurance provider");
561 $insurance_info = array();
562 $insurance_info[1] = getInsuranceData($pid,"primary");
563 $insurance_info[2] = getInsuranceData($pid,"secondary");
564 $insurance_info[3] = getInsuranceData($pid,"tertiary");
565 for($i=1;$i<=3;$i++) {
566 $result3 = $insurance_info[$i];
568 <table border="0">
569 <tr>
570 <td valign=top>
571 <table border="0">
572 <tr>
573 <td colspan="5"><span class='required'><?php echo $insurance_headings[$i -1]?></span></td>
574 </tr>
575 <tr>
576 <td colspan="5">
577 <select name="i<?php echo $i?>provider">
578 <option value=""><?php xl('Unassigned','e'); ?></option>
579 <?php
580 foreach ($insurancei as $iid => $iname) {
581 echo "<option value='" . $iid . "'";
582 if (strtolower($iid) == strtolower($result3{"provider"}))
583 echo " selected";
584 echo ">" . $iname . "</option>\n";
587 </select>&nbsp;<a href='' onclick='return ins_search(<?php echo $i?>)'><?php xl('Search/Add Insurer','e'); ?></a>
588 </td>
589 </tr>
590 <tr>
591 <td><span class=required><?php xl('Plan Name','e'); ?>: </span></td><td><input type=entry size=20 name=i<?php echo $i?>plan_name value="<?php echo $result3{"plan_name"}?>"></td>
592 </tr>
593 <tr>
594 <td><span class=required><?php xl('Policy Number','e'); ?>: </span></td><td><input type=entry size=16 name=i<?php echo $i?>policy_number value="<?php echo $result3{"policy_number"}?>"></td>
595 </tr>
596 <tr>
597 <td><span class=required><?php xl('Group Number','e'); ?>: </span></td><td><input type=entry size=16 name=i<?php echo $i?>group_number value="<?php echo $result3{"group_number"}?>"></td>
598 </tr>
600 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
601 <td class='required'><?php xl('Subscriber Employer (SE)','e'); ?><br><span style='font-weight:normal'>
602 (<?php xl('if unemployed enter Student','e'); ?>,<br><?php xl('PT Student, or leave blank','e'); ?>): </span></td>
603 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer value="<?php echo $result3{"subscriber_employer"}?>"></td>
604 </tr>
606 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
607 <td><span class=required><?php xl('SE Address','e'); ?>: </span></td><td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer_street value="<?php echo $result3{"subscriber_employer_street"}?>"></td>
608 </tr>
610 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
611 <td colspan="2">
612 <table>
613 <tr>
614 <td><span class=required><?php xl('SE City','e'); ?>: </span></td>
615 <td><input type=entry size=15 name=i<?php echo $i?>subscriber_employer_city value="<?php echo $result3{"subscriber_employer_city"}?>"></td>
616 <td><span class=required><?php xl('SE','e'); ?> <?php echo ($GLOBALS['phone_country_code'] == '1') ? 'State' : 'Locality' ?>: </span></td>
617 <td><input type=entry size=15 name=i<?php echo $i?>subscriber_employer_state value="<?php echo $result3{"subscriber_employer_state"}?>"></td>
618 </tr>
619 <tr>
620 <td><span class=required><?php xl('SE','e'); ?> <?php echo ($GLOBALS['phone_country_code'] == '1') ? 'Zip' : 'Postal' ?> <?php xl('Code','e'); ?>: </span></td>
621 <td><input type=entry size=10 name=i<?php echo $i?>subscriber_employer_postal_code value="<?php echo $result3{"subscriber_employer_postal_code"}?>"></td>
622 <td><span class=required><?php xl('SE Country','e'); ?>: </span></td>
623 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer_country value="<?php echo $result3{"subscriber_employer_country"}?>"></td>
624 </tr>
625 </table>
626 </td>
627 </tr>
629 </table>
630 </td>
632 <td valign=top>
633 <span class=required><?php xl('Subscriber','e'); ?>: </span><input type=entry size=10 name=i<?php echo $i?>subscriber_fname value="<?php echo $result3{"subscriber_fname"}?>"><input type=entry size=3 name=i<?php echo $i?>subscriber_mname value="<?php echo $result3{"subscriber_mname"}?>"><input type=entry size=10 name=i<?php echo $i?>subscriber_lname value="<?php echo $result3{"subscriber_lname"}?>">
634 <br>
635 <span class=required><?php xl('Relationship','e'); ?>: </span>
636 <select name=i<?php echo $i?>subscriber_relationship onchange="javascript:auto_populate_employer_address<?php echo $i?>();">
637 <?php
638 foreach ($relats as $s) {
639 if ($s == "unassigned") {
640 echo "<option value=''";
641 } else {
642 echo "<option value='".$s."'";
644 if ($s == $result3{"subscriber_relationship"})
645 echo " selected";
646 echo ">".ucfirst($s)."</option>\n";
649 </select>
650 <a href="javascript:popUp('browse.php?browsenum=<?php echo $i?>')" class=text>(<?php xl('Browse','e'); ?>)</a><br />
651 <span class=bold><?php xl('D.O.B.','e'); ?>: </span>
652 <input type='entry' size='11' name='i<?php echo $i?>subscriber_DOB'
653 value='<?php echo $result3['subscriber_DOB'] ?>'
654 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)'
655 title='yyyy-mm-dd' />
656 <span class=bold><?php xl('S.S.','e'); ?>: </span><input type=entry size=11 name=i<?php echo $i?>subscriber_ss value="<?php echo $result3{"subscriber_ss"}?> ">&nbsp;
657 <span class=bold><?php xl('Sex','e'); ?>: </span>
658 <select name=i<?php echo $i?>subscriber_sex>
659 <option value="Male" <?php if (strtolower($result3{"subscriber_sex"}) == "male") echo "selected"?>><?php xl('Male','e'); ?></option>
660 <option value="Female" <?php if (strtolower($result3{"subscriber_sex"}) == "female") echo "selected"?>><?php xl('Female','e'); ?></option>
661 </select>
662 <br>
663 <span class=required><?php xl('Subscriber Address','e'); ?>: </span><input type=entry size=25 name=i<?php echo $i?>subscriber_street value="<?php echo $result3{"subscriber_street"}?>"><br>
664 <span class=required><?php xl('City','e'); ?>: </span><input type=entry size=15 name=i<?php echo $i?>subscriber_city value="<?php echo $result3{"subscriber_city"}?>">
665 <span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? 'State' : 'Locality' ?>: </span><input type=entry size=15 name=i<?php echo $i?>subscriber_state value="<?php echo $result3{"subscriber_state"}?>"><br>
666 <span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? 'Zip' : 'Postal' ?> <?php xl('Code','e'); ?>: </span><input type=entry size=10 name=i<?php echo $i?>subscriber_postal_code value="<?php echo $result3{"subscriber_postal_code"}?>">
667 <span class='required'<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
668 <?php xl('Country','e'); ?>:
669 <input type=entry size=10 name=i<?php echo $i?>subscriber_country
670 value="<?php echo $result3{"subscriber_country"}?>"><br></span>
671 <span class=bold><?php xl('Subscriber Phone','e'); ?>:
672 <input type='text' size='20' name='i<?php echo $i?>subscriber_phone' value='<?php echo $result3["subscriber_phone"] ?>' onkeyup='phonekeyup(this,mypcc)' />
673 </span><br />
674 <span class=bold><?php xl('CoPay','e'); ?>: <input type=text size="6" name=i<?php echo $i?>copay value="<?php echo $result3{"copay"}?>">
675 </td>
676 </tr>
677 </table>
678 <a href="javascript:document.demographics_form.submit();" class=link_submit>[<?php xl('Save Patient Demographics','e'); ?>]</a>
679 <hr>
681 <?php
682 } //end insurer for loop
683 } // end of "if not simplified_demographics"
686 </form>
688 <br>
690 <script language="JavaScript">
692 // fix inconsistently formatted phone numbers from the database
693 var f = document.forms[0];
694 phonekeyup(f.phone_contact,mypcc);
695 phonekeyup(f.phone_home,mypcc);
696 phonekeyup(f.phone_biz,mypcc);
697 phonekeyup(f.phone_cell,mypcc);
699 <?php if (! $GLOBALS['simplified_demographics']) { ?>
700 phonekeyup(f.i1subscriber_phone,mypcc);
701 phonekeyup(f.i2subscriber_phone,mypcc);
702 phonekeyup(f.i3subscriber_phone,mypcc);
703 <?php } ?>
705 <?php if ($GLOBALS['concurrent_layout'] && $set_pid) { ?>
706 parent.left_nav.setPatient(<?php echo "'" . $result['fname'] . " " . $result['lname'] . "',$pid,''"; ?>);
707 parent.left_nav.setRadio(window.name, 'dem');
708 <?php } ?>
710 </script>
712 </body>
713 </html>