Patients under an Employer

For users or potential users.
Post Reply
jonesdds12
Posts: 12
Joined: Tue May 07, 2013 12:57 pm

Patients under an Employer

Post by jonesdds12 » Thu Sep 19, 2013 10:38 am

Trying to run a report showing all patients and their info under a certain employer. Using Query Example 131 which has: /*131 Patients with insurance of specific employers, uses insurance employer(s) you should repeat the employer name if you only want one, many times employers are listed more than one way, like HP and Hewlett Packard*/
SELECT EmpName AS 'Employer', PatNum, p.address, p.address2,p.city,p.state,p.zip
FROM patient p

For some reason OD is not recognizing EmpName. The error message is "Invalid query: Unkwon column 'EmpName' in 'field list'

Any reason this is happening. I am designating an employer in that area that is exact with what's in OD.

User avatar
jsalmon
Posts: 1565
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Patients under an Employer

Post by jsalmon » Thu Sep 19, 2013 10:53 am

That query is outdate. The employer feature got updated and is part of a different table and is now referenced as EmployerNum, hence the "unknown column" error. I'll have it updated soon.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

User avatar
jsalmon
Posts: 1565
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Patients under an Employer

Post by jsalmon » Thu Sep 19, 2013 10:56 am

Actually, after looking closer at the query, it is updated correctly. What version of Open Dental are you using? I recommend updating to our most recent stable version.

Or are you just running part of the query (the section you pasted above)? Because to have the query be successful, you need to run the entire thing.

Code: Select all

SELECT EmpName AS 'Employer', PatNum, p.address, p.address2,p.city,p.state,p.zip
FROM patient p
INNER JOIN inssub iss ON iss.Subscriber=p.PatNum
INNER JOIN insplan i ON i.PlanNum=iss.PlanNum
INNER JOIN employer e ON i.EmployerNum=e.EmployerNum
WHERE p.PatStatus=0 AND
((empname LIKE ('%IBM%')) OR (empname LIKE ('%Frijole Taco Stand%')))
ORDER BY EmpName, p.lname;
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

jonesdds12
Posts: 12
Joined: Tue May 07, 2013 12:57 pm

Re: Patients under an Employer

Post by jonesdds12 » Thu Sep 19, 2013 1:42 pm

Nevermind, Stupid mistake!

Post Reply