Notifications
Clear all
Topic starter
hi all, wondering if anyone has a report they can email me to get list of top meds prescribed by MD? i'm trying to help create some custom lists and this would help so much!!!
Posted : September 12, 2016 8:15 am
Here is a SQL script that I use:
SELECT Top 100
M.Description,
COUNT(P.MID) AS ScriptCount
FROM prescrib P
Inner Join MEDICATE m
on p.MID = m.MID
WHERE p.PVID = 'Insert PVID here'
group by M.DESCRIPTION
order by ScriptCount desc
Posted : September 12, 2016 9:23 am
I added another join to make it easier to use. This is for cps.
SELECT TOP 100
m.DESCRIPTION ,
COUNT(P.MID) AS ScriptCount
FROM PRESCRIB P
INNER JOIN MEDICATE m ON P.MID = m.MID
INNER JOIN usr u ON p.PVID = u.PVID
WHERE u.LOGINNAME like 'USERNAME HERE'
GROUP BY m.DESCRIPTION
ORDER BY ScriptCount DESC;
Posted : September 16, 2016 4:42 am