state machine for Appointment