Service Facility not correct in x12

@stephenwaite
We are using the code base that was downloaded from GitHub on 1-05-2018.

We are having a problem with the x12 file. The service location is not showing correctly in box 32.

Box 32 and 33 are the same when the should be different.

They have two offices on in Knoxville and the other in Alcoa.
Box 32 shows Knoxville all the time.

How can we fix this?

I found facility service in the Claim.php file.

Line 218 is where the call is made to the method that is supposed to return the facility ID.

Somehow it is getting this information incorrectly and falling back to the billing facility as you have it coded in your notes.

    if (empty($this->encounter['billing_facility'])) {
          $this->billing_facility = $this->facilityService->getPrimaryBillingLocation();
    } else {
          $this->billing_facility = $this->facilityService->getById($this->encounter['billing_facility']);
    }

if the billing facility is empty then the billing facility is equal to the facility of service getPrimaryBillingLocation().

Help me out with this one, please.

@stephenwaite

great job on using doctrine to communicate with the database.
Right now I am trying to follow your path and figure out how to test the code to return the service location.

I just tested this on another install on a different server and it worked the way it was supposed to but the code on the second server is older than other meaning it was downloaded in December before the holidays.

The newer code, downloaded 01-05-2018, is on a production site and the older code, downloaded 12/11/2017, is in dev.

2018-01-18-2149-batch.txt (964 Bytes)

I am left scratching my head. It makes no sense today.

What changed? Line 792 changed.