edit doctor logic