SELECT *
FROM BPS_Patients
WHERE StatusText = 'Active'
AND EXISTS (
    SELECT INVOICES.INVOICEID, INVOICES.INTERNALID, COUNT(*)
    FROM INVOICES
        INNER JOIN SERVICES ON INVOICES.INVOICEID = SERVICES.INVOICEID
    WHERE INVOICES.recordstatus=1
        AND INVOICES.INTERNALID = BPS_Patients.InternalID
        AND SERVICES.recordstatus=1
        AND SERVICES.SERVICESTATUS in (0,2)
        AND SERVICES.MBSITEM IN (
                     SELECT [ITEM]
                     FROM [BPSDrugs].[dbo].[MedicareFees]
                     WHERE [DESCRIPTION] LIKE '%telehealth%')             -- Description of item billed
        AND ServiceDate >= DATEADD(MONTH, -6, GETDATE())                  -- Billed from 6 months ago
    GROUP BY INVOICES.INVOICEID, INVOICES.INTERNALID HAVING COUNT(*) >= 1 -- Having 1 or more invoices
)
ORDER BY SURNAME,FIRSTNAME

-- Search for pts that have been billed a telehealth consult item or items, by description