Hi Stephen,
The claim is getting rejected in OfficeAlly and we could confirm in different insurance companies that they were rejecting the claim because the place of service was not being populated. Assuming we have a billing facility that is not a service location, but our npi is there, when we add the npi to service locations the service location won’t appear with it’s NPI on the X12.
I think that the problematic code is here:
*adding 3 backticks to make a code block - stephen
// 4010: REF*1C is required here for the Medicare provider number if NPI was
// specified in NM109. Not sure if other payers require anything here.
// --- apparently ECLAIMS, INC wants the data in 2010 but NOT in 2310B - tony@mi-squared.com
//
// 5010 spec says nothing here if NPI was specified.
//
if (($CMS_5010 && !$claim->providerNPI() && in_array($claim->providerNumberType(), array('0B','1G','G2','LU')))
|| (!$CMS_5010 && trim($claim->x12gsreceiverid()) != '470819582')) // if NOT ECLAIMS EDI
{
if ($claim->providerNumber()) {
++$edicount;
$out .= "REF" .
"*" . $claim->providerNumberType() .
"*" . $claim->providerNumber() .
"~\n";
}
}
// Loop 2310D is omitted in the case of home visits (POS=12).
if ($claim->facilityPOS() != 12 &&
(!$CMS_5010 || $claim->facilityNPI() != $claim->billingFacilityNPI()))
{
++$edicount;
$out .= "NM1" . // Loop 2310D Service Location
"*77" .
"*2";
//Field length is limited to 35. See nucc dataset page 77 www.nucc.org
$facilityName = substr($claim->facilityName(), 0, $CMS_5010 ? 60 : 35);
if ($claim->facilityName() || $claim->facilityNPI() || $claim->facilityETIN()) { $out .=
"*" . $facilityName;
}
if ($claim->facilityNPI() || $claim->facilityETIN()) { $out .=
"*" .
"*" .
"*" .
"*";
if ($CMS_5010 || $claim->facilityNPI()) { $out .=
"*XX*" . $claim->facilityNPI();
} else { $out .=
"*24*" . $claim->facilityETIN();
}
if (!$claim->facilityNPI()) {
$log .= "*** Service location has no NPI.\n";
}
}
$out .= "~\n";
if ($claim->facilityStreet()) {
++$edicount;
$out .= "N3" .
"*" . $claim->facilityStreet() .
"~\n";
}
if ($claim->facilityState()) {
++$edicount;
$out .= "N4" .
"*" . $claim->facilityCity() .
"*" . $claim->facilityState() .
"*" . stripZipCode($claim->facilityZip()) .
"~\n";
}
}
Regards,