Cluster-Then-Classify Methodology for the Identification of Pain Episodes in Chronic Diseases