Production by Procedure Code
Production by Procedure Code
How do I print production by procedure code? Thanks.
-
- Posts: 4
- Joined: Tue Aug 28, 2007 12:00 pm
- Location: Douglasville, GA
- Contact:
I think this is the one that used to give me that info. I can't test it right now though because it is broken with the new database setup since the ADA code deal changed..I don't have the time today, but if someone knows how to fix this to work with the new Code Tables then it should be a good report.
SELECT definition.ItemName,
procedurelog.ADACode,
procedurecode.Descript,
Count(*),
AVG(procedurelog.ProcFee) AS $AvgFee,
SUM(procedurelog.ProcFee) AS $TotProcFee,
CAST((SUM(procedurelog.ProcFee)/(SELECT SUM(procedurelog.ProcFee) FROM procedurelog WHERE procedurelog.ProcStatus = '2' AND procedurelog.ProcDate>='2006-01-01' AND procedurelog.ProcDate<='2007-01-01')*100) AS DECIMAL(6,2)) AS Percentage
FROM procedurelog,procedurecode,definition
WHERE procedurelog.ProcStatus = '2'
AND procedurelog.ADACode=procedurecode.ADACode
AND definition.DefNum=procedurecode.ProcCat
AND procedurelog.ProcDate>='2007-01-01' AND procedurelog.ProcDate<='2008-01-01'
GROUP BY procedurelog.ADACode
ORDER BY definition.ItemOrder,procedurelog.ADACode
SELECT definition.ItemName,
procedurelog.ADACode,
procedurecode.Descript,
Count(*),
AVG(procedurelog.ProcFee) AS $AvgFee,
SUM(procedurelog.ProcFee) AS $TotProcFee,
CAST((SUM(procedurelog.ProcFee)/(SELECT SUM(procedurelog.ProcFee) FROM procedurelog WHERE procedurelog.ProcStatus = '2' AND procedurelog.ProcDate>='2006-01-01' AND procedurelog.ProcDate<='2007-01-01')*100) AS DECIMAL(6,2)) AS Percentage
FROM procedurelog,procedurecode,definition
WHERE procedurelog.ProcStatus = '2'
AND procedurelog.ADACode=procedurecode.ADACode
AND definition.DefNum=procedurecode.ProcCat
AND procedurelog.ProcDate>='2007-01-01' AND procedurelog.ProcDate<='2008-01-01'
GROUP BY procedurelog.ADACode
ORDER BY definition.ItemOrder,procedurelog.ADACode