Skip to content

Commit 1562a90

Browse files
committed
Created a docs version of the ReadMe file.
1 parent 03763c5 commit 1562a90

File tree

8 files changed

+178
-0
lines changed

8 files changed

+178
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## CLI usage
2+
3+
This package installs `reproschema` Command Line Interface (CLI).
4+
5+
```
6+
$ reproschema --help
7+
8+
$ A client to support interactions with ReproSchema
9+
10+
To see help for a specific command, run
11+
12+
reproschema COMMAND --help e.g. reproschema validate --help
13+
14+
Options:
15+
--version
16+
-l, --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]
17+
Log level name [default: INFO]
18+
--help Show this message and exit.
19+
20+
Commands:
21+
convert Converts a path to a different format, jsonld,...
22+
create
23+
migrate Updates to a new reproschema version
24+
redcap2reproschema Converts REDCap CSV files to Reproschema format.
25+
reproschema2redcap Converts reproschema protocol to REDCap CSV format.
26+
serve
27+
validate Validates if the path has a valid reproschema format
28+
reproschema2fhir Generates FHIR questionnaire resources from reproschema activities
29+
output2redcap Generates redcap csv given the audio and survey data from reproschema ui
30+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Welcome to Reproschema-py
2+
3+
For full documentation visit [Reproschema-py](https://github.com/ReproNim/reproschema-py).
4+
reproschema requires Python 3.10+
5+
6+
## Project layout
7+
mkdocs.yml # The configuration file.
8+
docs/
9+
index.md # The documentation homepage.
10+
installation.md #A tutorial for installation.
11+
cli_usage.md #Notes on CLI usage
12+
reproschema2redcap.md #How to convert from resproschema to redcap
13+
redcap2reproschema.md #How to convert from redcap to reproscehma
14+
output2redcap.md #How to convert the output into redcap
15+
reproschema2fhir.md #How to convert the reproschema into an FHIR Questionaire Resource
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Installation
2+
3+
Use the following command to install reproschema:
4+
5+
```
6+
pip install reproschema
7+
```
8+
9+
### Developer installation
10+
11+
Fork this repo to your own GitHub account, then clone and install your forked repo in the developer mode:
12+
13+
```
14+
git clone https://github.com/<your github>/reproschema-py.git
15+
cd reproschema-py
16+
pip install -e .
17+
```
18+
#### Style
19+
This repo uses pre-commit to check styling.
20+
- Install pre-commit with pip: `pip install pre-commit`
21+
- In order to use it with the repository, you have to run `run pre-commit install` in the root directory the first time you use it.
22+
23+
When pre-commit is used, you may have to run git commit twice,
24+
since pre-commit may make additional changes to your code for styling and will
25+
not commit these changes by default.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## `output2redcap`
2+
The `output2redcap` function is designed to process the output from reproschema-ui into a REDCap CSV file as seen [here](reproschema/example/redcap).
3+
4+
5+
### CLI Usage
6+
7+
The `output2redcap` function has been integrated into a CLI tool, use the following command:
8+
```bash
9+
reproschema output2redcap ./path/to/your_reproschema-ui_files ./path/to/directory_you_want_to_save_output
10+
```
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## `reproschema2fhir`
2+
The `reproschema2fhir` function is designed to convert reproschema activities and items into a FHIR Questionnaire resource as seen [here](reproschema/example/fhir).
3+
4+
### CLI Usage
5+
6+
The `reproschema2fhir` function has been integrated into a CLI tool, use the following command:
7+
```bash
8+
reproschema reproschema2fhir ./path/to/your_reproschema_activities ./path/to/directory_you_want_to_save_output
9+
```
10+
### Notes
11+
1. The script requires an active internet connection to access the GitHub repository.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## `reproschema2redcap`
2+
3+
### CLI Usage
4+
5+
You can use this feature directly from the command line. To convert ReproSchema protocol to REDCap CSV format, use the following command
6+
7+
```
8+
reproschema reproschema2redcap <input_dir_path> <output_csv_filename>
9+
```
10+
11+
- `<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:
12+
```bash
13+
git clone https://github.com/ReproNim/reproschema-demo-protocol.git
14+
cd reproschema-demo-protocol
15+
pwd
16+
```
17+
In this case, the output from `pwd` (which shows your current directory path) should be your `<input_dir_path>`.
18+
- `<output_csv_filename>`: The name of the output CSV file where the converted data will be saved.
19+
20+
### Python Function Usage
21+
22+
You can also use the `reproschema2redcap` function from the `reproschema-py` package in your Python code.
23+
24+
```python
25+
from reproschema import reproschema2redcap
26+
27+
input_dir_path = "path-to/reproschema-demo-protocol"
28+
output_csv_filename = "output.csv"
29+
30+
reproschema2redcap(input_dir_path, output_csv_filename)
31+
```

reproschema-py-tutorial/mkdocs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
site_name: My Docs
2+
nav:
3+
- Home: index.md
4+
- Installation: installation.md
5+
- CLI Usage: cli_usage.md
6+
- Converting from reproschema to redcap: reproschema2redcap.md
7+
- Converting from redcap to reproschema: redcap2reproschema.md
8+
- Converting the output into redcap: output2redcap.md
9+
- Converting the reproschema into an FHIR Questionaire Resource: reproschema2fhir.md
10+
11+
theme: readthedocs

0 commit comments

Comments
 (0)