From 4643351305185ea32c0650e302eebe6d108f0a56 Mon Sep 17 00:00:00 2001 From: will king Date: Wed, 29 Mar 2023 11:54:34 -0700 Subject: [PATCH] minor adjustments to improve workflow --- .../Icd10ConditionsMatching/validation.py | 1 + .../match_conditions_to_icd10.txt | 16 ---------------- scripts/drugtools/historical_nct_extractor.py | 3 ++- 3 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 scripts/Icd10ConditionsMatching/match_conditions_to_icd10.txt diff --git a/scripts/Icd10ConditionsMatching/Icd10ConditionsMatching/validation.py b/scripts/Icd10ConditionsMatching/Icd10ConditionsMatching/validation.py index b3e4367..62e1838 100644 --- a/scripts/Icd10ConditionsMatching/Icd10ConditionsMatching/validation.py +++ b/scripts/Icd10ConditionsMatching/Icd10ConditionsMatching/validation.py @@ -90,6 +90,7 @@ def validate_trial(nct_id): record_suggested_matches(db_conn, nct_id, condition, code) return redirect(request.path) else: + record_suggested_matches(db_conn, nct_id, condition + "| Code not in GBD list", code) return """ Entered `{}`, which is not in the list of available ICD-10 codes. Return to trial summary """.format(code.strip("-"),request.path), 422 diff --git a/scripts/Icd10ConditionsMatching/match_conditions_to_icd10.txt b/scripts/Icd10ConditionsMatching/match_conditions_to_icd10.txt deleted file mode 100644 index 69805ae..0000000 --- a/scripts/Icd10ConditionsMatching/match_conditions_to_icd10.txt +++ /dev/null @@ -1,16 +0,0 @@ -The purpose of this application is to provide an easy way to manually review the -proposed matches between trial conditions and proposed icd10 codes. - -Plan: - - get list of proposed matches For each NCT_ID - - present appropriate information from trial - - nctid, descriptions, browse_conditions info (including mesh-ansestors) - - for each condition - - show proposed codes - - each code has a check box next to it. - - If there are no proposed codes, an entry box is made available. - -Design steps: - -Setup SQL queries and tables. -Setup Flask App diff --git a/scripts/drugtools/historical_nct_extractor.py b/scripts/drugtools/historical_nct_extractor.py index e3b1abe..f1da033 100644 --- a/scripts/drugtools/historical_nct_extractor.py +++ b/scripts/drugtools/historical_nct_extractor.py @@ -3,6 +3,7 @@ from copy import copy from datetime import datetime from bs4 import BeautifulSoup from drugtools.env_setup import ENV,postgres_conn +from tqdm import tqdm #requires Python 3.10 #### GLOBALS @@ -391,7 +392,7 @@ def run(): WHERE response_code = 200 """ curse.execute(sql) - for response in curse.fetchall(): + for response in tqdm(curse.fetchall()): nct_id, version_a, version_b, html = response print(nct_id, version_a, version_b) if VERBOSE else ""