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