コード例 #1
0
ファイル: ctgov.py プロジェクト: stormliucong/dquest-flask
def retrieve_trials(url, npag):
    # num. of studies available
    n = of.format_nct_number(get_nct_number('%s&count=0' % url))
    # get the list of clinical studies
    xml = download_web_data('%s&pg=%s' % (url, npag))
    if xml is None:
        return (0, [])
    xmltree = ElementTree.fromstring(xml)
    lnct = xmltree.findall('clinical_study')
    nct = []
    for ct in lnct:
        pct = parse_xml_nct(ct)
        if pct[0] is not None:
            cond = of.format_condition(pct[3])
            nct.append((pct[0], pct[1], pct[2], cond))
    return (n, nct)
コード例 #2
0
ファイル: ctgov.py プロジェクト: riccardomiotto/etacts
def retrieve_trials (url, npag):
    # num. of studies available
    n = of.format_nct_number(get_nct_number('%s&count=0' % url))
    # get the list of clinical studies
    xml = download_web_data('%s&pg=%s' % (url, npag))
    if xml is None:
        return (0, [])
    xmltree = ElementTree.fromstring (xml)
    lnct = xmltree.findall ('clinical_study')
    nct = []
    for ct in lnct:
        pct = parse_xml_nct (ct)
        if pct[0] is not None:
            if pct[0] not in app.jinja_env.globals['ctgov_idx']:
                app.jinja_env.globals['ctgov_idx'][pct[0]] = (pct[2], pct[3])
            cond = of.format_condition (pct[3])
            nct.append ((pct[0], pct[1], pct[2], cond))
    return (n, nct)