NYTimes.com – A federal appeals court in Boston on Tuesday dealt a setback to the pharmaceutical industry and companies that collect prescription data for use in drug marketing.

Ruling in support of a New Hampshire law, the court upheld the right of states to prohibit the sale of doctor-specific prescription drug data that is widely used in pharmaceutical marketing.

The law was intended to cut down on state health care costs by eliminating the tool used by drug sales representatives in promoting brand name drugs. By purchasing the data describing which doctors prescribe what drugs, pharmaceutical sales forces are better able to identify which doctors might use their products and be receptive to their sales pitches. They can also focus on persuading doctors who do not write many prescriptions for their products to change their minds.

Sales representatives — known as detailers in industry argot — often visit doctors’ offices carrying laptop computers with detailed reports on each doctor’s prescription-writing habits.

Saying in Tuesday’s opinion that the enterprise of buying and reselling prescription information was “mind-boggling” in its scope, United States Court of Appeals Judge Bruce Marshall Selya wrote, “The record contains substantial evidence that, in several instances, detailers armed with prescribing histories encourage the overzealous prescription of more costly brand-name drugs regardless of both the public health consequences and the probable outcome of a sensible cost/benefit analysis.”