Table/field locations

drpwayne wrote on Saturday, September 05, 2009:

Sorry for what may be a few dumb questions, but I can’t figure out where everything is located in OpenEMR. I confess that my php skills are very rudimentary, but I am trying to trace this section of gen_x12_837.inc.php:

if ($claim->referrerLastName()) {
    // Medicare requires referring provider’s name and UPIN.
    ++$edicount;
    $out .= “NM1” .     // Loop 2310A Referring Provider
      “*DN” .
      “*1” .
      “*” . $claim->referrerLastName() .
      “*” . $claim->referrerFirstName() .
      “*” . $claim->referrerMiddleName() .
      “*” .
      “*”;

I can’t find any methods for referrerLastName(), etc.  in Claim.class.php. Can someone point me in the right direction? Thank you.
- Peter

bradymiller wrote on Saturday, September 05, 2009:

hey,

If in linux command line I do following:
grep -Rn "function referrerLastName" openemr

it outputs:
openemr/library/Claim.class.php:1015:  function referrerLastName() {

So you should find the function on line 1015 of the openemr/library/Claim.class.php file. The grep command above is recursively (-R) sorting through every file in the openemr directory and spits out them all with the line number (-n).

-brady

drpwayne wrote on Saturday, September 05, 2009:

Thank you, Brady. I was looking in the “classes” directory – there’s a Claim.class.php file there as well but apparently it’s not the right one. I don’t know how php decides which one to use.

It seems to me from the (correct) Claim.class.php that the "referrer" is taken from the user table, which is not going to work for consultations. I think there should be a separate table of referrers.

bradymiller wrote on Saturday, September 05, 2009:

hey,
The best way to find out which files/scripts are being used is by looking at the include lines at the top of the file.  I know minimal stuff about the billing and referral engine, will await others input there.
-brady

sunsetsystems wrote on Sunday, September 06, 2009:

I am on vacation for the next week, but just a quick reply…

The users table contains address book entries, which are commonly outside providers, in addition to local users.  That is why this table is referenced for referring doctors.

Rod
www.sunsetsystems.com

drpwayne wrote on Sunday, September 06, 2009:

Someone with “accounting” privileges or someone at the front desk can’t add a referrer, then, as far as I can tell. Only an administrator. What does “accounting” mean? Isn’t that a person who can create bills? And how does a “front desk” person enter a referrer when a new patient makes an appointment, or comes to the front desk with referral information? I’m still confused as to how this is all supposed to work.

blankev wrote on Sunday, September 06, 2009:

Hello Dr. Peter Wayne,

start reading the Forums…

But as I did, you want to start working with OpenEMr… so I will give you a hint:   ;-)) and thsi is after I did not read the Forums and available manuals…

A USER is someone with special rights. Can be added through Admin => USER menu these have certain privileges to ADD CHANGE and DELETE. I can’t tell you wich ones, since I didn’t read that chapter jet ;-(

Within MISCELLANEOUS => Addr book, any registered USER can add and even to my  horror scenario settings DELETE, ADD and change persons within the "Add book". Can even DELETE  Admin Adminsistrator and others with full rights (those with a "  *  " are the vulnerable, with all terrible results as not being able to login into OpenEMR etc.

All persons in the Addr book are persons you can refer to.

Good luck and don’t forget to send your experiences to the OpenEMR community and your experience in writing for the manuals for others to learn.

Pimm

drpwayne wrote on Sunday, September 06, 2009:

Thank you Pimm, but I don’t think you understand the issue. It is possibly a peculiarity of the reimbursement system in the U.S., but for consultations, we need to have the referring physician. A typical visit would be:
Brady Miller referred by Dr. Bowen for evaluation of rectal bleeding.
This would generate 2 bills with 2 referrers and one rendering provider:
1) First bill would be a consultation, in which Dr. Bowen is the referrer, Dr. Wayne is the rendering provider, and the diagnosis is rectal bleeding.
2) Second bill would be for a stool guaiac test, in which Dr. Wayne is both the rendering provider and the referrer – in this case, the “referrer” is the person who ordered the lab test.

I have not been able to figure out how to bill for this. Rod said the referrer is the "provider" in the patient demographics – so it would be necessary to go into demographics twice to change the referrer, first to Dr Bowen,and then to Dr Wayne, and then back to Dr Bowen. However, when I go into Demographics and enter the "providers", I see a list of users, which includes non-physicians. That would just lead to data entry mistakes. And in the fee sheet when I choose the "provider" drop-down, I see all the local users, which again includes data entry and clerical personnel, who are not listed as physicians, and who, if chosen, would result in rejected bills.
Am I doing something wrong, or is this the way it works?

The only manual I’ve got is a 31 page manual, which is OK as far as it goes, but doesn’t really address these issues.

blankev wrote on Sunday, September 06, 2009:

Dr Dwayne,

thank you for your extensive answer. I should have read the Manuals first and than the Forums secondt  ;-((    , but now I can see why the President of the US has so much trouble refoming the healthcare system. He should make it easy. Just what you do, you get paid for. Every physician is reliable aren’t they? They should get the benefit of the doubt and only declare what they do and the health care system should pay whatever need to be done to keep the clients healthy…

I will refrain from answering your question, due to lack of knowledge.

Pimm

drpwayne wrote on Sunday, September 06, 2009:

Thank you Pimm, but I don’t think you understand the issue. It is possibly a peculiarity of the reimbursement system in the U.S., but for consultations, we need to have the referring physician. A typical visit would be:
Brady Miller referred by Dr. Bowen for evaluation of rectal bleeding.
This would generate 2 bills with 2 referrers and one rendering provider:
1) First bill would be a consultation, in which Dr. Bowen is the referrer, Dr. Wayne is the rendering provider, and the diagnosis is rectal bleeding.
2) Second bill would be for a stool guaiac test, in which Dr. Wayne is both the rendering provider and the referrer – in this case, the “referrer” is the person who ordered the lab test.

I have not been able to figure out how to bill for this. Rod said the referrer is the "provider" in the patient demographics – so it would be necessary to go into demographics twice to change the referrer, first to Dr Bowen,and then to Dr Wayne, and then back to Dr Bowen. However, when I go into Demographics and enter the "providers", I see a list of users, which includes non-physicians. That would just lead to data entry mistakes. And in the fee sheet when I choose the "provider" drop-down, I see all the local users, which again includes data entry and clerical personnel, who are not listed as physicians, and who, if chosen, would result in rejected bills.
Am I doing something wrong, or is this the way it works?

The only manual I’ve got is a 31 page manual, which is OK as far as it goes, but doesn’t really address these issues.

jpmd wrote on Monday, September 07, 2009:

I could not tell if this was mentioned prior but I think we should probably move or  add a referring provider drop down in the fee sheet that is associatied with the code being billed. I still think that a separate encounter would still need to be generated in order to create a separate x12 file for the same date of service.  We could keep the default provider so that one would not have to change the value if the billing provider is the same as the oredering provider for non consultation cases. 

Creating some kind of logic based on consulation CPT codes would be nice to prompt a biller that a referring provider is necessary or needs to be changed.

Jude Pierre, MD
Phyaura, LLC

drpwayne wrote on Monday, September 07, 2009:

Hello Jude,
I appreciate your comments. I also noticed there are some errors in the X12 file that is generated – if this is of value.
The UPIN number is not to be used at all any more – this took effect on 5/23/2008;  claims submitted with legacy identifiers will be rejected.
Also, a single X12 file can contain many claims. It is not clear to me why one claim creates one file.
There are other errors with the x12 files that I’ve mentioned before – the most glaring is that they all have the same batch number, date and time of creation.