def features_to_hpo(features):
    """Extracts HPO terms from a list of phenotype features of a patient

    Args:
        features(list): a list of features dictionaries

    Returns:
        hpo_terms(list): a list of HPO terms. Example : ['HP:0100026', 'HP:0009882', 'HP:0001285']
    """
    if features is None:
        return []
    hpo_terms = [feature.get("_id") for feature in features if feature.get("_id")]
    if len(hpo_terms) == 0:
        hpo_terms = [feature.get("id") for feature in features if feature.get("id")]
    return hpo_terms