Esempio n. 1
0
def index():
    """List all cases."""
    for_analysis = request.args.get('analyze') == 'on'
    per_page = current_app.config['ITEMS_PER_PAGE']
    page = int(request.args.get('page', 1))
    if for_analysis:
        case_q = db.to_analyze()
    else:
        case_q = db.cases()
    page = case_q.paginate(page, per_page=per_page)
    return render_template('cases/index.html', page=page,
                           for_analysis=for_analysis)
Esempio n. 2
0
def dashboard():
    """Show details for a case."""
    tot_samples = db.samples().count()
    sequenced = db.samples(sequenced=True).count()
    delivered = db.samples(delivered=True).count()
    invoiced = db.samples(invoiced=True).count()
    archived = db.samples(archived=True).count()
    genotyped = db.samples(genotyped=True).count()
    percents = dict(
        sequenced=(sequenced / tot_samples * 100),
        delivered=(delivered / tot_samples * 100),
        invoiced=(invoiced / tot_samples * 100),
        archived=(archived / tot_samples * 100),
        genotyped=(genotyped / tot_samples * 100),
    )
    failed = db.samples(maf_fail=True)
    to_rerun = db.cases(rerun=True)
    to_research = db.cases(research=True)
    return render_template('dashboard.html', samples=tot_samples,
                           percents=percents, failed=failed, reruns=to_rerun,
                           research=to_research)