def index():
    # get trial number
    # nnct = ctgov.get_nct_number ('http://clinicaltrials.gov/search?term=&displayxml=True&count=0')
    nnct = ctgov.get_nct_number(
        'http://clinicaltrials.gov/search?term=covid-19&displayxml=True&count=0'
    )
    nnct_us = ctgov.get_nct_number(
        'http://clinicaltrials.gov/search?term=covid-19&cntry=US&displayxml=True&count=0'
    )
    # active_roster = qst.find_active_nct_id_list()
    # nnct_local_kb = len(active_roster)

    # testing without length of active trials
    active_roster = []
    nnct_local_kb = 0

    # store active nct_id list for later usage
    session.clear()
    # session['active_nct_list'] = active_roster
    # session.modified = True

    return render_template('index.html',
                           nnct=of.format_nct_number(nnct),
                           nnct_us=of.format_nct_number(nnct_us),
                           nnct_local_kb=nnct_local_kb)
示例#2
0
def turn_fresult ():
    tag = list(request.form['tag'].split(';'))
    rnct = of.format_ranked_nct(request.form['nct'])
    npag = int (request.form['npag'])
    log.info ('%s -- visiting page n. %d' % (request.remote_addr, npag))
    (snct, unct) = tcloud.get_filtered_result (tag, rnct, npag)
    return jsonify (n=of.format_nct_number(len(unct)), npag=npag, onct=request.form['nct'], nct=of.format_nct(snct))
示例#3
0
def index():
    # get trial number
    # nnct = ctgov.get_nct_number ('http://clinicaltrials.gov/search?term=&displayxml=True&count=0')
    nnct = ctgov.get_nct_number(
        'http://clinicaltrials.gov/search?term=covid-19&displayxml=True&count=0'
    )
    nnct_us = ctgov.get_nct_number(
        'http://clinicaltrials.gov/search?term=covid-19&cntry=US&displayxml=True&count=0'
    )
    nnct_local_kb = len(qst.find_annotated_nct_id_list())
    # search form
    # form = SearchForm()
    return render_template('index.html',
                           nnct=of.format_nct_number(nnct),
                           nnct_us=of.format_nct_number(nnct_us),
                           nnct_local_kb=nnct_local_kb)
示例#4
0
def refine_search ():
    tag = list(request.form['tag'].split(';'))
    rnct = of.format_ranked_nct (request.form['nct'])
    npag = int (request.form['npag'])
    tgrp = request.form['ttag']
    trole = request.form['trole']
    (snct, unct) = tcloud.get_filtered_result (tag, rnct, npag)
    log.info ('%s -- refine-search: tags(%s) | left(%d trials)' % (request.remote_addr, ';'.join(tag), len(unct)))
    ctag = []
    if len(unct) > 0:
        ctag = tcloud.get_tagcloud (unct, tag, 20, 10, tgrp, trole)
    return jsonify (n=of.format_nct_number(len(unct)), npag=npag, tags=ctag, q=session['query'], onct=request.form['nct'], nct=of.format_nct(snct))
示例#5
0
def index ():
    # get trial number
    nnct = ctgov.get_nct_number ('http://clinicaltrials.gov/search?term=&displayxml=True&count=0')
    # search form    
    # form = SearchForm()
    return render_template('index.html', nnct = of.format_nct_number(nnct))
示例#6
0
def index ():
    # get trial number
    nnct = ctgov.get_nct_number ('http://clinicaltrials.gov/search?term=&displayxml=True&count=0')
    # search form    
    form = SearchForm()
    return render_template('index.html', form = form, nnct = of.format_nct_number(nnct))