Pay-to provider/ facility bugs?

aethelwulffe wrote on Wednesday, April 27, 2011:

4.0 release
No calender/billing location modification yet, just the facility edit patch.

Problem:  Facility “Office” is selected as the Pay-to-Provider/facility/npi used in generating the x12 instead of the facility “CBHA” which has a different group NPI.

Investigated points:

  Broke down generated 837 to identify every element, and compared it to the x12 gen file.

  Browsed the  facilities table.  Found that the “Office” x12_payer_id field was blank and not null.  Set the CBHA to blank instead of null, but looked in claim.class and identified that this field is probably not used anymore, as a field of the same name is present in the x12_partners table (sql upgrade script/drop needed for the next patch?).  Billing location and service location are “1”.

Postulation:
Facility “Office” has an id/index of 3 and is the first on the table.   Facility “CBHA” has an ID of 11 and is at the end of the table.
I believe the following bit in claim.class decides what facility is the billing facility for a claim:

 $sql = "SELECT * FROM facility " .
      "ORDER BY billing_location DESC, id ASC LIMIT 1";
    $this->billing_facility = sqlQuery($sql);

Is it possible (not real knowledgeable here) that ASC LIMIT 1 returns the first entry in the row that meets the criterion (bool true)?  In which case it is perhaps always selecting facility “office”?
  Does anyone else out there have more than one billing facility and more than one group NPI as a pay-to?

Other notes…
Investigated user settings for default facility and such (probably not important) and discovered that until I played with the facility table, the CBHA facility would not show up in the list to set a providers default facility.  This facility was added in version 3.2, and was un-editable until the last patch.  We have never successfully billed with it.

I have created new fake encounters/fee sheets to test after all investigations

tmccormi wrote on Wednesday, April 27, 2011:

In release 4.1 ZHH contributed a patch to allow more than one billing facility, it’s selectable at the encounter level.   Previous versions only support ONE billing facility as you discovered.
-Tony

aethelwulffe wrote on Wednesday, April 27, 2011:

Just switched “OFFICE” facility billing location flag to false.  I generated an 837 and everything was correct.  I would guess this means that my assumption is true, as there is no other way this error could be produced.  Perhaps it is unusual to have this situation, but I feel there should at least be a warning in the documentation, or on the facility edit form that only one of your facilities can be the billing location.   Hopefully someone is going to tell me that I am nuts, and fill me in on what is really going on, but right now I am assuming that claim.class can’t differentiate between two facilities that are billing locations.

aethelwulffe wrote on Wednesday, April 27, 2011:

Oh, thanks for the update there Tony.
  Is ZHH’s 4.1 patch ready to go for folks that are already overloaded and would probably go insane if they had to deal with any new bugs? :)  I downloaded it a while ago, but I was too scared to apply it, as bug reports were still coming in.

tmccormi wrote on Wednesday, April 27, 2011:

It was integrated into the main 4.1 branch a while back …

Author: Paul Simon <paul@zhservices.com>
Date:   Thu Mar 31 17:26:21 2011 +0530

There were a couple of bug fixes after that …

tmccormi wrote on Wednesday, April 27, 2011:

just so you have it:  commit b81ced1557ea6be419f5fe088e110fbcb995f5d4