Skip to content
Snippets Groups Projects
Commit 7fdebb00 authored by mjbonifa's avatar mjbonifa
Browse files

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

fix: moved omop export to concept-sets, moved concept set csv files to subdirectory of concept-sets. closes #42
parent 195cb71d
No related branches found
No related tags found
No related merge requests found
......@@ -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")
......
......@@ -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",
......
......@@ -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)
......
......@@ -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
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment