I'm working on a report to list patient visits by race. I took the ValuePack Visit counts report and am trying to add the race.description to the output. However, each patient's race comes in as "Not Entered", which I know is incorrect. Any help will be appreciated.
The query is basically:
SELECT
ISNULL(Race.Description,'Not Entered') as
Race (when I take out ISNULL, it errors out)
from
patientvisit pv
inner join patientprofile pp on
pp.patientprofileID = pv.patientprofileID
inner join patientvisitprocs pvp on pv.patientvisitID = pvp.patientvisitID
left join Medlists Race ON pp.racemid =
race.MedListsId (note: when I try to add AND race.TableName='Race' it errors out)
Race is no longer stored in that field. Link PatientProfile to the new PatientRace table on PID, and pull the PatientRaceMid value from that table.