Chronic pain induces alterations in the function of brain circuits that are not directly connected to tactile or painful processes". So as a result of chronic pain it is seen that "are also affected neuronal circuits linked to the processing of memories and emotions
http://www.news-medical.net/news/20130209/Study-finds-reason-why-patients-with-chronic-pain-often-suffer-from-impaired-short-term-memory.aspx
http://www.news-medical.net/