If pancreatitis is due to gallstones, most often the responsible gallstone passes into the intestine spontaneously, and the pancreatitis goes away. Less commonly, a minor surgical procedure is necessary to extract a gallstone that is blocking the pancreatic duct where it drains into the small intestine. An endoscope, with a camera on its end, is passed down the esophagus, through the stomach, and into the small intestine. The entrance of the pancreatic duct into the small intestine can be viewed through the endoscope. A special instrument on the end of the endoscope can then be passed into the pancreatic duct and the gallstone is extracted. Very rarely pancreatitis is severe enough to require surgery, which is usually performed when the pancreas becomes infected. Dead pancreatic tissue is removed, and the area around the pancreas is washed clean. Patients who require such treatment usually have prolonged hospital stays and are seriously ill.