Long term use of certain heartburn and ulcer drugs could lead to a vitamin B12 deficiency.

Stomach acids help the body process vitamin B12; when the acids are reduced as a function of the drugs it could keep the body from getting the vitamins it needs, a PR Newswire press release reported.

Vitamin B12 deficient patients are at a higher risk for "dementia, nerve damage, anemia, and other medical complications, some of which may be irreversible," the news release reported.

A team of medical researchers looked at electronic health records of 25,956 adult Kaiser Permanente patients who had suffered from a vitamin B12 deficiency between the years of 1997 and 2011. The data was compared to that of 184,199 similar patients that had not suffered a deficiency in the same timeframe.

This study marks the first-ever large trial linking vitamin B12 deficiencies with anti-acid medications such as proton pump inhibitors (PPIs).

"Patients who took PPI medications for more than two years had a 65 percent increase in their risk of B12 deficiency," Douglas A. Corley MD. PhD, a gastroenterologist and research scientist with the Kaiser Permanente Division of Research, said. "Higher doses also were associated with an increased risk, compared with lower doses. Kaiser Permanente's electronic health records allowed us to look at what happens in the real world for these commonly used medications."

Some of these acid reducers are even available over the counter. Twelve percent of the vitamin B12 deficient patients in the study used PPIs, while only 7.2 of the control patients were on them.

"This research raises the question of whether people who are taking acid-depressing medications long term should be screened for vitamin B12 deficiency," Dr. Corley said. "It's a relatively simple blood test, and vitamin supplements are an effective way of managing the vitamin deficiency, if it is found."