Primary insurance payment gone after sending secondary through billing manager

Situation
We have a situation that recently started happening. The problem may have been here for some time but we never noticed it until we had to start sending secondary medicare claims electronically. Before this we sent paper claims when the secondary ins was medicare.

Specifically what’s happening is we have an encounter where we’ve imported an era. Everything in the claim looks good. Then we use the billing manager to send the secondary claim to medicare. The x12 part goes to the clearing house. In open emr however the payments from the primary insurance disappear. On further inspection in the ar_activity table i noticed the primary payments are still in there but now there is a date in the deleted column (which indicated that it is deleted). If i set the deleted column back to null everything shows back up in open emr just like it should.

So the date time that is in the deleted column is the date and time that we pushed the button to send the claim to the clearing house.

This only happens when we try to send a secondary medicare claim. The primary insurances are any number of different insurance companies. And to add to the mystery, it doesn’t always do this behavior on the secondary medicare claims. In fact in a single patient it might do it for the claim in one encounter but not on a different encounter.

I’m not sure where to go from here to resolve the problem. Any ideas would be appreciated.

OpenEMR Version
I’m using OpenEMR version 7.0.0 (2)

Browser:
I’m using: chromium, firefox

Operating System
I’m using: ubuntu linux 22.04

Search
Did you search the forum for similar questions? Yes

Logs
Did you check the logs? Yes
Was there anything pertinent in them? not that i noticed
Please paste them here (surround with three backticks (```) for readability.
You can also turn on User Debugging under Administration->Globals->Logging User Debugging Options=>All