From 9078ec6d0041c7a4ea5dc9102a69f944083f958d Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 11 Oct 2024 08:50:38 +0000 Subject: [PATCH] bug fix --- src/meds_etl/omop.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/meds_etl/omop.py b/src/meds_etl/omop.py index 801105d..96d3f39 100644 --- a/src/meds_etl/omop.py +++ b/src/meds_etl/omop.py @@ -451,7 +451,7 @@ def extract_metadata(path_to_src_omop_dir: str, path_to_decompressed_dir: str, v # from (concept ID -> concept code) and (concept ID -> concept name) print("Generating metadata from OMOP `concept` table") for concept_file in tqdm(itertools.chain(*get_table_files(path_to_src_omop_dir, "concept")), - total=len(get_table_files(path_to_src_omop_dir, "concept")[0]), + total=len(get_table_files(path_to_src_omop_dir, "concept")[0]) + len(get_table_files(path_to_src_omop_dir, "concept")[1]), desc="Generating metadata from OMOP `concept` table"): # Note: Concept table is often split into gzipped shards by default if verbose: @@ -493,7 +493,7 @@ def extract_metadata(path_to_src_omop_dir: str, path_to_decompressed_dir: str, v # Include map from custom concepts to normalized (ie standard ontology) # parent concepts, where possible, in the code_metadata dictionary for concept_relationship_file in tqdm(itertools.chain(*get_table_files(path_to_src_omop_dir, "concept_relationship")), - total=len(get_table_files(path_to_src_omop_dir, "concept_relationship")), + total=len(get_table_files(path_to_src_omop_dir, "concept_relationship")[0]) + len(get_table_files(path_to_src_omop_dir, "concept_relationship")[1]), desc="Generating metadata from OMOP `concept_relationship` table"): with load_file(path_to_decompressed_dir, concept_relationship_file) as f: # This table has `concept_id_1`, `concept_id_2`, `relationship_id` columns @@ -522,7 +522,7 @@ def extract_metadata(path_to_src_omop_dir: str, path_to_decompressed_dir: str, v datasets: List[str] = [] dataset_versions: List[str] = [] for cdm_source_file in tqdm(itertools.chain(*get_table_files(path_to_src_omop_dir, "cdm_source")), - total=get_table_files(path_to_src_omop_dir, "cdm_source"), + total=len(get_table_files(path_to_src_omop_dir, "cdm_source")[0]) + len(get_table_files(path_to_src_omop_dir, "cdm_source")[1]), desc="Extracting dataset metadata"): with load_file(path_to_decompressed_dir, cdm_source_file) as f: cdm_source = read_polars_df(f.name)