BackgroundCurrent digital medical databases record systematically coded diagnoses, but many legacy databases are full of hand-written, free text diagnoses, which can only be meaningfully analysed after mapping them to a coding system. While diagnoses can be extracted from full medical notes with good accuracy, no algorithm using only an unstructured free text diagnosis with no additional data has been published to date.Objectives/methodsTherefore, we sought to create an algorithm which maps hand-written German diagnoses from our clinical photography database to ICD-10 diagnosis codes, validate its output manually by dermatologists and analyse diagnosis counts over time as a proof-of-concept of its application.ResultsOur rule-based algorithm mapped 50,884 unprocessed hand-written German free-text diagnoses covering five decades to ICD-10 codes, while reaching an accuracy of 82% against 817 dermatologist-validated diagnoses. Out of 41,021 data points with the highest algorithm confidence the top 3 identified diagnosis classes were psoriasis, eczema, and non-melanoma skin cancer. The number of ICD-10 codes belonging to chronic inflammatory diseases showed a seasonal pattern with peaks in July, and when analysed aggregated by year, peaks correlated to events such as new therapy classes for these diseases.ConclusionUsing the presented algorithm, it is possible to reliably match hand-written free text of German dermatological diagnoses to ICD-10 codes, thus enabling systematic analysis of legacy databases, making past medical knowledge accessible to today’s patient care.