updated the query that pulls all patient encounters