(CNN) Hospitals in New York are giving Covid-19 patients heartburn medicine to see if it helps fight the virus, according to the doctor who initiated the trial.

Preliminary results of the clinical trial of famotidine , the active ingredient in Pepcid, could come out in the next few weeks, said Dr. Kevin Tracey, president of Feinstein Institutes for Medical Research at Northwell Health, which runs 23 hospitals in the New York City area.

So far, 187 patients have enrolled in the clinical trial, and Northwell eventually hopes to enroll 1,200, he said.

"There are many examples in the history of medicine where a drug that was designed for one purpose turns out to have an effect in another disease," Tracey said.

He said if famotidine works -- and that's a big if at this point -- it would be easy to use it on a widespread scale.

"It's generic, it's plentiful and it's inexpensive," he said.

But he emphasized that it might not work.

"We don't know if it has any benefit. We really don't. I swear we don't," he said. "People are hoping for anything. But we need to do this clinical trial."

He also emphasized that the patients in the study are in the hospital taking mega-doses intravenously -- doses about nine times what someone would normally take for heartburn.

"You should not go to the drugstore and take a bunch of heartburn medicine," he said.

Learning from Chinese patients' medications

Tracey and his colleagues got the idea to study famotidine after it was observed that some patients in China taking the drug fared better than patients not taking the drug.

He said studies on the Chinese patients have not yet been published, but that Dr. Michael Callahan, an infectious disease specialist at Massachusetts General Hospital who worked with coronavirus patients in China, observed that some people with lower incomes were surviving longer than their wealthier counterparts who also had heartburn.

When Callahan and the Chinese doctors looked closer, they found that many of the people with lower incomes were taking famotidine, whereas the wealthier patients tended to take a different, more expensive drug.

"The poor peasants really seemed to do well on famotidine," Tracey said. "There are a lot of anecdotes passing around that give us some hope."

Callahan could not be reached for comment.

The famotidine study was first reported in Science Magazine

Tracey said in addition to the observation in Chinese patients, Florida-based Alchem Laboratories used a computer model to make a list of existing drugs that might fight coronavirus, and famotidine showed up near the top of the list.

He said that's because, theoretically, the structure of famotidine is such that it could stop the virus from replicating, in the same way that protease inhibitors, which are used to treat HIV, stop that virus.

Concerns about famotidine shortages

In the Northwell trial, all the patients are taking hydroxychloroquine.

Tracey said that when the study started in early April, doctors and patients were insisting on using hydroxychloroquine, and in effect, it became the standard of care.

President Trump has frequently touted the drug as a "game-changer" in the fight against the virus, although recent studies have suggested it doesn't help.

"You have to be fair to people -- they're reading in the paper and hearing on the news that hydroxychloroquine works and they look at their dying wife or grandma or child and they want to try it and how could we say no? What kind of person would say no?" Tracey said.

Half of the patient in the study will be given famotidine in addition to hydroxychloroquine. The other half will be given intravenous saline as a placebo, which has no effect.

Hydroxychloroquine might not be used in the study moving forward, since last week, the US Food and Drug Administration warned against its use for coronavirus because of possible side effects.

Tracey said the independent board monitoring the trial will make the decision about whether to continue including hydroxychloroquine in the study.

He added that Northwell kept the study quiet until now because of the experience with doctors rushing to put patients on hydroxychloroquine. He doesn't want that same rush for intravenous famotidine -- it's unclear if it works, and if there's a rush on the drug, his research team might not have enough for their study subjects.

Get CNN Health's weekly newsletter Sign up here to get The Results Are In with Dr. Sanjay Gupta every Tuesday from the CNN Health team.

He's also concerned that people who don't have heartburn will rush to stores to buy famotidine pills, mistakenly convinced it will help against coronavirus.

That could leave heartburn patients in the lurch, especially since the FDA pulled Zantac -- a different heartburn medicine -- off the market earlier this month due to possible contamination.

He said these are unusual concerns at an unusual time.

"That's the reality of trying to do the right thing in a pandemic. It's very, very hard," he said.