Advanced Endoscopy. Endoscopy may need to be done for many different reasons, sometimes for benign diseases and sometimes for cancer. Endoscopy is most often done as an elective procedure and usually on an outpatient or ambulatory basis. Emergency endoscopy may be needed for acute bleeding or to remove gallstones that are blocking the bile ducts..