Using gen_x12_837.php.inc on an upgraded database where I reran a claim to compare I get slightly different results. The area in question seems to actually have changes in the 3.1 version, so I am wondering what the difference means.
I believe the 2.9 x12 is correct. The NM1*82 and PRV*PE in 2.9 identify the renderinr provider in the 2310B loop (used when the rendering provider is not the same as the billing or pay-to provider). In the 2.9 version the rendering provider’s NPI is given, which is correct. In the 3.1 x12, an incorrect 2310B loop is generated (the "34" in the NM1*82*… means that the rendering provider’s SSN is to be given, which is missing, and has been superseded, in any event, by NPI). The second iteration of the NM1*82 is then the 2420A loop, which is only supposed to be generated when the rendering provider for one line in the bill is not the same as the rendering provider given in the 2310B, which is almost never the case.
You didn’t provide the coding information, so I have to do some guessing here.
The difference is that 3.1 now supports the ability to specify rendering provider at the service line level, whereas earlier versions did not.
However it is an error to not put in a "main" provider, and I suspect that is what happened here. If there are not multiple service providers for a claim, then you should not put any in at the line level.
If there is a bug, I think it’s that the Fee Sheet allowed you to put the data in that way.
The data was imported using the custom/import_medics.php script (that you wrote for me originally) directly into 3.1 just as it was into 2.9. So input didn’t change between versions. Same rendering provider all the way. What do you figure I need to add / change in the script to make it work correctly with 3.1? And just as importantly what happens if I need to regen a claim that was already in the system when we upgraded to 3.1?
Aha. Well it used to be that the only place to store the rendering provider was billing.provider_id. So it was a line-specific provider even though there was no way to specify it at the line level, and the claim generation logic had to pick it out of one of the lines and ignore the others, which were theoretically all the same. Ugly.
When I added *real* support for line-level providers, I put those into the same place, and added a new one, form\_encounter.provider\_id, for the main (default) provider. So that is where your import\_medics script should put it.
Regarding claims created before upgrading, there is some fancy stuff in 3\_0\_1-to-3\_1\_0\_upgrade.sql that takes care of converting those.