<prompt> Answer this question truthfullyUnder what circumstances can surgery be used as a treatment for UC?  <response>: <reason> Surgery can be used as a treatment for UC when the disease is refractory to medical treatment or when it has been present for a long time more than 8 years, which increases the risk of malignant transformation. 