From 4aff257e6715f8bb41f1aa245017c7ee8d199e75 Mon Sep 17 00:00:00 2001 From: Michael Boniface <m.j.boniface@soton.ac.uk> Date: Fri, 21 Feb 2025 13:00:22 +0000 Subject: [PATCH] moved full usage to docs as we now have an example --- README.md | 137 ------------------------------------------------- docs/index.md | 139 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 138 insertions(+), 138 deletions(-) diff --git a/README.md b/README.md index 2962927..b3259d7 100644 --- a/README.md +++ b/README.md @@ -153,8 +153,6 @@ Expected output: [INFO] - OMOP installation completed ``` ---- - ## **Example Usage** Follow these steps to initialize and manage a phenotype using `acmc`. In this example, we use a source concept code list for the Concept Set `Abdominal Pain` created from [ClinicalCodes.org](ClinicalCodes.org). The source concept codes are is read2. We genereate versioned phenotypes for read2 and then translate to snomed with a another version. @@ -329,141 +327,6 @@ Expected Output: [INFO] - New version: v1.0.4 [INFO] - Phenotype published successfully ``` -## Usage - -The `acmc` command-line tool provides various commands to interact with TRUD, OMOP, and Phenotype data. Below are the usage details for each command. - -### General Syntax - -```bash -acmc [OPTIONS] COMMAND [SUBCOMMAND] [ARGUMENTS] -``` - -Where: -- `[OPTIONS]` are global options that apply to all commands (e.g., `--debug`, `--version`). -- `[COMMAND]` is the top-level command (e.g., `trud`, `omop`, `phen`). -- `[SUBCOMMAND]` refers to the specific operation within the command (e.g., `install`, `validate`). - -### Global Options - -- `--version`: Display the acmc tool version number -- `--debug`: Enable debug mode for more verbose logging. - -### Commands - -#### TRUD Command - -The `trud` command is used for installing NHS TRUD vocabularies. - -- **Install TRUD** - - Install clinically assurred TRUD medical code mappings: - - ```bash - acmc trud install - ``` - -#### OMOP Command - -The `omop` command is used for installing OMOP vocabularies. - -- **Install OMOP** - - Install vocabularies in a local OMOP database: - - ```bash - acmc omop install -d <OMOP_DIRECTORY_PATH> -v <OMOP_VERSION> - ``` - - - `-d`, `--omop-dir`: (Optional) Directory path to extracted OMOP downloads, default is `./build/omop` - - `-v`, `--version`: OMOP vocabularies release version. - -- **Clear OMOP** - - Clear data from the local OMOP database: - - ```bash - acmc omop clear - ``` - -- **Delete OMOP** - - Delete the local OMOP database: - - ```bash - acmc omop delete - ``` - -#### PHEN Command - -The `phen` command is used phenotype-related operations. - -- **Initialize Phenotype** - - Initialize a phenotype directory locally or from a remote git repository: - - ```bash - acmc phen init -d <PHENOTYPE_DIRECTORY> -r <REMOTE_URL> - ``` - - - `-d`, `--phen-dir`: (Optional) Directory to write phenotype configuration (the default is ./build/phen). - - `-r`, `--remote_url`: (Optional) URL to a remote git repository. - -- **Validate Phenotype** - - Validate the phenotype configuration: - - ```bash - acmc phen validate -d <PHENOTYPE_DIRECTORY> - ``` - - - `-d`, `--phen-dir`: (Optional) Directory of phenotype configuration (the default is ./build/phen). - -- **Map Phenotype** - - Process phenotype mapping and specify the target coding and output format: - - ```bash - acmc phen map -d <PHENOTYPE_DIRECTORY> -t <TARGET_CODING> -o <OUTPUT_FORMAT> - ``` - - - `-t`, `--target-coding`: Specify the target coding (e.g., `read2`, `read3`, `icd10`, `snomed`, `opcs4`). - - `-d`, `--phen-dir`: (Optional) Directory of phenotype configuration (the default is ./build/phen). - - `-o`, `--output`: Output format(s) (`csv`, `omop`, or both), default is 'csv'. - -- **Publish Phenotype Configuration** - - Publish a phenotype configuration, committing all changes and tagging with a new version number. If the phenotype has been initialised from a remote git URL, then the commit and new version tag will be pushed to the remote repo: - - ```bash - acmc phen publish -d <PHENOTYPE_DIRECTORY> - ``` - - - `-d`, `--phen-dir`: (Optional) Directory of phenotype configuration (the default is ./build/phen). - -- **Copy Phenotype Configuration** - - Copy a phenotype configuration from a source directory to a target directory at a specific version. This is used when wanting to compare versions of phenotypes using the `acmc phen diff` command: - - ```bash - acmc phen copy -d <PHENOTYPE_DIRECTORY> -td <TARGET_DIRECTORY> -v <PHENOTYPE_VERSION> - ``` - - - `-d`, `--phen-dir`: (Optional) Directory of phenotype configuration (the default is ./build/phen). - - `-td`, `--target-dir`: (Optional) Directory to copy the phenotype configuration to, (the default is ./build). - - `-v`, `--version`: The phenotype version to copy. - -- **Compare Phenotype Configurations** - - Compare a a new phenotype version with pervious version of a phenotype: - - ```bash - acmc phen diff -d <NEW_PHENOTYPE_DIRECTORY> -old <OLD_PHENOTYPE_DIRECTORY> - ``` - - - `-d`, `--phen-dir`: (Optional) Directory of current phenotype configuration (the default is ./build/phen). - - `-old`, `--phen-dir-old`: (Required) Directory of old phenotype version) - ## License diff --git a/docs/index.md b/docs/index.md index d5c1620..4ef8d11 100644 --- a/docs/index.md +++ b/docs/index.md @@ -34,4 +34,141 @@ The tool supports verification and mapping across diagnostic coding formats belo Processed resources will be saved in the `build/maps/processed/` directory. -*Note: NHS TRUD provides one-way mappings. To reverse mappings, duplicate the `.parquet` file and reverse the filename (e.g., `read2_code_to_snomed_code.parquet` to `snomed_code_to_read2_code.parquet`).* \ No newline at end of file +*Note: NHS TRUD provides one-way mappings. To reverse mappings, duplicate the `.parquet` file and reverse the filename (e.g., `read2_code_to_snomed_code.parquet` to `snomed_code_to_read2_code.parquet`).* + + + +## Usage + +The `acmc` command-line tool provides various commands to interact with TRUD, OMOP, and Phenotype data. Below are the usage details for each command. + +### General Syntax + +```bash +acmc [OPTIONS] COMMAND [SUBCOMMAND] [ARGUMENTS] +``` + +Where: +- `[OPTIONS]` are global options that apply to all commands (e.g., `--debug`, `--version`). +- `[COMMAND]` is the top-level command (e.g., `trud`, `omop`, `phen`). +- `[SUBCOMMAND]` refers to the specific operation within the command (e.g., `install`, `validate`). + +### Global Options + +- `--version`: Display the acmc tool version number +- `--debug`: Enable debug mode for more verbose logging. + +### Commands + +#### TRUD Command + +The `trud` command is used for installing NHS TRUD vocabularies. + +- **Install TRUD** + + Install clinically assurred TRUD medical code mappings: + + ```bash + acmc trud install + ``` + +#### OMOP Command + +The `omop` command is used for installing OMOP vocabularies. + +- **Install OMOP** + + Install vocabularies in a local OMOP database: + + ```bash + acmc omop install -d <OMOP_DIRECTORY_PATH> -v <OMOP_VERSION> + ``` + + - `-d`, `--omop-dir`: (Optional) Directory path to extracted OMOP downloads, default is `./build/omop` + - `-v`, `--version`: OMOP vocabularies release version. + +- **Clear OMOP** + + Clear data from the local OMOP database: + + ```bash + acmc omop clear + ``` + +- **Delete OMOP** + + Delete the local OMOP database: + + ```bash + acmc omop delete + ``` + +#### PHEN Command + +The `phen` command is used phenotype-related operations. + +- **Initialize Phenotype** + + Initialize a phenotype directory locally or from a remote git repository: + + ```bash + acmc phen init -d <PHENOTYPE_DIRECTORY> -r <REMOTE_URL> + ``` + + - `-d`, `--phen-dir`: (Optional) Directory to write phenotype configuration (the default is ./build/phen). + - `-r`, `--remote_url`: (Optional) URL to a remote git repository. + +- **Validate Phenotype** + + Validate the phenotype configuration: + + ```bash + acmc phen validate -d <PHENOTYPE_DIRECTORY> + ``` + + - `-d`, `--phen-dir`: (Optional) Directory of phenotype configuration (the default is ./build/phen). + +- **Map Phenotype** + + Process phenotype mapping and specify the target coding and output format: + + ```bash + acmc phen map -d <PHENOTYPE_DIRECTORY> -t <TARGET_CODING> -o <OUTPUT_FORMAT> + ``` + + - `-t`, `--target-coding`: Specify the target coding (e.g., `read2`, `read3`, `icd10`, `snomed`, `opcs4`). + - `-d`, `--phen-dir`: (Optional) Directory of phenotype configuration (the default is ./build/phen). + - `-o`, `--output`: Output format(s) (`csv`, `omop`, or both), default is 'csv'. + +- **Publish Phenotype Configuration** + + Publish a phenotype configuration, committing all changes and tagging with a new version number. If the phenotype has been initialised from a remote git URL, then the commit and new version tag will be pushed to the remote repo: + + ```bash + acmc phen publish -d <PHENOTYPE_DIRECTORY> + ``` + + - `-d`, `--phen-dir`: (Optional) Directory of phenotype configuration (the default is ./build/phen). + +- **Copy Phenotype Configuration** + + Copy a phenotype configuration from a source directory to a target directory at a specific version. This is used when wanting to compare versions of phenotypes using the `acmc phen diff` command: + + ```bash + acmc phen copy -d <PHENOTYPE_DIRECTORY> -td <TARGET_DIRECTORY> -v <PHENOTYPE_VERSION> + ``` + + - `-d`, `--phen-dir`: (Optional) Directory of phenotype configuration (the default is ./build/phen). + - `-td`, `--target-dir`: (Optional) Directory to copy the phenotype configuration to, (the default is ./build). + - `-v`, `--version`: The phenotype version to copy. + +- **Compare Phenotype Configurations** + + Compare a a new phenotype version with pervious version of a phenotype: + + ```bash + acmc phen diff -d <NEW_PHENOTYPE_DIRECTORY> -old <OLD_PHENOTYPE_DIRECTORY> + ``` + + - `-d`, `--phen-dir`: (Optional) Directory of current phenotype configuration (the default is ./build/phen). + - `-old`, `--phen-dir-old`: (Required) Directory of old phenotype version) \ No newline at end of file -- GitLab