The procedure that we have described in this paper takes advantage of semantic similarity in an ontology to rank candidate diseases (the differential diagnosis) according to their semantic similarity with the query terms and to provide a P value that indicates whether the similarity scores of best-matching candidate diseases are significantly better than would be expected by chance.