Edited function policykeyup() to allow for common symbolic characters found in some...
[openemr.git] / interface / patient_file / summary / demographics_full.php
blob22ac2a6457b8df4a2a67fdea7f1d8fc2c7b96ecc
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");
12 // Session pid must be right or bad things can happen when demographics are saved!
14 include_once("$srcdir/pid.inc");
15 $set_pid = $_GET["set_pid"] ? $_GET["set_pid"] : $_GET["pid"];
16 if ($set_pid && $set_pid != $_SESSION["pid"]) {
17 setpid($set_pid);
20 include_once("$srcdir/patient.inc");
22 $result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD");
23 $result2 = getEmployerData($pid);
25 // Check authorization.
26 $thisauth = acl_check('patients', 'demo');
27 if ($pid) {
28 if ($thisauth != 'write')
29 die(xl('Updating demographics is not authorized.'));
30 if ($result['squad'] && ! acl_check('squads', $result['squad']))
31 die(xl('You are not authorized to access this squad.'));
32 } else {
33 if ($thisauth != 'write' && $thisauth != 'addonly')
34 die(xl('Adding demographics is not authorized.'));
37 $CPR = 4; // cells per row
39 // $statii = array('married','single','divorced','widowed','separated','domestic partner');
40 // $langi = getLanguages();
41 // $ethnoraciali = getEthnoRacials();
42 // $provideri = getProviderInfo();
44 $insurancei = getInsuranceProviders();
46 $fres = sqlStatement("SELECT * FROM layout_options " .
47 "WHERE form_id = 'DEM' AND uor > 0 " .
48 "ORDER BY group_name, seq");
50 <html>
51 <head>
52 <?php html_header_show();?>
54 <link rel="stylesheet" href="<?php echo $css_header; ?>" type="text/css">
56 <style type="text/css">@import url(../../../library/dynarch_calendar.css);</style>
58 <script type="text/javascript" src="../../../library/dialog.js"></script>
59 <script type="text/javascript" src="../../../library/textformat.js"></script>
60 <script type="text/javascript" src="../../../library/dynarch_calendar.js"></script>
61 <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
62 <script type="text/javascript" src="../../../library/dynarch_calendar_setup.js"></script>
64 <script type="text/javascript" src="../../../library/js/jquery.1.3.2.js"></script>
65 <script type="text/javascript" src="../../../library/js/common.js"></script>
67 <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 // Some insurance validation.
234 for (var i = 1; i <= 3; ++i) {
235 subprov = 'i' + i + 'provider';
236 if (!f[subprov] || f[subprov].selectedIndex <= 0) continue;
237 var subpfx = 'i' + i + 'subscriber_';
238 var subrelat = f['form_' + subpfx + 'relationship'];
239 var samename =
240 f[subpfx + 'fname'].value == f.form_fname.value &&
241 f[subpfx + 'mname'].value == f.form_mname.value &&
242 f[subpfx + 'lname'].value == f.form_lname.value;
243 var samess = f[subpfx + 'ss'].value == f.form_ss.value;
244 if (subrelat.options[subrelat.selectedIndex].value == "self") {
245 if (!samename) {
246 if (!confirm("<?php xl('Subscriber relationship is self but name is different! Is this really OK?','e'); ?>"))
247 return false;
249 if (!samess) {
250 alert("<?php xl('Subscriber relationship is self but SS number is different!','e'); ?>");
251 return false;
253 } // end self
254 else {
255 if (samename) {
256 if (!confirm("<?php xl('Subscriber relationship is not self but name is the same! Is this really OK?','e'); ?>"))
257 return false;
259 if (samess) {
260 alert("<?php xl('Subscriber relationship is not self but SS number is the same!','e'); ?>");
261 return false;
263 } // end not self
264 } // end for
266 return errMsgs.length < 1;
269 function submitme() {
270 var f = document.forms[0];
271 if (validate(f)) {
272 top.restoreSession();
273 f.submit();
277 // Onkeyup handler for policy number. Allows only A-Z and 0-9.
278 function policykeyup(e) {
279 var v = e.value.toUpperCase();
280 for (var i = 0; i < v.length; ++i) {
281 var c = v.charAt(i);
282 if (c >= '0' && c <= '9') continue;
283 if (c >= 'A' && c <= 'Z') continue;
284 if (c == '*') continue;
285 if (c == '-') continue;
286 if (c == '_') continue;
287 if (c == '(') continue;
288 if (c == ')') continue;
289 if (c == '#') continue;
290 v = v.substring(0, i) + v.substring(i + i);
291 --i;
293 e.value = v;
294 return;
297 // Added 06/2009 by BM to make compatible with list_options table and functions - using jquery
298 $(document).ready(function() {
300 <?php for ($i=1;$i<=3;$i++) { ?>
301 $("#form_i<?php echo $i?>subscriber_relationship").change(function() { auto_populate_employer_address<?php echo $i?>(); });
302 <?php } ?>
306 </script>
307 </head>
309 <body class="body_top">
310 <form action='demographics_save.php' name='demographics_form' method='post' onsubmit='return validate(this)'>
311 <input type='hidden' name='mode' value='save' />
312 <input type='hidden' name='db_id' value="<?php echo $result['id']?>" />
313 <table cellpadding='0' cellspacing='0' border='0'>
314 <tr>
315 <td>
316 <?php if ($GLOBALS['concurrent_layout']) { ?>
317 <a href="demographics.php" onclick="top.restoreSession()">
318 <?php } else { ?>
319 <a href="patient_summary.php" target="Main" onclick="top.restoreSession()">
320 <?php } ?>
321 <font class=title><?php xl('Current Patient','e'); ?></font>
322 </a>
323 &nbsp;&nbsp;
324 </td>
325 <td>
326 <a href="javascript:submitme();" class='css_button'>
327 <span><?php xl('Save','e'); ?></span>
328 </a>
329 </td>
330 <td>
331 <?php if ($GLOBALS['concurrent_layout']) { ?>
332 <a class="css_button" href="demographics.php" onclick="top.restoreSession()">
333 <?php } else { ?>
334 <a href="patient_summary.php" target="Main" onclick="top.restoreSession()">
335 <?php } ?>
336 <span><?php xl('Cancel','e'); ?></span>
337 </a>
338 </td>
339 </tr>
340 </table>
341 <?php
343 function end_cell() {
344 global $item_count, $cell_count;
345 if ($item_count > 0) {
346 echo "</td>";
347 $item_count = 0;
351 function end_row() {
352 global $cell_count, $CPR;
353 end_cell();
354 if ($cell_count > 0) {
355 for (; $cell_count < $CPR; ++$cell_count) echo "<td></td>";
356 echo "</tr>\n";
357 $cell_count = 0;
361 function end_group() {
362 global $last_group;
363 if (strlen($last_group) > 0) {
364 end_row();
365 echo " </table>\n";
366 echo "</div>\n";
370 $last_group = '';
371 $cell_count = 0;
372 $item_count = 0;
373 $display_style = 'block';
375 $group_seq=0; // this gives the DIV blocks unique IDs
378 <br>
379 <div class="section-header">
380 <span class="text"><b> <?php xl("Demographics", "e" )?></b></span>
381 </div>
383 <div id="DEM" >
385 <ul class="tabNav">
386 <?php display_layout_tabs('DEM', $result, $result2); ?>
387 </ul>
389 <div class="tabContainer">
390 <?php display_layout_tabs_data_editable('DEM', $result, $result2); ?>
391 </div>
392 </div>
393 <br>
394 <div class="section-header">
395 <span class="text"><b><?php xl("Insurance", "e" )?></b></span>
396 </div>
397 <div id="DEM" >
400 <?php
401 if (! $GLOBALS['simplified_demographics']) {
403 $insurance_headings = array(xl("Primary Insurance Provider"), xl("Secondary Insurance Provider"), xl("Tertiary Insurance provider"));
404 $insurance_info = array();
405 $insurance_info[1] = getInsuranceData($pid,"primary");
406 $insurance_info[2] = getInsuranceData($pid,"secondary");
407 $insurance_info[3] = getInsuranceData($pid,"tertiary");
410 <div id="INSURANCE" >
411 <ul class="tabNav">
412 <?php
413 foreach (array('primary','secondary','tertiary') as $instype) {
414 ?><li <?php echo $instype == 'primary' ? 'class="current"' : '' ?>><a href="/play/javascript-tabbed-navigation/"><?php $CapInstype=ucfirst($instype); xl($CapInstype,'e'); ?></a></li><?php
417 </ul>
419 <div class="tabContainer">
421 <?php
422 for($i=1;$i<=3;$i++) {
423 $result3 = $insurance_info[$i];
426 <div class="tab <?php echo $i == 1 ? 'current': '' ?>" style='height:auto;width:auto'> <!---display icky, fix to auto-->
428 <table border="0">
430 <tr>
431 <td valign=top width="430">
432 <table border="0">
434 <tr>
435 <td valign='top'>
436 <span class='required'><?php echo $insurance_headings[$i -1]."&nbsp;"?></span>
437 </td>
438 <td class='required'>:</td>
439 <td>
440 <a href="../../practice/ins_search.php" class="iframe medium_modal css_button" onclick="ins_search(<?php echo $i?>)">
441 <span><?php echo xl('Search/Add') ?></span>
442 </a>
443 <select name="i<?php echo $i?>provider">
444 <option value=""><?php xl('Unassigned','e'); ?></option>
445 <?php
446 foreach ($insurancei as $iid => $iname) {
447 echo "<option value='" . $iid . "'";
448 if (strtolower($iid) == strtolower($result3{"provider"}))
449 echo " selected";
450 echo ">" . $iname . "</option>\n";
453 </select>
455 </td>
456 </tr>
458 <tr>
459 <td>
460 <span class='required'><?php xl('Plan Name','e'); ?> </span>
461 </td>
462 <td class='required'>:</td>
463 <td>
464 <input type='entry' size='20' name='i<?php echo $i?>plan_name' value="<?php echo $result3{"plan_name"} ?>"
465 onchange="capitalizeMe(this);" />&nbsp;&nbsp;
466 </td>
467 </tr>
469 <tr>
470 <td>
471 <span class='required'><?php xl('Effective Date','e'); ?></span>
472 </td>
473 <td class='required'>:</td>
474 <td>
475 <input type='entry' size='16' id='i<?php echo $i ?>effective_date' name='i<?php echo $i ?>effective_date'
476 value='<?php echo $result3['date'] ?>'
477 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)'
478 title='yyyy-mm-dd' />
479 <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'); ?>'>
480 </td>
481 </tr>
483 <tr>
484 <td><span class=required><?php xl('Policy Number','e'); ?></span></td>
485 <td class='required'>:</td>
486 <td><input type='entry' size='16' name='i<?php echo $i?>policy_number' value="<?php echo $result3{"policy_number"}?>"
487 onkeyup='policykeyup(this)'></td>
488 </tr>
490 <tr>
491 <td><span class=required><?php xl('Group Number','e'); ?></span></td>
492 <td class='required'>:</td>
493 <td><input type=entry size=16 name=i<?php echo $i?>group_number value="<?php echo $result3{"group_number"}?>" onkeyup='policykeyup(this)'></td>
494 </tr>
496 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
497 <td class='required'><?php xl('Subscriber Employer (SE)','e'); ?><br><span style='font-weight:normal'>
498 (<?php xl('if unemployed enter Student','e'); ?>,<br><?php xl('PT Student, or leave blank','e'); ?>) </span></td>
499 <td class='required'>:</td>
500 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer
501 value="<?php echo $result3{"subscriber_employer"}?>"
502 onchange="capitalizeMe(this);" /></td>
503 </tr>
505 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
506 <td><span class=required><?php xl('SE Address','e'); ?></span></td>
507 <td class='required'>:</td>
508 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer_street
509 value="<?php echo $result3{"subscriber_employer_street"}?>"
510 onchange="capitalizeMe(this);" /></td>
511 </tr>
513 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
514 <td colspan="3">
515 <table>
516 <tr>
517 <td><span class=required><?php xl('SE City','e'); ?>: </span></td>
518 <td><input type=entry size=15 name=i<?php echo $i?>subscriber_employer_city
519 value="<?php echo $result3{"subscriber_employer_city"}?>"
520 onchange="capitalizeMe(this);" /></td>
521 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('SE State','e') : xl('SE Locality','e') ?>: </span></td>
522 <td>
523 <?php
524 // Modified 7/2009 by BM to incorporate data types
525 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']);
527 </td>
528 </tr>
529 <tr>
530 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('SE Zip Code','e') : xl('SE Postal Code','e') ?>: </span></td>
531 <td><input type=entry size=15 name=i<?php echo $i?>subscriber_employer_postal_code value="<?php echo $result3{"subscriber_employer_postal_code"}?>"></td>
532 <td><span class=required><?php xl('SE Country','e'); ?>: </span></td>
533 <td>
534 <?php
535 // Modified 7/2009 by BM to incorporate data types
536 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']);
538 </td>
539 </tr>
540 </table>
541 </td>
542 </tr>
544 </table>
545 </td>
547 <td valign=top>
548 <table border="0">
549 <tr>
550 <td><span class=required><?php xl('Relationship','e'); ?></span></td>
551 <td class=required>:</td>
552 <td colspan=3><?php
553 // Modified 6/2009 by BM to use list_options and function
554 generate_form_field(array('data_type'=>1,'field_id'=>('i'.$i.'subscriber_relationship'),'list_id'=>'sub_relation','empty_title'=>' '), $result3['subscriber_relationship']);
557 <a href="javascript:popUp('browse.php?browsenum=<?php echo $i?>')" class=text>(<?php xl('Browse','e'); ?>)</a></td>
558 <td></td><td></td><td></td><td></td>
559 </tr>
560 <tr>
561 <td width=120><span class=required><?php xl('Subscriber','e'); ?> </span></td>
562 <td class=required>:</td>
563 <td colspan=3><input type=entry size=10 name=i<?php echo $i?>subscriber_fname value="<?php echo $result3{"subscriber_fname"}?>" onchange="capitalizeMe(this);" />
564 <input type=entry size=3 name=i<?php echo $i?>subscriber_mname value="<?php echo $result3{"subscriber_mname"}?>" onchange="capitalizeMe(this);" />
565 <input type=entry size=10 name=i<?php echo $i?>subscriber_lname value="<?php echo $result3{"subscriber_lname"}?>" onchange="capitalizeMe(this);" /></td>
566 <td></td><td></td><td></td><td></td>
567 </tr>
568 <tr>
569 <td><span class=bold><?php xl('D.O.B.','e'); ?> </span></td>
570 <td class=required>:</td>
571 <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>
573 <td><span class=bold><?php xl('Sex','e'); ?>: </span></td>
574 <td><?php
575 // Modified 6/2009 by BM to use list_options and function
576 generate_form_field(array('data_type'=>1,'field_id'=>('i'.$i.'subscriber_sex'),'list_id'=>'sex'), $result3['subscriber_sex']);
578 </td>
579 <td></td><td></td> <td></td><td></td>
580 </tr>
581 <tr>
582 <td class=leftborder><span class=bold><?php xl('S.S.','e'); ?> </span></td>
583 <td class=required>:</td>
584 <td><input type=entry size=11 name=i<?php echo $i?>subscriber_ss value="<?php echo $result3{"subscriber_ss"}?>"></td>
585 </tr>
587 <tr>
588 <td><span class=required><?php xl('Subscriber Address','e'); ?> </span></td>
589 <td class=required>:</td>
590 <td><input type=entry size=20 name=i<?php echo $i?>subscriber_street value="<?php echo $result3{"subscriber_street"}?>" onchange="capitalizeMe(this);" /></td>
592 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('State','e') : xl('Locality','e') ?>: </span></td>
593 <td>
594 <?php
595 // Modified 7/2009 by BM to incorporate data types
596 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']);
598 </td>
599 </tr>
600 <tr>
601 <td class=leftborder><span class=required><?php xl('City','e'); ?></span></td>
602 <td class=required>:</td>
603 <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>
604 <?php
605 // Modified 7/2009 by BM to incorporate data types
606 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']);
608 </td>
609 </tr>
610 <tr>
611 <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>
614 <td colspan=2>
615 </td><td></td>
616 </tr>
617 <tr>
618 <td><span class=bold><?php xl('Subscriber Phone','e'); ?></span></td>
619 <td class=required>:</td>
620 <td><input type='text' size='20' name='i<?php echo $i?>subscriber_phone' value='<?php echo $result3["subscriber_phone"] ?>' onkeyup='phonekeyup(this,mypcc)' /></td>
621 <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>
622 <td colspan=2>
623 </td><td></td><td></td>
624 </tr>
625 <tr>
626 <td colspan=0><span class='required'><?php xl('Accept Assignment','e'); ?></span></td>
627 <td class=required>:</td>
628 <td colspan=2>
629 <select name=i<?php echo $i?>accept_assignment>
630 <option value="TRUE" <?php if (strtoupper($result3{"accept_assignment"}) == "TRUE") echo "selected"?>><?php xl('YES','e'); ?></option>
631 <option value="FALSE" <?php if (strtoupper($result3{"accept_assignment"}) == "FALSE") echo "selected"?>><?php xl('NO','e'); ?></option>
632 </select>
633 </td>
634 <td></td><td></td>
635 <td colspan=2>
636 </td><td></td>
637 </tr>
638 </table>
642 </td>
643 </tr>
644 </table>
646 </div>
648 <?php } //end insurer for loop ?>
650 </div>
651 </div>
653 <?php } // end of "if not simplified_demographics" ?>
654 </div></div>
660 </form>
662 <br>
664 <script language="JavaScript">
666 // fix inconsistently formatted phone numbers from the database
667 var f = document.forms[0];
668 if (f.form_phone_contact) phonekeyup(f.form_phone_contact,mypcc);
669 if (f.form_phone_home ) phonekeyup(f.form_phone_home ,mypcc);
670 if (f.form_phone_biz ) phonekeyup(f.form_phone_biz ,mypcc);
671 if (f.form_phone_cell ) phonekeyup(f.form_phone_cell ,mypcc);
673 <?php if (! $GLOBALS['simplified_demographics']) { ?>
674 phonekeyup(f.i1subscriber_phone,mypcc);
675 phonekeyup(f.i2subscriber_phone,mypcc);
676 phonekeyup(f.i3subscriber_phone,mypcc);
677 <?php } ?>
679 <?php if ($GLOBALS['concurrent_layout'] && $set_pid) { ?>
680 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']) . "'"; ?>);
681 parent.left_nav.setRadio(window.name, 'dem');
682 <?php } ?>
684 <?php echo $date_init; ?>
685 <?php if (! $GLOBALS['simplified_demographics']) { for ($i=1; $i<=3; $i++): ?>
686 Calendar.setup({inputField:"i<?php echo $i?>effective_date", ifFormat:"%Y-%m-%d", button:"img_i<?php echo $i?>effective_date"});
687 Calendar.setup({inputField:"i<?php echo $i?>subscriber_DOB", ifFormat:"%Y-%m-%d", button:"img_i<?php echo $i?>dob_date"});
688 <?php endfor; } ?>
689 </script>
691 <!-- include support for the list-add selectbox feature -->
692 <?php include $GLOBALS['fileroot']."/library/options_listadd.inc"; ?>
694 </body>
696 </html>