Page 1 of 1

Query examples

Posted: Mon Aug 31, 2009 3:32 pm
by fishdrzig
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

Re: Query examples

Posted: Tue Sep 01, 2009 4:05 am
by jclaydds
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.

Re: Query examples

Posted: Tue Sep 01, 2009 8:39 am
by JimZ
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

Re: Query examples

Posted: Tue Sep 01, 2009 5:13 pm
by fishdrzig
Jim

Thank you, it worked great!

Re: Query examples

Posted: Tue Sep 01, 2009 5:18 pm
by fishdrzig
JayclayDDS

Thanks for the help