A new study suggests that using electronic health records to tell doctors what infections are going around in their community could help cut down on unnecessary antibiotic prescriptions.

That's important because the more often antibiotics are used, the more likely bugs will become resistant to the drugs and harder to treat the next time around. And doctors often prescribe antibiotics when it's not clear whether or not a bacterial infection is really behind a person's fever, runny nose and cough, researchers said.

"That's the crux of the problem for a physician: they don't know if it's viral or bacterial," said Dr. Ari Robicsek from NorthShore University HealthSystem in Evanston, Illinois, who worked on the new study.

"Oftentimes they treat with an antibiotic, just in case it's a bacterial infection," he said.

Robicsek and his colleagues used electronic health records to look back at 28,000 patients who saw one of 69 doctors at NorthShore's hospitals and clinics during flu seasons between 2006 and 2011.

On average, those doctors prescribed an antibiotic for patients complaining of a fever and cough or cold symptoms 45 percent of the time, according to the findings published Monday in the Annals of Internal Medicine.

"A significant proportion of respiratory infections are really caused by viruses, and taking an antibiotic will provide no benefit to the patient and in fact really could cause unintended adverse outcomes," said infectious diseases researcher Dr. Philip Polgreen, from the University of Iowa in Iowa City, who didn't participate in the new study.

"We know that every year, thousands of prescriptions are prescribed inappropriately to patients with influenza," he told Reuters Health.

In the new study, the rate of antibiotic prescribing varied widely by doctor, with individuals giving out antibiotics anywhere from 18 percent to 84 percent of the time.

The researchers also noticed patterns across these different prescribers suggesting that context was influencing their choices.

For one thing, antibiotic prescriptions dropped by a few percentage points during flu "pandemic" periods, when the virus was known to be heavily affecting people in the area.

In addition, the more patients doctors had seen in the previous week with similar symptoms, the less likely they were to prescribe an antibiotic.

That's probably because those doctors assumed the flu was going around, Robicsek said - so it seemed likely their patient had the flu, as well.

"The more cases they've seen during an epidemic or a pandemic, they may be more comfortable not prescribing," said Dr. Andrew Fine, a pediatric emergency medicine specialist from Boston Children's Hospital.

Robicsek said the finding supports the idea that hospitals could be doing more to alert doctors to what's going around in their community - and that such information might help practitioners make smarter prescribing decisions.

Fine, who wasn't involved in the research but has studied such disease surveillance, agreed.

"There's an opportunity now to really take advantage of the massive investment in surveillance and the massive investment in electronic health records to improve patient care, and that includes" cutting down on unnecessary antibiotic prescribing, he told Reuters Health.

Robicsek said his group is working on a tool that would help hospitals do just that, using data from electronic health records to alert health providers to what symptoms and illnesses have been popping up recently in their area.

The study is published in journal Annals of Internal Medicine.