state and encounter with encounterdatetime equals to startdate of
patientstate