Billing Manager, billing log is blank

there’s an exit() in the completeToScreen() so never gets there

1 Like

@stephenwaite I switched the statements around so the system will write to the bill_process.log first, then call the callback.

1 Like

I also removed the exit() calls. @juggernautsei can you test?

thanks @ken, am in there rn

looks good, thanks again

1 Like

@ken yes I can test it and let you know the results.

2 Likes

I brought in all the code changes.
I am still getting the same error as before;

 Fatal error: Uncaught Error: Call to a member function addClaim() on null in /var/www/html/boss/src/Billing/BillingProcessor/Tasks/GeneratorX12Direct.php:208 Stack trace: #0 /var/www/html/boss/src/Billing/BillingProcessor/Tasks/GeneratorX12Direct.php(144): OpenEMR\Billing\BillingProcessor\Tasks\GeneratorX12Direct->updateBatchFile() #1 /var/www/html/boss/src/Billing/BillingProcessor/Tasks/AbstractGenerator.php(68): OpenEMR\Billing\BillingProcessor\Tasks\GeneratorX12Direct->validateOnly() #2 /var/www/html/boss/src/Billing/BillingProcessor/BillingProcessor.php(139): OpenEMR\Billing\BillingProcessor\Tasks\AbstractGenerator->execute() #3 /var/www/html/boss/src/Billing/BillingProcessor/BillingProcessor.php(91): OpenEMR\Billing\BillingProcessor\BillingProcessor->processClaims() #4 /var/www/html/boss/interface/billing/billing_process.php(33): OpenEMR\Billing\BillingProcessor\BillingProcessor->execute() #5 {main} thrown in /var/www/html/boss/src/Billing/BillingProcessor/Tasks/GeneratorX12Direct.php on line 208

My concern is that this

 $batch = $this->x12_partner_batches[$claim->getPartner()];

is still null which is causing the error.

The GeneratorX12.php is not throwing any flags like in line 91. It is passing all the flags but is still rendering null

What should be passed into $batch? So, I can hard code it and see if the rest of the code works.

I hard coded $batch = 4. The same error message comes up about the line 208. Seems like

 $batch->addClaim($claim);

is not an object.

My mistake. I was not looking at the claim. There was no x12 partner set for the claim that I was selecting. So, in this round of testing, I looked at it and set the x12 partner to Office Ally.

Ran the validate only and the error message move to line 214.

Fatal error: Uncaught Error: Call to undefined method OpenEMR\Billing\X125010837P::gen_x12_837_tr3() in /var/www/html/boss/src/Billing/BillingProcessor/Tasks/GeneratorX12Direct.php:214 Stack trace: #0 /var/www/html/boss/src/Billing/BillingProcessor/Tasks/GeneratorX12Direct.php(144): OpenEMR\Billing\BillingProcessor\Tasks\GeneratorX12Direct->updateBatchFile() #1 /var/www/html/boss/src/Billing/BillingProcessor/Tasks/AbstractGenerator.php(68): OpenEMR\Billing\BillingProcessor\Tasks\GeneratorX12Direct->validateOnly() #2 /var/www/html/boss/src/Billing/BillingProcessor/BillingProcessor.php(139): OpenEMR\Billing\BillingProcessor\Tasks\AbstractGenerator->execute() #3 /var/www/html/boss/src/Billing/BillingProcessor/BillingProcessor.php(91): OpenEMR\Billing\BillingProcessor\BillingProcessor->processClaims() #4 /var/www/html/boss/interface/billing/billing_process.php(33): OpenEMR\Billing\BillingProcessor\BillingProcessor->execute() #5 {main} thrown in /var/www/html/boss/src/Billing/BillingProcessor/Tasks/GeneratorX12Direct.php on line 214

New development that now if I select Continue. It marks the encounter as billed but does not generate the claim for transmit.

@juggernautsei I don’t think you have all the code. Can you try from master?

I will pull down master tonight an do a merge.

you’re right @juggernautsei
updateBatchfile() should check if $batch is null before proceeding

@stephenwaite That should be taken care of in BillingProcessor::prepareClaims()

The x-12 Generators shouldn’t be handed claims with no x-12 partner set.

                $billingClaim = new BillingClaim($claimId, $partner_and_payor);
                if (($billingClaim->getPartner() == -1) && ($_SESSION['bn_x12'])) {
                    // If the x-12 partner is unassigned, don't process it.
                    $this->logger->printToScreen(xl("No X-12 partner assigned for claim " . $billingClaim->getId()));
                    continue;
                } 
1 Like

how about !empty() instead of isset() for that if above the $billingClaim?

The ‘bill’ element is set on the array if that claim was checked for processing on the billing manager.

    // The form posts all claims whether they were selected or not, and we
    // just want the claims that were selected by the user, which have 'bill'
    // index set on their array

Something may have changed, or it’s possible there could be another value if there’s no x-12 partner. Maybe in this line we should also check for $billingClaim->getPartner() equal NULL or empty string?

if (($billingClaim->getPartner() == -1) && ($_SESSION['bn_x12'])) {

But Sherwin’s dump said the partner was 4, so I don’t know. Could be a wild-goose-chase… I don’t even really know what we’re trying to fix at this point :slight_smile:

@ken thanks for chiming in. I am going to take your advice. I will start over. The water has gotten muddy here. I will get a clean install of the code base from master and start there. :blush:

!empty prevents the the $partner_and_payor['bill'] = 0 condition that causes the exception when validating or creating a batch with a claim that is not capable of being sent electronically, if you don’t mind adding that to your PR or can do with a quick follow up

actually nvm, it’s that $_SESSION['bn_x12'] isn’t set

just needs
SessionUtil::setSession('bn_x12', true);
to be added to all X12 and HCFA items in
protected function buildProcessingTaskFromPost($post)

UPDATE:
I pulled down master and got it stood up and ported over the database.
It works

This was an all night challenge.

1 Like

Epilogue:

I merged the code back into the production site using ExamDiff Pro. Then I ran the composer dumpautoload -o. After that the billing log displayed the proper information and we were able to batch the claim in the production system.

No longer using Winmerge =(