Beispiel #1
0
def search(term):
    res = {}

    # genes
    args = MultiDict([('filter[symbol.ilike]', "%{0}%".format(term)), ('fields[genes]', 'symbol')])
    response = jsonapi.get_collection(db, args, 'genes')
    res = response.document
    if response.status != 200:
        return jsonify(res), response.status

    # projects
    args = MultiDict([('filter[name.ilike]', "%{0}%".format(term)), ('fields[projects]', 'key,name')])
    response = jsonapi.get_collection(db, args, 'projects')
    res['data'].extend(response.document['data'])
    if response.status != 200:
        return jsonify(res), response.status

    # subjects
    args = MultiDict([('filter[external-key.ilike]', "%{0}%".format(term)), ('fields[subjects]', 'external-key')])
    response = jsonapi.get_collection(db, args, 'subjects')
    res['data'].extend(response.document['data'])

    return jsonify(res), response.status
Beispiel #2
0
def get_user_surveys():
    response = jsonapi.get_collection(db.session, request.args, 'user-surveys')
    return jsonify(response.document), response.status
Beispiel #3
0
def get_pictures():
    response = jsonapi.get_collection(db.session, request.args, 'pictures')
    return jsonify(response.document), response.status
Beispiel #4
0
def get_content_pedigrees():
    response = jsonapi.get_collection(db.session, request.args, 'content-pedigrees')
    return jsonify(response.document), response.status
Beispiel #5
0
def get_categories():
    response = jsonapi.get_collection(db.session, request.args, 'project-categories')
    return jsonify(response.document), response.status
Beispiel #6
0
def get_communication_post(post_id):
    response = jsonapi.get_collection(db.session, request.args, 'com-posts',
                                      post_id)
    return jsonify(response.document), response.status
Beispiel #7
0
def get_project_post_comments():
    response = jsonapi.get_collection(db.session, request.args,
                                      'project-post-comments')
    return jsonify(response.document), response.status
Beispiel #8
0
def get_project_post_comments():
    response = jsonapi.get_collection(db.session, request.args, 'project-post-comments')
    return jsonify(response.document), response.status
Beispiel #9
0
def get_communication_posts():
    response = jsonapi.get_collection(db.session, request.args, 'com-posts')
    return jsonify(response.document), response.status
Beispiel #10
0
def get_gene_targets():
    response = jsonapi.get_collection(db, request.args, 'gene-targets')
    return jsonify(response.document), response.status
Beispiel #11
0
def get_users():
    response = jsonapi.get_collection(db, request.args, 'users')
    return jsonify(response.document), response.status
Beispiel #12
0
def get_disease_symptoms():
    response = jsonapi.get_collection(db, request.args, 'disease-symptoms')
    return jsonify(response.document), response.status
Beispiel #13
0
def get_content_pedigrees():
    response = jsonapi.get_collection(db.session, request.args,
                                      'content-pedigrees')
    return jsonify(response.document), response.status
Beispiel #14
0
def get_user_surveys():
    response = jsonapi.get_collection(db.session, request.args, 'user-surveys')
    return jsonify(response.document), response.status
Beispiel #15
0
def get_report_comments():
    response = jsonapi.get_collection(db, request.args, 'report-comments')
    return jsonify(response.document), response.status
Beispiel #16
0
def get_survey_questions():
    response = jsonapi.get_collection(db.session, request.args, 'survey-questions')
    return jsonify(response.document), response.status