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!
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"]) {
13 include_once("$srcdir/patient.inc");
15 $result = getPatientData($pid);
16 $result2 = getEmployerData($pid);
18 // Check authorization.
19 $thisauth = acl_check('patients', 'demo');
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.");
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();
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
);
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
;
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();
107 str
=document
.demographics_form
.monthly_income
.value
;
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);
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
130 for (; i
< theopts
.length
; ++i
) {
131 if (theopts
[i
].value
== ins_id
) {
132 theopts
[i
].selected
= true;
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(' ');
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);
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">
168 <a href
="patient_summary.php" target
=Main
>
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%'>
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
>
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);" />
195 <span
class='bold'><?php
echo ($GLOBALS['athletic_team']) ?
'OID ' : '' ?
><?php
xl('Number','e'); ?
>: </span
>
197 <td
><input type
='entry' size
='10' name
='pubpid' value
="<?php echo $result{"pubpid
"} ?>"></td
>
201 <td valign
='top'><span
class='required'><?php
xl('DOB','e'); ?
>: </span
></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' />
208 <td rowspan
="12"> 
;</td
>
209 <td
><span
class='bold'><?php
xl('Emergency Contact','e'); ?
>: </span
></td
>
210 <td rowspan
="12"> 
;</td
>
211 <td
><input type
='entry' size
='10' name
='contact_relationship'
212 value
="<?php echo $result{"contact_relationship
"}?>"
213 onchange
="capitalizeMe(this);" /></td
>
217 <td
><span
class=required
><?php
xl('Sex','e'); ?
>: </span
></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
>
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
>
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
>
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
>
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
>
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
>
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
>
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'); ?
>:
278 <td
><span
class=required
><?php
xl('Marital Status','e'); ?
>: </span
></td
>
280 <select name
=status tabindex
="14">
282 print "<!-- ".$result["status"]." -->\n";
283 foreach ($statii as $s) {
284 if ($s == "unassigned") {
285 echo "<option value=''";
287 echo "<option value='".$s."'";
290 if ($s == $result["status"])
293 echo ">".ucwords($s)."</option>\n";
299 <?php
if ($GLOBALS['weight_loss_clinic']) { ?
>
300 <td
class='bold'>Starting Weight
</td
>
302 <input name
="genericname1" size
='4' value
="<?php echo $result{"genericname1
"} ?>" />
304 <input name
="genericval1" size
='10' value
="<?php echo $result{"genericval1
"} ?>" />
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
>
316 <td
><span
class=required
><?php
xl('Provider','e'); ?
>: </span
></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
>
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"])
328 echo ">".ucwords($s['fname']." ".$s['lname'])."</option>\n";
334 <?php
if ($GLOBALS['weight_loss_clinic']) { ?
>
335 <td
class='bold'>Ending Weight
</td
>
337 <input name
="genericname2" size
='4' value
="<?php echo $result{"genericname2
"} ?>" />
339 <input name
="genericval2" size
='10' value
="<?php echo $result{"genericval2
"} ?>" />
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
>
351 <td
><span
class=bold
><?php
xl('Pharmacy','e'); ?
>: </span
></td
>
353 <select name
='pharmacy_id'>
354 <option value
='0'></option
>
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)) {
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";
376 <a href
="javascript:document.demographics_form.submit();" class='link_submit'>[<?php
xl('Save Patient Demographics','e'); ?
>]</a
>
382 <?php
if (! $GLOBALS['athletic_team']) { ?
>
386 <th colspan
='4' align
='left' class='bold'><?php
xl('HIPAA Choices','e'); ?
>:</th
>
389 <td
class='bold' width
='10%' nowrap
><?php
xl('Did you receive a copy of the HIPAA Notice?','e'); ?
> </td
>
391 <select name
= "hipaa_notice">
393 echo " <option>" .xl('NO'). "</option>\n";
394 $opt_sel = ($result['hipaa_notice'] == 'YES' ||
($GLOBALS['weight_loss_clinic'] && !$result['hipaa_notice']))
396 echo " <option$opt_sel>" .xl('YES'). "</option>\n";
400 <td
class='bold' width
='10%' nowrap
><?php
xl('Allow Voice Msg','e'); ?
>:</td
>
402 <select name
="hipaa_voice">
404 echo " <option>" .xl('NO'). "</option>\n";
405 $opt_sel = ($result['hipaa_voice'] == 'YES' ||
($GLOBALS['weight_loss_clinic'] && !$result['hipaa_voice']))
407 echo " <option$opt_sel>" .xl('YES'). "</option>\n";
413 <td
class='bold' width
='10%' nowrap
><?php
xl('Allow Mail','e'); ?
>:</td
>
415 <select name
="hipaa_mail">
417 echo " <option>" .xl('NO'). "</option>\n";
418 $opt_sel = ($result['hipaa_mail'] == 'YES' ||
($GLOBALS['weight_loss_clinic'] && !$result['hipaa_mail']))
420 echo " <option$opt_sel>" .xl('YES'). "</option>\n";
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
>
430 <a href
="javascript:document.demographics_form.submit();" class=link_submit
>[<?php
xl('Save Patient Demographics','e'); ?
>]</a
>
438 <table width
='100%'<?php
if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?
>>
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
"}?>">
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
>
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
>
455 <td colspan
='2' class='bold' style
='font-weight:normal'>(<?php
xl('if unemployed enter Student, PT Student, or leave blank','e'); ?
>)</td
>
457 <?php
if ($GLOBALS['athletic_team']) { ?
>
459 <td colspan
='2' class='bold' style
='font-weight:normal'> 
;</td
>
462 <td
><span
class='bold'><?php
xl('Squad','e'); ?
>: </span
></td
>
464 <select name
='squad'>
465 <option value
=''> 
;</option
>
467 $squads = acl_get_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";
484 <?php
if (! $GLOBALS['simplified_demographics']) { ?
>
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
>
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
>
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
>
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
>
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
>
519 <a href
="javascript:document.demographics_form.submit();" class=link_submit
>[<?php
xl('Save Patient Demographics','e'); ?
>]</a
><hr
></td
>
522 <?php
if (! $GLOBALS['athletic_team'] && ! $GLOBALS['simplified_demographics']) { ?
>
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);">
529 foreach ($langi as $s) {
530 if ($s == "unassigned") {
531 echo "<option value=''";
533 echo "<option value='".$s."'";
535 if ($s == strtolower($result["language"]))
537 echo ">".ucwords($s)."</option>\n";
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);">
545 foreach ($ethnoraciali as $s) {
546 if ($s == "unassigned") {
547 echo "<option value=''";
549 echo "<option value='".$s."'";
551 if ($s == strtolower($result["ethnoracial"]))
553 echo ">".ucwords($s)."</option>\n";
558 <input type
=entry size
=30 name
=ethnoracial value
="<?php echo ucfirst($result{"ethnoracial
"});?>"><br
>
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
>
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
>
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
>
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
>
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
>
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
>
587 <a href
="javascript:document.demographics_form.submit();" class=link_submit
>[<?php
xl('Save Patient Demographics','e'); ?
>]</a
>
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];
611 <td colspan
="5"><span
class='required'><?php
echo $insurance_headings[$i -1]?
></span
></td
>
615 <select name
="i<?php echo $i?>provider">
616 <option value
=""><?php
xl('Unassigned','e'); ?
></option
>
618 foreach ($insurancei as $iid => $iname) {
619 echo "<option value='" . $iid . "'";
620 if (strtolower($iid) == strtolower($result3{"provider"}))
622 echo ">" . $iname . "</option>\n";
625 </select
> 
;<a href
='' onclick
='return ins_search(<?php echo $i?>)'><?php
xl('Search/Add Insurer','e'); ?
></a
>
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
>
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
>
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
>
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
>
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
>
655 <tr
<?php
if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?
>>
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
>
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
>
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);" />
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?>();">
697 foreach ($relats as $s) {
698 if ($s == "unassigned") {
699 echo "<option value=''";
701 echo "<option value='".$s."'";
703 if ($s == strtolower($result3['subscriber_relationship']))
705 echo ">".ucfirst($s)."</option>\n";
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
"}?> "> 
;
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
>
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)' />
740 <span
class=bold
><?php
xl('CoPay','e'); ?
>: <input type
=text size
="6" name
=i
<?php
echo $i?
>copay value
="<?php echo $result3{"copay
"}?>">
744 <a href
="javascript:document.demographics_form.submit();" class=link_submit
>[<?php
xl('Save Patient Demographics','e'); ?
>]</a
>
748 } //end insurer for loop
749 } // end of "if not simplified_demographics"
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
);
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');