BOSTON — To the medical students, the patient was a conundrum.

According to his chart, he had residual pain from a leg injury sustained while working on a train track. Now he wanted an opioid stronger than the Percocet he’d been prescribed. So why did his urine test positive for two other drugs — cocaine and hydromorphone, a powerful opioid that doctors had not ordered?

It was up to Clark Yin, 29, to figure out what was really going on with Chris McQ, 58 — as seven other third-year medical students and two instructors watched.

“How are you going to have a conversation around the patient’s positive tox screen results?” asked Dr. Lidya H. Wlasiuk, who teaches addiction awareness and interventions here at Boston University School of Medicine.

Mr. Yin threw up his hands. “I have no idea,” he admitted.

Chris McQ is a fictional case study created by Dr. Wlasiuk, brought to life for this class by Ric Mauré, a keyboard player who also works as a standardized patient — trained to represent a real patient, to help medical students practice diagnostic and communication skills. The assignment today: grappling with the delicate art and science of managing a chronic pain patient who might be tipping into a substance use disorder.