added a date widget to the Effective Date in the insurance form
[openemr.git] / interface / patient_file / summary / demographics_full.php
blobc49b9ab81633c94889d2ea661212558fdad047f6
1 <?php
2 include_once("../../globals.php");
3 include_once("$srcdir/acl.inc");
4 include_once("$srcdir/options.inc.php");
6 // Session pid must be right or bad things can happen when demographics are saved!
7 //
8 include_once("$srcdir/pid.inc");
9 $set_pid = $_GET["set_pid"] ? $_GET["set_pid"] : $_GET["pid"];
10 if ($set_pid && $set_pid != $_SESSION["pid"]) {
11 setpid($set_pid);
14 include_once("$srcdir/patient.inc");
16 $result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD");
17 $result2 = getEmployerData($pid);
19 // Check authorization.
20 $thisauth = acl_check('patients', 'demo');
21 if ($pid) {
22 if ($thisauth != 'write')
23 die(xl('Updating demographics is not authorized.'));
24 if ($result['squad'] && ! acl_check('squads', $result['squad']))
25 die(xl('You are not authorized to access this squad.'));
26 } else {
27 if ($thisauth != 'write' && $thisauth != 'addonly')
28 die(xl('Adding demographics is not authorized.'));
31 $CPR = 4; // cells per row
33 // $statii = array('married','single','divorced','widowed','separated','domestic partner');
34 // $langi = getLanguages();
35 // $ethnoraciali = getEthnoRacials();
36 // $provideri = getProviderInfo();
38 $insurancei = getInsuranceProviders();
40 $fres = sqlStatement("SELECT * FROM layout_options " .
41 "WHERE form_id = 'DEM' AND uor > 0 " .
42 "ORDER BY group_name, seq");
44 <html>
45 <head>
46 <?php html_header_show();?>
48 <link rel="stylesheet" href="<?php echo $css_header; ?>" type="text/css">
50 <style>
51 body, td, input, select, textarea {
52 font-family: Arial, Helvetica, sans-serif;
53 font-size: 10pt;
56 body {
57 padding: 5pt 5pt 5pt 5pt;
60 div.section {
61 border: solid;
62 border-width: 1px;
63 border-color: #0000ff;
64 margin: 0 0 0 10pt;
65 padding: 5pt;
68 </style>
70 <style type="text/css">@import url(../../../library/dynarch_calendar.css);</style>
72 <script type="text/javascript" src="../../../library/dialog.js"></script>
73 <script type="text/javascript" src="../../../library/textformat.js"></script>
74 <script type="text/javascript" src="../../../library/dynarch_calendar.js"></script>
75 <script type="text/javascript" src="../../../library/dynarch_calendar_en.js"></script>
76 <script type="text/javascript" src="../../../library/dynarch_calendar_setup.js"></script>
78 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.js"></script>
80 <SCRIPT LANGUAGE="JavaScript"><!--
82 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
84 //code used from http://tech.irt.org/articles/js037/
85 function replace(string,text,by) {
86 // Replaces text with by in string
87 var strLength = string.length, txtLength = text.length;
88 if ((strLength == 0) || (txtLength == 0)) return string;
90 var i = string.indexOf(text);
91 if ((!i) && (text != string.substring(0,txtLength))) return string;
92 if (i == -1) return string;
94 var newstr = string.substring(0,i) + by;
96 if (i+txtLength < strLength)
97 newstr += replace(string.substring(i+txtLength,strLength),text,by);
99 return newstr;
102 function upperFirst(string,text) {
103 return replace(string,text,text.charAt(0).toUpperCase() + text.substring(1,text.length));
106 <?php for ($i=1;$i<=3;$i++) { ?>
107 function auto_populate_employer_address<?php echo $i ?>(){
108 var f = document.demographics_form;
109 if (f.form_i<?php echo $i?>subscriber_relationship.options[f.form_i<?php echo $i?>subscriber_relationship.selectedIndex].value == "self") {
110 f.i<?php echo $i?>subscriber_fname.value=f.form_fname.value;
111 f.i<?php echo $i?>subscriber_mname.value=f.form_mname.value;
112 f.i<?php echo $i?>subscriber_lname.value=f.form_lname.value;
113 f.i<?php echo $i?>subscriber_street.value=f.form_street.value;
114 f.i<?php echo $i?>subscriber_city.value=f.form_city.value;
115 f.form_i<?php echo $i?>subscriber_state.value=f.form_state.value;
116 f.i<?php echo $i?>subscriber_postal_code.value=f.form_postal_code.value;
117 if (f.form_country_code)
118 f.form_i<?php echo $i?>subscriber_country.value=f.form_country_code.value;
119 f.i<?php echo $i?>subscriber_phone.value=f.form_phone_home.value;
120 f.i<?php echo $i?>subscriber_DOB.value=f.form_DOB.value;
121 f.i<?php echo $i?>subscriber_ss.value=f.form_ss.value;
122 f.form_i<?php echo $i?>subscriber_sex.value = f.form_sex.value;
123 f.i<?php echo $i?>subscriber_employer.value=f.form_em_name.value;
124 f.i<?php echo $i?>subscriber_employer_street.value=f.form_em_street.value;
125 f.i<?php echo $i?>subscriber_employer_city.value=f.form_em_city.value;
126 f.form_i<?php echo $i?>subscriber_employer_state.value=f.form_em_state.value;
127 f.i<?php echo $i?>subscriber_employer_postal_code.value=f.form_em_postal_code.value;
128 if (f.form_em_country)
129 f.form_i<?php echo $i?>subscriber_employer_country.value=f.form_em_country.value;
133 <?php } ?>
135 function popUp(URL) {
136 day = new Date();
137 id = day.getTime();
138 top.restoreSession();
139 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');");
142 function checkNum () {
143 var re= new RegExp();
144 re = /^\d*\.?\d*$/;
145 str=document.demographics_form.monthly_income.value;
146 if(re.exec(str))
148 }else{
149 alert("<?php xl('Please enter a monetary amount using only numbers and a decimal point.','e'); ?>");
153 // Indicates which insurance slot is being updated.
154 var insurance_index = 0;
156 // The OnClick handler for searching/adding the insurance company.
157 function ins_search(ins) {
158 insurance_index = ins;
159 dlgopen('../../practice/ins_search.php', '_blank', 550, 400);
160 return false;
163 // The ins_search.php window calls this to set the selected insurance.
164 function set_insurance(ins_id, ins_name) {
165 var thesel = document.forms[0]['i' + insurance_index + 'provider'];
166 var theopts = thesel.options; // the array of Option objects
167 var i = 0;
168 for (; i < theopts.length; ++i) {
169 if (theopts[i].value == ins_id) {
170 theopts[i].selected = true;
171 return;
174 // no matching option was found so create one, append it to the
175 // end of the list, and select it.
176 theopts[i] = new Option(ins_name, ins_id, false, true);
179 // This capitalizes the first letter of each word in the passed input
180 // element. It also strips out extraneous spaces.
181 function capitalizeMe(elem) {
182 var a = elem.value.split(' ');
183 var s = '';
184 for(var i = 0; i < a.length; ++i) {
185 if (a[i].length > 0) {
186 if (s.length > 0) s += ' ';
187 s += a[i].charAt(0).toUpperCase() + a[i].substring(1);
190 elem.value = s;
193 function divclick(cb, divid) {
194 var divstyle = document.getElementById(divid).style;
195 if (cb.checked) {
196 divstyle.display = 'block';
197 } else {
198 divstyle.display = 'none';
200 return true;
203 // Compute the length of a string without leading and trailing spaces.
204 function trimlen(s) {
205 var i = 0;
206 var j = s.length - 1;
207 for (; i <= j && s.charAt(i) == ' '; ++i);
208 for (; i <= j && s.charAt(j) == ' '; --j);
209 if (i > j) return 0;
210 return j + 1 - i;
213 function validate(f) {
214 <?php generate_layout_validation('DEM'); ?>
216 // Some insurance validation.
217 for (var i = 1; i <= 3; ++i) {
218 subprov = 'i' + i + 'provider';
219 if (!f[subprov] || f[subprov].selectedIndex <= 0) continue;
220 var subpfx = 'i' + i + 'subscriber_';
221 var subrelat = f['form_' + subpfx + 'relationship'];
222 var samename =
223 f[subpfx + 'fname'].value == f.form_fname.value &&
224 f[subpfx + 'mname'].value == f.form_mname.value &&
225 f[subpfx + 'lname'].value == f.form_lname.value;
226 var samess = f[subpfx + 'ss'].value == f.form_ss.value;
227 if (subrelat.options[subrelat.selectedIndex].value == "self") {
228 if (!samename) {
229 if (!confirm("<?php xl('Subscriber relationship is self but name is different! Is this really OK?','e'); ?>"))
230 return false;
232 if (!samess) {
233 alert("<?php xl('Subscriber relationship is self but SS number is different!','e'); ?>");
234 return false;
236 } // end self
237 else {
238 if (samename) {
239 if (!confirm("<?php xl('Subscriber relationship is not self but name is the same! Is this really OK?','e'); ?>"))
240 return false;
242 if (samess) {
243 alert("<?php xl('Subscriber relationship is not self but SS number is the same!','e'); ?>");
244 return false;
246 } // end not self
247 } // end for
249 return true;
252 function submitme() {
253 var f = document.forms[0];
254 if (validate(f)) {
255 top.restoreSession();
256 f.submit();
260 // Onkeyup handler for policy number. Allows only A-Z and 0-9.
261 function policykeyup(e) {
262 var v = e.value.toUpperCase();
263 for (var i = 0; i < v.length; ++i) {
264 var c = v.charAt(i);
265 if (c >= '0' && c <= '9') continue;
266 if (c >= 'A' && c <= 'Z') continue;
267 v = v.substring(0, i) + v.substring(i + i);
268 --i;
270 e.value = v;
271 return;
274 // Added 06/2009 by BM to make compatible with list_options table and functions - using jquery
275 $(document).ready(function() {
277 <?php for ($i=1;$i<=3;$i++) { ?>
278 $("#form_i<?php echo $i?>subscriber_relationship").change(function() { auto_populate_employer_address<?php echo $i?>(); });
279 <?php } ?>
281 });
283 //-->
285 </script>
286 </head>
288 <body class="body_top">
290 <form action='demographics_save.php' name='demographics_form' method='post' onsubmit='return validate(this)'>
291 <input type='hidden' name='mode' value='save' />
292 <input type='hidden' name='db_id' value="<?php echo $result['id']?>" />
294 <?php if ($GLOBALS['concurrent_layout']) { ?>
295 <a href="demographics.php" onclick="top.restoreSession()">
296 <?php } else { ?>
297 <a href="patient_summary.php" target="Main" onclick="top.restoreSession()">
298 <?php } ?>
299 <font class=title><?php xl('Demographics','e'); ?></font>
300 <font class=back><?php echo $tback;?></font></a>
302 <?php
304 function end_cell() {
305 global $item_count, $cell_count;
306 if ($item_count > 0) {
307 echo "</td>";
308 $item_count = 0;
312 function end_row() {
313 global $cell_count, $CPR;
314 end_cell();
315 if ($cell_count > 0) {
316 for (; $cell_count < $CPR; ++$cell_count) echo "<td></td>";
317 echo "</tr>\n";
318 $cell_count = 0;
322 function end_group() {
323 global $last_group;
324 if (strlen($last_group) > 0) {
325 end_row();
326 echo " </table>\n";
327 echo "</div>\n";
331 $last_group = '';
332 $cell_count = 0;
333 $item_count = 0;
334 $display_style = 'block';
336 $group_seq=0; // this gives the DIV blocks unique IDs
338 while ($frow = sqlFetchArray($fres)) {
339 $this_group = $frow['group_name'];
340 $titlecols = $frow['titlecols'];
341 $datacols = $frow['datacols'];
342 $data_type = $frow['data_type'];
343 $field_id = $frow['field_id'];
344 $list_id = $frow['list_id'];
345 $currvalue = '';
347 if (strpos($field_id, 'em_') === 0) {
348 $tmp = substr($field_id, 3);
349 if (isset($result2[$tmp])) $currvalue = $result2[$tmp];
351 else {
352 if (isset($result[$field_id])) $currvalue = $result[$field_id];
355 // Handle a data category (group) change.
356 if (strcmp($this_group, $last_group) != 0) {
357 end_group();
358 //$group_seq = substr($this_group, 0, 1); -- replaced by a simple counter
359 $group_seq++; // ID for DIV tags
360 $group_name = substr($this_group, 1);
361 $last_group = $this_group;
362 echo "<br /><span class='bold'><input type='checkbox' name='form_cb_$group_seq' value='1' " .
363 "onclick='return divclick(this,\"div_$group_seq\");'";
364 if ($display_style == 'block') echo " checked";
366 // Modified 6-09 by BM - Translate if applicable
367 echo " /><b>" . xl_layout_label($group_name) . "</b></span>\n";
369 echo "<div id='div_$group_seq' class='section' style='display:$display_style;'>\n";
370 echo " <table border='0' cellpadding='0'>\n";
371 $display_style = 'none';
374 // Handle starting of a new row.
375 if (($titlecols > 0 && $cell_count >= $CPR) || $cell_count == 0) {
376 end_row();
377 echo " <tr>";
380 if ($item_count == 0 && $titlecols == 0) $titlecols = 1;
382 // Handle starting of a new label cell.
383 if ($titlecols > 0) {
384 end_cell();
385 echo "<td colspan='$titlecols'";
386 echo ($frow['uor'] == 2) ? " class='required'" : " class='bold'";
387 if ($cell_count == 2) echo " style='padding-left:10pt'";
388 echo ">";
389 $cell_count += $titlecols;
391 ++$item_count;
393 echo "<b>";
395 // Modified 6-09 by BM - Translate if applicable
396 if ($frow['title']) echo (xl_layout_label($frow['title']).":"); else echo "&nbsp;";
398 echo "</b>";
400 // Handle starting of a new data cell.
401 if ($datacols > 0) {
402 end_cell();
403 echo "<td colspan='$datacols' class='text'";
404 if ($cell_count > 0) echo " style='padding-left:5pt'";
405 echo ">";
406 $cell_count += $datacols;
409 ++$item_count;
410 generate_form_field($frow, $currvalue);
413 end_group();
415 if (! $GLOBALS['simplified_demographics']) {
416 $insurance_headings = array(xl("Primary Insurance Provider"), xl("Secondary Insurance Provider"), xl("Tertiary Insurance provider"));
417 $insurance_info = array();
418 $insurance_info[1] = getInsuranceData($pid,"primary");
419 $insurance_info[2] = getInsuranceData($pid,"secondary");
420 $insurance_info[3] = getInsuranceData($pid,"tertiary");
422 echo "<br /><span class='bold'><input type='checkbox' name='form_cb_ins' value='1' " .
423 "onclick='return divclick(this,\"div_ins\");'";
424 if ($display_style == 'block') echo " checked";
425 echo " /><b>" . xl('Insurance') . "</b></span>\n";
426 echo "<div id='div_ins' class='section' style='display:$display_style;'>\n";
428 for($i=1;$i<=3;$i++) {
429 $result3 = $insurance_info[$i];
431 <table border="0">
432 <tr>
433 <td valign='top' colspan='2'>
434 <span class='required'><?php echo $insurance_headings[$i -1].":"?></span>
435 <select name="i<?php echo $i?>provider">
436 <option value=""><?php xl('Unassigned','e'); ?></option>
437 <?php
438 foreach ($insurancei as $iid => $iname) {
439 echo "<option value='" . $iid . "'";
440 if (strtolower($iid) == strtolower($result3{"provider"}))
441 echo " selected";
442 echo ">" . $iname . "</option>\n";
445 </select>&nbsp;<a href='' onclick='return ins_search(<?php echo $i?>)'>
446 <?php xl('Search/Add Insurer','e'); ?></a>
447 </td>
448 </tr>
450 <tr>
451 <td valign=top>
452 <table border="0">
454 <tr>
455 <td>
456 <span class='required'><?php xl('Plan Name','e'); ?>: </span>
457 </td>
458 <td>
459 <input type='entry' size='20' name='i<?php echo $i?>plan_name' value="<?php echo $result3{"plan_name"} ?>"
460 onchange="capitalizeMe(this);" />&nbsp;&nbsp;
461 </td>
462 </tr>
464 <tr>
465 <td>
466 <span class='required'><?php xl('Effective Date','e'); ?>: </span>
467 </td>
468 <td>
469 <input type='entry' size='11' id='i<?php echo $i ?>effective_date' name='i<?php echo $i ?>effective_date'
470 value='<?php echo $result3['date'] ?>'
471 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)'
472 title='yyyy-mm-dd' />
473 <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'); ?>'>
474 </td>
475 </tr>
477 <tr>
478 <td><span class=required><?php xl('Policy Number','e'); ?>: </span></td>
479 <td><input type='entry' size='16' name='i<?php echo $i?>policy_number' value="<?php echo $result3{"policy_number"}?>"
480 onkeyup='policykeyup(this)'></td>
481 </tr>
483 <tr>
484 <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>
485 </tr>
487 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
488 <td class='required'><?php xl('Subscriber Employer (SE)','e'); ?><br><span style='font-weight:normal'>
489 (<?php xl('if unemployed enter Student','e'); ?>,<br><?php xl('PT Student, or leave blank','e'); ?>): </span></td>
490 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer
491 value="<?php echo $result3{"subscriber_employer"}?>"
492 onchange="capitalizeMe(this);" /></td>
493 </tr>
495 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
496 <td><span class=required><?php xl('SE Address','e'); ?>: </span></td>
497 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer_street
498 value="<?php echo $result3{"subscriber_employer_street"}?>"
499 onchange="capitalizeMe(this);" /></td>
500 </tr>
502 <tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
503 <td colspan="2">
504 <table>
505 <tr>
506 <td><span class=required><?php xl('SE City','e'); ?>: </span></td>
507 <td><input type=entry size=15 name=i<?php echo $i?>subscriber_employer_city
508 value="<?php echo $result3{"subscriber_employer_city"}?>"
509 onchange="capitalizeMe(this);" /></td>
510 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('SE State','e') : xl('SE Locality','e') ?>: </span></td>
511 <td>
512 <?php
513 // Modified 7/2009 by BM to incorporate data types
514 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']);
516 </td>
517 </tr>
518 <tr>
519 <td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('SE Zip Code','e') : xl('SE Postal Code','e') ?>: </span></td>
520 <td><input type=entry size=10 name=i<?php echo $i?>subscriber_employer_postal_code value="<?php echo $result3{"subscriber_employer_postal_code"}?>"></td>
521 <td><span class=required><?php xl('SE Country','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['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']);
527 </td>
528 </tr>
529 </table>
530 </td>
531 </tr>
533 </table>
534 </td>
536 <td valign=top>
537 <span class=required><?php xl('Subscriber','e'); ?>: </span>
538 <input type=entry size=10 name=i<?php echo $i?>subscriber_fname
539 value="<?php echo $result3{"subscriber_fname"}?>"
540 onchange="capitalizeMe(this);" />
541 <input type=entry size=3 name=i<?php echo $i?>subscriber_mname
542 value="<?php echo $result3{"subscriber_mname"}?>"
543 onchange="capitalizeMe(this);" />
544 <input type=entry size=10 name=i<?php echo $i?>subscriber_lname
545 value="<?php echo $result3{"subscriber_lname"}?>"
546 onchange="capitalizeMe(this);" />
547 <br>
548 <span class=required><?php xl('Relationship','e'); ?>: </span>
549 <?php
550 // Modified 6/2009 by BM to use list_options and function
551 generate_form_field(array('data_type'=>1,'field_id'=>('i'.$i.'subscriber_relationship'),'list_id'=>'sub_relation','empty_title'=>''), $result3['subscriber_relationship']);
553 <a href="javascript:popUp('browse.php?browsenum=<?php echo $i?>')" class=text>(<?php xl('Browse','e'); ?>)</a><br />
554 <span class=bold><?php xl('D.O.B.','e'); ?>: </span>
555 <input type='entry' size='11' id='i<?php echo $i?>subscriber_DOB' name='i<?php echo $i?>subscriber_DOB'
556 value='<?php echo $result3['subscriber_DOB'] ?>'
557 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)'
558 title='yyyy-mm-dd' />
560 <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22'
561 id='img_i<?php echo $i; ?>dob_date' border='0' alt='[?]' style='cursor:pointer'
562 title='<?php xl('Click here to choose a date','e'); ?>'>
564 <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;
565 <span class=bold><?php xl('Sex','e'); ?>: </span>
566 <?php
567 // Modified 6/2009 by BM to use list_options and function
568 generate_form_field(array('data_type'=>1,'field_id'=>('i'.$i.'subscriber_sex'),'list_id'=>'sex'), $result3['subscriber_sex']);
570 <br>
571 <span class=required><?php xl('Subscriber Address','e'); ?>: </span>
572 <input type=entry size=25 name=i<?php echo $i?>subscriber_street
573 value="<?php echo $result3{"subscriber_street"}?>"
574 onchange="capitalizeMe(this);" /><br>
575 <span class=required><?php xl('City','e'); ?>: </span>
576 <input type=entry size=15 name=i<?php echo $i?>subscriber_city
577 value="<?php echo $result3{"subscriber_city"}?>"
578 onchange="capitalizeMe(this);" />
579 <span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('State','e') : xl('Locality','e') ?>: </span>
580 <?php
581 // Modified 7/2009 by BM to incorporate data types
582 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']);
584 <br />
585 <span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('Zip Code','e') : xl('Postal Code','e') ?>: </span><input type=entry size=10 name=i<?php echo $i?>subscriber_postal_code value="<?php echo $result3{"subscriber_postal_code"}?>">
586 <span class='required'<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
587 <?php xl('Country','e'); ?>: </span>
588 <?php
589 // Modified 7/2009 by BM to incorporate data types
590 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']);
592 <br />
593 <span class=bold><?php xl('Subscriber Phone','e'); ?>:
594 <input type='text' size='20' name='i<?php echo $i?>subscriber_phone' value='<?php echo $result3["subscriber_phone"] ?>' onkeyup='phonekeyup(this,mypcc)' />
595 </span><br />
596 <span class=bold><?php xl('CoPay','e'); ?>: <input type=text size="6" name=i<?php echo $i?>copay value="<?php echo $result3{"copay"}?>">
597 </span><br />
598 <span class='required'><?php xl('Accept Assignment','e'); ?>: </span>
599 <select name=i<?php echo $i?>accept_assignment>
600 <option value="TRUE" <?php if (strtoupper($result3{"accept_assignment"}) == "TRUE") echo "selected"?>><?php xl('YES','e'); ?></option>
601 <option value="FALSE" <?php if (strtoupper($result3{"accept_assignment"}) == "FALSE") echo "selected"?>><?php xl('NO','e'); ?></option>
602 </select>
603 </td>
604 </tr>
605 </table>
607 <?php
608 if ($i < 3) echo "<hr />\n";
609 } //end insurer for loop
610 echo "</div>\n";
611 } // end of "if not simplified_demographics"
614 <center><br />
615 <a href="javascript:submitme();"
616 class='link_submit'>[<?php xl('Save Patient Demographics','e'); ?>]</a>
617 </center>
619 </form>
621 <br>
623 <script language="JavaScript">
625 // fix inconsistently formatted phone numbers from the database
626 var f = document.forms[0];
627 if (f.form_phone_contact) phonekeyup(f.form_phone_contact,mypcc);
628 if (f.form_phone_home ) phonekeyup(f.form_phone_home ,mypcc);
629 if (f.form_phone_biz ) phonekeyup(f.form_phone_biz ,mypcc);
630 if (f.form_phone_cell ) phonekeyup(f.form_phone_cell ,mypcc);
632 <?php if (! $GLOBALS['simplified_demographics']) { ?>
633 phonekeyup(f.i1subscriber_phone,mypcc);
634 phonekeyup(f.i2subscriber_phone,mypcc);
635 phonekeyup(f.i3subscriber_phone,mypcc);
636 <?php } ?>
638 <?php if ($GLOBALS['concurrent_layout'] && $set_pid) { ?>
639 parent.left_nav.setPatient(<?php echo "'" . addslashes($result['fname']) . " " . addslashes($result['lname']) . "',$pid,'" . addslashes($result['pubpid']) . "','', ' ".xl('DOB').": ".$result['DOB_YMD']." ".xl('Age').": ".getPatientAge($result['DOB_YMD'])."'"; ?>);
640 parent.left_nav.setRadio(window.name, 'dem');
641 <?php } ?>
643 <?php echo $date_init; ?>
644 <?php if (! $GLOBALS['simplified_demographics']) { for ($i=1; $i<=3; $i++): ?>
645 Calendar.setup({inputField:"i<?php echo $i?>effective_date", ifFormat:"%Y-%m-%d", button:"img_i<?php echo $i?>effective_date"});
646 Calendar.setup({inputField:"i<?php echo $i?>subscriber_DOB", ifFormat:"%Y-%m-%d", button:"img_i<?php echo $i?>dob_date"});
647 <?php endfor; } ?>
648 </script>
650 <!-- include support for the list-add selectbox feature -->
651 <?php include $GLOBALS['fileroot']."/library/options_listadd.inc"; ?>
653 </body>
655 </html>