A federal appeals court on Friday upheld a Florida law that seeks to bar doctors from discussing firearms safety with their patients – including inquiring whether they keep any guns at home.

The action reversed a 2012 injunction issued by a federal judge in Miami, who ruled that the Florida law violated the free-speech rights of physicians to counsel their patients about health-related matters.

The appeals court panel voted 2 to 1 to uphold the Florida law.

The measure, the Firearm Owners’ Privacy Act, was passed in 2011 in response to an American Medical Association policy that encouraged doctors to inquire about the presence of firearms in homes with children. The AMA policy was designed to help raise awareness and protect children from gun-related accidents.

Despite these good intentions, several would-be patients and the parents of children seeking medical services perceived the questions about gun ownership as intrusive and offensive.

In one case, medical staff members separated a mother from her children and then asked the children whether their mother owned any firearms.

In another instance, a mother refused to answer questions about whether she kept a gun at home, telling the physician that she felt the question was an invasion of her privacy. The pediatrician then informed the mother that she had 30 days to find a new doctor for her child.

The Florida law sought to protect patients’ privacy by restricting nonrelevant inquiries and record keeping by physicians about firearms. Violators could lose their license and face up to $10,000 in fines.

A group of physicians and medical associations responded to the new statute by filing a federal lawsuit. They argued that the law violated the First Amendment by imposing a content-based restriction on their speech.

Lawyers for the state countered that the Florida law was merely a regulation of professional conduct and imposed only an incidental burden on the physicians’ speech.

Other parts of the law sought to prevent discrimination and harassment by doctors. This was a regulation of conduct, not speech, the state lawyers argued.

In reversing the lower court injunction, the appeals court agreed with the state.

“We find that the Act is a valid regulation of professional conduct that has only incidental effect on physicians’ speech,” Judge Gerald Tjoflat wrote for the court. “As such, the Act does not facially violate the First Amendment.”

The judge added: “The Act simply codifies that good medical care does not require inquiry or record-keeping regarding firearms when unnecessary to a patient’s care.”

Judge Tjoflat noted that one part of the law seeks to prevent harassment of patients by doctors seeking to “pursue an agenda unrelated to medical care or safety.”

Such harassment would probably occur when a doctor had no relevant reason to ask about someone’s possession of guns in the home, he said. In contrast, the judge said, a physician dealing with a suicidal patient “may wish to attempt to persuade the patient to remove firearms from the patient’s home.”

The judge said fears that doctors will be subject to discipline for offending their patient’s sensibilities were “unfounded.”

“So long as a physician is operating in good faith within the boundaries of good medical practice, and is providing only firearm safety advice which is relevant and necessary, he or she need not fear discipline at the hands of the [state licensing] Board or a money judgment in a court of law,” Tjoflat said.

In a dissent, Judge Charles Wilson said he would find the Florida law unconstitutional as a legislative act that seeks to silence doctors’ “disfavored message about firearm safety.”

“This law is ... designed to stop a perceived political agenda, and it is difficult to conceive of any law designed for that purpose that could withstand First Amendment scrutiny,” he said.

“Simply put, the Act is a gag order that prevents doctors from even asking the first question in a conversation about firearms,” Judge Wilson said.

“The Act prohibits or significantly chills doctors from expressing their views and providing information to patients about one topic and one topic only, firearms,” he said.

“Regardless of whether we agree with the message conveyed by doctors to patients about firearms, I think it is perfectly clear that doctors have a First Amendment right to convey that message,” Wilson said.

Wilson said the decision was unprecedented because it held essentially that licensed professionals have no First Amendment rights when they are speaking to clients or patients in private. “This in turn says that patients have no First Amendment right to receive information from licensed professionals – a frightening prospect,” he said.

The case is Wollschlaeger v. Governor of the State of Florida (12-14009).