> For the complete documentation index, see [llms.txt](https://helx.gitbook.io/helx-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helx.gitbook.io/helx-documentation/helx/helx-workspaces/blackbalsam.md).

# Blackbalsam

## Exporting REDCap Data into R

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

{% hint style="info" %}
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
{% endhint %}

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

3\. Click “New Application” and choose **Blackbalsam Clinical**

![](/files/-MEU5UzOJGdl1t-R591S)

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

![](/files/-MEU5UzP2mvO3nX5ZZ_p)

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

![](/files/-MEU5UzQ3E3VlRNja9Dj)

6\. Run first three cells in the notebook

![](/files/-MEU5UzRY7jmComtR_Xv)

7\. To export records, use show\_forms, show\_fields, or show\_all\_records cells

![](/files/-MEU5UzSovE2GKE8T0vY)

## Using the restartr notebook to get data into mongodb

1. Go to <https://reccap.cloudapps.unc.edu/accounts/login> and login.&#x20;
2. Click on “New Application”, choose **Blackbalsam Clinical** then click "Create Application"**.**\
   &#x20;&#x20;

![](/files/-MEZL6AFZEz_sErGfH8i)

3\. Click on the "blackbalsam" directory and then launch the RestartrApiDemo.ipynb notebook. \
&#x20;&#x20;

![](/files/-MEZOV5oZvdqJ5trx7hO)

4\. In cells 3 to 6 substitute your api-key here "\<put-api-key>".\
&#x20;&#x20;

![](/files/-MEcN_jGl1_DGWrbbqIE)

5\. Run the first two cells in the notebook. \
&#x20;&#x20;

![](/files/-MEcP45NwZnlX_qWQv6b)

* The first cell imports the required dependencies.&#x20;
* The second cell is where data can be formatted to insert into mongodb. &#x20;

6\. Run the third cell to persist data into mongodb. \
&#x20;&#x20;

![](/files/-MEcRa9E1wRzTmlDCY7z)

* 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\\""}.&#x20;

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

&#x20;

![](/files/-MEcXeRX5SpXWMgZ5JGs)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://helx.gitbook.io/helx-documentation/helx/helx-workspaces/blackbalsam.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
