Method of diagnosis and treatment in endodontics