WASHINGTON (Reuters) - U.S. regulators proposed a new rule to improve the tracking of safety problems with medical devices by requiring that each have a unique code.

The Food and Drug Administration said under the rule, device makers like Boston Scientific Corp and Medtronic Inc would put the special code on most of their products, ranging from hip implants to heart defibrillators.

The unique device identifier (UDI) would allow doctors and regulators to detect safety problems more quickly and to inform patients about flaws or dangers.

Companies and hospitals could pull faulty devices from the market faster -- by knowing which products are affected.

Unique codes would also prevent counterfeit or stolen devices from entering the supply chain, the FDA said.

The FDA said people have 120 days to comment on the proposed rule. The agency will consider the comments before it makes the rule final.

Recent problems included all-metal hip implants from Johnson & Johnson, which failed at a higher-than-expected rate and caused some patients to have joint dislocation or nerve damage.

There have also been problems with vaginal mesh implants from companies including J&J and Boston Scientific, and exposed electrical wires in defibrillators from St. Jude Medical Inc.

Doctors and patient advocates say the system would allow the FDA to be more active in identifying flawed or unsafe products before they cause widespread injuries.

The critics said the FDA was slow to implement the changes, since Congress first directed the agency to develop the device codes in 2007.

Last month, Congress failed to agree on a similar national "track and trace" plan for medications, after regulators, companies and others could not agree on the details.