Gallstone pancreatitis occurs when one or more gallstones gets stuck in a duct in the pancreas. This blocks pancreatic enzymes from leaving the pancreas and traveling to the small intestine to aid in digestion. When those enzymes back up into the pancreas, it causes inflammation and pain, according to the American College of Gastroenterology.

The standard treatment is to remove the gallbladder within 30 days to prevent a recurrence, researchers said.

The study included information on more than 17,000 cases of gallstone pancreatitis in the United States. All occurred between 2010 and 2013. The patients all had private insurance and were under the age 65.

Seventy-eight percent of the patients had their gallbladders removed within the recommended 30 days of their initial hospitalization. Less than 10 percent of those patients returned to the hospital with pancreatitis, the study found.

Of the more than 3,700 patients who didn't have their gallbladder removed within 30 days, about 1,200 had their gallbladder removed within six months. But nearly 2,500 patients who didn't have their gallbladder removed within 30 days had still not undergone the surgery four years later.

It's not clear why some patients who didn't initially undergo gallbladder removal had pancreatitis recurrences while others did not. More research is needed to find the answers, according to the study authors.

"These findings tell us that there may be a way to avoid gallbladder removal surgery," said principal investigator Susan Hutfless, an assistant professor of medicine at Johns Hopkins University School of Medicine in Baltimore.

"This paper shows that as medicine evolves, it is important to reflect on opportunities to refine care further," she said in a school news release.

However, the study authors did not indicate a change in practice was warranted.

"The personalization of [gallbladder removal] timing is still a hypothesis and would need to be tested in rigorous studies. For now, there is clear evidence that the guidelines are beneficial to patients and should be followed," Hutfless concluded.