Skip to content

Commit

Permalink
update the tool page
Browse files Browse the repository at this point in the history
  • Loading branch information
yibeichan committed Jan 10, 2024
1 parent db9a475 commit d21e376
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 4 deletions.
86 changes: 83 additions & 3 deletions docs/46_tools.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,85 @@
# Converting between ReproSchema and REDCap
# Toolkit

In the world of research data management, flexibility and compatibility are key. Understanding this, we provide specialized tools designed to seamlessly convert data between ReproSchema format and REDCap CSV format. Whether you're transitioning from REDCap to ReproSchema or vice versa, these tools ensure a smooth and efficient conversion process, preserving the integrity and structure of your data.
In the world of research data management, flexibility and compatibility are key. Understanding this, we provide specialized tools designed to create, validata schemas, and convert data between ReproSchema format and REDCap CSV format. Whether you're transitioning from REDCap to ReproSchema or vice versa, these tools ensure a smooth and efficient conversion process, preserving the integrity and structure of your data.

For detailed instructions on how to use these conversion tools, please visit [reproschema-py](https://github.com/ReproNim/reproschema-py). This link provides comprehensive guidance on usage, ensuring you can easily adapt your data to the format best suited for your research needs.
## Install reproschema-py

```
pip install reproschema
```

## CLI usage

`reproschema-py` can be used as a Commend-Line Interface.

```
$ reproschema
Usage: reproschema [OPTIONS] COMMAND [ARGS]...
A client to support interactions with ReproSchema
To see help for a specific command, run
reproschema COMMAND --help e.g. reproschema validate --help
Options:
--version
-l, --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]
Log level name [default: INFO]
--help Show this message and exit.
Commands:
convert
create
redcap2reproschema Convert REDCap CSV files to Reproschema format.
reproschema2redcap Convert reproschema protocol to REDCap CSV format.
serve
validate
```

## `reproschema2redcap` Usage

To convert ReproSchema protocol to REDCap CSV format, use the following command

```
reproschema reproschema2redcap <input_dir_path> <output_csv_filename>
```

- `<input_dir_path>`: The path to the root folder of a protocol. For example, to convert the reproschema-demo-protocol provided by ReproNim, you can use the following commands:
```bash
git clone https://github.com/ReproNim/reproschema-demo-protocol.git
cd reproschema-demo-protocol
pwd
```
In this case, the output from `pwd` (which shows your current directory path)should be your `<input_dir_path>`.
- `<output_csv_filename>`: The name of the output CSV file where the converted data will be saved.

## `redcap2reproschema` Usage
The `redcap2reproschema` function is designed to process a given REDCap CSV file and YAML configuration to generate the output in the reproschema format.

### Prerequisites
Before the conversion, ensure you have the following:

**YAML Configuration File**:
- Download [templates/redcap2rs.yaml](templates/redcap2rs.yaml) and fill it out with your protocol details.

### YAML File Configuration
In the `templates/redcap2rs.yaml` file, provide the following information:

- **protocol_name**: This is a unique identifier for your protocol. Use underscores for spaces and avoid special characters.
- **protocol_display_name**: The name that will appear in the application.
- **protocol_description**: A brief description of your protocol.

Example:
```yaml
protocol_name: "My_Protocol"
protocol_display_name: "Assessment Protocol"
protocol_description: "This protocol is for assessing cognitive skills."
```

The `redcap2reproschema`` function has been integrated into a CLI tool, use the following command:
```bash
reproschema redcap2reproschema path/to/your_redcap_data_dic.csv path/to/your_redcap2rs.yaml
```

Those tools can also be used as Python functions. For detailed instructions, please visit [reproschema-py](https://github.com/ReproNim/reproschema-py).
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ nav:
- Create new assessments for a protocol: "43_create_new_assess.md"
- Add a feedback section: "44_setup_feedback.md"
- Finalize the protocol: "45_finalize_protocol.md"
- Additional tools: "46_tools.md"
- Toolkit: "46_tools.md"

# - Creating a new activity and protocol: "create_new_activity_protocol.md"
# - Testing your schema and collecting data: "testing_using_schema.md"
Expand Down

0 comments on commit d21e376

Please sign in to comment.