Aged Recall query
Posted: Fri Jan 10, 2014 11:08 am
I'm looking for a query that provides a list of pts that were seen 6 to 8 months ago for prophies or cleanings. Ideally, it would also ID those who don't have apts for cleanings in this month... Just having a list of everyone we did cleanings on about 6 months ago would be a start.
I found a forum post for a query (below) that looked for Delta cleanings in a specific time frame. It doesn't work any more (2007 vintage). Also, rather than having to manually set the date range, I'd like it to just look 6 to 8 months in the past to find patients that might be falling thru the cracks as far as cleanings go.
SET @pos=0;
SELECT @pos:=@pos+1 as numberofpatients, carrier.CarrierName,procedurelog.ProcDate,patient.LName,patient.Fname
FROM patient,carrier,insplan,procedurelog,procedurecode
WHERE patient.PatNum=insplan.Subscriber
AND insplan.CarrierNum=carrier.CarrierNum
AND carrier.CarrierName LIKE '%Delta%'
AND patient.PatNum=procedurelog.PatNum
AND procedurelog.ProcDate>='2007-05-01'
AND procedurelog.ProcDate<='2007-09-30'
AND procedurelog.CodeNum=procedurecode.CodeNum
AND procedurecode.ProcCode LIKE '%D11%'
ORDER BY procedurelog.ProcDate
I found a forum post for a query (below) that looked for Delta cleanings in a specific time frame. It doesn't work any more (2007 vintage). Also, rather than having to manually set the date range, I'd like it to just look 6 to 8 months in the past to find patients that might be falling thru the cracks as far as cleanings go.
SET @pos=0;
SELECT @pos:=@pos+1 as numberofpatients, carrier.CarrierName,procedurelog.ProcDate,patient.LName,patient.Fname
FROM patient,carrier,insplan,procedurelog,procedurecode
WHERE patient.PatNum=insplan.Subscriber
AND insplan.CarrierNum=carrier.CarrierNum
AND carrier.CarrierName LIKE '%Delta%'
AND patient.PatNum=procedurelog.PatNum
AND procedurelog.ProcDate>='2007-05-01'
AND procedurelog.ProcDate<='2007-09-30'
AND procedurelog.CodeNum=procedurecode.CodeNum
AND procedurecode.ProcCode LIKE '%D11%'
ORDER BY procedurelog.ProcDate