Cystogastrostomy is an endoscopic outpatient surgery performed to drain a pancreatic pseudocyst that develops after acute or chronic pancreatitis. The pancreas produces hormones to regulate blood sugar, enzymes that help digest food, and bicarbonates that help neutralize stomach acid.