During an ERCP,the health care provider guides the endoscope through the stomach and into the small intestine. The health care provider then injects a special dye that temporarily stains the ducts in the biliary system.