Skip to content
Snippets Groups Projects
Commit 0a627e67 authored by Jakub Dylag's avatar Jakub Dylag
Browse files

Allow multiple files per concept set - update map function

parent a6636f57
No related branches found
No related tags found
No related merge requests found
......@@ -593,12 +593,12 @@ def _process_actions(df: pd.DataFrame, concept_set: dict) -> pd.DataFrame:
# Perform Structural Changes to file before preprocessing
_logger.debug("Processing file structural actions")
if (
"actions" in concept_set["file"]
and "split_col" in concept_set["file"]["actions"]
and "codes_col" in concept_set["file"]["actions"]
"actions" in concept_set
and "split_col" in concept_set["actions"]
and "codes_col" in concept_set["actions"]
):
split_col = concept_set["file"]["actions"]["split_col"]
codes_col = concept_set["file"]["actions"]["codes_col"]
split_col = concept_set["actions"]["split_col"]
codes_col = concept_set["actions"]["codes_col"]
_logger.debug(
"Action: Splitting",
split_col,
......@@ -626,12 +626,12 @@ def _preprocess_source_concepts(
# Preprocess codes
code_types = parse.CodeTypeParser().code_types
for code_type in concept_set["file"]["columns"]:
for code_type in concept_set["columns"]:
parser = code_types[code_type]
_logger.info(f"Processing {code_type} codes for {code_file_path}")
# get codes by column name
source_col_name = concept_set["file"]["columns"][code_type]
source_col_name = concept_set["columns"][code_type]
codes = df[source_col_name].dropna()
codes = codes.astype(str) # convert to string
codes = codes.str.strip() # remove excess spaces
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment