Added HIPAA choice fields in patient demographic information
[openemr.git] / interface / patient_file / summary / demographics_full.php
blob3013d7bf4863e6f9e022f808880c73cd1f47dcc6
1 <?
2 include_once("../../globals.php");
4 // Session pid must be right or bad things can happen when demographics are saved!
5 //
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"]) {
11 setpid($_GET["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();
26 <html>
27 <head>
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);
63 return newstr;
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 = "";
119 <?}?>
122 function popUp(URL) {
123 day = new Date();
124 id = day.getTime();
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();
130 re = /^\d*\.?\d*$/;
131 str=document.demographics_form.monthly_income.value;
132 if(re.exec(str))
135 }else{
136 alert("Please enter a dollar amount using only numbers and a decimal point.");
139 //-->
140 </script>
141 </head>
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:
158 $pmatch_biz=array();
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>
180 <td colspan="6">
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>
187 </select>
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"}?>">
189 </td>
191 </tr>
192 <tr>
193 <td valign=top>
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'];
200 else {
201 echo "MM/DD/YYYY";
204 "></td><td rowspan="12">&nbsp;</td>
205 <td><span class=bold>Patient Number: </span></td><td rowspan="12">&nbsp;</td><td><input type=entry size=10 name=pubpid value="<?echo $result{"pubpid"}?>"></td>
206 </tr>
207 <tr>
208 <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>
213 </select>
214 </td>
215 <td><span class=bold>Emergency Contact: </span></td><td><input type=entry size=10 name=contact_relationship value="<?echo $result{"contact_relationship"}?>"></td>
217 </tr>
218 <tr>
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>
221 </tr>
222 <tr>
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>
225 </tr>
226 <tr>
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>
229 </tr>
230 <tr>
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>
233 </tr>
234 <tr>
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>
237 </tr>
238 <tr>
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>
241 </tr>
242 <tr>
243 <td><span class=required>Marital Status: </span></td>
244 <td>
246 <select name=status tabindex="13">
247 <?php
248 print "<!-- ".$result["status"]." -->\n";
249 foreach ($statii as $s) {
250 if ($s == "unassigned") {
251 echo "<option value=''";
252 } else {
253 echo "<option value='".$s."'";
256 if ($s == $result["status"])
257 echo " selected";
259 echo ">".ucwords($s)."</option>\n";
262 </select>
263 </td>
264 <td><input name="genericname1" size=20 value="<?echo $result{"genericname1"};?>" /></td><td><input name="genericval1" size=20 value="<?echo $result{"genericval1"};?>" /></td>
265 </tr>
266 <tr>
267 <td><span class=required>Provider: </span></td>
268 <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>
271 <?php
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"])
279 echo " selected";
280 echo ">".ucwords($s['fname']." ".$s['lname'])."</option>\n";
285 </select>
286 </td>
287 <td><input name="genericname2" size=20 value="<?echo $result{"genericname2"};?>" /></td><td><input name="genericval2" size=20 value="<?echo $result{"genericval2"};?>" /></td>
288 </tr>
289 <tr>
290 <td colspan=6>
291 <a href="javascript:document.demographics_form.submit();" target=Main class=link_submit>[Save Patient Demographics]</a>
292 <hr>
293 </td>
294 </tr>
295 </table>
297 <table class=bold>
298 <th>HIPAA Choices:</th>
299 <tr>
300 <td>Allow Mail:</td>
301 <td>
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>' ;
306 echo $opt_out;
308 </select>
309 <td>Allow Voice Msg:</td>
310 <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>' ;
315 echo $opt_out;
317 </select>
318 </td>
319 <td></td>
320 <td></td>
321 </tr>
322 </table>
325 <table><tr>
326 <td colspan=4>
327 <a href="javascript:document.demographics_form.submit();" target=Main class=link_submit>[Save Patient Demographics]</a><hr></td>
328 </tr>
331 <tr>
332 <td valign=top>
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"}?>">
336 <table>
337 <tr>
338 <td><span class=bold>Occupation: </span></td>
339 <td><input type=entry size=20 name=occupation value="<?echo $result{"occupation"}?>"></td>
340 </tr>
341 <tr>
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>
343 </tr>
344 </table>
345 </td>
346 <td valign=top>
347 <table>
348 <tr>
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>
350 </tr>
351 <tr>
352 <td><span class=bold>City: </span></td><td><input type=entry size=15 name=ecity value="<?echo $result2{"city"}?>"></td>
353 </tr>
354 <tr>
355 <td><span class=bold>State: </span></td><td><input type=entry size=15 name=estate value="<?echo $result2{"state"}?>"></td>
356 </tr>
357 <tr>
358 <td><span class=bold>Zip Code: </span></td><td><input type=entry size=10 name=epostal_code value="<?echo $result2{"postal_code"}?>"></td>
359 </tr>
360 <tr>
361 <td><span class=bold>Country: </span></td><td><input type=entry size=10 name=ecountry value="<?echo $result2{"country"}?>"></td>
362 </tr>
363 </table>
364 </td>
365 <td valign=top></td>
366 </tr>
368 <tr>
369 <td colspan=4>
370 <a href="javascript:document.demographics_form.submit();" target=Main class=link_submit>[Save Patient Demographics]</a><hr></td>
371 </tr>
374 <tr>
375 <td valign=top>
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);">
378 <?php
379 foreach ($langi as $s) {
380 if ($s == "unassigned") {
381 echo "<option value=''";
382 } else {
383 echo "<option value='".$s."'";
385 if ($s == strtolower($result["language"]))
386 echo " selected";
387 echo ">".ucwords($s)."</option>\n";
390 </select><br>
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);">
396 <?php
397 foreach ($ethnoraciali as $s) {
398 if ($s == "unassigned") {
399 echo "<option value=''";
400 } else {
401 echo "<option value='".$s."'";
403 if ($s == strtolower($result["ethnoracial"]))
404 echo " selected";
405 echo ">".ucwords($s)."</option>\n";
408 </select>
409 <br>
410 <input type=entry size=30 name=ethnoracial value="<?echo ucfirst($result{"ethnoracial"});?>"><br>
412 </td>
413 <td valign=top>
414 <table>
415 <tr>
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>
417 </tr>
418 <tr>
419 <td><span class=bold>Family Size: </span></td><td><input type=entry size=20 name=family_size value="<?echo $result{"family_size"}?>"></td>
420 </tr>
421 <tr>
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>
423 </tr>
424 <tr>
425 <td><span class=bold>Homeless, etc.: </span></td><td><input type=entry size=20 name=homeless value="<?echo $result{"homeless"}?>"></td>
426 </tr>
427 <tr>
428 <td><span class=bold>Interpretter: </span></td><td><input type=entry size=20 name=interpretter value="<?echo $result{"interpretter"}?>"></td>
429 </tr>
430 <tr>
431 <td><span class=bold>Migrant/Seasonal: </span></td><td><input type=entry size=20 name=migrantseasonal value="<?echo $result{"migrantseasonal"}?>"></td>
432 </tr>
433 </table>
441 </td>
442 <td valign=top></td>
443 </tr>
445 <tr>
446 <td colspan=4>
447 <a href="javascript:document.demographics_form.submit();" target=Main class=link_submit>[Save Patient Demographics]</a>
448 <hr></td>
449 </tr>
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];
460 <table border="0">
461 <tr>
462 <td valign=top>
463 <table border="0">
464 <tr>
465 <td colspan="5"><span class=required><?=$insurance_headings[$i -1]?></span></td>
466 <tr></tr>
467 <td colspan="5"><select name="i<?=$i?>provider">
468 <option value="">Unassigned</option>
469 <?php
471 foreach ($insurancei as $iid => $iname) {
472 echo "<option value='".$iid."'";
473 if (strtolower($iid) == strtolower($result3{"provider"}))
474 echo " selected";
475 echo ">".$iname."</option>\n";
478 </select>&nbsp;<a href="<? echo $GLOBALS['webroot'] ?>/controller.php?practice_settings&insurance_company&action=edit">Add New Insurer</a>
479 </td>
480 </tr>
481 <tr>
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>
483 </tr>
484 <tr>
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>
486 </tr>
487 <tr>
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>
489 </tr>
490 <tr>
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>
492 </tr>
493 <tr>
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>
495 </tr>
496 <tr>
497 <td colspan="2">
498 <table>
499 <tr>
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>
504 </tr>
505 <tr>
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>
510 </tr>
511 </table>
512 </td>
513 </tr>
514 </table>
515 </td>
517 <td valign=top>
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"}?>">
520 <br>
522 <span class=required>Relationship: </span>
523 <select name=i<?=$i?>subscriber_relationship onchange="javascript:auto_populate_employer_address<?=$i?>();">
525 <?php
526 foreach ($relats as $s) {
527 if ($s == "unassigned") {
528 echo "<option value=''";
529 } else {
530 echo "<option value='".$s."'";
532 if ($s == $result3{"subscriber_relationship"})
533 echo " selected";
534 echo ">".ucfirst($s)."</option>\n";
538 </select>
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'];
545 else {
546 echo "MM/DD/YYYY";
548 ?>">
549 <span class=bold>S.S.: </span><input type=entry size=11 name=i<?=$i?>subscriber_ss value="<?echo $result3{"subscriber_ss"}?> ">&nbsp;
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>
554 </select>
555 <br>
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:
567 $pmatch=array();
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]?>">
571 </span><br />
572 <span class=bold>CoPay: <input type=text size="6" name=i<?=$i?>copay value="<?echo $result3{"copay"}?>">
573 </td>
575 </tr>
576 </table>
577 <a href="javascript:document.demographics_form.submit();" target=Main class=link_submit>[Save Patient Demographics]</a
578 <hr>
579 </td></tr>
580 </table>
581 <?} //end insurer for loop ?>
583 </td></tr>
584 </table>
586 </form>
588 <br><br>
590 </body>
591 </html>