Add Referral Source Not working

kenyanprince wrote on Thursday, May 05, 2016:

When I click on the add button on “Referral Source” in demographics and type a source and then click add it nothing happens on the pop up that comes and I have to click cancel, therefore cannot add referral sources.
Below is the code for the page interface/patient_file/summary/demographics_full.php

<?php // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. require_once("../../globals.php"); require_once("$srcdir/acl.inc"); require_once("$srcdir/options.inc.php"); require_once("$srcdir/formatting.inc.php"); require_once("$srcdir/erx_javascript.inc.php"); // Session pid must be right or bad things can happen when demographics are saved! // include_once("$srcdir/pid.inc"); $set_pid = $_GET["set_pid"] ? $_GET["set_pid"] : $_GET["pid"]; if ($set_pid && $set_pid != $_SESSION["pid"]) { setpid($set_pid); } include_once("$srcdir/patient.inc"); $result = getPatientData($pid, "*, DATE_FORMAT(DOB,'%Y-%m-%d') as DOB_YMD"); $result2 = getEmployerData($pid); // Check authorization. if ($pid) { if (!acl_check('patients', 'demo', '', 'write')) die(xl('Updating demographics is not authorized.')); if ($result['squad'] && ! acl_check('squads', $result['squad'])) die(xl('You are not authorized to access this squad.')); } else { if (!acl_check('patients', 'demo', '', array('write','addonly') )) die(xl('Adding demographics is not authorized.')); } $CPR = 4; // cells per row // $statii = array('married','single','divorced','widowed','separated','domestic partner'); // $langi = getLanguages(); // $ethnoraciali = getEthnoRacials(); // $provideri = getProviderInfo(); $insurancei = getInsuranceProviders(); $fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = 'DEM' AND uor > 0 " . "ORDER BY group_name, seq"); ?> <?php html_header_show();?> @import url(../../../library/dynarch_calendar.css); <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?> <?php include_once("{$GLOBALS['srcdir']}/options.js.php"); ?>
<?php if ($GLOBALS['concurrent_layout']) { ?> <?php } else { ?> <?php } ?> <?php xl('Current Patient','e'); ?>    <?php xl('Save','e'); ?> <?php if ($GLOBALS['concurrent_layout']) { ?> <?php } else { ?> <?php } ?> <?php xl('Cancel','e'); ?>
<?php

function end_cell() {
global $item_count, $cell_count;
if ($item_count > 0) {
echo “”;
$item_count = 0;
}
}

function end_row() {
global $cell_count, $CPR;
end_cell();
if ($cell_count > 0) {
for (; $cell_count < $CPR; ++$cell_count) echo “

”;
echo “\n”;
$cell_count = 0;
}
}

function end_group() {
global $last_group;
if (strlen($last_group) > 0) {
end_row();
echo " \n";
echo “\n”;
}
}

$last_group = ‘’;
$cell_count = 0;
$item_count = 0;
$display_style = ‘block’;

$group_seq=0; // this gives the DIV blocks unique IDs

?>

<?php xl("Demographics", "e" )?>
<ul class="tabNav">
   <?php display_layout_tabs('DEM', $result, $result2); ?>
</ul>

<div class="tabContainer">
	<?php display_layout_tabs_data_editable('DEM', $result, $result2); ?>
</div>

<?php xl("Insurance", "e" )?>
<?php if (! $GLOBALS['simplified_demographics']) { $insurance_headings = array(xl("Primary Insurance Provider"), xl("Secondary Insurance Provider"), xl("Tertiary Insurance provider")); $insurance_info = array(); $insurance_info[1] = getInsuranceData($pid,"primary"); $insurance_info[2] = getInsuranceData($pid,"secondary"); $insurance_info[3] = getInsuranceData($pid,"tertiary"); ?>
<div id="INSURANCE" >
	<ul class="tabNav">
	<?php
	foreach (array('primary','secondary','tertiary') as $instype) {
		?><li <?php echo $instype == 'primary' ? 'class="current"' : '' ?>><a href="/play/javascript-tabbed-navigation/"><?php $CapInstype=ucfirst($instype); xl($CapInstype,'e'); ?></a></li><?php
	}
	?>
	</ul>

<div class="tabContainer">

<?php
  for($i=1;$i<=3;$i++) {
   $result3 = $insurance_info[$i];
?>

	<div class="tab <?php echo $i == 1 ? 'current': '' ?>" style='height:auto;width:auto'>		<!---display icky, fix to auto-->

	<table border="0">

	 <tr>
	  <td valign=top width="430">
	   <table border="0">

		 <tr>
		  <td valign='top'>
		   <span class='required'><?php echo $insurance_headings[$i -1]."&nbsp;"?></span>
		  </td>
		  <td class='required'>:</td>
		  <td>
                       <a href="../../practice/ins_search.php" class="iframe medium_modal css_button" onclick="ins_search(<?php echo $i?>)">
			<span><?php echo xl('Search/Add') ?></span>
    			</a>
			<select name="i<?php echo $i?>provider">
			<option value=""><?php xl('Unassigned','e'); ?></option>
			<?php
			 foreach ($insurancei as $iid => $iname) {
			  echo "<option value='" . $iid . "'";
			  if (strtolower($iid) == strtolower($result3{"provider"}))
			   echo " selected";
			  echo ">" . $iname . "</option>\n";
			 }
			?>
		   </select>

		  </td>
		 </tr>

		<tr>
		 <td>
		  <span class='required'><?php xl('Plan Name','e'); ?> </span>
		 </td>
		 <td class='required'>:</td>
		 <td>
		  <input type='entry' size='20' name='i<?php echo $i?>plan_name' value="<?php echo $result3{"plan_name"} ?>"
		   onchange="capitalizeMe(this);" />&nbsp;&nbsp;
		 </td>
		</tr>

		<tr>
		 <td>
		  <span class='required'><?php xl('Effective Date','e'); ?></span>
		 </td>
		 <td class='required'>:</td>
		 <td>
		  <input type='entry' size='16' id='i<?php echo $i ?>effective_date' name='i<?php echo $i ?>effective_date'
		   value='<?php echo $result3['date'] ?>'
		   onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)'
		   title='yyyy-mm-dd' />
                      <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22' id='img_i<?php echo $i ?>effective_date' border='0' alt='[?]' style='cursor:pointer' title='<?php xl('Click here to choose a date','e'); ?>'>
		 </td>
		</tr>

		<tr>
		 <td><span class=required><?php xl('Policy Number','e'); ?></span></td>
		 <td class='required'>:</td>
		 <td><input type='entry' size='16' name='i<?php echo $i?>policy_number' value="<?php echo $result3{"policy_number"}?>"
		  onkeyup='policykeyup(this)'></td>
		</tr>

		<tr>
		 <td><span class=required><?php xl('Group Number','e'); ?></span></td>
		 <td class='required'>:</td>
		 <td><input type=entry size=16 name=i<?php echo $i?>group_number value="<?php echo $result3{"group_number"}?>" onkeyup='policykeyup(this)'></td>
		</tr>

		<tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
		 <td class='required'><?php xl('Subscriber Employer (SE)','e'); ?><br><span style='font-weight:normal'>
		  (<?php xl('if unemployed enter Student','e'); ?>,<br><?php xl('PT Student, or leave blank','e'); ?>) </span></td>
		  <td class='required'>:</td>
		 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer
		  value="<?php echo $result3{"subscriber_employer"}?>"
		   onchange="capitalizeMe(this);" /></td>
		</tr>

		<tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
		 <td><span class=required><?php xl('SE Address','e'); ?></span></td>
		 <td class='required'>:</td>
		 <td><input type=entry size=25 name=i<?php echo $i?>subscriber_employer_street
		  value="<?php echo $result3{"subscriber_employer_street"}?>"
		   onchange="capitalizeMe(this);" /></td>
		</tr>

		<tr<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>>
		 <td colspan="3">
		  <table>
		   <tr>
			<td><span class=required><?php xl('SE City','e'); ?>: </span></td>
			<td><input type=entry size=15 name=i<?php echo $i?>subscriber_employer_city
			 value="<?php echo $result3{"subscriber_employer_city"}?>"
			  onchange="capitalizeMe(this);" /></td>
			<td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('SE State','e') : xl('SE Locality','e') ?>: </span></td>
		<td>
			 <?php
			  // Modified 7/2009 by BM to incorporate data types
		  generate_form_field(array('data_type'=>$GLOBALS['state_data_type'],'field_id'=>('i'.$i.'subscriber_employer_state'),'list_id'=>$GLOBALS['state_list'],'fld_length'=>'15','max_length'=>'63','edit_options'=>'C'), $result3['subscriber_employer_state']);
			 ?>
			</td>
		   </tr>
		   <tr>
			<td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('SE Zip Code','e') : xl('SE Postal Code','e') ?>: </span></td>
			<td><input type=entry size=15 name=i<?php echo $i?>subscriber_employer_postal_code value="<?php echo $result3{"subscriber_employer_postal_code"}?>"></td>
			<td><span class=required><?php xl('SE Country','e'); ?>: </span></td>
		<td>
			 <?php
			  // Modified 7/2009 by BM to incorporate data types
		  generate_form_field(array('data_type'=>$GLOBALS['country_data_type'],'field_id'=>('i'.$i.'subscriber_employer_country'),'list_id'=>$GLOBALS['country_list'],'fld_length'=>'10','max_length'=>'63','edit_options'=>'C'), $result3['subscriber_employer_country']);
			 ?>
		</td>
		   </tr>
		  </table>
		 </td>
		</tr>

	   </table>
	  </td>

	  <td valign=top>
	<table border="0">
		<tr>
			<td><span class=required><?php xl('Relationship','e'); ?></span></td>
			<td class=required>:</td>
			<td colspan=3><?php
				// Modified 6/2009 by BM to use list_options and function
				generate_form_field(array('data_type'=>1,'field_id'=>('i'.$i.'subscriber_relationship'),'list_id'=>'sub_relation','empty_title'=>' '), $result3['subscriber_relationship']);
				?>

			<a href="javascript:popUp('browse.php?browsenum=<?php echo $i?>')" class=text>(<?php xl('Browse','e'); ?>)</a></td>
			<td></td><td></td><td></td><td></td>
		</tr>
                    <tr>
			<td width=120><span class=required><?php xl('Subscriber','e'); ?> </span></td>
			<td class=required>:</td>
			<td colspan=3><input type=entry size=10 name=i<?php echo $i?>subscriber_fname	value="<?php echo $result3{"subscriber_fname"}?>" onchange="capitalizeMe(this);" />
			<input type=entry size=3 name=i<?php echo $i?>subscriber_mname value="<?php echo $result3{"subscriber_mname"}?>" onchange="capitalizeMe(this);" />
			<input type=entry size=10 name=i<?php echo $i?>subscriber_lname value="<?php echo $result3{"subscriber_lname"}?>" onchange="capitalizeMe(this);" /></td>
			<td></td><td></td><td></td><td></td>
		</tr>
		<tr>
			<td><span class=bold><?php xl('D.O.B.','e'); ?> </span></td>
			<td class=required>:</td>
			<td><input type='entry' size='11' id='i<?php echo $i?>subscriber_DOB' name='i<?php echo $i?>subscriber_DOB' value='<?php echo $result3['subscriber_DOB'] ?>' onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' title='yyyy-mm-dd' /><img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22' id='img_i<?php echo $i; ?>dob_date' border='0' alt='[?]' style='cursor:pointer' title='<?php xl('Click here to choose a date','e'); ?>'></td>

			<td><span class=bold><?php xl('Sex','e'); ?>: </span></td>
			<td><?php
				// Modified 6/2009 by BM to use list_options and function
				generate_form_field(array('data_type'=>1,'field_id'=>('i'.$i.'subscriber_sex'),'list_id'=>'sex'), $result3['subscriber_sex']);
				?>
			</td>
			<td></td><td></td> <td></td><td></td>
		</tr>
		<tr>
			<td class=leftborder><span class=bold><?php xl('S.S.','e'); ?> </span></td>
			<td class=required>:</td>
			<td><input type=entry size=11 name=i<?php echo $i?>subscriber_ss value="<?php echo trim($result3{"subscriber_ss"})?>"></td>
		</tr>

		<tr>
			<td><span class=required><?php xl('Subscriber Address','e'); ?> </span></td>
			<td class=required>:</td>
			<td><input type=entry size=20 name=i<?php echo $i?>subscriber_street value="<?php echo $result3{"subscriber_street"}?>" onchange="capitalizeMe(this);" /></td>

			<td><span class=required><?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('State','e') : xl('Locality','e') ?>: </span></td>
			<td>
				<?php
				// Modified 7/2009 by BM to incorporate data types
				generate_form_field(array('data_type'=>$GLOBALS['state_data_type'],'field_id'=>('i'.$i.'subscriber_state'),'list_id'=>$GLOBALS['state_list'],'fld_length'=>'15','max_length'=>'63','edit_options'=>'C'), $result3['subscriber_state']);
			?>
			</td>
		</tr>
		<tr>
			<td class=leftborder><span class=required><?php xl('City','e'); ?></span></td>
			<td class=required>:</td>
			<td><input type=entry size=11 name=i<?php echo $i?>subscriber_city value="<?php echo $result3{"subscriber_city"}?>" onchange="capitalizeMe(this);" /></td><td class=leftborder><span class='required'<?php if ($GLOBALS['omit_employers']) echo " style='display:none'"; ?>><?php xl('Country','e'); ?>: </span></td><td>
				<?php
				// Modified 7/2009 by BM to incorporate data types
				generate_form_field(array('data_type'=>$GLOBALS['country_data_type'],'field_id'=>('i'.$i.'subscriber_country'),'list_id'=>$GLOBALS['country_list'],'fld_length'=>'10','max_length'=>'63','edit_options'=>'C'), $result3['subscriber_country']);
				?>
			</td>
<?php echo ($GLOBALS['phone_country_code'] == '1') ? xl('Zip Code','e') : xl('Postal Code','e') ?> : subscriber_postal_code value="<?php echo $result3{"subscriber_postal_code"}?>">
			<td colspan=2>
			</td><td></td>
		</tr>
		<tr>
			<td><span class=bold><?php xl('Subscriber Phone','e'); ?></span></td>
			<td class=required>:</td>
			<td><input type='text' size='20' name='i<?php echo $i?>subscriber_phone' value='<?php echo $result3["subscriber_phone"] ?>' onkeyup='phonekeyup(this,mypcc)' /></td>
			<td colspan=2><span class=bold><?php xl('CoPay','e'); ?>: <input type=text size="6" name=i<?php echo $i?>copay value="<?php echo $result3{"copay"}?>"></span></td>
			<td colspan=2>
			</td><td></td><td></td>
		</tr>
		<tr>
			<td colspan=0><span class='required'><?php xl('Accept Assignment','e'); ?></span></td>
			<td class=required>:</td>
			<td colspan=2>
				<select name=i<?php echo $i?>accept_assignment>
					<option value="TRUE" <?php if (strtoupper($result3{"accept_assignment"}) == "TRUE") echo "selected"?>><?php xl('YES','e'); ?></option>
					<option value="FALSE" <?php if (strtoupper($result3{"accept_assignment"}) == "FALSE") echo "selected"?>><?php xl('NO','e'); ?></option>
				</select>
			</td>
			<td></td><td></td>
			<td colspan=2>
			</td><td></td>
		</tr>
  <tr>
    <td><span class='bold'><?php xl('Secondary Medicare Type','e'); ?></span></td>
    <td class='bold'>:</td>
    <td colspan='6'>
      <select name=i<?php echo $i?>policy_type>
<?php foreach ($policy_types AS $key => $value) { echo " " . htmlspecialchars($value) . "\n"; } ?>
      </select>
    </td>
  </tr>
	</table>

	  </td>
	 </tr>
	</table>

	</div>

<?php } //end insurer for loop ?>

</div>
<?php } // end of "if not simplified_demographics" ?>
<?php include $GLOBALS['fileroot']."/library/options_listadd.inc"; ?>

visolveemr wrote on Thursday, May 05, 2016:

Greetings from ViSolve!!

Try adding the Referral Source from Administration -> Lists -> Referral Source. Here, add the list that you wnat to include and click on Save. (Check if this works for you and you are able to see the new Referral Source added in the Demographics screen)

Please share a screenshot of the issue that you face when you are trying to add the Referral source from the demographics page directly to troubleshoot further.

Thanks
OpenEMR Customization/Support Team,
ViSolve Inc
services@visolve.com | Phone: 408-850-2243
Demo’s @ ViSolve Demo Library

kenyanprince wrote on Friday, May 13, 2016:

The list shows that they are there but not being picked or able to add others from the demographics section. Find attached the screen shots.

visolveemr wrote on Friday, May 13, 2016:

Richard,

In the layout screen, please include the referral source list under List (Refer screenshot attached).
Click on the field, it will show the available lists and you can pick the referral source.

Thanks
OpenEMR Customization/Support Team,
ViSolve Inc
services@visolve.com | Phone: 408-850-2243
Demo’s @ ViSolve Demo Library

kenyanprince wrote on Tuesday, May 24, 2016:

Thank you, that worked very well.