2 include_once("../../globals.php");
4 // Session pid must be right or bad things can happen when demographics are saved!
6 include_once("$srcdir/pid.inc");
7 if ($_GET["set_pid"] && $_GET["set_pid"] != $_SESSION["pid"]) {
8 setpid($_GET["set_pid"]);
10 else if ($_GET["pid"] && $_GET["pid"] != $_SESSION["pid"]) {
14 include_once("$srcdir/patient.inc");
16 $relats = array('','self','spouse','child','other');
17 $statii = array('married','single','divorced','widowed','separated','domestic partner');
18 //$langi = array('english','spanish','french','tagalog','vietnamese');
20 $langi = getLanguages();
21 $ethnoraciali = getEthnoRacials();
22 $provideri = getProviderInfo();
23 $insurancei = getInsuranceProviders();
30 <link rel
=stylesheet href
="<?echo $css_header;?>" type
="text/css">
31 <SCRIPT LANGUAGE
="JavaScript"><!--
32 function update_phone_biz() {
33 document
.demographics_form
.phone_biz
.value
= '('+document
.demographics_form
.phone_biz_area
.value+
') '+document
.demographics_form
.phone_biz_first
.value+
'-'+document
.demographics_form
.phone_biz_last
.value
;
34 if (document
.demographics_form
.phone_biz
.value
== "() -"){
35 document
.demographics_form
.phone_biz
.value
= "";
39 function update_phone_cell() {
40 document
.demographics_form
.phone_cell
.value
= '('+document
.demographics_form
.phone_cell_area
.value+
') '+document
.demographics_form
.phone_cell_first
.value+
'-'+document
.demographics_form
.phone_cell_last
.value
;
41 if (document
.demographics_form
.phone_cell
.value
== "() -"){
42 document
.demographics_form
.phone_cell
.value
= "";
48 //code used from http://tech.irt.org/articles/js037/
49 function replace(string,text
,by
) {
50 // Replaces text with by in string
51 var strLength
= string.length
, txtLength
= text
.length
;
52 if ((strLength
== 0) ||
(txtLength
== 0)) return string;
54 var i
= string.indexOf(text
);
55 if ((!i
) && (text
!= string.substring(0,txtLength
))) return string;
56 if (i
== -1) return string;
58 var newstr
= string.substring(0,i
) + by
;
60 if (i+txtLength
< strLength
)
61 newstr +
= replace(string.substring(i+txtLength
,strLength
),text
,by
);
66 function upperFirst(string,text
) {
67 return replace(string,text
,text
.charAt(0).toUpperCase() + text
.substring(1,text
.length
));
71 function update_phone_contact() {
72 document
.demographics_form
.phone_contact
.value
= '('+document
.demographics_form
.phone_contact_area
.value+
') '+document
.demographics_form
.phone_contact_first
.value+
'-'+document
.demographics_form
.phone_contact_last
.value
;
73 if (document
.demographics_form
.phone_contact
.value
== "() -"){
74 document
.demographics_form
.phone_contact
.value
= "";
77 function update_phone_home() {
78 document
.demographics_form
.phone_home
.value
= '('+document
.demographics_form
.phone_home_area
.value+
') '+document
.demographics_form
.phone_home_first
.value+
'-'+document
.demographics_form
.phone_home_last
.value
;
79 if (document
.demographics_form
.phone_home
.value
== "() -"){
80 document
.demographics_form
.phone_home
.value
= "";
83 <?
for ($i=1;$i<=3;$i++
) { ?
>
84 function auto_populate_employer_address
<?
=$i?
>(){
85 //alert(document.demographics_form.i<?=$i?>subscriber_relationship.options[document.demographics_form.i<?=$i?>subscriber_relationship.selectedIndex].value);
86 if (document
.demographics_form
.i
<?
=$i?
>subscriber_relationship
.options
[document
.demographics_form
.i
<?
=$i?
>subscriber_relationship
.selectedIndex
].value
== "self") {
87 document
.demographics_form
.i
<?
=$i?
>subscriber_fname
.value
=document
.demographics_form
.fname
.value
;
88 document
.demographics_form
.i
<?
=$i?
>subscriber_mname
.value
=document
.demographics_form
.mname
.value
;
89 document
.demographics_form
.i
<?
=$i?
>subscriber_lname
.value
=document
.demographics_form
.lname
.value
;
90 document
.demographics_form
.i
<?
=$i?
>subscriber_street
.value
=document
.demographics_form
.street
.value
;
91 document
.demographics_form
.i
<?
=$i?
>subscriber_city
.value
=document
.demographics_form
.city
.value
;
92 document
.demographics_form
.i
<?
=$i?
>subscriber_state
.value
=document
.demographics_form
.state
.value
;
93 document
.demographics_form
.i
<?
=$i?
>subscriber_postal_code
.value
=document
.demographics_form
.postal_code
.value
;
94 document
.demographics_form
.i
<?
=$i?
>subscriber_country
.value
=document
.demographics_form
.country_code
.value
;
95 document
.demographics_form
.i
<?
=$i?
>subscriber_phone
.value
=document
.demographics_form
.phone_home
.value
;
96 document
.demographics_form
.i
<?
=$i?
>subscriber_phone_area
.value
=document
.demographics_form
.phone_home_area
.value
;
97 document
.demographics_form
.i
<?
=$i?
>subscriber_phone_first
.value
=document
.demographics_form
.phone_home_first
.value
;
98 document
.demographics_form
.i
<?
=$i?
>subscriber_phone_last
.value
=document
.demographics_form
.phone_home_last
.value
;
99 document
.demographics_form
.i
<?
=$i?
>subscriber_DOB
.value
=document
.demographics_form
.dob
.value
;
100 document
.demographics_form
.i
<?
=$i?
>subscriber_ss
.value
=document
.demographics_form
.ss
.value
;
101 document
.demographics_form
.i
<?
=$i?
>subscriber_sex
.selectedIndex
= document
.demographics_form
.sex
.selectedIndex
;
102 document
.demographics_form
.i
<?
=$i?
>subscriber_employer
.value
=document
.demographics_form
.ename
.value
;
103 document
.demographics_form
.i
<?
=$i?
>subscriber_employer_street
.value
=document
.demographics_form
.estreet
.value
;
104 document
.demographics_form
.i
<?
=$i?
>subscriber_employer_city
.value
=document
.demographics_form
.ecity
.value
;
105 document
.demographics_form
.i
<?
=$i?
>subscriber_employer_state
.value
=document
.demographics_form
.estate
.value
;
106 document
.demographics_form
.i
<?
=$i?
>subscriber_employer_postal_code
.value
=document
.demographics_form
.epostal_code
.value
;
107 document
.demographics_form
.i
<?
=$i?
>subscriber_employer_country
.value
=document
.demographics_form
.ecountry
.value
;
112 function update_i
<?
=$i?
>subscriber_phone() {
113 document
.demographics_form
.i
<?
=$i?
>subscriber_phone
.value
= '('+document
.demographics_form
.i
<?
=$i?
>subscriber_phone_area
.value+
') '+document
.demographics_form
.i
<?
=$i?
>subscriber_phone_first
.value+
'-'+document
.demographics_form
.i
<?
=$i?
>subscriber_phone_last
.value
;
114 if (document
.demographics_form
.i
<?
=$i?
>subscriber_phone
.value
== "() -"){
115 document
.demographics_form
.i
<?
=$i?
>subscriber_phone
.value
= "";
122 function popUp(URL
) {
125 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');");
128 function checkNum () {
129 var re
= new RegExp();
131 str
=document
.demographics_form
.monthly_income
.value
;
136 alert("Please enter a dollar amount using only numbers and a decimal point.");
142 <body
<?
echo $top_bg_line;?
> topmargin
=0 rightmargin
=0 leftmargin
=2 bottommargin
=0 marginwidth
=2 marginheight
=0>
144 $result = getPatientData($pid);
145 $result2 = getEmployerData($pid);
147 //extract formatting of phone number:
148 $pmatch_contact=array();
149 // preg_match("/^\((.*?)\)\s(.*?)\-(.*?)$/",$result{"phone_contact"},$pmatch_contact);
150 preg_match("/\D*(\d\d\d)\D*(\d\d\d)\D*(\d\d\d\d)\D*$/",$result{"phone_contact"},$pmatch_contact);
152 //extract formatting of phone number:
153 $pmatch_home=array();
154 // preg_match("/^\((.*?)\)\s(.*?)\-(.*?)$/",$result{"phone_home"},$pmatch_home);
155 preg_match("/\D*(\d\d\d)\D*(\d\d\d)\D*(\d\d\d\d)\D*$/",$result{"phone_home"},$pmatch_home);
157 //extract formatting of phone number:
159 // preg_match("/^\((.*?)\)\s(.*?)\-(.*?)$/",$result{"phone_biz"},$pmatch_biz);
160 preg_match("/\D*(\d\d\d)\D*(\d\d\d)\D*(\d\d\d\d)\D*$/",$result{"phone_biz"},$pmatch_biz);
162 //extract formatting of phone number:
163 $pmatch_cell=array();
164 // preg_match("/^\((.*?)\)\s(.*?)\-(.*?)$/",$result{"phone_cell"},$pmatch_cell);
165 preg_match("/\D*(\d\d\d)\D*(\d\d\d)\D*(\d\d\d\d)\D*$/",$result{"phone_cell"},$pmatch_cell);
169 <form action
="demographics_save.php" name
=demographics_form method
=post
>
170 <input type
=hidden name
=mode value
=save
>
171 <input type
=hidden name
=phone_contact value
="<?echo $result{"phone_contact
"}?>">
172 <input type
=hidden name
=phone_biz value
="<?echo $result{"phone_biz
"}?>">
173 <input type
=hidden name
=phone_cell value
="<?echo $result{"phone_cell
"}?>">
175 <a href
="patient_summary.php" target
=Main
><font
class=title
>Demographics
</font
><font
class=back
><?
echo $tback;?
></font
></a
>
177 <table border
="0" cellpadding
="0">
178 <tr
><td valign
="top">
179 <span
class=required
>Name
: </span
></td
>
181 <select name
=title tabindex
="1">
182 <option value
="<?echo $result{"title
"}?>"><?
echo $result{"title"}?
></option
>
183 <option value
="Mr.">Mr
.</option
>
184 <option value
="Mrs.">Mrs
.</option
>
185 <option value
="Ms.">Ms
.</option
>
186 <option value
="Dr.">Dr
.</option
>
188 <input tabindex
="2" type
=entry size
=15 name
=fname value
="<?echo $result{"fname
"}?>"> <input tabindex
="3" type
=entry size
=3 name
=mname value
="<?echo $result{"mname
"}?>"> <input tabindex
="4" type
=entry size
=15 name
=lname value
="<?echo $result{"lname
"}?>">
194 <span
class=required
>DOB
: </span
>
195 <td
><input tabindex
="5" type
=entry size
=11 name
=dob value
="
197 if (!empty($result['DOB_TS'])) {
198 echo $result['DOB_TS'];
204 "></td
><td rowspan
="12"> 
;</td
>
205 <td
><span
class=bold
>Patient Number
: </span
></td
><td rowspan
="12"> 
;</td
><td
><input type
=entry size
=10 name
=pubpid value
="<?echo $result{"pubpid
"}?>"></td
>
209 <span
class=required
>Sex
: </span
></td
><td
>
210 <select name
=sex tabindex
="6">
211 <option value
="Male" <?
if ($result{"sex"} == "Male") {echo "selected";};?
>>Male
</option
>
212 <option value
="Female" <?
if ($result{"sex"} == "Female") {echo "selected";};?
>>Female
</option
>
215 <td
><span
class=bold
>Emergency Contact
: </span
></td
><td
><input type
=entry size
=10 name
=contact_relationship value
="<?echo $result{"contact_relationship
"}?>"></td
>
219 <td
><span
class=bold
>S
.S
.: </span
></td
><td
><input tabindex
="7" type
=entry size
=11 name
=ss value
="<?echo $result{"ss
"}?>"></td
>
220 <td
><span
class=bold
>Emergency Phone
:</span
></td
><td
>(<input type
=entry size
=3 name
=phone_contact_area onblur
="javascript:update_phone_contact();" value
="<?echo $pmatch_contact[1]?>">) <input type
=entry size
=3 name
=phone_contact_first onblur
="javascript:update_phone_contact();" value
="<?echo $pmatch_contact[2]?>">-<input type
=entry size
=4 name
=phone_contact_last onblur
="javascript:update_phone_contact();" value
="<?echo $pmatch_contact[3]?>"></td
>
223 <td
><span
class=required
>Address
: </span
></td
><td
><input tabindex
="8" type
=entry size
=25 name
=street value
="<?echo $result{"street
"}?>"></td
>
224 <td
><span
class=bold
>Home Phone
: <input type
=hidden name
=phone_home value
="<?echo $result{"phone_home
"}?>"></span
></td
><td
>(<input type
=entry size
=3 name
=phone_home_area onblur
="javascript:update_phone_home();" value
="<?echo $pmatch_home[1]?>">) <input type
=entry size
=3 name
=phone_home_first onblur
="javascript:update_phone_home();" value
="<?echo $pmatch_home[2]?>">-<input type
=entry size
=4 name
=phone_home_last onblur
="javascript:update_phone_home();" value
="<?echo $pmatch_home[3]?>"></td
>
227 <td
><span
class=required
>City
: </span
></td
><td
><input tabindex
="9" type
=entry size
=15 name
=city value
="<?echo $result{"city
"}?>"></td
>
228 <td
><span
class=bold
>Work Phone
:</span
></td
><td
>(<input type
=entry size
=3 name
=phone_biz_area onblur
="javascript:update_phone_biz();" value
="<?echo $pmatch_biz[1]?>">) <input type
=entry size
=3 name
=phone_biz_first onblur
="javascript:update_phone_biz();" value
="<?echo $pmatch_biz[2]?>">-<input type
=entry size
=4 name
=phone_biz_last onblur
="javascript:update_phone_biz();" value
="<?echo $pmatch_biz[3]?>"></td
>
231 <td
><span
class=required
>State
: </span
></td
><td
><input tabindex
="10" type
=entry size
=15 name
=state value
="<?echo $result{"state
"}?>"></td
>
232 <td
><span
class=bold
>Mobile Phone
: </span
></td
><td
>(<input type
=entry size
=3 name
=phone_cell_area onblur
="javascript:update_phone_cell();" value
="<?echo $pmatch_cell[1]?>">) <input type
=entry size
=3 name
=phone_cell_first onblur
="javascript:update_phone_cell();" value
="<?echo $pmatch_cell[2]?>">-<input type
=entry size
=4 name
=phone_cell_last onblur
="javascript:update_phone_cell();" value
="<?echo $pmatch_cell[3]?>"></td
>
235 <td
><span
class=required
>Zip Code
: </span
></td
><td
><input tabindex
="11" type
=entry size
=6 name
=postal_code value
="<?echo $result{"postal_code
"}?>"></td
>
236 <td
><span
class=bold
>Contact Email
: </span
></td
><td
><input type
=entry size
=30 name
=email value
="<?echo $result{"email
"}?>"></td
>
239 <td
><span
class=required
>Country
: </span
></td
><td
><input tabindex
="12" type
=entry size
=10 name
=country_code value
="<?echo $result{"country_code
"}?>"></td
>
240 <td
><span
class=bold
>User Defined Fields
</span
></td
>
243 <td
><span
class=required
>Marital Status
: </span
></td
>
246 <select name
=status tabindex
="13">
248 print "<!-- ".$result["status"]." -->\n";
249 foreach ($statii as $s) {
250 if ($s == "unassigned") {
251 echo "<option value=''";
253 echo "<option value='".$s."'";
256 if ($s == $result["status"])
259 echo ">".ucwords($s)."</option>\n";
264 <td
><input name
="genericname1" size
=20 value
="<?echo $result{"genericname1
"};?>" /></td
><td
><input name
="genericval1" size
=20 value
="<?echo $result{"genericval1
"};?>" /></td
>
267 <td
><span
class=required
>Provider
: </span
></td
>
269 <select tabindex
="14" name
="providerID" onchange
="javascript:document.demographics_form.referrer.value=upperFirst(this.options[this.selectedIndex].text,this.options[this.selectedIndex].text);">
270 <option value
=''>Unassigned
</option
>
273 foreach ($provideri as $s) {
274 //echo "defined provider is: " .trim($s['fname']." ".$s['lname']). " compared to : " .$result["referrer"] . "<br />";
276 echo "<option value='".$s['id']."'";
278 if ($s['id'] == $result["providerID"])
280 echo ">".ucwords($s['fname']." ".$s['lname'])."</option>\n";
287 <td
><input name
="genericname2" size
=20 value
="<?echo $result{"genericname2
"};?>" /></td
><td
><input name
="genericval2" size
=20 value
="<?echo $result{"genericval2
"};?>" /></td
>
291 <a href
="javascript:document.demographics_form.submit();" target
=Main
class=link_submit
>[Save Patient Demographics
]</a
>
298 <th
>HIPAA Choices
:</th
>
302 <select name
="hipaa_mail">
304 echo ('<option>NO</option>');
305 $result{"hipaa_mail"}=='YES' ?
$opt_out='<option selected>YES</option>' : $opt_out='<option>YES</option>' ;
309 <td
>Allow Voice Msg
:</td
>
311 <select name
="hipaa_voice">
313 echo ('<option>NO</option>');
314 $result{"hipaa_voice"}=='YES' ?
$opt_out='<option selected>YES</option>' : $opt_out='<option>YES</option>' ;
327 <a href
="javascript:document.demographics_form.submit();" target
=Main
class=link_submit
>[Save Patient Demographics
]</a
><hr
></td
>
333 <input type
=hidden size
=30 name
=referrer value
="<?echo ucfirst($result{"referrer
"});?>">
334 <input type
=hidden size
=20 name
=referrerID value
="<?echo $result{"referrerID
"}?>">
335 <input type
=hidden size
=20 name
=db_id value
="<?echo $result{"id
"}?>">
338 <td
><span
class=bold
>Occupation
: </span
></td
>
339 <td
><input type
=entry size
=20 name
=occupation value
="<?echo $result{"occupation
"}?>"></td
>
342 <td
><span
class=bold
>Employer
: <br
>(enter Student
, PT Student
, or leave blank
for unemployed
)</span
></td
><td
><input type
=entry size
=20 name
=ename value
="<?echo $result2{"name
"}?>"></td
>
349 <td
><span
class=bold
>Employer Address
</span
></td
><td
><span
class=bold
></span
><input type
=entry size
=25 name
=estreet value
="<?echo $result2{"street
"}?>"></td
>
352 <td
><span
class=bold
>City
: </span
></td
><td
><input type
=entry size
=15 name
=ecity value
="<?echo $result2{"city
"}?>"></td
>
355 <td
><span
class=bold
>State
: </span
></td
><td
><input type
=entry size
=15 name
=estate value
="<?echo $result2{"state
"}?>"></td
>
358 <td
><span
class=bold
>Zip Code
: </span
></td
><td
><input type
=entry size
=10 name
=epostal_code value
="<?echo $result2{"postal_code
"}?>"></td
>
361 <td
><span
class=bold
>Country
: </span
></td
><td
><input type
=entry size
=10 name
=ecountry value
="<?echo $result2{"country
"}?>"></td
>
370 <a href
="javascript:document.demographics_form.submit();" target
=Main
class=link_submit
>[Save Patient Demographics
]</a
><hr
></td
>
376 <span
class=bold
>Language
: </span
><br
>
377 <select onchange
="javascript:document.demographics_form.language.value=upperFirst(this.options[this.selectedIndex].value,this.options[this.selectedIndex].value);">
379 foreach ($langi as $s) {
380 if ($s == "unassigned") {
381 echo "<option value=''";
383 echo "<option value='".$s."'";
385 if ($s == strtolower($result["language"]))
387 echo ">".ucwords($s)."</option>\n";
391 <input type
=entry size
=30 name
=language value
="<?echo ucfirst($result{"language
"});?>"><br
><br
/>
394 <span
class=bold
>Race
/Ethnicity
: </span
><br
>
395 <select onchange
="javascript:document.demographics_form.ethnoracial.value=upperFirst(this.options[this.selectedIndex].value,this.options[this.selectedIndex].value);">
397 foreach ($ethnoraciali as $s) {
398 if ($s == "unassigned") {
399 echo "<option value=''";
401 echo "<option value='".$s."'";
403 if ($s == strtolower($result["ethnoracial"]))
405 echo ">".ucwords($s)."</option>\n";
410 <input type
=entry size
=30 name
=ethnoracial value
="<?echo ucfirst($result{"ethnoracial
"});?>"><br
>
416 <td
><span
class=bold
>Financial Review Date
: </span
></td
><td
><input type
=entry size
=11 name
=financial_review value
="<?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
>
419 <td
><span
class=bold
>Family Size
: </span
></td
><td
><input type
=entry size
=20 name
=family_size value
="<?echo $result{"family_size
"}?>"></td
>
422 <td
><span
class=bold
>Monthly Income
: </span
></td
><td
><input type
=entry size
=20 name
=monthly_income onblur
="javascript:checkNum();" value
="<?echo $result{"monthly_income
"}?>"><span
class=small
>(Numbers only
)</span
></td
>
425 <td
><span
class=bold
>Homeless
, etc
.: </span
></td
><td
><input type
=entry size
=20 name
=homeless value
="<?echo $result{"homeless
"}?>"></td
>
428 <td
><span
class=bold
>Interpretter
: </span
></td
><td
><input type
=entry size
=20 name
=interpretter value
="<?echo $result{"interpretter
"}?>"></td
>
431 <td
><span
class=bold
>Migrant
/Seasonal
: </span
></td
><td
><input type
=entry size
=20 name
=migrantseasonal value
="<?echo $result{"migrantseasonal
"}?>"></td
>
447 <a href
="javascript:document.demographics_form.submit();" target
=Main
class=link_submit
>[Save Patient Demographics
]</a
>
452 $insurance_headings = array("Primary Insurance Provider:", "Secondary Insurance Provider", "Tertiary Insurance provider");
453 $insurance_info = array();
454 $insurance_info[1] = getInsuranceData($pid,"primary");
455 $insurance_info[2] = getInsuranceData($pid,"secondary");
456 $insurance_info[3] = getInsuranceData($pid,"tertiary");
457 for($i=1;$i<=3;$i++
) {
458 $result3 = $insurance_info[$i];
465 <td colspan
="5"><span
class=required
><?
=$insurance_headings[$i -1]?
></span
></td
>
467 <td colspan
="5"><select name
="i<?=$i?>provider">
468 <option value
="">Unassigned
</option
>
471 foreach ($insurancei as $iid => $iname) {
472 echo "<option value='".$iid."'";
473 if (strtolower($iid) == strtolower($result3{"provider"}))
475 echo ">".$iname."</option>\n";
478 </select
> 
;<a href
="<? echo $GLOBALS['webroot'] ?>/controller.php?practice_settings&insurance_company&action=edit">Add
New Insurer
</a
>
482 <td
><span
class=required
>Plan Name
: </span
></td
><td
><input type
=entry size
=20 name
=i
<?
=$i?
>plan_name value
="<?echo $result3{"plan_name
"}?>"></td
>
485 <td
><span
class=required
>Policy Number
: </span
></td
><td
><input type
=entry size
=16 name
=i
<?
=$i?
>policy_number value
="<?echo $result3{"policy_number
"}?>"></td
>
488 <td
><span
class=required
>Group Number
: </span
></td
><td
><input type
=entry size
=16 name
=i
<?
=$i?
>group_number value
="<?echo $result3{"group_number
"}?>"></td
>
491 <td
><span
class=required
>Subscriber
Employer (SE
) <br
>(enter Student
, PT Student
, or leave blank
for unemployed
): </span
></td
><td
><input type
=entry size
=25 name
=i
<?
=$i?
>subscriber_employer value
="<?echo $result3{"subscriber_employer
"}?>"></td
>
494 <td
><span
class=required
>SE Address
: </span
></td
><td
><input type
=entry size
=25 name
=i
<?
=$i?
>subscriber_employer_street value
="<?echo $result3{"subscriber_employer_street
"}?>"></td
>
500 <td
><span
class=required
>SE City
: </span
></td
>
501 <td
><input type
=entry size
=15 name
=i
<?
=$i?
>subscriber_employer_city value
="<?echo $result3{"subscriber_employer_city
"}?>"></td
>
502 <td
><span
class=required
>SE State
: </span
></td
>
503 <td
><input type
=entry size
=15 name
=i
<?
=$i?
>subscriber_employer_state value
="<?echo $result3{"subscriber_employer_state
"}?>"></td
>
506 <td
><span
class=required
>SE Zip Code
: </span
></td
>
507 <td
><input type
=entry size
=10 name
=i
<?
=$i?
>subscriber_employer_postal_code value
="<?echo $result3{"subscriber_employer_postal_code
"}?>"></td
>
508 <td
><span
class=required
>SE Country
: </span
></td
>
509 <td
><input type
=entry size
=25 name
=i
<?
=$i?
>subscriber_employer_country value
="<?echo $result3{"subscriber_employer_country
"}?>"></td
>
518 <span
class=required
>Subscriber
: </span
><input type
=entry size
=10 name
=i
<?
=$i?
>subscriber_fname value
="<?echo $result3{"subscriber_fname
"}?>"><input type
=entry size
=3 name
=i
<?
=$i?
>subscriber_mname value
="<?echo $result3{"subscriber_mname
"}?>"><input type
=entry size
=10 name
=i
<?
=$i?
>subscriber_lname value
="<?echo $result3{"subscriber_lname
"}?>">
522 <span
class=required
>Relationship
: </span
>
523 <select name
=i
<?
=$i?
>subscriber_relationship onchange
="javascript:auto_populate_employer_address<?=$i?>();">
526 foreach ($relats as $s) {
527 if ($s == "unassigned") {
528 echo "<option value=''";
530 echo "<option value='".$s."'";
532 if ($s == $result3{"subscriber_relationship"})
534 echo ">".ucfirst($s)."</option>\n";
539 <a href
="javascript:popUp('browse.php?browsenum=<?=$i?>')" class=text
>(Browse
)</a
><br
/>
540 <span
class=bold
>D
.O
.B
.: </span
><input type
=entry size
=11 name
=i
<?
=$i?
>subscriber_DOB value
="
542 if (!empty($result3['subscriber_DOB'])) {
543 echo $result3['subscriber_DOB'];
549 <span
class=bold
>S
.S
.: </span
><input type
=entry size
=11 name
=i
<?
=$i?
>subscriber_ss value
="<?echo $result3{"subscriber_ss
"}?> "> 
;
550 <span
class=bold
>Sex
: </span
>
551 <select name
=i
<?
=$i?
>subscriber_sex
>
552 <option value
="Male" <?
if (strtolower($result3{"subscriber_sex"}) == "male") echo "selected"?
>>Male
</option
>
553 <option value
="Female" <?
if (strtolower($result3{"subscriber_sex"}) == "female") echo "selected"?
>>Female
</option
>
556 <span
class=required
>Subscriber Address
: </span
><input type
=entry size
=25 name
=i
<?
=$i?
>subscriber_street value
="<?echo $result3{"subscriber_street
"}?>"><br
>
557 <span
class=required
>City
: </span
><input type
=entry size
=15 name
=i
<?
=$i?
>subscriber_city value
="<?echo $result3{"subscriber_city
"}?>">
558 <span
class=required
>State
: </span
><input type
=entry size
=15 name
=i
<?
=$i?
>subscriber_state value
="<?echo $result3{"subscriber_state
"}?>"><br
>
559 <span
class=required
>Zip Code
: </span
><input type
=entry size
=10 name
=i
<?
=$i?
>subscriber_postal_code value
="<?echo $result3{"subscriber_postal_code
"}?>">
560 <span
class=required
>Country
: </span
><input type
=entry size
=10 name
=i
<?
=$i?
>subscriber_country value
="<?echo $result3{"subscriber_country
"}?>"><br
>
563 <span
class=bold
>Subscriber Phone
: <input type
=hidden name
=i
<?
=$i?
>subscriber_phone value
="<?echo $result3{"subscriber_phone
"}?>">
566 //extract formatting of phone number:
568 preg_match("/^\((.*?)\)\s(.*?)\-(.*?)$/",$result3{"subscriber_phone"},$pmatch);
570 (<input type
=entry size
=3 name
=i
<?
=$i?
>subscriber_phone_area onblur
="javascript:update_i<?=$i?>subscriber_phone();" value
="<?echo $pmatch[1]?>">) <input type
=entry size
=3 name
=i
<?
=$i?
>subscriber_phone_first onblur
="javascript:update_i<?=$i?>subscriber_phone();" value
="<?echo $pmatch[2]?>">-<input type
=entry size
=4 name
=i
<?
=$i?
>subscriber_phone_last onblur
="javascript:update_i<?=$i?>subscriber_phone();" value
="<?echo $pmatch[3]?>">
572 <span
class=bold
>CoPay
: <input type
=text size
="6" name
=i
<?
=$i?
>copay value
="<?echo $result3{"copay
"}?>">
577 <a href
="javascript:document.demographics_form.submit();" target
=Main
class=link_submit
>[Save Patient Demographics
]</a
581 <?
} //end insurer for loop ?>