Study finds 40% of doctors pessimistic about practice of medicine