A diagnostic test that uses an endoscope to look at the tubes that drain the liver, gallbladder and pancreas. This is done to look at the health of the tubes and to fix any problems such as a stone blocking the tube or duct.