Some people who occasionally have upsetting bouts of irregular heartbeats may be able to treat themselves and avoid a trip to the emergency room by popping a pill, much as those with chest pain do now with nitroglycerin, new research suggests. Italian doctors tested this “pill-in-the-pocket” strategy on people with heartbeat problems, and it worked 94 percent of the time with few side effects, drastically reducing ER visits and hospital stays. The approach “appears to be feasible and safe,” the researchers reported in Thursday’s New England Journal of Medicine.