|  | 
|  | 1 | +## `redcap2reproschema` | 
|  | 2 | +The `redcap2reproschema` function is designed to process a given REDCap CSV file and YAML configuration to generate the output in the reproschema format. | 
|  | 3 | + | 
|  | 4 | +### Prerequisites | 
|  | 5 | +Before the conversion, ensure you have the following: | 
|  | 6 | + | 
|  | 7 | +**YAML Configuration File**: | 
|  | 8 | +   - Download [templates/redcap2rs.yaml](templates/redcap2rs.yaml) and fill it out with your protocol details. | 
|  | 9 | + | 
|  | 10 | +### YAML File Configuration | 
|  | 11 | +In the `templates/redcap2rs.yaml` file, provide the following information: | 
|  | 12 | + | 
|  | 13 | +- **protocol_name**: A unique identifier for your protocol. Use underscores for spaces and avoid special characters. | 
|  | 14 | +- **protocol_display_name**: Name that will appear in the application. | 
|  | 15 | +- **protocol_description**: A brief description of your protocol. | 
|  | 16 | +- **redcap_version**: Version of your redcap file (you can customize it). | 
|  | 17 | + | 
|  | 18 | +Example: | 
|  | 19 | +```yaml | 
|  | 20 | +protocol_name: "My_Protocol" | 
|  | 21 | +protocol_display_name: "Assessment Protocol" | 
|  | 22 | +protocol_description: "This protocol is for assessing cognitive skills." | 
|  | 23 | +redcap_version: "X.XX.X" | 
|  | 24 | +``` | 
|  | 25 | +### CLI Usage | 
|  | 26 | +
 | 
|  | 27 | +The `redcap2reproschema` function has been integrated into a CLI tool, use the following command: | 
|  | 28 | +```bash | 
|  | 29 | +reproschema redcap2reproschema path/to/your_redcap_data_dic.csv path/to/your_redcap2rs.yaml | 
|  | 30 | +``` | 
|  | 31 | + | 
|  | 32 | +Optionally you can provide a path to the output directory (default is the current directory) by adding the option: `--output-path PATH` | 
|  | 33 | +### Python Function Usage | 
|  | 34 | + | 
|  | 35 | +You can also use the `redcap2reproschema` function from the `reproschema-py` package in your Python code. | 
|  | 36 | + | 
|  | 37 | +```python | 
|  | 38 | +from reproschema import redcap2reproschema | 
|  | 39 | +
 | 
|  | 40 | +csv_path = "path-to/your_redcap_data_dic.csv" | 
|  | 41 | +yaml_path = "path-to/your_redcap2rs.yaml" | 
|  | 42 | +output_path = "path-to/directory_you_want_to_save_output" | 
|  | 43 | +
 | 
|  | 44 | +redcap2reproschema(csv_file, yaml_file, output_path) | 
|  | 45 | +``` | 
0 commit comments