diff --git a/acmc/main.py b/acmc/main.py index e2765e8abeab17375e75ebd2ae3ca5dfc0a939d7..ec29b5d1ffe3e2bc8da733a7ce16f3328a2cf598 100644 --- a/acmc/main.py +++ b/acmc/main.py @@ -66,7 +66,6 @@ def phen_diff(args): phen.diff(args.phen_dir, args.phen_dir_old) - def main(): parser = argparse.ArgumentParser(description="ACMC command-line tool") parser.add_argument("--debug", action="store_true", help="Enable debug mode") diff --git a/acmc/omop.py b/acmc/omop.py index d3f171098493abab5c1bbabf95ae0b0f3671bb3c..7bc5dce6252b97caa119c851e64887f05c54efeb 100644 --- a/acmc/omop.py +++ b/acmc/omop.py @@ -21,7 +21,7 @@ OMOP_DB_FILENAME = f"omop_{OMOP_CDM_Version}.sqlite" DB_PATH = VOCAB_PATH / OMOP_DB_FILENAME VERSION_FILE = "omop_version.yaml" VERSION_PATH = VOCAB_PATH / VERSION_FILE -EXPORT_FILE = "omop_export.db" +EXPORT_FILE = f"omop_{OMOP_CDM_Version}_export.sqlite" vocabularies = { "source": "OHDSI Athena", diff --git a/acmc/phen.py b/acmc/phen.py index d35d3bf56fc81b7a97cda794b0840058bc6d0d62..05ac0d1f96fbe6908faea5b9fca0d7040aa2c41e 100644 --- a/acmc/phen.py +++ b/acmc/phen.py @@ -32,8 +32,9 @@ DEFAULT_PHEN_PATH = Path("./workspace") / PHEN_DIR CODES_DIR = "codes" MAP_DIR = "map" CONCEPT_SET_DIR = "concept-set" -OMOP_DIR = "omop" -DEFAULT_PHEN_DIR_LIST = [CODES_DIR, MAP_DIR, CONCEPT_SET_DIR, OMOP_DIR] +CSV_PATH = Path(CONCEPT_SET_DIR) / "csv" +OMOP_PATH = Path(CONCEPT_SET_DIR) / "omop" +DEFAULT_PHEN_DIR_LIST = [CODES_DIR, MAP_DIR, CONCEPT_SET_DIR] CONFIG_FILE = "config.yaml" VOCAB_VERSION_FILE = "vocab_version.yaml" @@ -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())}") # 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 git_items = [".git", ".gitkeep"] @@ -866,7 +867,7 @@ def export(phen_dir, version): if not map_path.exists(): 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 if not export_path.exists(): export_path.mkdir(parents=True) diff --git a/docs/index.md b/docs/index.md index d25b74ef6c95b884f3a581c3284a66a3a7dc1074..fd3ad6772f70dda5410009f6c769f25badd902e4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -46,10 +46,11 @@ The tool supports verification and mapping across diagnostic coding formats belo workspace/ # Default workspace directory ├── phen/ # Default phenotype 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 │ │ ├── errors/ # Errors recorded during mapping process -│ ├── omop/ # Processed phenotype concept sets in OMOP database CSV files │ ├── config.yaml # Phenotype configuration file │ ├── vocab_versions.yaml # Versions file for vocabularies used to generate concept sets ```