I've been to a psych and he has never actually suggested that my issues are caused by my work place but he has suggested I take short-term leave on several occasions. I have refused to do it thus far but that seem obvious that he thinks work is causing or increasing my issues.
I've also talked to a therapist's but in general have no other major causes of stress in my life. I make more than double the median income in my area, my family is all healthy and close, etc. Work seems to be a major cause of stress. I've tried to find another job but the interview process in tech is more stressful than the actual work. So many rejections just wear you out over time.
To your point I would say the only way they could really tell if it was job related would be talking to each person and ruling out other causes.