Sending Letters Via Clinical Portal
Sending Letters Via Clinical Portal Something like this should do the trick Select dc.DocumentID, dc.AuthorCode, au.FirstName, au.LastName, ad.PracticeCode, ad.AddressLine1 from DocumentCopy dc with (nolock) inner join Author au with (nolock) on au.authorcode = dc.AuthorCode and au.SiteCode = 'CMDHB' inner join [Address] ad with (nolock) on ad.LicenseNumber = au.LicenseNumber where dc.SiteCode = 'CMDHB' and ad.PracticeCode is null and au.LicenseNumber not in (Select LicenseNumber from [User] with (nolock) where LastSite = 'CMDHB' and UserType = 1) and dc.DocumentID not in (Select DocumentID from HA_DocumentAcknowledgement with (nolock) where DocumentID = dc.DocumentID and [userid] = au.AuthorCode)