Got the historical downloader working (fixed an sql issue) and setup tools to select trials.
parent
61dc377e0a
commit
01514be0b4
@ -1,21 +0,0 @@
|
|||||||
DELETE FROM http.download_status;
|
|
||||||
|
|
||||||
INSERT INTO http.download_status (nct_id, status)
|
|
||||||
SELECT nct_id, 'Of Interest'::http.history_download_status AS status
|
|
||||||
FROM ctgov.studies
|
|
||||||
WHERE
|
|
||||||
is_fda_regulated_drug=TRUE
|
|
||||||
AND
|
|
||||||
study_type = 'Interventional'
|
|
||||||
AND
|
|
||||||
phase='Phase 3'
|
|
||||||
AND
|
|
||||||
overall_status in ('Terminated', 'Completed')
|
|
||||||
AND
|
|
||||||
start_date > '2008-01-01'
|
|
||||||
AND
|
|
||||||
completion_date < '2022-01-01'
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
SELECT count(*) FROM http.download_status ;
|
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import downloader as dldr
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
dbc = dldr.DBConnectionCreator(
|
||||||
|
dbname="aact_db"
|
||||||
|
,user="root"
|
||||||
|
,host="will-office"
|
||||||
|
,port=5432
|
||||||
|
,password="root")
|
||||||
|
|
||||||
|
with open('selected_trials.sql','r') as fh:
|
||||||
|
sqlfile = fh.read()
|
||||||
|
with dbc.new() as connection:
|
||||||
|
with connection.cursor() as curse:
|
||||||
|
curse.execute(sqlfile)
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
DELETE FROM http.download_status;
|
||||||
|
|
||||||
|
INSERT INTO http.download_status (nct_id, status)
|
||||||
|
SELECT nct_id, 'Of Interest'::http.history_download_status AS status
|
||||||
|
FROM ctgov.studies
|
||||||
|
WHERE
|
||||||
|
is_fda_regulated_drug=TRUE
|
||||||
|
AND
|
||||||
|
study_type = 'Interventional'
|
||||||
|
AND
|
||||||
|
phase='Phase 3'
|
||||||
|
AND
|
||||||
|
overall_status in ('Terminated', 'Completed')
|
||||||
|
AND
|
||||||
|
start_date > '2008-01-01'
|
||||||
|
AND
|
||||||
|
completion_date < '2022-01-01'
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
SELECT count(*) FROM http.download_status ;
|
||||||
Loading…
Reference in New Issue