コード例 #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
ファイル: views.py プロジェクト: mycancerdb-team/scout
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
ファイル: views.py プロジェクト: Clinical-Genomics/scout
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)