Query examples

For users or potential users.
Post Reply
fishdrzig
Posts: 433
Joined: Tue Oct 07, 2008 12:46 pm

Query examples

Post by fishdrzig » Mon Aug 31, 2009 3:32 pm

Can someone offer a query just to find out how many active patients there are?
Can someone offer a query to find out how many deceased patients there are?

I checked the query examples and can't seem to find anything that will give me these two reports. Thank you

jclaydds
Posts: 180
Joined: Thu Mar 20, 2008 7:39 am
Location: Shady Spring, WV

Re: Query examples

Post by jclaydds » Tue Sep 01, 2009 4:05 am

To Find Active Patients, Go to the Query Example Page

http://70.90.133.65:1942/ODQueryList/QueryList.aspx

Use Query #22.

I am sorry but I can't help you with the Query for deceased patients.

JimZ
Posts: 113
Joined: Thu Nov 01, 2007 9:16 pm
Location: Pittsburgh, PA
Contact:

Re: Query examples

Post by JimZ » Tue Sep 01, 2009 8:39 am

I think this might work:

SELECT patient.LName,patient.FName,patient.Address,patient.Address2,patient.City,patient.State,patient.Zip,patient.HmPhone,patient.WirelessPhone,patient.Birthdate,patient.Email,patient.MedUrgNote FROM patient
WHERE PatStatus=5
ORDER BY LName

You can customize this by eliminating patient.Address, patient.City, etc if you do not need those items.
PatStatus is broken down as 0=Patient, 1=NonPatient, 2=Inactive, 3=Archived, 4=Deleted, and 5=Deceased.

Jim
After looking, this might work better:

SELECT PatStatus,COUNT(*)FROM patient
WHERE PatStatus= 5
Group By PatStatus

Sorry for the confusion
Jim

fishdrzig
Posts: 433
Joined: Tue Oct 07, 2008 12:46 pm

Re: Query examples

Post by fishdrzig » Tue Sep 01, 2009 5:13 pm

Jim

Thank you, it worked great!

fishdrzig
Posts: 433
Joined: Tue Oct 07, 2008 12:46 pm

Re: Query examples

Post by fishdrzig » Tue Sep 01, 2009 5:18 pm

JayclayDDS

Thanks for the help

Post Reply