Do doctors need to know their patients’ sexual orientation and gender identity?

A growing number of federal agencies has been pushing health care providers to ask. Federally funded community health centers, which treat millions of patients, have begun to collect the data. Electronic health software must be able to store it. And blueprints for national health goals recommend collecting the information from all patients.

By knowing whether a patient is lesbian, gay, bisexual, transgender or straight, say public health experts, clinicians can be more alert to a person’s medical needs and more thoughtful in interactions. If hospitals report statistics on all patients, health care disparities among L.G.B.T. patients can be identified and redressed more effectively.

But most doctors and nurses are in no rush to comply. In several studies, they have said they feel uneasy about asking because they don’t want to make patients uncomfortable.

Research now suggests those assumptions may be wrong.

A new study of both patients and providers in the journal JAMA Internal Medicine looked at the feasibility of gathering such information in emergency departments. Nearly 80 percent of providers surveyed believed that patients would refuse to disclose their sexual orientation.