Skip to content
Snippets Groups Projects
Commit 5bba5a98 authored by mjbonifa's avatar mjbonifa
Browse files

Merge branch '42-refactor-move-omop-export-into-concept-sets-for' into 'dev'

fix: moved omop export to concept-sets, moved concept set csv files to...

Closes #42

See merge request meldb/concepts-processing!24
parents 195cb71d 7fdebb00
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,6 @@ def phen_diff(args): ...@@ -66,7 +66,6 @@ def phen_diff(args):
phen.diff(args.phen_dir, args.phen_dir_old) phen.diff(args.phen_dir, args.phen_dir_old)
def main(): def main():
parser = argparse.ArgumentParser(description="ACMC command-line tool") parser = argparse.ArgumentParser(description="ACMC command-line tool")
parser.add_argument("--debug", action="store_true", help="Enable debug mode") parser.add_argument("--debug", action="store_true", help="Enable debug mode")
......
...@@ -21,7 +21,7 @@ OMOP_DB_FILENAME = f"omop_{OMOP_CDM_Version}.sqlite" ...@@ -21,7 +21,7 @@ OMOP_DB_FILENAME = f"omop_{OMOP_CDM_Version}.sqlite"
DB_PATH = VOCAB_PATH / OMOP_DB_FILENAME DB_PATH = VOCAB_PATH / OMOP_DB_FILENAME
VERSION_FILE = "omop_version.yaml" VERSION_FILE = "omop_version.yaml"
VERSION_PATH = VOCAB_PATH / VERSION_FILE VERSION_PATH = VOCAB_PATH / VERSION_FILE
EXPORT_FILE = "omop_export.db" EXPORT_FILE = f"omop_{OMOP_CDM_Version}_export.sqlite"
vocabularies = { vocabularies = {
"source": "OHDSI Athena", "source": "OHDSI Athena",
......
...@@ -32,8 +32,9 @@ DEFAULT_PHEN_PATH = Path("./workspace") / PHEN_DIR ...@@ -32,8 +32,9 @@ DEFAULT_PHEN_PATH = Path("./workspace") / PHEN_DIR
CODES_DIR = "codes" CODES_DIR = "codes"
MAP_DIR = "map" MAP_DIR = "map"
CONCEPT_SET_DIR = "concept-set" CONCEPT_SET_DIR = "concept-set"
OMOP_DIR = "omop" CSV_PATH = Path(CONCEPT_SET_DIR) / "csv"
DEFAULT_PHEN_DIR_LIST = [CODES_DIR, MAP_DIR, CONCEPT_SET_DIR, OMOP_DIR] OMOP_PATH = Path(CONCEPT_SET_DIR) / "omop"
DEFAULT_PHEN_DIR_LIST = [CODES_DIR, MAP_DIR, CONCEPT_SET_DIR]
CONFIG_FILE = "config.yaml" CONFIG_FILE = "config.yaml"
VOCAB_VERSION_FILE = "vocab_version.yaml" VOCAB_VERSION_FILE = "vocab_version.yaml"
...@@ -739,7 +740,7 @@ def map_target_code_type(phen_path, phenotype, target_code_type): ...@@ -739,7 +740,7 @@ def map_target_code_type(phen_path, phenotype, target_code_type):
logger.info(f"Saved mapped concepts to {str(map_path.resolve())}") logger.info(f"Saved mapped concepts to {str(map_path.resolve())}")
# save concept sets as separate files # save concept sets as separate files
concept_set_path = phen_path / CONCEPT_SET_DIR / target_code_type concept_set_path = phen_path / CSV_PATH / target_code_type
# empty the concept-set directory if it exists but keep the .git file # empty the concept-set directory if it exists but keep the .git file
git_items = [".git", ".gitkeep"] git_items = [".git", ".gitkeep"]
...@@ -866,7 +867,7 @@ def export(phen_dir, version): ...@@ -866,7 +867,7 @@ def export(phen_dir, version):
if not map_path.exists(): if not map_path.exists():
logger.warning(f"Map path does not exist '{map_path}'") logger.warning(f"Map path does not exist '{map_path}'")
export_path = phen_path / OMOP_DIR export_path = phen_path / OMOP_PATH
# check export directory exists and if not create it # check export directory exists and if not create it
if not export_path.exists(): if not export_path.exists():
export_path.mkdir(parents=True) export_path.mkdir(parents=True)
......
...@@ -46,10 +46,11 @@ The tool supports verification and mapping across diagnostic coding formats belo ...@@ -46,10 +46,11 @@ The tool supports verification and mapping across diagnostic coding formats belo
workspace/ # Default workspace directory workspace/ # Default workspace directory
├── phen/ # Default phenotype directory ├── phen/ # Default phenotype directory
│ ├── codes/ # Phenotype source concept code lists directory │ ├── codes/ # Phenotype source concept code lists directory
│ ├── concept-set/ # Processed phenotype concept sets in CSV format │ ├── concept-set/ # Processed phenotype concept sets
│ │ ├── csv/ # Processed phenotype concept sets in ACMC CSV format
│ │ ├── omop/ # Processed phenotype concept sets in OMOP CDM database exported as CSV files
│ ├── map/ # Process mapping from source to target code types │ ├── map/ # Process mapping from source to target code types
│ │ ├── errors/ # Errors recorded during mapping process │ │ ├── errors/ # Errors recorded during mapping process
│ ├── omop/ # Processed phenotype concept sets in OMOP database CSV files
│ ├── config.yaml # Phenotype configuration file │ ├── config.yaml # Phenotype configuration file
│ ├── vocab_versions.yaml # Versions file for vocabularies used to generate concept sets │ ├── vocab_versions.yaml # Versions file for vocabularies used to generate concept sets
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment