A 45-year-old woman presents with right upper quadrant pain, fever, and jaundice. Physical examination reveals right upper quadrant tenderness. Labs: total bilirubin 4.2 mg/dL, ALP 320 U/L, AST 110 U/L, ALT 90 U/L. Ultrasound shows gallstones and a dilated common bile duct. Which is the most appropriate next step in management?