Rep. Anthony Weiner announced this week that he’s seeking treatment for sexual “addiction” — mortifying in formation that a private person would want to keep to himself. But it soon may be difficult to keep any sensitive medical problem strictly between you and your doctor.

The 2009 stimulus and the Obama health law enacted last year established a national electronic health database that will hold and display your lifelong medical history — making it accessible to a troubling number of strangers, including government employees and a variety of health-care personnel.

Government will oversee the network linking doctors and hospitals. Doctors will have to enter your treatments in the database, and your doctors’ decisions will be monitored for compliance with federal guidelines.

The stimulus legislation allocated billions for incentive payments to doctors and hospitals to become part of the network. In 2015, those incentives get replaced with penalties on the doctors and hospitals that haven’t complied. And Section 1311 of the Obama health law says that private health plans can pay only doctors who implement whatever the federal government dictates to improve “quality.” This is the first time the federal government has asserted a broad power to control how doctors treat privately insured patients.

Before the Obama health law, patients who voluntarily bought insurance shared information with their insurer. Now, government regulators will have access to oversee physician compliance.

The advantage of an electronic medical record is obvious. When you need emergency care, a doctor can get information about your past illnesses, tests and treatments with the click of a mouse. It will reduce testing, save money and sometimes save a life. But there are dangers.

Mark Rothstein, a University of Louisville School of Medicine bioethicist, worries that the system discloses information that’s no longer relevant but could be embarrassing. Your oral surgeon doesn’t need to know about your erectile dysfunction or your bout of depression 20 years ago. Nevertheless, such information will be visible.

Federal proposals to protect privacy have been half-hearted. On May 31, the Health and Human Services Department proposed allowing patients to request a report on who has electronically viewed their information.

After the fact is too late. Patients should have to give consent before their doctor links their record to a nationwide database, says the New York Civil Liberties Union.

The National Committee on Vital and Health Statistics, a federal advisory committee, proposed permitting patients to keep categories of information, such as mental or reproductive health, out of the national database. The Goldwater Institute, a free-market think tank suing to overturn the Obama health law, argues that the law violates privacy rights by compelling Americans to share “with millions of strangers who are not physicians confidential private and personal medical history information they do not wish to share.”