Abstract Estimating disease prevalence is a fundamental while challenging public-health goal: in the absence of solid diagnostic data, it typically requires expensive and time intensive studies. Analyzing existing medical records is an alternative, complementary approach. In particular, prescription records offer a glimpse into the health status of populations, prescribing patterns, and operational dynamics. We asked whether these could be used to infer diagnostics and, therefore, estimate disease prevalence. We used the Portuguese electronic medical prescriptions dataset (ADD NUMBERS) and trained a machine learning model that captures the probability that specific drugs are prescribed for the same or related medical conditions. We 1) constructed a manually-curated dataset of diseases and associated medications; 2) used this dataset to train embeddings models; 3) tested these models against human-classified data; 4) used the trained/tested model to uncover comorbidities associated with a) antibiotic prescription (to validate the model), and b) the impact of COVID-19 in prescription patterns of chronic-diseases. The model was able to accurately identify drugs used for targeting ten specific diseases, with few false positives and false negatives. Our analysis showed that the COVID-19 pandemic had almost no effect on the number of prescriptions for some chronic diseases (such as diabetes and depression), but, importantly, had a strong impact on the number of new diagnoses, with new users of diabetes medication in 2019 dropping by more than 16.8% in 2020. Medical prescriptions offer a promising tool to quickly assess disease prevalence, underdiagnosis, and allow a broad overview of the medical status of the population, especially in the face of health emergencies that strongly pressure the medical system. Key messages • We propose a new approach to infer diagnostics from prescription data with several promising applications. • We propose a new approach to infer diagnostics from prescription data with several promising applications.