Active patients or patients seen in the last 24 months

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
jennifer@straine
Posts: 1
Joined: Thu Dec 11, 2014 10:53 am

Active patients or patients seen in the last 24 months

Post by jennifer@straine » Thu Dec 11, 2014 10:58 am

How to you find your active patients of record or the patients seen in the last 24 months?

Tom Zaccaria
Posts: 353
Joined: Mon Feb 25, 2008 3:09 am

Re: Active patients or patients seen in the last 24 months

Post by Tom Zaccaria » Thu Dec 11, 2014 12:06 pm

Change the dates according to your needs

# Count of active patients seen between two dates
SET @pos=0;
SELECT Year(ProcDate) AS Year, Month(ProcDate) AS month,
COUNT(DISTINCT patient.PatNum)AS 'Patients'
from patient, procedurelog
WHERE procedurelog.patnum = patient.patnum
AND patient.patstatus = '0'
AND procedurelog.procstatus = 2
AND procedurelog.procdate > '2014-01-01'
AND procedurelog.procdate < '2014-12-31'
GROUP BY YEAR(ProcDate), Month(ProcDate)
ORDER BY YEAR(ProcDate), Month(ProcDate);

drtmz

Post Reply