예제 #1
0
def hpoterms():
    """Search for HPO terms."""
    query = request.args.get('query')
    if query is None:
        return abort(500)
    terms = store.hpo_terms(query=query).limit(8)
    json_terms = [{'name': '{} | {}'.format(term['_id'], term['description']),
                   'id': term['_id']} for term in terms]
    return jsonify(json_terms)
예제 #2
0
def hpoterms():
    """Search for HPO terms."""
    query = request.args.get("query")
    if query is None:
        return abort(500)
    terms = sorted(store.hpo_terms(query=query), key=itemgetter("hpo_number"))
    json_terms = [{
        "name": "{} | {}".format(term["_id"], term["description"]),
        "id": term["_id"]
    } for term in terms[:7]]

    return jsonify(json_terms)
예제 #3
0
def hpoterms():
    """Search for HPO terms."""
    query = request.args.get('query')
    if query is None:
        return abort(500)
    terms = sorted(store.hpo_terms(query=query), key=itemgetter('hpo_number'))
    json_terms = [{
        'name': '{} | {}'.format(term['_id'], term['description']),
        'id': term['_id']
    } for term in terms[:7]]

    return jsonify(json_terms)
예제 #4
0
def hpoterms():
    """Search for HPO terms."""
    query = request.args.get('query')
    if query is None:
        return abort(500)
    terms = sorted(store.hpo_terms(query=query), key=itemgetter('hpo_number'))
    json_terms = [
        {'name': '{} | {}'.format(term['_id'], term['description']),
         'id': term['_id']
        } for term in terms[:7]]

    return jsonify(json_terms)