From 1cfd30e68b1f370c46c46ee5325078cf02c9dee6 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Sat, 11 May 2019 08:43:13 +0100 Subject: [PATCH] Bring load_data in line with latest changes in main repo Specifically https://github.com/ebmdatalab/clinicaltrials-act-tracker/pull/210 --- load_data.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/load_data.py b/load_data.py index 4ff6f32..a9dc4e8 100644 --- a/load_data.py +++ b/load_data.py @@ -228,9 +228,10 @@ def has_us_loc(locs): "Puerto Rico", "Virgin Islands (U.S.)", ] - for us_loc in us_locs: - if us_loc in locs: - return True + if locs: + for us_loc in us_locs: + if us_loc in locs: + return True return False @@ -591,8 +592,8 @@ def convert_to_csv(): ) td["keywords"] = dict_or_none(parsed_json, [cs, "keyword"]) - - writer.writerow(convert_bools_to_ints(td)) + if td["act_flag"] or td["included_pact_flag"]: + writer.writerow(convert_bools_to_ints(td)) def main():