Doctor makes court appearance while performing surgery