Medical diagnosis by algorithm