Added Lithuanian language
[openemr.git] / interface / patient_file / summary / demographics_full.php
blob65633c8325dee3ea66f51b41de9f553432466b27
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 if ($pid) {
28 if (!acl_check('patients', 'demo', '', '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 (!acl_check('patients', 'demo', '', array('write','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>
68 <link rel="stylesheet" type="text/css" href="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
70 <script type="text/javascript">
71 $(document).ready(function(){
72 tabbify();
73 enable_modals();
75 // special size for
76 $(".medium_modal").fancybox( {
77 'overlayOpacity' : 0.0,
78 'showCloseButton' : true,
79 'frameHeight' : 460,
80 'frameWidth' : 650
81 });
83 });
85 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
87 //code used from http://tech.irt.org/articles/js037/
88 function replace(string,text,by) {
89 // Replaces text with by in string
90 var strLength = string.length, txtLength = text.length;
91 if ((strLength == 0) || (txtLength == 0)) return string;
93 var i = string.indexOf(text);
94 if ((!i) && (text != string.substring(0,txtLength))) return string;
95 if (i == -1) return string;
97 var newstr = string.substring(0,i) + by;
99 if (i+txtLength < strLength)
100 newstr += replace(string.substring(i+txtLength,strLength),text,by);
102 return newstr;
105 function upperFirst(string,text) {
106 return replace(string,text,text.charAt(0).toUpperCase() + text.substring(1,text.length));
109 <?php for ($i=1;$i<=3;$i++) { ?>
110 function auto_populate_employer_address<?php echo $i ?>(){
111 var f = document.demographics_form;
112 if (f.form_i<?php echo $i?>subscriber_relationship.options[f.form_i<?php echo $i?>subscriber_relationship.selectedIndex].value == "self")
114 f.i<?php echo $i?>subscriber_fname.value=f.form_fname.value;
115 f.i<?php echo $i?>subscriber_mname.value=f.form_mname.value;
116 f.i<?php echo $i?>subscriber_lname.value=f.form_lname.value;
117 f.i<?php echo $i?>subscriber_street.value=f.form_street.value;
118 f.i<?php echo $i?>subscriber_city.value=f.form_city.value;
119 f.form_i<?php echo $i?>subscriber_state.value=f.form_state.value;
120 f.i<?php echo $i?>subscriber_postal_code.value=f.form_postal_code.value;
121 if (f.form_country_code)
122 f.form_i<?php echo $i?>subscriber_country.value=f.form_country_code.value;
123 f.i<?php echo $i?>subscriber_phone.value=f.form_phone_home.value;
124 f.i<?php echo $i?>subscriber_DOB.value=f.form_DOB.value;
125 if(typeof f.form_ss!="undefined")
127 f.i<?php echo $i?>subscriber_ss.value=f.form_ss.value;
129 f.form_i<?php echo $i?>subscriber_sex.value = f.form_sex.value;
130 f.i<?php echo $i?>subscriber_employer.value=f.form_em_name.value;
131 f.i<?php echo $i?>subscriber_employer_street.value=f.form_em_street.value;
132 f.i<?php echo $i?>subscriber_employer_city.value=f.form_em_city.value;
133 f.form_i<?php echo $i?>subscriber_employer_state.value=f.form_em_state.value;
134 f.i<?php echo $i?>subscriber_employer_postal_code.value=f.form_em_postal_code.value;
135 if (f.form_em_country)
136 f.form_i<?php echo $i?>subscriber_employer_country.value=f.form_em_country.value;
140 <?php } ?>
142 function popUp(URL) {
143 day = new Date();
144 id = day.getTime();
145 top.restoreSession();
146 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');");
149 function checkNum () {
150 var re= new RegExp();
151 re = /^\d*\.?\d*$/;
152 str=document.demographics_form.monthly_income.value;
153 if(re.exec(str))
155 }else{
156 alert("<?php xl('Please enter a monetary amount using only numbers and a decimal point.','e'); ?>");
160 // Indicates which insurance slot is being updated.
161 var insurance_index = 0;
163 // The OnClick handler for searching/adding the insurance company.
164 function ins_search(ins) {
165 insurance_index = ins;
166 return false;
169 // The ins_search.php window calls this to set the selected insurance.
170 function set_insurance(ins_id, ins_name) {
171 var thesel = document.forms[0]['i' + insurance_index + 'provider'];
172 var theopts = thesel.options; // the array of Option objects
173 var i = 0;
174 for (; i < theopts.length; ++i) {
175 if (theopts[i].value == ins_id) {
176 theopts[i].selected = true;
177 return;
180 // no matching option was found so create one, append it to the
181 // end of the list, and select it.
182 theopts[i] = new Option(ins_name, ins_id, false, true);
185 // This capitalizes the first letter of each word in the passed input
186 // element. It also strips out extraneous spaces.
187 function capitalizeMe(elem) {
188 var a = elem.value.split(' ');
189 var s = '';
190 for(var i = 0; i < a.length; ++i) {
191 if (a[i].length > 0) {
192 if (s.length > 0) s += ' ';
193 s += a[i].charAt(0).toUpperCase() + a[i].substring(1);
196 elem.value = s;
199 function divclick(cb, divid) {
200 var divstyle = document.getElementById(divid).style;
201 if (cb.checked) {
202 divstyle.display = 'block';
203 } else {
204 divstyle.display = 'none';
206 return true;
209 // Compute the length of a string without leading and trailing spaces.
210 function trimlen(s) {
211 var i = 0;
212 var j = s.length - 1;
213 for (; i <= j && s.charAt(i) == ' '; ++i);
214 for (; i <= j && s.charAt(j) == ' '; --j);
215 if (i > j) return 0;
216 return j + 1 - i;
219 function validate(f) {
220 var errCount = 0;
221 var errMsgs = new Array();
222 <?php generate_layout_validation('DEM'); ?>
224 var msg = "";
225 msg += "<?php xl('The following fields are required', 'e' ); ?>:\n\n";
226 for ( var i = 0; i < errMsgs.length; i++ ) {
227 msg += errMsgs[i] + "\n";
229 msg += "\n<?php xl('Please fill them in before continuing.', 'e'); ?>";
231 if ( errMsgs.length > 0 ) {
232 alert(msg);
235 //Patient Data validations
236 <?php if($GLOBALS['erx_enable']){ ?>
237 alertMsg='';
238 for(i=0;i<f.length;i++){
239 if(f[i].type=='text' && f[i].value)
241 if(f[i].name == 'form_fname' || f[i].name == 'form_mname' || f[i].name == 'form_lname')
243 alertMsg += checkLength(f[i].name,f[i].value,35);
244 alertMsg += checkUsername(f[i].name,f[i].value);
246 else if(f[i].name == 'form_street' || f[i].name == 'form_city')
248 alertMsg += checkLength(f[i].name,f[i].value,35);
249 alertMsg += checkAlphaNumericExtended(f[i].name,f[i].value);
251 else if(f[i].name == 'form_phone_home')
253 alertMsg += checkPhone(f[i].name,f[i].value);
257 if(alertMsg)
259 alert(alertMsg);
260 return false;
262 <?php } ?>
263 //return false;
265 // Some insurance validation.
266 for (var i = 1; i <= 3; ++i) {
267 subprov = 'i' + i + 'provider';
268 if (!f[subprov] || f[subprov].selectedIndex <= 0) continue;
269 var subpfx = 'i' + i + 'subscriber_';
270 var subrelat = f['form_' + subpfx + 'relationship'];
271 var samename =
272 f[subpfx + 'fname'].value == f.form_fname.value &&
273 f[subpfx + 'mname'].value == f.form_mname.value &&
274 f[subpfx + 'lname'].value == f.form_lname.value;
275 var ss_regexp=/[0-9][0-9][0-9]-?[0-9][0-9]-?[0-9][0-9][0-9][0-9]/;
276 var samess=true;
277 var ss_valid=false;
278 if(typeof f.form_ss!="undefined")
280 samess = f[subpfx + 'ss'].value == f.form_ss.value;
281 ss_valid=ss_regexp.test(f[subpfx + 'ss'].value) && ss_regexp.test(f.form_ss.value);
283 if (subrelat.options[subrelat.selectedIndex].value == "self") {
284 if (!samename) {
285 if (!confirm("<?php echo xls('Subscriber relationship is self but name is different! Is this really OK?'); ?>"))
286 return false;
288 if (!samess && ss_valid) {
289 if(!confirm("<?php echo xls('Subscriber relationship is self but SS number is different!')." ". xls("Is this really OK?"); ?>"))
290 return false;
292 } // end self
293 else {
294 if (samename) {
295 if (!confirm("<?php echo xls('Subscriber relationship is not self but name is the same! Is this really OK?'); ?>"))
296 return false;
298 if (samess && ss_valid) {
299 if(!confirm("<?php echo xls('Subscriber relationship is not self but SS number is the same!') ." ". xls("Is this really OK?"); ?>"))
300 return false;
302 } // end not self
303 } // end for
305 return errMsgs.length < 1;
308 function submitme() {
309 var f = document.forms[0];
310 if (validate(f)) {
311 top.restoreSession();
312 f.submit();
316 // Onkeyup handler for policy number. Allows only A-Z and 0-9.
317 function policykeyup(e) {
318 var v = e.value.toUpperCase();
319 for (var i = 0; i < v.length; ++i) {
320 var c = v.charAt(i);
321 if (c >= '0' && c <= '9') continue;
322 if (c >= 'A' && c <= 'Z') continue;
323 if (c == '*') continue;
324 if (c == '-') continue;
325 if (c == '_') continue;
326 if (c == '(') continue;
327 if (c == ')') continue;
328 if (c == '#') continue;
329 v = v.substring(0, i) + v.substring(i + i);
330 --i;
332 e.value = v;
333 return;
336 // Added 06/2009 by BM to make compatible with list_options table and functions - using jquery
337 $(document).ready(function() {
339 <?php for ($i=1;$i<=3;$i++) { ?>
340 $("#form_i<?php echo $i?>subscriber_relationship").change(function() { auto_populate_employer_address<?php echo $i?>(); });
341 <?php } ?>
345 </script>
346 </head>
348 <body class="body_top">
349 <form action='demographics_save.php' name='demographics_form' method='post' onsubmit='return validate(this)'>
350 <input type='hidden' name='mode' value='save' />
351 <input type='hidden' name='db_id' value="<?php echo $result['id']?>" />
352 <table cellpadding='0' cellspacing='0' border='0'>
353 <tr>
354 <td>
355 <?php if ($GLOBALS['concurrent_layout']) { ?>
356 <a href="demographics.php" onclick="top.restoreSession()">
357 <?php } else { ?>
358 <a href="patient_summary.php" target="Main" onclick="top.restoreSession()">
359 <?php } ?>
360 <font class=title><?php xl('Current Patient','e'); ?></font>
361 </a>
362 &nbsp;&nbsp;
363 </td>
364 <td>
365 <a href="javascript:submitme();" class='css_button'>
366 <span><?php xl('Save','e'); ?></span>
367 </a>
368 </td>
369 <td>
370 <?php if ($GLOBALS['concurrent_layout']) { ?>
371 <a class="css_button" href="demographics.php" onclick="top.restoreSession()">
372 <?php } else { ?>
373 <a href="patient_summary.php" target="Main" onclick="top.restoreSession()">
374 <?php } ?>
375 <span><?php xl('Cancel','e'); ?></span>
376 </a>
377 </td>
378 </tr>
379 </table>
380 <?php
382 function end_cell() {
383 global $item_count, $cell_count;
384 if ($item_count > 0) {
385 echo "</td>";
386 $item_count = 0;
390 function end_row() {
391 global $cell_count, $CPR;
392 end_cell();
393 if ($cell_count > 0) {
394 for (; $cell_count < $CPR; ++$cell_count) echo "<td></td>";
395 echo "</tr>\n";
396 $cell_count = 0;
400 function end_group() {
401 global $last_group;
402 if (strlen($last_group) > 0) {
403 end_row();
404 echo " </table>\n";
405 echo "</div>\n";
409 $last_group = '';
410 $cell_count = 0;
411 $item_count = 0;
412 $display_style = 'block';
414 $group_seq=0; // this gives the DIV blocks unique IDs
417 <br>
418 <div class="section-header">
419 <span class="text"><b> <?php xl("Demographics", "e" )?></b></span>
420 </div>
422 <div id="DEM" >
424 <ul class="tabNav">
425 <?php display_layout_tabs('DEM', $result, $result2); ?>
426 </ul>
428 <div class="tabContainer">
429 <?php display_layout_tabs_data_editable('DEM', $result, $result2); ?>
430 </div>
431 </div>
432 <br>
433 <div class="section-header">
434 <span class="text"><b><?php xl("Insurance", "e" )?></b></span>
435 </div>
436 <div id="DEM" >
439 <?php
440 if (! $GLOBALS['simplified_demographics']) {
442 $insurance_headings = array(xl("Primary Insurance Provider"), xl("Secondary Insurance Provider"), xl("Tertiary Insurance provider"));
443 $insurance_info = array();
444 $insurance_info[1] = getInsuranceData($pid,"primary");
445 $insurance_info[2] = getInsuranceData($pid,"secondary");
446 $insurance_info[3] = getInsuranceData($pid,"tertiary");
449 <div id="INSURANCE" >
450 <ul class="tabNav">
451 <?php
452 foreach (array('primary','secondary','tertiary') as $instype) {
453 ?><li <?php echo $instype == 'primary' ? 'class="current"' : '' ?>><a href="/play/javascript-tabbed-navigation/"><?php $CapInstype=ucfirst($instype); xl($CapInstype,'e'); ?></a></li><?php
456 </ul>
458 <div class="tabContainer">
460 <?php
461 for($i=1;$i<=3;$i++) {
462 $result3 = $insurance_info[$i];
465 <div class="tab <?php echo $i == 1 ? 'current': '' ?>" style='height:auto;width:auto'> <!---display icky, fix to auto-->
467 <table border="0">
469 <tr>
470 <td valign=top width="430">
471 <table border="0">
473 <tr>
474 <td valign='top'>
475 <span class='required'><?php echo $insurance_headings[$i -1]."&nbsp;"?></span>
476 </td>
477 <td class='required'>:</td>
478 <td>
479 <a href="../../practice/ins_search.php" class="iframe medium_modal css_button" onclick="ins_search(<?php echo $i?>)">
480 <span><?php echo xl('Search/Add') ?></span>
481 </a>
482 <select name="i<?php echo $i?>provider">
483 <option value=""><?php xl('Unassigned','e'); ?></option>
484 <?php
485 foreach ($insurancei as $iid => $iname) {
486 echo "<option value='" . $iid . "'";
487 if (strtolower($iid) == strtolower($result3{"provider"}))
488 echo " selected";
489 echo ">" . $iname . "</option>\n";
492 </select>
494 </td>
495 </tr>
497 <tr>
498 <td>
499 <span class='required'><?php xl('Plan Name','e'); ?> </span>
500 </td>
501 <td class='required'>:</td>
502 <td>
503 <input type='entry' size='20' name='i<?php echo $i?>plan_name' value="<?php echo $result3{"plan_name"} ?>"
504 onchange="capitalizeMe(this);" />&nbsp;&nbsp;
505 </td>
506 </tr>
508 <tr>
509 <td>
510 <span class='required'><?php xl('Effective Date','e'); ?></span>
511 </td>
512 <td class='required'>:</td>
513 <td>
514 <input type='entry' size='16' id='i<?php echo $i ?>effective_date' name='i<?php echo $i ?>effective_date'
515 value='<?php echo $result3['date'] ?>'
516 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)'
517 title='yyyy-mm-dd' />
518 <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'); ?>'>
519 </td>
520 </tr>
522 <tr>
523 <td><span class=required><?php xl('Policy Number','e'); ?></span></td>
524 <td class='required'>:</td>
525 <td><input type='entry' size='16' name='i<?php echo $i?>policy_number' value="<?php echo $result3{"policy_number"}?>"
526 onkeyup='policykeyup(this)'></td>
527 </tr>
529 <tr>
530 <td><span class=required><?php xl('Group Number','e'); ?></span></td>
531 <td class='required'>:</td>
532 <td><input type=entry size=16 name=i<?php echo $i?>group_number value="<?php echo $result3{"group_number"}?>" onkeyup='policykeyup(this)'></td>
533 </tr>
535 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
536 <td class='required'><?php xl('Subscriber Employer (SE)','e'); ?><br><span style='font-weight:normal'>
537 (<?php xl('if unemployed enter Student','e'); ?>,<br><?php xl('PT Student, or leave blank','e'); ?>) </span></td>
538 <td class='required'>:</td>
539 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer
540 value="<?php echo $result3{"subscriber_employer"}?>"
541 onchange="capitalizeMe(this);" /></td>
542 </tr>
544 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
545 <td><span class=required><?php xl('SE Address','e'); ?></span></td>
546 <td class='required'>:</td>
547 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer_street
548 value="<?php echo $result3{"subscriber_employer_street"}?>"
549 onchange="capitalizeMe(this);" /></td>
550 </tr>
552 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
553 <td colspan="3">
554 <table>
555 <tr>
556 <td><span class=required><?php xl('SE City','e'); ?>: </span></td>
557 <td><input type=entry size=15 name=i<?php echo $i?>subscriber_employer_city
558 value="<?php echo $result3{"subscriber_employer_city"}?>"
559 onchange="capitalizeMe(this);" /></td>
560 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('SE State','e') : xl('SE Locality','e') ?>: </span></td>
561 <td>
562 <?php
563 // Modified 7/2009 by BM to incorporate data types
564 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']);
566 </td>
567 </tr>
568 <tr>
569 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('SE Zip Code','e') : xl('SE Postal Code','e') ?>: </span></td>
570 <td><input type=entry size=15 name=i<?php echo $i?>subscriber_employer_postal_code value="<?php echo $result3{"subscriber_employer_postal_code"}?>"></td>
571 <td><span class=required><?php xl('SE Country','e'); ?>: </span></td>
572 <td>
573 <?php
574 // Modified 7/2009 by BM to incorporate data types
575 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']);
577 </td>
578 </tr>
579 </table>
580 </td>
581 </tr>
583 </table>
584 </td>
586 <td valign=top>
587 <table border="0">
588 <tr>
589 <td><span class=required><?php xl('Relationship','e'); ?></span></td>
590 <td class=required>:</td>
591 <td colspan=3><?php
592 // Modified 6/2009 by BM to use list_options and function
593 generate_form_field(array('data_type'=>1,'field_id'=>('i'.$i.'subscriber_relationship'),'list_id'=>'sub_relation','empty_title'=>' '), $result3['subscriber_relationship']);
596 <a href="javascript:popUp('browse.php?browsenum=<?php echo $i?>')" class=text>(<?php xl('Browse','e'); ?>)</a></td>
597 <td></td><td></td><td></td><td></td>
598 </tr>
599 <tr>
600 <td width=120><span class=required><?php xl('Subscriber','e'); ?> </span></td>
601 <td class=required>:</td>
602 <td colspan=3><input type=entry size=10 name=i<?php echo $i?>subscriber_fname value="<?php echo $result3{"subscriber_fname"}?>" onchange="capitalizeMe(this);" />
603 <input type=entry size=3 name=i<?php echo $i?>subscriber_mname value="<?php echo $result3{"subscriber_mname"}?>" onchange="capitalizeMe(this);" />
604 <input type=entry size=10 name=i<?php echo $i?>subscriber_lname value="<?php echo $result3{"subscriber_lname"}?>" onchange="capitalizeMe(this);" /></td>
605 <td></td><td></td><td></td><td></td>
606 </tr>
607 <tr>
608 <td><span class=bold><?php xl('D.O.B.','e'); ?> </span></td>
609 <td class=required>:</td>
610 <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>
612 <td><span class=bold><?php xl('Sex','e'); ?>: </span></td>
613 <td><?php
614 // Modified 6/2009 by BM to use list_options and function
615 generate_form_field(array('data_type'=>1,'field_id'=>('i'.$i.'subscriber_sex'),'list_id'=>'sex'), $result3['subscriber_sex']);
617 </td>
618 <td></td><td></td> <td></td><td></td>
619 </tr>
620 <tr>
621 <td class=leftborder><span class=bold><?php xl('S.S.','e'); ?> </span></td>
622 <td class=required>:</td>
623 <td><input type=entry size=11 name=i<?php echo $i?>subscriber_ss value="<?php echo trim($result3{"subscriber_ss"})?>"></td>
624 </tr>
626 <tr>
627 <td><span class=required><?php xl('Subscriber Address','e'); ?> </span></td>
628 <td class=required>:</td>
629 <td><input type=entry size=20 name=i<?php echo $i?>subscriber_street value="<?php echo $result3{"subscriber_street"}?>" onchange="capitalizeMe(this);" /></td>
631 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('State','e') : xl('Locality','e') ?>: </span></td>
632 <td>
633 <?php
634 // Modified 7/2009 by BM to incorporate data types
635 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']);
637 </td>
638 </tr>
639 <tr>
640 <td class=leftborder><span class=required><?php xl('City','e'); ?></span></td>
641 <td class=required>:</td>
642 <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>
643 <?php
644 // Modified 7/2009 by BM to incorporate data types
645 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']);
647 </td>
648 </tr>
649 <tr>
650 <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>
652 <td colspan=2>
653 </td><td></td>
654 </tr>
655 <tr>
656 <td><span class=bold><?php xl('Subscriber Phone','e'); ?></span></td>
657 <td class=required>:</td>
658 <td><input type='text' size='20' name='i<?php echo $i?>subscriber_phone' value='<?php echo $result3["subscriber_phone"] ?>' onkeyup='phonekeyup(this,mypcc)' /></td>
659 <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>
660 <td colspan=2>
661 </td><td></td><td></td>
662 </tr>
663 <tr>
664 <td colspan=0><span class='required'><?php xl('Accept Assignment','e'); ?></span></td>
665 <td class=required>:</td>
666 <td colspan=2>
667 <select name=i<?php echo $i?>accept_assignment>
668 <option value="TRUE" <?php if (strtoupper($result3{"accept_assignment"}) == "TRUE") echo "selected"?>><?php xl('YES','e'); ?></option>
669 <option value="FALSE" <?php if (strtoupper($result3{"accept_assignment"}) == "FALSE") echo "selected"?>><?php xl('NO','e'); ?></option>
670 </select>
671 </td>
672 <td></td><td></td>
673 <td colspan=2>
674 </td><td></td>
675 </tr>
676 <tr>
677 <td><span class='bold'><?php xl('Secondary Medicare Type','e'); ?></span></td>
678 <td class='bold'>:</td>
679 <td colspan='6'>
680 <select name=i<?php echo $i?>policy_type>
681 <?php
682 foreach ($policy_types AS $key => $value) {
683 echo " <option value ='$key'";
684 if ($key == $result3['policy_type']) echo " selected";
685 echo ">" . htmlspecialchars($value) . "</option>\n";
688 </select>
689 </td>
690 </tr>
691 </table>
693 </td>
694 </tr>
695 </table>
697 </div>
699 <?php } //end insurer for loop ?>
701 </div>
702 </div>
704 <?php } // end of "if not simplified_demographics" ?>
705 </div></div>
707 </form>
709 <br>
711 <script language="JavaScript">
713 // fix inconsistently formatted phone numbers from the database
714 var f = document.forms[0];
715 if (f.form_phone_contact) phonekeyup(f.form_phone_contact,mypcc);
716 if (f.form_phone_home ) phonekeyup(f.form_phone_home ,mypcc);
717 if (f.form_phone_biz ) phonekeyup(f.form_phone_biz ,mypcc);
718 if (f.form_phone_cell ) phonekeyup(f.form_phone_cell ,mypcc);
720 <?php if (! $GLOBALS['simplified_demographics']) { ?>
721 phonekeyup(f.i1subscriber_phone,mypcc);
722 phonekeyup(f.i2subscriber_phone,mypcc);
723 phonekeyup(f.i3subscriber_phone,mypcc);
724 <?php } ?>
726 <?php if ($GLOBALS['concurrent_layout'] && $set_pid) { ?>
727 parent.left_nav.setPatient(<?php echo "'" . addslashes($result['fname']) . " " . addslashes($result['lname']) . "',$pid,'" . addslashes($result['pubpid']) . "','', ' " . xl('DOB') . ": " . oeFormatShortDate($result['DOB_YMD']) . " " . xl('Age') . ": " . getPatientAgeDisplay($result['DOB_YMD']) . "'"; ?>);
728 parent.left_nav.setRadio(window.name, 'dem');
729 <?php } ?>
731 <?php echo $date_init; ?>
732 <?php if (! $GLOBALS['simplified_demographics']) { for ($i=1; $i<=3; $i++): ?>
733 Calendar.setup({inputField:"i<?php echo $i?>effective_date", ifFormat:"%Y-%m-%d", button:"img_i<?php echo $i?>effective_date"});
734 Calendar.setup({inputField:"i<?php echo $i?>subscriber_DOB", ifFormat:"%Y-%m-%d", button:"img_i<?php echo $i?>dob_date"});
735 <?php endfor; } ?>
736 </script>
738 <!-- include support for the list-add selectbox feature -->
739 <?php include $GLOBALS['fileroot']."/library/options_listadd.inc"; ?>
741 </body>
743 </html>