SET NOCOUNT ON
SELECT DISTINCT
pp.First,
pp.Last,
pp.Birthdate,
pp.Sex,
pp.MedicalRecordNumber,
pp.Address1,
pp.City,
pp.State,
pp.Zip,
ic.ListName
FROM PatientProfile pp
LEFT JOIN PatientInsurance pip ON pip.PatientProfileId = pp.PatientProfileId AND ISNULL(pip.Inactive,0) AND pip.OrderForClaims = '1'
LEFT JOIN InsuranceCarriers ic ON ic.InsuranceCarriersId = pip.InsuranceCarriersId
Order by pp.Last
|