I have done Procedures report going back a couple of years for D71** (I'm interested particularly in D7111, D7140, D7210, D7220, D7230, D7241), which lists the extraction date, procedure code, patient name & tooth.
Can someone give me a query to list the extraction date, patient's DOB, patient name, procedure code & tooth extracted? I don't mind if it just searches for one of the codes at a time.
Thanks.
Query - Procedures Report
Re: Query - Procedures Report
Hi, any ideas please. Someone please help with a suitable query. Thanks.
Or please point me to the correct file in FormsReport which handles Report - Procedures. Thanks.
Or please point me to the correct file in FormsReport which handles Report - Procedures. Thanks.
Re: Query - Procedures Report
I took query number 135 from the examples page and edited it to get the information you needed. See if it works out for you:
SET @FromDate='2008-01-01' , @ToDate='2008-12-31';
SELECT CONCAT(patient.LName, ', ',patient.FName, ' ', patient.MiddleI) As Patient, patient.birthdate, pl.ProcDate,
pv.Abbr,pc.ProcCode, pc.AbbrDesc, ToothNum, pl.ProcFee
FROM patient
INNER JOIN procedurelog pl ON patient.PatNum=pl.PatNum
INNER JOIN procedurecode pc ON pl.CodeNum= pc.CodeNum
INNER JOIN provider pv ON pl.ProvNum=pv.ProvNum
WHERE pl.ProcStatus = '2' AND (pl.ProcDate >=@FromDate
AND pl.ProcDate <= @ToDate) AND
(pc.ProcCode LIKE '%D7111%' OR pc.ProcCode LIKE '%D7140%' OR pc.ProcCode LIKE '%D7210%'
OR pc.ProcCode LIKE '%D7220%' OR pc.ProcCode LIKE '%D7230%' OR pc.ProcCode LIKE '%D7241%')
ORDER BY ProcDate,patient.LName, patient.FName ASC;
Jorge Bonilla, DMD
SET @FromDate='2008-01-01' , @ToDate='2008-12-31';
SELECT CONCAT(patient.LName, ', ',patient.FName, ' ', patient.MiddleI) As Patient, patient.birthdate, pl.ProcDate,
pv.Abbr,pc.ProcCode, pc.AbbrDesc, ToothNum, pl.ProcFee
FROM patient
INNER JOIN procedurelog pl ON patient.PatNum=pl.PatNum
INNER JOIN procedurecode pc ON pl.CodeNum= pc.CodeNum
INNER JOIN provider pv ON pl.ProvNum=pv.ProvNum
WHERE pl.ProcStatus = '2' AND (pl.ProcDate >=@FromDate
AND pl.ProcDate <= @ToDate) AND
(pc.ProcCode LIKE '%D7111%' OR pc.ProcCode LIKE '%D7140%' OR pc.ProcCode LIKE '%D7210%'
OR pc.ProcCode LIKE '%D7220%' OR pc.ProcCode LIKE '%D7230%' OR pc.ProcCode LIKE '%D7241%')
ORDER BY ProcDate,patient.LName, patient.FName ASC;
Jorge Bonilla, DMD
Jorge Bonilla DMD
Open Dental user since May 2005
Open Dental user since May 2005
Re: Query - Procedures Report
Thanks. I did not remember that the queries could be seen on the OpenDental website, and I wasn't successful finding them here. Arrgh.
Thanks much.
Thanks much.