updated query for checking out of range (for dob and deathdate) visits