Extraction of medical pathways from electronic patient records