The study identified variables associated with mental health diagnoses in Puno, Peru, a region with significant volumes of clinical and demographic data. A non-experimental, observational, retrospective design was used, with a corpus of 583,390 mental health care records (2021-2023), after removing 2,874 exact duplicates. The unit of analysis was the care record with diagnosis (not the patient, since the source lacks a unique patient identifier). A Random Forest model was built to predict the grouped ICD-10 diagnostic category (10 classes), evaluated with a stratified 70/30 split and 5-fold cross-validation, obtaining an accuracy of 52.2%, macro-F1 of 0.44, and weighted-F1 of 0.54. The variable with the highest relative predictive importance was patient age (60%), followed by month (11%) and year (6%) of visit. K-Means segmentation (K=5, selected via silhouette coefficient) reached a silhouette score of 0.547. Anxiety/stress disorders (24.4%), psychotic disorders/schizophrenia (20.2%), and mood disorders (19.9%) were the most frequent categories. Psychotic disorders represented 21.4% of diagnoses in first-level facilities versus 10.3% in hospitals; mood disorders showed no meaningful difference between facility types. November visits exceeded the monthly average by 22.9%. The conclusions highlight that age and temporal variables (month and year) are the most associated with diagnostic category in this corpus, without implying causal relationships, given the study's observational design.