functional close/open with warning for appointment deletion