Example #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)
Example #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)
Example #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)
Example #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)