updated the query to pull encounters