Surgery was practiced in the Middle Ages, although it was seen as a last resort. It is known to have been successful in the treatment of breast cancer, gangrene, hemorrhoids, and other conditions. There are illustrations showing medieval surgery, but naturally they give no sign of the pain suffered by the person on the operating table.
Anesthetics were used, but many of the concoctions used to relieve pain or induce sleep were also potentially fatal. ‘Dwale’, for example, consisted of gall from a cow or castrated boar, lettuce, briony, opium, henbane and hemlock juice mixed with wine. The opium, alcohol and hemlock would have made patient incapable. Henbane and briony would have quickened the passage of poisons out of the body. However, it must be noted that hemlock was particularly dangerous, too much being a death sentence. You can learn more about The Heretic's Tomb and the historical background to the novel on my website.