scout/server/blueprints/variants/views.py
def variant_acmg(institute_id, case_name, variant_id):
    """ACMG classification form."""
    if request.method == 'GET':
        data = controllers.variant_acmg(store, institute_id, case_name, variant_id)
        return data
    else:
        criteria = []
        criteria_terms = request.form.getlist('criteria')
        for term in criteria_terms:
            criteria.append(dict(
                term=term,
                comment=request.form.get("comment-{}".format(term)),
                links=[request.form.get("link-{}".format(term))],
            ))
        acmg = controllers.variant_acmg_post(store, institute_id, case_name, variant_id,
                                             current_user.email, criteria)
        flash("classified as: {}".format(acmg), 'info')
        return redirect(url_for('.variant', institute_id=institute_id, case_name=case_name,
                                variant_id=variant_id))
def variant_acmg(institute_id, case_name, variant_id):
    if request.method == 'GET':
        data = controllers.variant_acmg(store, institute_id, case_name, variant_id)
        return data
    else:
        criteria = []
        criteria_terms = request.form.getlist('criteria')
        for term in criteria_terms:
            criteria.append(dict(
                term=term,
                comment=request.form.get("comment-{}".format(term)),
                links=[request.form.get("link-{}".format(term))],
            ))
        acmg = controllers.variant_acmg_post(store, institute_id, case_name, variant_id,
                                             current_user.email, criteria)
        flash("classified as: {}".format(acmg), 'info')
        return redirect(url_for('.variant', institute_id=institute_id, case_name=case_name,
                                variant_id=variant_id))
def variant_acmg ( institute_id , case_name , variant_id ) : if request . method == 'GET' : data = controllers . variant_acmg ( store , institute_id , case_name , variant_id ) return data else : criteria = [ ] criteria_terms = request . form . getlist ( 'criteria' ) for term in criteria_terms : criteria . append ( dict ( term = term , comment = request . form . get ( "comment-{}" . format ( term ) ) , links = [ request . form . get ( "link-{}" . format ( term ) ) ] , ) ) acmg = controllers . variant_acmg_post ( store , institute_id , case_name , variant_id , current_user . email , criteria ) flash ( "classified as: {}" . format ( acmg ) , 'info' ) return redirect ( url_for ( '.variant' , institute_id = institute_id , case_name = case_name , variant_id = variant_id ) )
ACMG classification form.
ACMG classification form .