First by the kind of pain and secondly by examination of a doctor (internist). Chronic pain to internal organs (visceral pain) is the result of an internal organ disease such as pancreatitis.
In a multidisciplinary pain centre, they can not cure the cause of the pain, but they can do help to reduce the pain that leads to a better life.