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