Blackbalsam

Exporting REDCap Data into R

1. Get a REDCap account for a project URL and API key

if you don’t have an account contact Adam Lee to get one

if you have an existing account use the credentials associated with it

2. Go to https://reccap.cloudapps.unc.edu/accounts/login

3. Click “New Application” and choose Blackbalsam Clinical

4. Click on “black balsam” folder and then click on RedCapAPIRDemo.ipynb

5. In the notebook, on cell 2 substitute REDCap URL and API key with your credentials

6. Run first three cells in the notebook

7. To export records, use show_forms, show_fields, or show_all_records cells

Using the restartr notebook to get data into mongodb

  1. Click on “New Application”, choose Blackbalsam Clinical then click "Create Application".

3. Click on the "blackbalsam" directory and then launch the RestartrApiDemo.ipynb notebook.

4. In cells 3 to 6 substitute your api-key here "<put-api-key>".

5. Run the first two cells in the notebook.

  • The first cell imports the required dependencies.

  • The second cell is where data can be formatted to insert into mongodb.

6. Run the third cell to persist data into mongodb.

  • This cell will call the observation api and insert data into mongodb.

  • Upon a successful call it will return an id, for example {"id": "\"5f355dd39e55e62921768dec\""}.

7. To query the data use, query by "_id", query by sub-field, or just use query methods provided in the RestartrApiDemo.ipynb notebook.

Last updated