Notifications
Clear all
Topic starter
Good afternoon, just wanted to see if anyone might have a report that can pull patients that have certain preferred pharmacies? We had a report to do this when we were on CEMR but of course it doesn't work in CPS because of table changes and I'm having trouble finding what I need to try and recreate it.
Thanks,
Linda
Posted : September 14, 2018 6:28 am
This will show all patients who have this pharmacy, but not if it is the preferred or not. I can likely alter it to show the preferred if that is what you are wanting but it will take some digging.
select pp.Last + ', ' + pp.First as Patient, cast(pp.Birthdate as date) as BirthDate, pp.PatientId, p.Name as PharmacyName, p.City as PharmacyCity, p.State as PharmacyState from PatientProfile pp
INNER JOIN PatientRelationship pr on pp.PId = pr.PId
INNER JOIN Pharmacy p on pr.RelatedPartyId = p.PharmacyId
where p.Name like '%Pharmacy%' and p.City = 'Glasgow' and p.State = 'KY'
Should be pretty explanatory but just modify what you want to return in the query. I set up the search based on pharmacy name/city/state to ensure you pull in the proper pharmacy.
Hope this helps!
Posted : September 14, 2018 7:40 am
Topic starter
Thanks Jonathan! This worked great!
Posted : September 18, 2018 2:01 am