Modifiers missing bug in coding

juggernautsei wrote on Thursday, February 21, 2013:

Hi,

Looking for a little guidance.  In the new code there is a problem with modifiers on the fee sheet not showing up where they are suppose to. The file is under openemr/interface/forms/fee_sheet/new.php.

The original code that works is:

line 159:

if (modifiers_are_used(true)) {
      if ($codetype != 'COPAY' && ($code_types[$codetype]['mod'] || $modifier)) {
	  	$query = "SELECT * from list_options where list_id = 'Modifiers' order by option_id ASC";
	  	$res = sqlStatement($query);
        //<input type='text' name='' " ."value='$modifier' size='" . $code_types[$codetype]['mod'] . "'>
		echo "  <td class='billcell'>
					<select name='bill[$lino][mod]'>
						<option value=''></option>";
						while($row = sqlFetchArray($res)){
							$selected = ($row['option_id'] == $modifier) ? "selected='selected'" : '';
							echo "<option value='".$row['option_id']."' ".$selected." >".$row['option_id']."</option>";
						}	
					"</select>
		</td>\n";
      } else {
        echo "  <td class='billcell'>&nbsp;</td>\n";
      }
    }

The new code that doesn’t work is this:

Line 151

if (modifiers_are_used(true)) {
      echo "  <td class='billcell'>$strike1" . text($modifier) . "$strike2" .
        "<input type='hidden' name='bill[".attr($lino)."][mod]' value='".attr($modifier)."'></td>\n";
    }

I tried coping and pasting the old code into the new but that does not work. So, that means I have to understand how the new code is operating before implementing changes.

I just wanted to know if the fix for this is in any patch or has anyone ran across this and fixed it before I spend hours or dollars on this.

Thanks!
Sherwin
openmedpractice.com

yehster wrote on Thursday, February 21, 2013:

Sherwin,
I suspect that your problem is an “incomplete upgrade” and your code_types table is missing the ct_mod column.
You mention “In the new code”  but the lines of code you are referencing are nearly a year old. 

juggernautsei wrote on Thursday, February 21, 2013:

Sorry, second block of code is wrong.

It should be this is the new code.

if (modifiers_are_used(true)) {
      if ($codetype != 'COPAY' && ($code_types[$codetype]['mod'] || $modifier)) {
        echo "  <td class='billcell'><input type='text' name='bill[".attr($lino)."][mod]' " .
             "value='" . attr($modifier) . "' " .
             "title='" . xla("Multiple modifiers can be separated by colons or spaces, maximum of 4 (M1:M2:M3:M4)") . "' " .
             "value='" . attr($modifier) . "' size='" . attr($code_types[$codetype]['mod']) . "'></td>\n";
      }

sherwin

yehster wrote on Thursday, February 21, 2013:

In looking at the code in a little more detail, can you describe your problem in more detail than just “modifiers are not showing up” where they are supposed to?  What is the context?  Is this while you are editing the fee sheet? Or is it after it’s been billed.

“<input type=‘hidden’ name=‘bill’ value='”.attr($modifier).“'></td>\n”;

Try changing type to text on line 153 and seeing if that changes the behavior to what you expect.

juggernautsei wrote on Thursday, February 21, 2013:

yehster,

There is s ct_mod column in the code_types table. Please see image below.

Sherwin

yehster wrote on Thursday, February 21, 2013:

Then you haven’t adequately described your scenario to identify the problem.

juggernautsei wrote on Thursday, February 21, 2013:

Here I will try to show you …

Screenshot of old fee sheet: 4.1.0 (10)

Screenshot of the new fee sheet 4.1.1 (8)

Where I have the arrows, the modifier should be there like in the upper screenshot. and it is not. I don’t know how else to say it.

Sherwin

juggernautsei wrote on Thursday, February 21, 2013:

I did change this line to what you posted but there is no change in behavior.

“<input type=‘hidden’ name=‘bill’value=’”.attr($modifier)."’></td>\n";

sherwin

yehster wrote on Thursday, February 21, 2013:

It looks like your 4.1.0 branch had custom code to turn the modifiers input in to a “select list” instead of a simple text box as it is in the “official” OpenEMR.

The line numbers you are reporting don’t correspond with what I see in the 4.1.0 branch in github. Which supports my hypothesis.

The fundamental problem is that the official code base seems to be incompatible with whatever customizations you may have implemented in the past.

juggernautsei wrote on Thursday, February 21, 2013:

yehster,

I did not know I had a custom code base out there. So, in the official code base there is no drop down box?

Also in the screenshot that is just the database and there is no custom coding. I am using it straight out of the box. That is how I test if it is a code issue or something else. In this case it is something else because, I am not using the custom code in the screenshot where I show there is no drop down for the modifiers.

In the official code, are modifiers suppose to be manually typed in?

Sherwin

juggernautsei wrote on Thursday, February 21, 2013:

I tried it with the same code in the office demo and the same thing happend
http://demo.open-emr.org:2102/openemr/interface/main/main_screen.php?auth=login&site=default
officialcodebase.PNG

There should be modifiers for this code 440.20 and in the official site there are no modifiers that show. So, I cannot be my past custom coding that is the problem, right?

Sherwin
openmedpractice.com

yehster wrote on Thursday, February 21, 2013:

On the that demo server the CT_MOD column for icd9 was set to 0.  I just changed it to 2 and the textbox shows up exactly as expected.

juggernautsei wrote on Thursday, February 21, 2013:

That is great, I did the same and yes the box is there but how can we make this a drop down list?

Sherwin

juggernautsei wrote on Thursday, February 21, 2013:

Ok I got it working the way the billing person wants it to work.

Thanks for all your help.
The final code is

    if (modifiers_are_used(true)) {
      if ($codetype != 'COPAY' && ($code_types[$codetype]['mod'] || $modifier)) {
	  	$query = "SELECT * from list_options where list_id = 'Modifiers' order by option_id ASC";
	  	$res = sqlStatement($query);
	  echo "  <td class='billcell'>
	         <select name='bill[".attr($lino)."][mod]' " .
             "value='" . attr($modifier) . "' " .
             "title='" . xla("Multiple modifiers can be separated by colons or spaces, maximum of 4 (M1:M2:M3:M4)") . "' " .
             "value='" . attr($modifier) . "' size='" . attr($code_types[$codetype]['mod']) . "'>
			 <option value=''></option>";
			 			while($row = sqlFetchArray($res)){
							$selected = ($row['option_id'] == $modifier) ? "selected='selected'" : '';
							echo "<option value='".$row['option_id']."' ".$selected." >".$row['option_id']."</option>";
						}
			 "</select>
			 </td>\n";
      }