Cardiologists have worked hard to remove heart blockages faster for patients coming into the emergency room. But they’ve overlooked patients who have heart attacks while they’re already in the hospital.

If you had to have a heart attack, you’d probably choose to have it in the hospital, where you would have immediate access to a surgeon, just in case.

But it turns out that among those who have a type of heart attack called a STEMI, or ST-elevation myocardial infarction, patients already in the hospital are three times more likely to die, according to a paper published today in the Journal of the American Medical Association.

About one in five heart attacks is a STEMI, a major episode in which an artery is completely blocked. Doctors recognize a STEMI by a pattern on the patient’s electrocardiogram (ECG) reading. Treatment usually involves surgery to restore blood flow through the artery.

A patient’s chance of survival depends heavily on speedy access to diagnosis and medical intervention to unblock the artery.

Learn More About Heart Attack Treatments »

So why do patients in the hospital fare worse than those who have to wait for an ambulance?

“Historically, we’ve focused almost exclusively on the patients who come in from the outside,” said study author Dr. Prashant Kaul, an interventional cardiologist at the University of North Carolina, Chapel Hill.

The vast majority of patients have heart attacks at home, at work, or in the grocery store. Most other studies have gathered data on patients who were brought to the hospital already in the throes of a heart attack. One key data point in the effort to speed up care is “door-to-balloon time” — looking at how fast patients are diagnosed and treated after they come in the emergency room doors. That time has gone down by 30 percent.

Yet patients who are already admitted have been ignored, though they make up 5 percent of STEMI cases.

The researchers looked at the medical records of more than 60,000 STEMI patients in 300 California hospitals between 2008 and 2011. The patients who were already in the hospital when they had the heart attack were less likely to undergo cardiac catheterization to unblock their artery. They also stayed in the hospital almost two weeks for heart attack care, compared to the outside patients’ five days. The cost of their heart care was around $245,000, compared to the other patients’ $129,000.

Dr. Gregg Fonarow, a professor of cardiovascular medicine at the University of California, Los Angeles, and a spokesman for the American Heart Association (AHA), called it “a small but significant number,” given that heart disease kills more Americans than anything else.

Kaul’s study “highlights a really important and substantial opportunity to improve care,” Fonarow said.

Kaul hopes the study will get physicians to “transfer” the lessons they’ve learned through “door-to-balloon” measurements to in-hospital patients.

When heart attack patients are brought into the hospital, interventional cardiologists like Kaul are likely at home, equipped with a group pager.

“As soon as it’s identified as a STEMI and as soon as that pager goes off, we start driving in. The same process or protocol would also work for a patient that’s already in the hospital,” he said.

But hospitalized patients are nevertheless trickier due to the medical issues that brought them to the hospital in the first place. The study’s mortality numbers account for those illnesses. The already-hospitalized patients were less likely to undergo invasive testing or intervention, suggesting that there’s trouble getting to a diagnosis quickly.

Keep Reading: What’s Your Risk of a Heart Attack? »

Other, underlying illnesses also mean that doctors can’t just move faster.

“There are often more complex decision points, which is why we haven’t focused on this group before,” said Kaul.

Doctors have to recognize a possible heart attack in patients who may have other heart problems or who could be experiencing general postoperative pain, Fonarow explained.

Patients recovering from surgery, particularly vascular surgery, have higher risks of a STEMI heart attack. So do patients with congestive heart failure and some types of cancer.

Second, blood-thinning drugs are often prescribed after surgery to unblock arteries, and these drugs can be more dangerous for patients with some of the conditions that are most likely to trigger an in-hospital STEMI.

Read More: Stents and Blood Clots »

Doctors could develop specific guidelines for treating these patients, even though the same basic medical rules apply.

These patients may also become a separate category as data is monitored in hospital quality assurance programs. They will likely be added to the AHA’s Mission: Lifeline program, which captures data on heart attack patients and uses it to develop standards of care.

“It’d be a logical and important step to expand that,” Fonarow said.

Take Action: Protect Your Heart »