Ajax error solved. getSimilarPatients now ignores elements with class ignore.