A 73-year-old woman was admitted to the hospital 12 hours ago with fever, epigastric abdominal pain, and jaundice. She was hypotensive on admission to the emergency department but improved after receiving intravenous antibiotics and fluids. One hour ago the epigastric pain recurred and she again became febrile and hypotensive. She is transferred to the ICU, and her blood pressure improves with administration of fluids. She has no history of liver or biliary disease. Her only medication is piperacillin-tazobactam.

On physical examination, temperature is 39.3 °C (102.7 °F), blood pressure is 106/60 mm Hg, pulse rate is 102/min, and respiration rate is 22/min. Oxygen saturation is 96% breathing ambient air. Jaundice is noted. Abdominal examination reveals right upper quadrant tenderness but no hepatomegaly, ascites, abdominal guarding, or tenderness to percussion.

Laboratory studies:

Hemoglobin

13 g/dL (130 g/L)

Leukocyte count

19,000/µL (19 × 109/L), with 80% segmented neutrophils and 15% band forms

Alanine aminotransferase

453 U/L

Total bilirubin

8.3 mg/dL (141.9 µmol/L)

Ultrasound of the right upper quadrant reveals dilated intrahepatic and extrahepatic bile ducts, gallstones, a normal gallbladder wall, and no pericholecystic fluid. The pancreas is not well visualized.

Which of the following is the most appropriate management?