Added support for secondary Medicare policy types.
[openemr.git] / interface / patient_file / summary / demographics_full.php
blob4360042b657a20b810d090debeb867bc3917c4f1
1 <?php
2 // This program is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU General Public License
4 // as published by the Free Software Foundation; either version 2
5 // of the License, or (at your option) any later version.
7 require_once("../../globals.php");
8 require_once("$srcdir/acl.inc");
9 require_once("$srcdir/options.inc.php");
10 require_once("$srcdir/formatting.inc.php");
11 require_once("$srcdir/erx_javascript.inc.php");
13 // Session pid must be right or bad things can happen when demographics are saved!
15 include_once("$srcdir/pid.inc");
16 $set_pid = $_GET["set_pid"] ? $_GET["set_pid"] : $_GET["pid"];
17 if ($set_pid && $set_pid != $_SESSION["pid"]) {
18 setpid($set_pid);
21 include_once("$srcdir/patient.inc");
23 $result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD");
24 $result2 = getEmployerData($pid);
26 // Check authorization.
27 $thisauth = acl_check('patients', 'demo');
28 if ($pid) {
29 if ($thisauth != 'write')
30 die(xl('Updating demographics is not authorized.'));
31 if ($result['squad'] && ! acl_check('squads', $result['squad']))
32 die(xl('You are not authorized to access this squad.'));
33 } else {
34 if ($thisauth != 'write' && $thisauth != 'addonly')
35 die(xl('Adding demographics is not authorized.'));
38 $CPR = 4; // cells per row
40 // $statii = array('married','single','divorced','widowed','separated','domestic partner');
41 // $langi = getLanguages();
42 // $ethnoraciali = getEthnoRacials();
43 // $provideri = getProviderInfo();
45 $insurancei = getInsuranceProviders();
47 $fres = sqlStatement("SELECT * FROM layout_options " .
48 "WHERE form_id = 'DEM' AND uor > 0 " .
49 "ORDER BY group_name, seq");
51 <html>
52 <head>
53 <?php html_header_show();?>
55 <link rel="stylesheet" href="<?php echo $css_header; ?>" type="text/css">
57 <style type="text/css">@import url(../../../library/dynarch_calendar.css);</style>
59 <script type="text/javascript" src="../../../library/dialog.js"></script>
60 <script type="text/javascript" src="../../../library/textformat.js"></script>
61 <script type="text/javascript" src="../../../library/dynarch_calendar.js"></script>
62 <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
63 <script type="text/javascript" src="../../../library/dynarch_calendar_setup.js"></script>
65 <script type="text/javascript" src="../../../library/js/jquery.1.3.2.js"></script>
66 <script type="text/javascript" src="../../../library/js/common.js"></script>
68 <script type="text/javascript" src="../../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script>
69 <link rel="stylesheet" type="text/css" href="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
71 <script type="text/javascript">
72 $(document).ready(function(){
73 tabbify();
74 enable_modals();
76 // special size for
77 $(".medium_modal").fancybox( {
78 'overlayOpacity' : 0.0,
79 'showCloseButton' : true,
80 'frameHeight' : 460,
81 'frameWidth' : 650
82 });
84 });
86 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
88 //code used from http://tech.irt.org/articles/js037/
89 function replace(string,text,by) {
90 // Replaces text with by in string
91 var strLength = string.length, txtLength = text.length;
92 if ((strLength == 0) || (txtLength == 0)) return string;
94 var i = string.indexOf(text);
95 if ((!i) && (text != string.substring(0,txtLength))) return string;
96 if (i == -1) return string;
98 var newstr = string.substring(0,i) + by;
100 if (i+txtLength < strLength)
101 newstr += replace(string.substring(i+txtLength,strLength),text,by);
103 return newstr;
106 function upperFirst(string,text) {
107 return replace(string,text,text.charAt(0).toUpperCase() + text.substring(1,text.length));
110 <?php for ($i=1;$i<=3;$i++) { ?>
111 function auto_populate_employer_address<?php echo $i ?>(){
112 var f = document.demographics_form;
113 if (f.form_i<?php echo $i?>subscriber_relationship.options[f.form_i<?php echo $i?>subscriber_relationship.selectedIndex].value == "self")
115 f.i<?php echo $i?>subscriber_fname.value=f.form_fname.value;
116 f.i<?php echo $i?>subscriber_mname.value=f.form_mname.value;
117 f.i<?php echo $i?>subscriber_lname.value=f.form_lname.value;
118 f.i<?php echo $i?>subscriber_street.value=f.form_street.value;
119 f.i<?php echo $i?>subscriber_city.value=f.form_city.value;
120 f.form_i<?php echo $i?>subscriber_state.value=f.form_state.value;
121 f.i<?php echo $i?>subscriber_postal_code.value=f.form_postal_code.value;
122 if (f.form_country_code)
123 f.form_i<?php echo $i?>subscriber_country.value=f.form_country_code.value;
124 f.i<?php echo $i?>subscriber_phone.value=f.form_phone_home.value;
125 f.i<?php echo $i?>subscriber_DOB.value=f.form_DOB.value;
126 f.i<?php echo $i?>subscriber_ss.value=f.form_ss.value;
127 f.form_i<?php echo $i?>subscriber_sex.value = f.form_sex.value;
128 f.i<?php echo $i?>subscriber_employer.value=f.form_em_name.value;
129 f.i<?php echo $i?>subscriber_employer_street.value=f.form_em_street.value;
130 f.i<?php echo $i?>subscriber_employer_city.value=f.form_em_city.value;
131 f.form_i<?php echo $i?>subscriber_employer_state.value=f.form_em_state.value;
132 f.i<?php echo $i?>subscriber_employer_postal_code.value=f.form_em_postal_code.value;
133 if (f.form_em_country)
134 f.form_i<?php echo $i?>subscriber_employer_country.value=f.form_em_country.value;
138 <?php } ?>
140 function popUp(URL) {
141 day = new Date();
142 id = day.getTime();
143 top.restoreSession();
144 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');");
147 function checkNum () {
148 var re= new RegExp();
149 re = /^\d*\.?\d*$/;
150 str=document.demographics_form.monthly_income.value;
151 if(re.exec(str))
153 }else{
154 alert("<?php xl('Please enter a monetary amount using only numbers and a decimal point.','e'); ?>");
158 // Indicates which insurance slot is being updated.
159 var insurance_index = 0;
161 // The OnClick handler for searching/adding the insurance company.
162 function ins_search(ins) {
163 insurance_index = ins;
164 return false;
167 // The ins_search.php window calls this to set the selected insurance.
168 function set_insurance(ins_id, ins_name) {
169 var thesel = document.forms[0]['i' + insurance_index + 'provider'];
170 var theopts = thesel.options; // the array of Option objects
171 var i = 0;
172 for (; i < theopts.length; ++i) {
173 if (theopts[i].value == ins_id) {
174 theopts[i].selected = true;
175 return;
178 // no matching option was found so create one, append it to the
179 // end of the list, and select it.
180 theopts[i] = new Option(ins_name, ins_id, false, true);
183 // This capitalizes the first letter of each word in the passed input
184 // element. It also strips out extraneous spaces.
185 function capitalizeMe(elem) {
186 var a = elem.value.split(' ');
187 var s = '';
188 for(var i = 0; i < a.length; ++i) {
189 if (a[i].length > 0) {
190 if (s.length > 0) s += ' ';
191 s += a[i].charAt(0).toUpperCase() + a[i].substring(1);
194 elem.value = s;
197 function divclick(cb, divid) {
198 var divstyle = document.getElementById(divid).style;
199 if (cb.checked) {
200 divstyle.display = 'block';
201 } else {
202 divstyle.display = 'none';
204 return true;
207 // Compute the length of a string without leading and trailing spaces.
208 function trimlen(s) {
209 var i = 0;
210 var j = s.length - 1;
211 for (; i <= j && s.charAt(i) == ' '; ++i);
212 for (; i <= j && s.charAt(j) == ' '; --j);
213 if (i > j) return 0;
214 return j + 1 - i;
217 function validate(f) {
218 var errCount = 0;
219 var errMsgs = new Array();
220 <?php generate_layout_validation('DEM'); ?>
222 var msg = "";
223 msg += "<?php xl('The following fields are required', 'e' ); ?>:\n\n";
224 for ( var i = 0; i < errMsgs.length; i++ ) {
225 msg += errMsgs[i] + "\n";
227 msg += "\n<?php xl('Please fill them in before continuing.', 'e'); ?>";
229 if ( errMsgs.length > 0 ) {
230 alert(msg);
233 //Patient Data validations
234 <?php if($GLOBALS['erx_enable']){ ?>
235 alertMsg='';
236 for(i=0;i<f.length;i++){
237 if(f[i].type=='text' && f[i].value)
239 if(f[i].name == 'form_fname' || f[i].name == 'form_mname' || f[i].name == 'form_lname')
241 alertMsg += checkLength(f[i].name,f[i].value,35);
242 alertMsg += checkUsername(f[i].name,f[i].value);
244 else if(f[i].name == 'form_street' || f[i].name == 'form_city')
246 alertMsg += checkLength(f[i].name,f[i].value,35);
247 alertMsg += checkAlphaNumericExtended(f[i].name,f[i].value);
249 else if(f[i].name == 'form_phone_home')
251 alertMsg += checkPhone(f[i].name,f[i].value);
255 if(alertMsg)
257 alert(alertMsg);
258 return false;
260 <?php } ?>
261 //return false;
263 // Some insurance validation.
264 for (var i = 1; i <= 3; ++i) {
265 subprov = 'i' + i + 'provider';
266 if (!f[subprov] || f[subprov].selectedIndex <= 0) continue;
267 var subpfx = 'i' + i + 'subscriber_';
268 var subrelat = f['form_' + subpfx + 'relationship'];
269 var samename =
270 f[subpfx + 'fname'].value == f.form_fname.value &&
271 f[subpfx + 'mname'].value == f.form_mname.value &&
272 f[subpfx + 'lname'].value == f.form_lname.value;
273 var samess = f[subpfx + 'ss'].value == f.form_ss.value;
274 if (subrelat.options[subrelat.selectedIndex].value == "self") {
275 if (!samename) {
276 if (!confirm("<?php xl('Subscriber relationship is self but name is different! Is this really OK?','e'); ?>"))
277 return false;
279 if (!samess) {
280 alert("<?php xl('Subscriber relationship is self but SS number is different!','e'); ?>");
281 return false;
283 } // end self
284 else {
285 if (samename) {
286 if (!confirm("<?php xl('Subscriber relationship is not self but name is the same! Is this really OK?','e'); ?>"))
287 return false;
289 if (samess) {
290 alert("<?php xl('Subscriber relationship is not self but SS number is the same!','e'); ?>");
291 return false;
293 } // end not self
294 } // end for
296 return errMsgs.length < 1;
299 function submitme() {
300 var f = document.forms[0];
301 if (validate(f)) {
302 top.restoreSession();
303 f.submit();
307 // Onkeyup handler for policy number. Allows only A-Z and 0-9.
308 function policykeyup(e) {
309 var v = e.value.toUpperCase();
310 for (var i = 0; i < v.length; ++i) {
311 var c = v.charAt(i);
312 if (c >= '0' && c <= '9') continue;
313 if (c >= 'A' && c <= 'Z') continue;
314 if (c == '*') continue;
315 if (c == '-') continue;
316 if (c == '_') continue;
317 if (c == '(') continue;
318 if (c == ')') continue;
319 if (c == '#') continue;
320 v = v.substring(0, i) + v.substring(i + i);
321 --i;
323 e.value = v;
324 return;
327 // Added 06/2009 by BM to make compatible with list_options table and functions - using jquery
328 $(document).ready(function() {
330 <?php for ($i=1;$i<=3;$i++) { ?>
331 $("#form_i<?php echo $i?>subscriber_relationship").change(function() { auto_populate_employer_address<?php echo $i?>(); });
332 <?php } ?>
336 </script>
337 </head>
339 <body class="body_top">
340 <form action='demographics_save.php' name='demographics_form' method='post' onsubmit='return validate(this)'>
341 <input type='hidden' name='mode' value='save' />
342 <input type='hidden' name='db_id' value="<?php echo $result['id']?>" />
343 <table cellpadding='0' cellspacing='0' border='0'>
344 <tr>
345 <td>
346 <?php if ($GLOBALS['concurrent_layout']) { ?>
347 <a href="demographics.php" onclick="top.restoreSession()">
348 <?php } else { ?>
349 <a href="patient_summary.php" target="Main" onclick="top.restoreSession()">
350 <?php } ?>
351 <font class=title><?php xl('Current Patient','e'); ?></font>
352 </a>
353 &nbsp;&nbsp;
354 </td>
355 <td>
356 <a href="javascript:submitme();" class='css_button'>
357 <span><?php xl('Save','e'); ?></span>
358 </a>
359 </td>
360 <td>
361 <?php if ($GLOBALS['concurrent_layout']) { ?>
362 <a class="css_button" href="demographics.php" onclick="top.restoreSession()">
363 <?php } else { ?>
364 <a href="patient_summary.php" target="Main" onclick="top.restoreSession()">
365 <?php } ?>
366 <span><?php xl('Cancel','e'); ?></span>
367 </a>
368 </td>
369 </tr>
370 </table>
371 <?php
373 function end_cell() {
374 global $item_count, $cell_count;
375 if ($item_count > 0) {
376 echo "</td>";
377 $item_count = 0;
381 function end_row() {
382 global $cell_count, $CPR;
383 end_cell();
384 if ($cell_count > 0) {
385 for (; $cell_count < $CPR; ++$cell_count) echo "<td></td>";
386 echo "</tr>\n";
387 $cell_count = 0;
391 function end_group() {
392 global $last_group;
393 if (strlen($last_group) > 0) {
394 end_row();
395 echo " </table>\n";
396 echo "</div>\n";
400 $last_group = '';
401 $cell_count = 0;
402 $item_count = 0;
403 $display_style = 'block';
405 $group_seq=0; // this gives the DIV blocks unique IDs
408 <br>
409 <div class="section-header">
410 <span class="text"><b> <?php xl("Demographics", "e" )?></b></span>
411 </div>
413 <div id="DEM" >
415 <ul class="tabNav">
416 <?php display_layout_tabs('DEM', $result, $result2); ?>
417 </ul>
419 <div class="tabContainer">
420 <?php display_layout_tabs_data_editable('DEM', $result, $result2); ?>
421 </div>
422 </div>
423 <br>
424 <div class="section-header">
425 <span class="text"><b><?php xl("Insurance", "e" )?></b></span>
426 </div>
427 <div id="DEM" >
430 <?php
431 if (! $GLOBALS['simplified_demographics']) {
433 $insurance_headings = array(xl("Primary Insurance Provider"), xl("Secondary Insurance Provider"), xl("Tertiary Insurance provider"));
434 $insurance_info = array();
435 $insurance_info[1] = getInsuranceData($pid,"primary");
436 $insurance_info[2] = getInsuranceData($pid,"secondary");
437 $insurance_info[3] = getInsuranceData($pid,"tertiary");
440 <div id="INSURANCE" >
441 <ul class="tabNav">
442 <?php
443 foreach (array('primary','secondary','tertiary') as $instype) {
444 ?><li <?php echo $instype == 'primary' ? 'class="current"' : '' ?>><a href="/play/javascript-tabbed-navigation/"><?php $CapInstype=ucfirst($instype); xl($CapInstype,'e'); ?></a></li><?php
447 </ul>
449 <div class="tabContainer">
451 <?php
452 for($i=1;$i<=3;$i++) {
453 $result3 = $insurance_info[$i];
456 <div class="tab <?php echo $i == 1 ? 'current': '' ?>" style='height:auto;width:auto'> <!---display icky, fix to auto-->
458 <table border="0">
460 <tr>
461 <td valign=top width="430">
462 <table border="0">
464 <tr>
465 <td valign='top'>
466 <span class='required'><?php echo $insurance_headings[$i -1]."&nbsp;"?></span>
467 </td>
468 <td class='required'>:</td>
469 <td>
470 <a href="../../practice/ins_search.php" class="iframe medium_modal css_button" onclick="ins_search(<?php echo $i?>)">
471 <span><?php echo xl('Search/Add') ?></span>
472 </a>
473 <select name="i<?php echo $i?>provider">
474 <option value=""><?php xl('Unassigned','e'); ?></option>
475 <?php
476 foreach ($insurancei as $iid => $iname) {
477 echo "<option value='" . $iid . "'";
478 if (strtolower($iid) == strtolower($result3{"provider"}))
479 echo " selected";
480 echo ">" . $iname . "</option>\n";
483 </select>
485 </td>
486 </tr>
488 <tr>
489 <td>
490 <span class='required'><?php xl('Plan Name','e'); ?> </span>
491 </td>
492 <td class='required'>:</td>
493 <td>
494 <input type='entry' size='20' name='i<?php echo $i?>plan_name' value="<?php echo $result3{"plan_name"} ?>"
495 onchange="capitalizeMe(this);" />&nbsp;&nbsp;
496 </td>
497 </tr>
499 <tr>
500 <td>
501 <span class='required'><?php xl('Effective Date','e'); ?></span>
502 </td>
503 <td class='required'>:</td>
504 <td>
505 <input type='entry' size='16' id='i<?php echo $i ?>effective_date' name='i<?php echo $i ?>effective_date'
506 value='<?php echo $result3['date'] ?>'
507 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)'
508 title='yyyy-mm-dd' />
509 <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22' id='img_i<?php echo $i ?>effective_date' border='0' alt='[?]' style='cursor:pointer' title='<?php xl('Click here to choose a date','e'); ?>'>
510 </td>
511 </tr>
513 <tr>
514 <td><span class=required><?php xl('Policy Number','e'); ?></span></td>
515 <td class='required'>:</td>
516 <td><input type='entry' size='16' name='i<?php echo $i?>policy_number' value="<?php echo $result3{"policy_number"}?>"
517 onkeyup='policykeyup(this)'></td>
518 </tr>
520 <tr>
521 <td><span class=required><?php xl('Group Number','e'); ?></span></td>
522 <td class='required'>:</td>
523 <td><input type=entry size=16 name=i<?php echo $i?>group_number value="<?php echo $result3{"group_number"}?>" onkeyup='policykeyup(this)'></td>
524 </tr>
526 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
527 <td class='required'><?php xl('Subscriber Employer (SE)','e'); ?><br><span style='font-weight:normal'>
528 (<?php xl('if unemployed enter Student','e'); ?>,<br><?php xl('PT Student, or leave blank','e'); ?>) </span></td>
529 <td class='required'>:</td>
530 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer
531 value="<?php echo $result3{"subscriber_employer"}?>"
532 onchange="capitalizeMe(this);" /></td>
533 </tr>
535 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
536 <td><span class=required><?php xl('SE Address','e'); ?></span></td>
537 <td class='required'>:</td>
538 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer_street
539 value="<?php echo $result3{"subscriber_employer_street"}?>"
540 onchange="capitalizeMe(this);" /></td>
541 </tr>
543 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
544 <td colspan="3">
545 <table>
546 <tr>
547 <td><span class=required><?php xl('SE City','e'); ?>: </span></td>
548 <td><input type=entry size=15 name=i<?php echo $i?>subscriber_employer_city
549 value="<?php echo $result3{"subscriber_employer_city"}?>"
550 onchange="capitalizeMe(this);" /></td>
551 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('SE State','e') : xl('SE Locality','e') ?>: </span></td>
552 <td>
553 <?php
554 // Modified 7/2009 by BM to incorporate data types
555 generate_form_field(array('data_type'=>$GLOBALS['state_data_type'],'field_id'=>('i'.$i.'subscriber_employer_state'),'list_id'=>$GLOBALS['state_list'],'fld_length'=>'15','max_length'=>'63','edit_options'=>'C'), $result3['subscriber_employer_state']);
557 </td>
558 </tr>
559 <tr>
560 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('SE Zip Code','e') : xl('SE Postal Code','e') ?>: </span></td>
561 <td><input type=entry size=15 name=i<?php echo $i?>subscriber_employer_postal_code value="<?php echo $result3{"subscriber_employer_postal_code"}?>"></td>
562 <td><span class=required><?php xl('SE Country','e'); ?>: </span></td>
563 <td>
564 <?php
565 // Modified 7/2009 by BM to incorporate data types
566 generate_form_field(array('data_type'=>$GLOBALS['country_data_type'],'field_id'=>('i'.$i.'subscriber_employer_country'),'list_id'=>$GLOBALS['country_list'],'fld_length'=>'10','max_length'=>'63','edit_options'=>'C'), $result3['subscriber_employer_country']);
568 </td>
569 </tr>
570 </table>
571 </td>
572 </tr>
574 </table>
575 </td>
577 <td valign=top>
578 <table border="0">
579 <tr>
580 <td><span class=required><?php xl('Relationship','e'); ?></span></td>
581 <td class=required>:</td>
582 <td colspan=3><?php
583 // Modified 6/2009 by BM to use list_options and function
584 generate_form_field(array('data_type'=>1,'field_id'=>('i'.$i.'subscriber_relationship'),'list_id'=>'sub_relation','empty_title'=>' '), $result3['subscriber_relationship']);
587 <a href="javascript:popUp('browse.php?browsenum=<?php echo $i?>')" class=text>(<?php xl('Browse','e'); ?>)</a></td>
588 <td></td><td></td><td></td><td></td>
589 </tr>
590 <tr>
591 <td width=120><span class=required><?php xl('Subscriber','e'); ?> </span></td>
592 <td class=required>:</td>
593 <td colspan=3><input type=entry size=10 name=i<?php echo $i?>subscriber_fname value="<?php echo $result3{"subscriber_fname"}?>" onchange="capitalizeMe(this);" />
594 <input type=entry size=3 name=i<?php echo $i?>subscriber_mname value="<?php echo $result3{"subscriber_mname"}?>" onchange="capitalizeMe(this);" />
595 <input type=entry size=10 name=i<?php echo $i?>subscriber_lname value="<?php echo $result3{"subscriber_lname"}?>" onchange="capitalizeMe(this);" /></td>
596 <td></td><td></td><td></td><td></td>
597 </tr>
598 <tr>
599 <td><span class=bold><?php xl('D.O.B.','e'); ?> </span></td>
600 <td class=required>:</td>
601 <td><input type='entry' size='11' id='i<?php echo $i?>subscriber_DOB' name='i<?php echo $i?>subscriber_DOB' value='<?php echo $result3['subscriber_DOB'] ?>' onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' title='yyyy-mm-dd' /><img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22' id='img_i<?php echo $i; ?>dob_date' border='0' alt='[?]' style='cursor:pointer' title='<?php xl('Click here to choose a date','e'); ?>'></td>
603 <td><span class=bold><?php xl('Sex','e'); ?>: </span></td>
604 <td><?php
605 // Modified 6/2009 by BM to use list_options and function
606 generate_form_field(array('data_type'=>1,'field_id'=>('i'.$i.'subscriber_sex'),'list_id'=>'sex'), $result3['subscriber_sex']);
608 </td>
609 <td></td><td></td> <td></td><td></td>
610 </tr>
611 <tr>
612 <td class=leftborder><span class=bold><?php xl('S.S.','e'); ?> </span></td>
613 <td class=required>:</td>
614 <td><input type=entry size=11 name=i<?php echo $i?>subscriber_ss value="<?php echo $result3{"subscriber_ss"}?>"></td>
615 </tr>
617 <tr>
618 <td><span class=required><?php xl('Subscriber Address','e'); ?> </span></td>
619 <td class=required>:</td>
620 <td><input type=entry size=20 name=i<?php echo $i?>subscriber_street value="<?php echo $result3{"subscriber_street"}?>" onchange="capitalizeMe(this);" /></td>
622 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('State','e') : xl('Locality','e') ?>: </span></td>
623 <td>
624 <?php
625 // Modified 7/2009 by BM to incorporate data types
626 generate_form_field(array('data_type'=>$GLOBALS['state_data_type'],'field_id'=>('i'.$i.'subscriber_state'),'list_id'=>$GLOBALS['state_list'],'fld_length'=>'15','max_length'=>'63','edit_options'=>'C'), $result3['subscriber_state']);
628 </td>
629 </tr>
630 <tr>
631 <td class=leftborder><span class=required><?php xl('City','e'); ?></span></td>
632 <td class=required>:</td>
633 <td><input type=entry size=11 name=i<?php echo $i?>subscriber_city value="<?php echo $result3{"subscriber_city"}?>" onchange="capitalizeMe(this);" /></td><td class=leftborder><span class='required'<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>><?php xl('Country','e'); ?>: </span></td><td>
634 <?php
635 // Modified 7/2009 by BM to incorporate data types
636 generate_form_field(array('data_type'=>$GLOBALS['country_data_type'],'field_id'=>('i'.$i.'subscriber_country'),'list_id'=>$GLOBALS['country_list'],'fld_length'=>'10','max_length'=>'63','edit_options'=>'C'), $result3['subscriber_country']);
638 </td>
639 </tr>
640 <tr>
641 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('Zip Code','e') : xl('Postal Code','e') ?> </span></td><td class=required>:</td><td><input type=entry size=10 name=i<?php echo $i?>subscriber_postal_code value="<?php echo $result3{"subscriber_postal_code"}?>"></td>
643 <td colspan=2>
644 </td><td></td>
645 </tr>
646 <tr>
647 <td><span class=bold><?php xl('Subscriber Phone','e'); ?></span></td>
648 <td class=required>:</td>
649 <td><input type='text' size='20' name='i<?php echo $i?>subscriber_phone' value='<?php echo $result3["subscriber_phone"] ?>' onkeyup='phonekeyup(this,mypcc)' /></td>
650 <td colspan=2><span class=bold><?php xl('CoPay','e'); ?>: <input type=text size="6" name=i<?php echo $i?>copay value="<?php echo $result3{"copay"}?>"></span></td>
651 <td colspan=2>
652 </td><td></td><td></td>
653 </tr>
654 <tr>
655 <td colspan=0><span class='required'><?php xl('Accept Assignment','e'); ?></span></td>
656 <td class=required>:</td>
657 <td colspan=2>
658 <select name=i<?php echo $i?>accept_assignment>
659 <option value="TRUE" <?php if (strtoupper($result3{"accept_assignment"}) == "TRUE") echo "selected"?>><?php xl('YES','e'); ?></option>
660 <option value="FALSE" <?php if (strtoupper($result3{"accept_assignment"}) == "FALSE") echo "selected"?>><?php xl('NO','e'); ?></option>
661 </select>
662 </td>
663 <td></td><td></td>
664 <td colspan=2>
665 </td><td></td>
666 </tr>
667 <tr>
668 <td><span class='bold'><?php xl('Secondary Medicare Type','e'); ?></span></td>
669 <td class='bold'>:</td>
670 <td colspan='6'>
671 <select name=i<?php echo $i?>policy_type>
672 <?php
673 foreach ($policy_types AS $key => $value) {
674 echo " <option value ='$key'";
675 if ($key == $result3['policy_type']) echo " selected";
676 echo ">" . htmlspecialchars($value) . "</option>\n";
679 </select>
680 </td>
681 </tr>
682 </table>
684 </td>
685 </tr>
686 </table>
688 </div>
690 <?php } //end insurer for loop ?>
692 </div>
693 </div>
695 <?php } // end of "if not simplified_demographics" ?>
696 </div></div>
698 </form>
700 <br>
702 <script language="JavaScript">
704 // fix inconsistently formatted phone numbers from the database
705 var f = document.forms[0];
706 if (f.form_phone_contact) phonekeyup(f.form_phone_contact,mypcc);
707 if (f.form_phone_home ) phonekeyup(f.form_phone_home ,mypcc);
708 if (f.form_phone_biz ) phonekeyup(f.form_phone_biz ,mypcc);
709 if (f.form_phone_cell ) phonekeyup(f.form_phone_cell ,mypcc);
711 <?php if (! $GLOBALS['simplified_demographics']) { ?>
712 phonekeyup(f.i1subscriber_phone,mypcc);
713 phonekeyup(f.i2subscriber_phone,mypcc);
714 phonekeyup(f.i3subscriber_phone,mypcc);
715 <?php } ?>
717 <?php if ($GLOBALS['concurrent_layout'] && $set_pid) { ?>
718 parent.left_nav.setPatient(<?php echo "'" . addslashes($result['fname']) . " " . addslashes($result['lname']) . "',$pid,'" . addslashes($result['pubpid']) . "','', ' " . xl('DOB') . ": " . oeFormatShortDate($result['DOB_YMD']) . " " . xl('Age') . ": " . getPatientAge($result['DOB_YMD']) . "'"; ?>);
719 parent.left_nav.setRadio(window.name, 'dem');
720 <?php } ?>
722 <?php echo $date_init; ?>
723 <?php if (! $GLOBALS['simplified_demographics']) { for ($i=1; $i<=3; $i++): ?>
724 Calendar.setup({inputField:"i<?php echo $i?>effective_date", ifFormat:"%Y-%m-%d", button:"img_i<?php echo $i?>effective_date"});
725 Calendar.setup({inputField:"i<?php echo $i?>subscriber_DOB", ifFormat:"%Y-%m-%d", button:"img_i<?php echo $i?>dob_date"});
726 <?php endfor; } ?>
727 </script>
729 <!-- include support for the list-add selectbox feature -->
730 <?php include $GLOBALS['fileroot']."/library/options_listadd.inc"; ?>
732 </body>
734 </html>