Introduction: Chronic pain, affecting 20–26% of adults, has a profound impact on quality of life and generates substantial socioeconomic costs. Patient profiling enables the individualization of treatment, the identification of patient subgroups, and the design of personalized therapeutic strategies, ultimately improving outcomes and healthcare efficiency. The main objective of this study is to establish patient clusters based on pain characteristics and to develop a screening tool capable of identifying patients according to the resulting clustering model.
Materials and Methods: A descriptive, cross-sectional, multicenter study was conducted in patients experiencing pain who visited community pharmacies. Unsupervised clustering techniques were employed to identify patterns among patients with acute and chronic pain. These were followed by statistical analyses and supervised algorithms for the prediction and evaluation of the questionnaire. Based on these findings, a tool was developed to predict patient group membership according to the identified clusters.
Results: The analysis identified four acute pain profiles and five chronic pain profiles, with subgroup 1 exhibiting the poorest outcomes in both cases. The classification model used to predict new data achieved an accuracy of 64.52% for acute pain and 85.56% for chronic pain based on the available data.
Conclusions: Four patient profiles were identified in acute pain and five in chronic pain, facilitating the personalization of treatment. Community pharmacy, due to its accessibility, enables continuous follow-up, improves adherence, allows for treatment adjustments, and enhances coordination of care. The classification tool will enable patient assessment through psychometric variables, thereby improving pain management.