Secondary Billing through X12

anonymous wrote on Monday, May 10, 2010:

When performing secondary billing… is any one else experiencing issues where the payment from the previous payer(s) isn’t populating the X12? As well as the Balance?

It works properly for the CMS1500 but not for the X12… I have noticed this with two different OpenEMR installations. 1 running on centos 5.4 with openemr 3.2 and the other running on windows server 2003 with openemr 3.2.

Wondering if this is a bug that needs fixing because I did go through the proper billing process and can reproduce the issue every time. Also the fact that it pulls into the CMS1500 also leads me to believe it’s a bug with the X12 Generator.

Any body else seeing this issue?

Chris

zhhealthcare wrote on Monday, May 10, 2010:

I haven’t tried the secondary billing yet.  However there are some gaps is the x12 generation: see this discussion.  https://sourceforge.net/projects/openemr/forums/forum/202506/topic/3702992

maybe the X12 generation is in need of a comprehensive review. 

Thanks
Sam

sunsetsystems wrote on Monday, May 10, 2010:

Last I checked it was working, but maybe something happened in 3.2.  You might look at the X12 logic (library/gen_x12_837.inc.php), it’s not difficult to follow.  And the CMS 1500 logic is in gen_hcfa_1500.inc.php.

Rod
www.sunsetsystems.com

anonymous wrote on Monday, May 10, 2010:

Rod,

Yes, I did compare the two and here are the finding as noted in our internal case log:

X12 Output:
SVD**0.00*HC:99205**1~CAS*CO*45*237.00~CAS*CO*45*-237.00~CAS*CO*45*237.00~CAS*PR*1*192.00~DTP*573*D8*20100330

X12 Code:

 // Loop 2430, adjudication by previous payers.
    //
    for ($ins = 1; $ins < $claim->payerCount(); ++$ins) {
      if ($claim->payerSequence($ins) > $claim->payerSequence())
        continue; // payer is future, not previous
      $payerpaid = $claim->payerTotals($ins, $claim->cptKey($prockey));
      $aarr = $claim->payerAdjustments($ins, $claim->cptKey($prockey));
      if ($payerpaid[1] == 0 && !count($aarr)) {
        $log .= "*** Procedure '" . $claim->cptKey($prockey) .
          "' has no payments or adjustments from previous payer!\n";
        continue;
      }
      ++$edicount;
      $out .= "SVD" . // Service line adjudication. Page 554.
        "*" . $claim->payerID($ins) .
        "*" . $payerpaid[1] .
        "*HC:" . $claim->cptKey($prockey) .
        "*" .
        "*" . $claim->cptUnits($prockey) .
        "~\n";
      $tmpdate = $payerpaid[0];
      foreach ($aarr as $a) {
        ++$edicount;
        $out .= "CAS" . // Previous payer's line level adjustments. Page 558.
          "*" . $a[1] .
          "*" . $a[2] .
          "*" . $a[3] .
          "~\n";
        if (!$tmpdate) $tmpdate = $a[0];
      }
      if ($tmpdate) {
        ++$edicount;
        $out .= "DTP" . // Previous payer's line adjustment date. Page 566.
          "*573" .
          "*D8" .
          "*$tmpdate" .
          "~\n";
      }
    } // end loop 2430
  } // end this procedure

X12 Output:
~SBR*P*19*300**C1****CI~AMT*D*0.00~AMT*B6*192.00~AMT*F2*192.00

X12 Code:

    // Things that apply only to previous payers, not future payers.
    //
    if ($claim->payerSequence($ins) < $claim->payerSequence()) {
      // Generate claim-level adjustments.
      $aarr = $claim->payerAdjustments($ins);
      foreach ($aarr as $a) {
        ++$edicount;
        $out .= "CAS" . // Previous payer's claim-level adjustments. Page 323.
          "*" . $a[1] .
          "*" . $a[2] .
          "*" . $a[3] .
          "~\n";
      }
      $payerpaid = $claim->payerTotals($ins);
      ++$edicount;
      $out .= "AMT" . // Previous payer's paid amount. Page 332.
        "*D" .
        "*" . $payerpaid[1] .
        "~\n";
      // Patient responsibility amount as of this previous payer.
      $prev_pt_resp -= $payerpaid[1]; // reduce by payments
      $prev_pt_resp -= $payerpaid[2]; // reduce by adjustments
      ++$edicount;
      $out .= "AMT" . // Allowed amount per previous payer. Page 334.
        "*B6" .
        "*" . sprintf('%.2f', $payerpaid[1] + $prev_pt_resp) .
        "~\n";
      ++$edicount;
      $out .= "AMT" . // Patient responsibility amount per previous payer. Page 335.
        "*F2" .
        "*" . sprintf('%.2f', $prev_pt_resp) .
        "~\n";
    } // End of things that apply only to previous payers.

anonymous wrote on Monday, May 10, 2010:

Sam,

Your issue with the X12 is unrelated. I have brought on quite a few practices on and not one of the payers has requested the line you are referring to. In the ANSI X12 837P standard there are many more options available… but many of them are not used. ANSI X12 837P deals with many billing transaction and in the case of general practices the misc options are not necessary. I would revert to Rod’s reply to your need.

Thanks,
Chris

anonymous wrote on Monday, May 10, 2010:

To further add to the analysis. It seems the “$payerpaid” is the issue where it’s pulling in the $0.00 amount. Because “$prev_pt_resp” has the $192.00 amount pulling. But that is still the wrong amount as noted here:

Charge   Adjust   Paid   Balance   Prv
429.00           237.00  153.60  38.40           -1

zhhealthcare wrote on Monday, May 10, 2010:

Chris
You are probably right: and Rod too.   However the requirement gains importance in the scenario where there is Paperwork that needs to be send for an electronic claim.  My solution was to use Fastattach software(www.mea-fast.com).  the way it works is we upload the paperwork through their system, it generates a code which we enter in the PWK section of the e-claim and send it out.  It is gaining more and more traction especially among surgical practices where paperwork like op note is relevant to a claim. 

The requirement is not a pressing need at this time: but it could help out the providers a lot and our ability to market the EMR.

I Was wondering how your clients work with claims that have paperwork: do they print out the claim and send it with the paper work?

Thanks
Sam

anonymous wrote on Monday, May 10, 2010:

I just want to see if any one else is experiencing this before we go about fixing the issue, so that we don’t fix something that may have already been fixed by someone else. If someone can confirm this issue then I will put this in the works to be fixed. Not unless you see something right off the bat Rod.

Thanks,
Chris

sunsetsystems wrote on Monday, May 10, 2010:

No it would take some study.  You might compare with the previous release to see if some change broke it.

Rod
www.sunsetsystems.com

anonymous wrote on Monday, May 10, 2010:

Thanks Rod. Can someone out there please confirm they are having similar issues with secondary billing through x12… just so we can rule out “a problem between the chair and the keyboard.”

Sam, that online service really sounds cool. Yeah, currently they send paperwork claims via printed CMS1500 (ie. accident claims). That could be an added function that you could sponsor development on…

Chris
www.ehrlive.com

zhhealthcare wrote on Monday, May 10, 2010:

I am working on the NTE 2300 loop.  I will post it in here as soon as it is done. 
Also we are testing patient statements to PDF in case anyone is interested.

I will check on the secondary X12 and revert to you

zhhealthcare wrote on Monday, May 10, 2010:

I tested a secondary. The X12 shows the amount paid by the primary but not the balance.  Is this helpful

jpmd wrote on Monday, May 10, 2010:

We have had secondary issues for a while but have not been able to fix them as of yet.  I am not sure they are related to this thread but when we re-bill a secondary procedure causes payments to be double posted.
             
Jude
www.phyaura.com       

anonymous wrote on Monday, May 10, 2010:

Sam,

Thanks for sending me your test data. Yes, you are having the same issues as confirmed with others. These are the loop segments in question:

~AMT*D*0.00

and

~SVD*00901*0.00*HC:99203**1

Thanks,
Chris

anonymous wrote on Monday, May 10, 2010:

I am going to setup a test environment with openemr 3.1.0 and see if i get the same results.

Chris

sraj49 wrote on Tuesday, May 11, 2010:

Hi zhhealthcare,

We would be interested in the patient statements to pdf. Let me know and we appreciate.

Thanks

Raj

anonymous wrote on Thursday, May 20, 2010:

Version 3.1 has the same issues with secondary billing.

We have captured variable values and it looks like the x12 process is doing the right thing, but getting the wrong values from the payerTotals function in the Claim object.  Before we consider making any changes in the Claim object, does anone know what other processes might use that object, or would we need to do a search to see what we can  find. We wouldn’t want to fix this and break something else.

Chris
www.ehrlive.com

sunsetsystems wrote on Thursday, May 20, 2010:

I’m pretty sure the Claim class is used only by gen_x12_837.inc.php and gen_hcfa_1500.inc.php.  But you can search the code to make sure.

Rod
www.sunsetsystems.com

anonymous wrote on Saturday, May 22, 2010:

All,

Looks like we found the issue to this problem… took a bit of diagnosing and trying to track down the issue. And of course it was something really simple!

in /openemr/library/invoice_summary.inc.php  @ line 231, add a “!” to the beginning of “empty” as shown bellow:

$tmp = !empty($row) ? $row : $row;

That’s it… let me know if you guys test secondary claims to be working after this as well.

Thanks,
Chris
www.ehrlive.com

sunsetsystems wrote on Monday, May 24, 2010:

Chris, I don’t see how that can be the right solution.  if ‘session_id’ is empty then there is no ar_session row, and so ‘reference’ which comes from the session row will be null.  The effect of your change is to get the check number from the ar_activity memo field when there *is* an ar_session row, and to always supply an empty check number when there is *not* an ar_session row.

Perhaps you are omitting the check number when posting payments?

Rod
www.sunsetsystems.com