Skip to content

Instantly share code, notes, and snippets.

@msarchet
Created October 11, 2011 15:23
Show Gist options
  • Save msarchet/1278384 to your computer and use it in GitHub Desktop.
Save msarchet/1278384 to your computer and use it in GitHub Desktop.
Schedule Facility Query
Select
RXInfo.Patient,
RXInfo.Number,
Facility.Name,
RxInfo.RefillNumber
From scriptassist.RXInfo AS RXInfo
Left Join scriptAssist.Patient As PatientT On PatientT.PatientId = RXInfo.PatientID
Left Join scriptAssist.Facility On Facility.FacilityID = PatientT.FacilityID
Where
RXInfo.Schedule In ('2','3','4','5')
And ISNull(PatientT.FacilityID, 0) > 0
Order By
Facility.Name,
RxInfo.Patient,
RxInfo.Number,
RXInfo.RefillNumber
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment