We complain, in the U.S., that our doctors don't know us: office visits last only a few minutes, conversations are curt and high-tech testing takes the place of talking. Now, perversely, one state has passed a law expressly forbidding doctors from asking certain questions about patients' health and lifestyle.

The questions concern guns and gun safety. This year the U.S. Court of Appeals for the Eleventh Circuit has been hearing arguments about a Florida statute that says doctors cannot ask a patient about gun ownership—including safety issues and children's access—unless they believe such information is relevant to the patient's medical care. If the law is upheld, doctors will not be able to talk to patients about one of the biggest threats to public health in the U.S.—guns were involved in slightly more than 11,000 homicides, 21,000 suicides and 500 accidental deaths in 2013, according to the U.S. Centers for Disease Control and Prevention. To wall off this topic from doctor-patient conversations is a dangerous step.

Gun ownership is a right protected, of course, by the Second Amendment to the U.S. Constitution. In 2011 Governor Rick Scott of Florida and the state's legislature felt that that right was being infringed on by Florida doctors. Scott signed the Privacy of Firearms Owners bill, which said that patients could file a complaint with the state if they felt doctors were being too nosy. Robert Young, a physician representing a group called Doctors for Responsible Gun Ownership that supported the bill, explained the rationale: “Too many Floridians had bad experiences with physicians telling them to get rid of their guns, when many patients who own and use guns knew that wasn't right.” He added that “many gun owners also fear the creation of databases of gun ownership because that could be a step toward confiscation someday.”

Florida doctors countered that the law deprived them of their own constitutional right, the First Amendment guarantee of free speech, and that deprivation prevented them from helping patients. They sued, backed by the American Medical Association and other physician groups. The First Amendment is important here: one judge who heard this case noted that courts have repeatedly said that free and open doctor-patient communication is crucial to care and the common good. (The judge also noted that Florida lawmakers relied on anecdotes in crafting the law rather than on data or studies.)

Physicians are supposed to offer counseling not just about diet and exercise but also about injury prevention connected to boating, bicycling and riding motorcycles, observed Stuart Himmelstein, then head of the Florida Chapter of the American College of Physicians, in a lawsuit document. Counseling a motorcyclist to wear a helmet is no different than counseling a gun owner to store firearms safely. Safe behavior with guns will have a health effect beyond the gun owner: 89 percent of accidental firearms-related injuries to children happen in homes, often when a youngster grabs an unattended and loaded weapon, according to a study published in JAMA Pediatrics in 1996.

Concerns about doctors creating a database of gun owners are also misguided. Doctors already are explicitly prohibited from keeping records on gun ownership by a provision of the federal Affordable Care Act.

The lawsuit about the Florida statute, which has been dubbed “Docs vs. Glocks,” has bounced among various courts in recent years, with some judges upholding the law and some overturning it. Meanwhile Indiana and Texas have been considering their own versions this spring. The Eleventh Circuit should follow the evidence and strike down the Florida law this year, an action that could keep other lawmakers from getting between patients and their doctors.

Nobody wants to tread on gun owners' constitutional rights. But the Second Amendment does not protect them or innocent bystanders from bullets.