Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: 837P service location details are not created when service facility and billing facility differ #7213

Closed
juggernautsei opened this issue Feb 9, 2024 · 7 comments · Fixed by #7228
Milestone

Comments

@juggernautsei
Copy link
Member

Describe the bug

When creating an encounter with a service facility and a different billing facility. The service facility is not being saved. The facility column in the database is filled with the billing facility number. This causes the incorrect billing.

To Reproduce

Steps to reproduce the behavior:

  1. Add a facility and a billing facility
  2. Create an encounter
  3. Save encounter then look in the forms encounter table.
  4. facility_id_sel is not stored in the facility_id column of the form_encounter table.

Expected behavior

Facility to be filled with the service facility number.

image

Client configuration

  • Browser:
  • OpenEMR version:
  • Operating system:
@stephenwaite
Copy link
Sponsor Member

hi @juggernautsei , can't reproduce on master, what version are you testing?

@juggernautsei
Copy link
Member Author

juggernautsei commented Feb 9, 2024

v7.0.2. I reported it because in the codebase it is the same code. I know that in master things can be fixed that has not made it git. I changed this line per the screenshot that I sent.

$facility_id = $_POST['facility_id'] ?? null;

I posted this issue hoping this has been fixed already. I did search for this issue. You tell me.

@stephenwaite
Copy link
Sponsor Member

Did you know it's Phil Belford's bday?

bday

@stephenwaite
Copy link
Sponsor Member

main demo looks okay
Screenshot from 2024-02-09 14-53-55

@juggernautsei
Copy link
Member Author

So, why is the code on github wrong? Pull down the release code and it is wrong.

@stephenwaite
Copy link
Sponsor Member

stephenwaite commented Feb 10, 2024

hi @juggernautsei , check out this line, https://github.com/openemr/openemr/blob/master/src/Billing/X125010837P.php#L990

it's not very good logic and needs to be improved in master when you get a chance, thank you

it should be something like

if ($claim->facilityPOS() != 12 && ($claim->billing_facility['id'] != $claim->facility['id'])) {} 

@stephenwaite stephenwaite changed the title Facility is not being saved when creating an encounter bug: 837P service details are not created when service facility and billing facility differ Feb 13, 2024
@stephenwaite stephenwaite changed the title bug: 837P service details are not created when service facility and billing facility differ bug: 837P service location details are not created when service facility and billing facility differ Feb 13, 2024
@juggernautsei
Copy link
Member Author

Thanks @stephenwaite

@adunsulag adunsulag added this to the 7.0.2.1 milestone Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants