... | ... | @@ -9,49 +9,34 @@ The `pepcli` utility is documented extensively on a [separate page](Using-pepcli |
|
|
|
|
|
There is also a section on the use of the `pepcli get` command, which provides more control over the download process but comes with some limitations.
|
|
|
|
|
|
The documentation on this page assumes that the user is familiar with the `pepcli` utility's [general usage](Using-pepcli#general-usage) principles.
|
|
|
The documentation on this page assumes that the user is familiar with the `pepcli` utility's [general usage](Using-pepcli#general-usage) principles. In particular, the user should be able to [ensure that they are enrolled](Using-pepcli#enrollment) with the PEP system. The examples on this page assume a Unix-like environment.
|
|
|
|
|
|
# Up- and downloading pseudonymised data to and from PEP
|
|
|
# Uploading data
|
|
|
|
|
|
You can use the tool `pepcli` to work with PEP from the command line. This guide describes the upload process for a BIDS-directory of one participant, identified by a Short Pseudonym (e.g. POM1FM0023671). In the examples we will upload a normal (so not a PIT-variant) FMRI for Visit 1. This can be adapted to the other visits / variants.
|
|
|
|
|
|
|
|
|
## 1. `pepcli` overview
|
|
|
This guide assumes you are using pepcli from within a Singularity container. The general usage of pepcli is as follows:
|
|
|
|
|
|
```
|
|
|
/app/pepcli <GENERAL FLAGS> <COMMAND> <COMMAND SPECIFIC FLAGS>
|
|
|
```
|
|
|
|
|
|
This guide will discuss the flags and commands that are needed for the up- and download of data, such as the FRMI and Castor data. You can see what other options are available with:
|
|
|
Data can be uploaded into the PEP system by means of [the `pepcli store` command](Using-pepcli#store). In its most basic form, the command is used to upload a file's contents to a specified column for a specified participant. E.g.:
|
|
|
|
|
|
```
|
|
|
/app/pepcli --help
|
|
|
/app/pepcli store -p POM162733743006 -c Holter.Visit1 -i ~/holter/49170044-1C98-4A21-886C-A6E18DE1F885.ecg
|
|
|
```
|
|
|
|
|
|
You can get help for a specific command with:
|
|
|
Because of PEP's [pseudonymization](Pseudonymization) goals, uploaders will often not be privy to a participant identifier. Instead they'll usually have a *short pseudonym*, i.e. an identifier for the data sample. Short pseudonyms can be passed to the `pepcli store` command using the `--sp` switch:
|
|
|
|
|
|
```
|
|
|
/app/pepcli <COMMAND> --help
|
|
|
/app/pepcli store -sp POM1EC7713461 -c Holter.Visit1 -i ~/holter/49170044-1C98-4A21-886C-A6E18DE1F885.ecg
|
|
|
```
|
|
|
|
|
|
### The `--client-config-name` flag
|
|
|
You have received a zip-file with the configuration needed to run pepcli. Extract this to a place you can reach from the Singularity container, e.g. somewhere in your home directory. One of the files in this configuration is the file `ClientConfig.json` You need to tell pepcli where to find this file. You do this with the `--client-config-name` flag:
|
|
|
Instead of reading data from a file, the `pepcli store` command can also process data provided over the standard input stream (`stdin`). This feature allows it to be included in command redirection pipelines. The use of `stdin` is denoted by omitting the `-i` switch, or by passing a hyphen `-` to it. E.g.:
|
|
|
|
|
|
```
|
|
|
/app/pepcli --client-config-name /PATH/TO/ClientConfig.json <OTHER GENERAL FLAGS> <COMMAND> <COMMAND SPECIFIC FLAGS>
|
|
|
curl https://ecg.ppth.com/49170044-1C98-4A21-886C-A6E18DE1F885/ | /app/pepcli store -sp POM1EC7713461 -c Holter.Visit1
|
|
|
```
|
|
|
|
|
|
### The `--oauth-token` flag
|
|
|
The `pepcli` utility exits with code `0` (zero) if the `store` command succeeds, or a different value if it fails. Automated (scripted) invocations of `pepcli store` should check for these values. When the command fails, the utility write details to the log and/or to the standard error stream `stderr`.
|
|
|
|
|
|
You will receive a token that can be used to authenticate. Store this file in a place you can reach from the Singularity container, e.g. somewhere in your home directory.
|
|
|
Use the flag `--oauth-token` to tell pepcli to use the token
|
|
|
## Identifier pseudonymization
|
|
|
|
|
|
```
|
|
|
/app/pepcli --oauth-token /PATH/TO/OAuthToken.json --client-config-name /PATH/TO/ClientConfig.json <COMMAND> <COMMAND SPECIFIC FLAGS>
|
|
|
```
|
|
|
@@@more here@@@
|
|
|
|
|
|
After doing this once, you will remain authenticated for 1 day. It is therefore not necessary to use this flag every time. It is however not a problem if you do use it every time.
|
|
|
|
|
|
## 2. List data from PEP e.g. to retrieve a short pseudonym
|
|
|
|
... | ... | |