In this July 16, 1964, photo, Barry Goldwater waves to delegates at the Republican National Convention in San Francisco. (AP)

Donald Trump had a very bad week — so bad that some were asking whether something was wrong with him. Like, really wrong.

"We’re asking ourselves — I didn’t say this, but this is what everybody is saying: Is Donald Trump a sociopath?" MSNBC host Joe Scarborough said.

Then there was this from former Harvard Medical School dean Jeffrey Flier:

And a Northwestern University professor recently published a 9,000-word psychological evaluation of Trump — from afar, of course — largely dealing with Trump and narcissism.

He isn't the only public figure who's been subjected to some remote analysis.

Witness this report from People magazine in 2008 about Britney Spears (emphasis mine):

During her 14-day hold, her doctor can discharge her to outpatient treatment if she is deemed well enough or apply to keep her longer — a move UCLA psychiatrist Dr. Carole Lieberman (who is not treating Spears) would advise.

Or this, from Radar Online, about Lindsay Lohan:

While Lindsay Lohan continues to party until the wee hours of the morning, and her family and friends grow increasingly concerned for her, Dr. Drew Pinsky, who is not treating Lohan, has some candid advice for the people closest to her.

Or this, from the National Enquirer, about Lisa Marie Presley:

Dr. Judy Kuriansky, a leading New York psychologist who has not treated Lisa Marie, said: “This is an absolutely danger­ous and potentially deadly situation.

The reason each of those bolded disclosures were made: They have to be. And that's because of yet another presidential candidate, half a century ago. Back in 1964, a whole bunch of psychiatrists decided they would like to psychoanalyze Republican presidential candidate Barry Goldwater. The result was what's known as the "Goldwater Rule."

Well, that's not technically what the rule is all about. In fact, it states:

On occasion psychiatrists are asked for an opinion about an individual who is in the light of public attention or who has disclosed information about himself/herself through public media. In such circumstances, a psychiatrist may share with the public his or her expertise about psychiatric issues in general. However, it is unethical for a psychiatrist to offer a professional opinion unless he or she has conducted an examination and has been granted proper authorization for such a statement.

The short version: It's okay to talk about psychiatric issues — but not okay to diagnose people you haven't treated.

Experts say all people have some narcissistic traits, but what does being a "narcissist" mean? (Victoria Walker/The Washington Post)

The American Psychiatric Association first began to follow the rule in 1973, but given recent events, it saw fit Wednesday to remind psychiatrists across the United States that the rule exists and must be followed.

"The unique atmosphere of this year’s election cycle may lead some to want to psychoanalyze the candidates," Maria A. Oquendo, president of the APA, wrote, "but to do so would not only be unethical, it would be irresponsible."

It's not clear whether Oquendo's post was a direct response to Flier's tweet or Scarborough's comments, but the timing certainly seems to fit. She did not respond to a request for comment.

As she notes in her post, the rule derives from a survey by Fact magazine in 1964. The magazine surveyed more than 12,000 psychiatrists about Goldwater. About 2,400 responded, and half of them declared Goldwater unfit for the presidency.

"FACT: 1,189 Psychiatrists Say Goldwater is Psychologically Unfit to Be President," blared the headline. Goldwater sued for libel and won.

"This large, very public ethical misstep by a significant number of psychiatrists violated the spirit of the ethical code that we live by as physicians, and could very well have eroded public confidence in psychiatry," Oquendo wrote.

Goldwater wasn't the last candidate to face psychological speculation and armchair analysis during a campaign.

In 1972, Thomas Eagleton withdrew as George McGovern's running mate after it was revealed that he had had been hospitalized three times for depression and undergone electroshock therapy.

In 1988, both George H.W. Bush and Michael Dukakis insisted that they had never undergone psychiatric treatment, after the Washington Times reported on rumors related to Dukakis's mental health. Then-President Ronald Reagan drew some criticism for making fun of the Dukakis controversy by saying, "I'm not going to pick on an invalid."

But whatever happens over the next three months, any rumors and speculation along those lines will be the domain of the media and political partisans — not psychiatrists.