How does surgery affect psychological variables of pain processing?

How does surgery affect psychological variables of pain processing?