Most doctors get exactly zero nutrition education and the few which do are very limited and usually heavily influenced by Big-Ag and Big-Pharma. Certainly "only eating vegetables" is not sound advice, but it's not unreasonable to second-guess your doctor's diet recommendations.