patients_in_window function