updated so that if htmlform is flagged to create retrospective visit, the end date for that visit is set to the end of the day