Sets up logger as a singleton outputing to file and sysout syserr
<aid="logging_config.set_log_level"></a>
#### set\_log\_level
```python
defset_log_level(log_level:int)
```
Sets the log level for the acmc logger
<aid="main"></a>
# main
<aid="main.trud_install"></a>
#### trud\_install
```python
deftrud_install(args:argparse.Namespace)
```
Handle the `trud install` command.
<aid="main.omop_install"></a>
#### omop\_install
```python
defomop_install(args:argparse.Namespace)
```
Handle the `omop install` command.
<aid="main.omop_clear"></a>
#### omop\_clear
```python
defomop_clear(args:argparse.Namespace)
```
Handle the `omop clear` command.
<aid="main.omop_delete"></a>
#### omop\_delete
```python
defomop_delete(args:argparse.Namespace)
```
Handle the `omop delete` command.
<aid="main.phen_init"></a>
#### phen\_init
```python
defphen_init(args:argparse.Namespace)
```
Handle the `phen init` command.
<aid="main.phen_fork"></a>
#### phen\_fork
```python
defphen_fork(args:argparse.Namespace)
```
Handle the `phen fork` command.
<aid="main.phen_validate"></a>
#### phen\_validate
```python
defphen_validate(args:argparse.Namespace)
```
Handle the `phen validate` command.
<aid="main.phen_map"></a>
#### phen\_map
```python
defphen_map(args:argparse.Namespace)
```
Handle the `phen map` command.
<aid="main.phen_export"></a>
#### phen\_export
```python
defphen_export(args:argparse.Namespace)
```
Handle the `phen copy` command.
<aid="main.phen_publish"></a>
#### phen\_publish
```python
defphen_publish(args:argparse.Namespace)
```
Handle the `phen publish` command.
<aid="main.phen_copy"></a>
#### phen\_copy
```python
defphen_copy(args:argparse.Namespace)
```
Handle the `phen copy` command.
<aid="main.phen_diff"></a>
#### phen\_diff
```python
defphen_diff(args:argparse.Namespace)
```
Handle the `phen diff` command.
<aid="omop"></a>
# omop
OMOP Module
================
This module provides functionality to manage OMOP vocabularies.
<aid="omop.install"></a>
#### install
```python
definstall(omop_zip_file:str,version:str)
```
Installs the OMOP release csv files in a file-based sql database
<aid="omop.write_version_file"></a>
#### write\_version\_file
```python
defwrite_version_file(version:str)
```
Writes the OMOP vocaburaries and version to a file
<aid="omop.clear"></a>
#### clear
```python
defclear(db_path:Path)
```
Clears the OMOP sql database
<aid="omop.delete"></a>
#### delete
```python
defdelete(db_path:Path)
```
Deletes the OMOP sql database
<aid="parse"></a>
# parse
<aid="parse.CodesError"></a>
## CodesError Objects
```python
classCodesError()
```
A class used in InvalidCodesException to report an error if a code parser check fails
<aid="parse.InvalidCodesException"></a>
## InvalidCodesException Objects
```python
classInvalidCodesException(Exception)
```
Custom exception class raised when invalid codes are found that cannot be resolved by processing
<aid="parse.Proto"></a>
## Proto Objects
```python
classProto()
```
Define checks as list of 3 tuple: (Message, Condition, Process)
- Message = The name of the condition (what is printed and logged)
- Condition = True if Passed, and False if Failed
- Process = Aims to resolve all issues that stop condition from passing (Do not change index!)
<aid="parse.Proto.raise_exception"></a>
#### raise\_exception
```python
defraise_exception(ex:Exception)
```
Raises an exception inside a lambda function. Python does not allow using raise statement inside lambda because lambda can only contain expressions, not statements. Using raise_exception not raise_ as it's more explict
<aid="parse.Proto.process"></a>
#### process
```python
defprocess(codes:pd.DataFrame,
codes_file:Path)->Tuple[pd.DataFrame,list]
```
identify issues that do not pass and fix them with define/d process
<aid="parse.Proto.verify"></a>
#### verify
```python
defverify(codes:pd.DataFrame,codes_file:Path)
```
verify codes in codes file
<aid="parse.Read2"></a>
## Read2 Objects
```python
classRead2(Proto)
```
This Read2 class extends Proto, adding custom validation checks for a dataset of "Read2" codes. It ensures that the dataset is loaded, validates the codes based on several rules, and applies corrections or logs errors when necessary.
<aid="parse.CodeTypeParser"></a>
## CodeTypeParser Objects
```python
classCodeTypeParser()
```
A class used in InvalidCodesException to report an error if a code parser check fails
<aid="phen"></a>
# phen
Phenotype Module
================
This module provides functionality for managing phenotypes.
<aid="phen.PhenValidationException"></a>
## PhenValidationException Objects
```python
classPhenValidationException(Exception)
```
Custom exception class raised when validation errors in phenotype configuration file
<aid="phen.construct_git_url"></a>
#### construct\_git\_url
```python
defconstruct_git_url(remote_url:str)
```
Constructs a git url for github or gitlab including a PAT token environment variable
<aid="phen.create_empty_git_dir"></a>
#### create\_empty\_git\_dir
```python
defcreate_empty_git_dir(path:Path)
```
Creates a directory with a .gitkeep file so that it's tracked in git
<aid="phen.check_delete_dir"></a>
#### check\_delete\_dir
```python
defcheck_delete_dir(path:Path,msg:str)->bool
```
Checks on the command line if a user wants to delete a directory
**Arguments**:
-`path` _Path_ - path of the directory to be deleted
-`msg` _str_ - message to be displayed to the user