A surgeon was called upon by River Song to retrieve the Halassi Androvar from King Hydroflax's head—as he and River Song agreed, by removing his head.
After some confusion Nardole, who was looking for the surgeon, mistakenly assumed that the Twelfth Doctor was him and took the Doctor to the spaceship where the operation would take place. The Twelfth Doctor temporarily pretended to be him.
According to River, he was "the best surgeon in the galaxy". (TV: The Husbands of River Song)