From 918d6b17c3fcd00ce99b7f9d3ac656b7da684f45 Mon Sep 17 00:00:00 2001
From: GitHub Actions <actions@github.com>
Date: Sat, 7 Sep 2024 05:09:53 +0000
Subject: [PATCH] Built site for REDCapR@1.1.9007: 9f2b424

---
 articles/BasicREDCapROperations.html        | 62 ++++++++++-----------
 articles/TroubleshootingApiCalls.html       |  4 +-
 articles/advanced-redcapr-operations.html   |  8 +--
 articles/workflow-read.html                 | 10 ++--
 authors.html                                |  4 +-
 pkgdown.yml                                 |  2 +-
 reference/REDCapR-package.html              |  2 +-
 reference/kernel_api.html                   |  2 +-
 reference/redcap_arm_export.html            |  4 +-
 reference/redcap_dag_read.html              |  2 +-
 reference/redcap_event_instruments.html     |  6 +-
 reference/redcap_event_read.html            |  2 +-
 reference/redcap_file_download_oneshot.html | 10 ++--
 reference/redcap_instrument_download.html   | 12 ++--
 reference/redcap_instruments.html           |  2 +-
 reference/redcap_log_read.html              | 14 ++---
 reference/redcap_metadata_coltypes.html     |  4 +-
 reference/redcap_metadata_read.html         |  6 +-
 reference/redcap_metadata_write.html        |  6 +-
 reference/redcap_next_free_record_name.html |  2 +-
 reference/redcap_project.html               | 48 ++++++++--------
 reference/redcap_project_info_read.html     | 40 ++++++-------
 reference/redcap_read.html                  | 22 ++++----
 reference/redcap_read_eav_oneshot.html      |  2 +-
 reference/redcap_read_oneshot.html          |  8 +--
 reference/redcap_read_oneshot_eav.html      | 10 ++--
 reference/redcap_report.html                |  2 +-
 reference/redcap_users_export.html          |  2 +-
 reference/retrieve_credential.html          |  2 +-
 search.json                                 |  2 +-
 30 files changed, 151 insertions(+), 151 deletions(-)

diff --git a/articles/BasicREDCapROperations.html b/articles/BasicREDCapROperations.html
index 3b088de3..0e246086 100644
--- a/articles/BasicREDCapROperations.html
+++ b/articles/BasicREDCapROperations.html
@@ -99,15 +99,15 @@ <h3 id="read-all-records-and-fields">Read all records and fields<a class="anchor
 <div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
 <code class="sourceCode R"><span><span class="co"># Return all records and all variables.</span></span>
 <span><span class="va">ds_all_rows_all_fields</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/redcap_read.html">redcap_read</a></span><span class="op">(</span>redcap_uri <span class="op">=</span> <span class="va">uri</span>, token <span class="op">=</span> <span class="va">token</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span>
-<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 1 rows were read from REDCap in 0.6 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; Starting to read 5 records  at 2024-09-07 01:07:09.145935.</span></span>
+<span><span class="co">#&gt; Starting to read 5 records  at 2024-09-07 05:08:57.132047.</span></span>
 <span><span class="co">#&gt; Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).</span></span>
-<span><span class="co">#&gt; 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="va">ds_all_rows_all_fields</span> <span class="co"># Inspect the returned dataset</span></span>
 <span><span class="co">#&gt; <span style="color: #949494;"># A tibble: 5 × 25</span></span></span>
 <span><span class="co">#&gt;   record_id name_first name_last address  telephone email dob          age   sex</span></span>
@@ -144,15 +144,15 @@ <h3 id="read-a-subset-of-the-records">Read a subset of the records<a class="anch
 <span>  token      <span class="op">=</span> <span class="va">token</span>,</span>
 <span>  records    <span class="op">=</span> <span class="va">desired_records</span></span>
 <span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span>
-<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.1 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; The data dictionary describing 17 fields was read from REDCap in 0.1 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 2 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; Starting to read 2 records  at 2024-09-07 01:07:11.537467.</span></span>
+<span><span class="co">#&gt; 2 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; Starting to read 2 records  at 2024-09-07 05:08:59.155095.</span></span>
 <span><span class="co">#&gt; Reading batch 1 of 1, with subjects 1 through 3 (ie, 2 unique subject records).</span></span>
-<span><span class="co">#&gt; 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span></code></pre></div>
+<span><span class="co">#&gt; 2 records and 25 columns were read from REDCap in 0.8 seconds.  The http status code was 200.</span></span></code></pre></div>
 </div>
 <div class="section level3">
 <h3 id="read-a-subset-of-the-fields">Read a subset of the fields<a class="anchor" aria-label="anchor" href="#read-a-subset-of-the-fields"></a>
@@ -175,15 +175,15 @@ <h3 id="read-a-subset-of-the-fields">Read a subset of the fields<a class="anchor
 <span>  token      <span class="op">=</span> <span class="va">token</span>,</span>
 <span>  fields     <span class="op">=</span> <span class="va">desired_fields</span></span>
 <span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span>
-<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.1 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 2 data access groups were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; Starting to read 5 records  at 2024-09-07 01:07:13.796254.</span></span>
+<span><span class="co">#&gt; Starting to read 5 records  at 2024-09-07 05:09:02.157745.</span></span>
 <span><span class="co">#&gt; Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).</span></span>
-<span><span class="co">#&gt; 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span></code></pre></div>
+<span><span class="co">#&gt; 5 records and 3 columns were read from REDCap in 0.4 seconds.  The http status code was 200.</span></span></code></pre></div>
 </div>
 <div class="section level3">
 <h3 id="read-a-subset-of-records-conditioned-on-the-values-in-some-variables">Read a subset of records, conditioned on the values in some
@@ -209,13 +209,13 @@ <h3 id="read-a-subset-of-records-conditioned-on-the-values-in-some-variables">Re
 <span>  token      <span class="op">=</span> <span class="va">token</span>,</span>
 <span>  fields     <span class="op">=</span> <span class="va">desired_fields_v3</span></span>
 <span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span>
-<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; The data dictionary describing 17 fields was read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; The data dictionary describing 17 fields was read from REDCap in 0.1 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 3 instrument metadata records were read from REDCap in 0.4 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; Starting to read 5 records  at 2024-09-07 01:07:16.24055.</span></span>
+<span><span class="co">#&gt; 2 data access groups were read from REDCap in 0.4 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 5 records and 1 columns were read from REDCap in 0.5 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; Starting to read 5 records  at 2024-09-07 05:09:05.091162.</span></span>
 <span><span class="co">#&gt; Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).</span></span>
 <span><span class="co">#&gt; 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
 <span></span>
@@ -246,15 +246,15 @@ <h3 id="read-a-subset-of-records-conditioned-on-the-values-in-some-variables">Re
 <span>  token      <span class="op">=</span> <span class="va">token</span>,</span>
 <span>  records    <span class="op">=</span> <span class="va">desired_records_v3</span></span>
 <span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span>
-<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 2 data access groups were read from REDCap in 0.4 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 1 rows were read from REDCap in 0.4 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 2 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; Starting to read 2 records  at 2024-09-07 01:07:18.695033.</span></span>
+<span><span class="co">#&gt; Starting to read 2 records  at 2024-09-07 05:09:07.570098.</span></span>
 <span><span class="co">#&gt; Reading batch 1 of 1, with subjects 3 through 5 (ie, 2 unique subject records).</span></span>
-<span><span class="co">#&gt; 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 2 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span></span>
 <span><span class="va">ds_some_rows_v3</span> <span class="co">#Examine the results.</span></span>
 <span><span class="co">#&gt; <span style="color: #949494;"># A tibble: 2 × 25</span></span></span>
@@ -302,12 +302,12 @@ <h3 id="additional-returned-information">Additional Returned Information<a class
 <span>  fields     <span class="op">=</span> <span class="va">desired_fields</span></span>
 <span><span class="op">)</span></span>
 <span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; The data dictionary describing 17 fields was read from REDCap in 0.6 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; Starting to read 5 records  at 2024-09-07 01:07:21.096432.</span></span>
+<span><span class="co">#&gt; 5 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; Starting to read 5 records  at 2024-09-07 05:09:10.115858.</span></span>
 <span><span class="co">#&gt; Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).</span></span>
 <span><span class="co">#&gt; 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
 <span><span class="va">all_information</span> <span class="co">#Inspect the additional information</span></span>
@@ -352,7 +352,7 @@ <h3 id="additional-returned-information">Additional Returned Information<a class
 <span><span class="co">#&gt; [1] NA</span></span>
 <span><span class="co">#&gt; </span></span>
 <span><span class="co">#&gt; $elapsed_seconds</span></span>
-<span><span class="co">#&gt; [1] 2.237706</span></span></code></pre></div>
+<span><span class="co">#&gt; [1] 2.569948</span></span></code></pre></div>
 </div>
 </div>
 <div class="section level2">
@@ -441,7 +441,7 @@ <h2 id="session-information">Session Information<a class="anchor" aria-label="an
 <span><span class="co">#&gt; <span style="color: #555555;"> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library</span></span></span>
 <span><span class="co">#&gt; </span></span>
 <span><span class="co">#&gt; <span style="color: #00BBBB; font-weight: bold;">──────────────────────────────────────────────────────────────────────────────</span></span></span></code></pre>
-</details><p>Report rendered by runner at 2024-09-07, 01:07 +0000 in 15
+</details><p>Report rendered by runner at 2024-09-07, 05:09 +0000 in 16
 seconds.</p>
 </div>
   </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
diff --git a/articles/TroubleshootingApiCalls.html b/articles/TroubleshootingApiCalls.html
index 1bff86ca..552024aa 100644
--- a/articles/TroubleshootingApiCalls.html
+++ b/articles/TroubleshootingApiCalls.html
@@ -374,9 +374,9 @@ <h3 id="gotchas-agnostic">Common Gotchas<a class="anchor" aria-label="anchor" hr
 <li>
 <p><strong>Problems in the project’s metadata/dictionary.</strong>
 If exporting the metadata fails (<em>e.g.</em>, <a href="https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html"><code>REDCapR::redcap_metadata_read()</code></a>
-and <a href="https://rdrr.io/github/nutterb/redcapAPI/man/exportMetaData.html" class="external-link"><code>redcapAPI::exportMetaData()</code></a>),
+and <a href="https://www.rdocumentation.org/packages/redcapAPI/versions/2.0/topics/exportMetaData.html" class="external-link"><code>redcapAPI::exportMetaData()</code></a>),
 manually download the data dictionary from the REDCap browser. Inspect
-the plain text closely in a text editor like <a href="https://code.visualstudio.com/" class="external-link">Visual Studio Code</a>; avoid
+the plain text closely in a text editor like <a href="https://code.visualstudio.com" class="external-link">Visual Studio Code</a>; avoid
 programs like Excel that tend to interpret, align, and decorate the
 values, which sometimes masks problems. Scrutinize all elements, but
 especially look for nonstandard characters. <em>See the next
diff --git a/articles/advanced-redcapr-operations.html b/articles/advanced-redcapr-operations.html
index 688b5694..d32b2a64 100644
--- a/articles/advanced-redcapr-operations.html
+++ b/articles/advanced-redcapr-operations.html
@@ -116,7 +116,7 @@ <h2 id="converting-from-talllong-to-wide">Converting from tall/long to wide<a cl
 <span><span class="va">events_to_retain</span>  <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"dose_1_arm_1"</span>, <span class="st">"visit_1_arm_1"</span>, <span class="st">"dose_2_arm_1"</span>, <span class="st">"visit_2_arm_1"</span><span class="op">)</span></span>
 <span></span>
 <span><span class="va">ds_long</span> <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu"><a href="../reference/redcap_read_oneshot.html">redcap_read_oneshot</a></span><span class="op">(</span>redcap_uri <span class="op">=</span> <span class="va">uri</span>, token <span class="op">=</span> <span class="va">token_longitudinal</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></code></pre></div>
-<pre><code><span><span class="co">#&gt; 18 records and 125 columns were read from REDCap in 0.4 seconds.  The http status code was 200.</span></span></code></pre>
+<pre><code><span><span class="co">#&gt; 18 records and 125 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span></code></pre>
 <div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
 <code class="sourceCode R"><span><span class="va">ds_long</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html" class="external-link">%&gt;%</a></span></span>
 <span>  <span class="fu">dplyr</span><span class="fu">::</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="va">study_id</span>, <span class="va">redcap_event_name</span>, <span class="va">pmq1</span>, <span class="va">pmq2</span>, <span class="va">pmq3</span>, <span class="va">pmq4</span><span class="op">)</span></span></code></pre></div>
@@ -329,7 +329,7 @@ <h2 id="ssl-options">SSL Options<a class="anchor" aria-label="anchor" href="#ssl
 <span>    config_options <span class="op">=</span> <span class="va">config_options</span></span>
 <span>  <span class="op">)</span><span class="op">$</span><span class="va">data</span></span>
 <span><span class="op">}</span></span></code></pre></div>
-<pre><code><span><span class="co">#&gt; 5 records and 25 columns were read from REDCap in 1.0 seconds.  The http status code was 200.</span></span></code></pre>
+<pre><code><span><span class="co">#&gt; 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span></code></pre>
 <p>Force the connection to use SSL=3 (which is not preferred, and
 possibly insecure).</p>
 <div class="sourceCode" id="cb17"><pre class="downlit sourceCode r">
@@ -347,7 +347,7 @@ <h2 id="ssl-options">SSL Options<a class="anchor" aria-label="anchor" href="#ssl
 <span>  token          <span class="op">=</span> <span class="va">token_simple</span>,</span>
 <span>  config_options <span class="op">=</span> <span class="va">config_options</span></span>
 <span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></code></pre></div>
-<pre><code><span><span class="co">#&gt; 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span></code></pre>
+<pre><code><span><span class="co">#&gt; 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span></code></pre>
 </div>
 <div class="section level2">
 <h2 id="convert-spss-output-to-redcap-data-dictionary">Convert SPSS Output to REDCap data dictionary<a class="anchor" aria-label="anchor" href="#convert-spss-output-to-redcap-data-dictionary"></a>
@@ -454,7 +454,7 @@ <h2 id="session-information">Session Information<a class="anchor" aria-label="an
 <span><span class="co">#&gt; <span style="color: #555555;"> [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library</span></span></span>
 <span><span class="co">#&gt; </span></span>
 <span><span class="co">#&gt; <span style="color: #00BBBB; font-weight: bold;">──────────────────────────────────────────────────────────────────────────────</span></span></span></code></pre>
-</details><p>Report rendered by runner at 2024-09-07, 01:07 +0000 in 3
+</details><p>Report rendered by runner at 2024-09-07, 05:08 +0000 in 2
 seconds.</p>
 </div>
   </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
diff --git a/articles/workflow-read.html b/articles/workflow-read.html
index 0a822cd8..6dc04bd9 100644
--- a/articles/workflow-read.html
+++ b/articles/workflow-read.html
@@ -242,15 +242,15 @@ <h2 id="part-3---read-data-unstructured-approach">Part 3 - Read Data: Unstructur
 <span>    redcap_uri  <span class="op">=</span> <span class="va">credential</span><span class="op">$</span><span class="va">redcap_uri</span>,</span>
 <span>    token       <span class="op">=</span> <span class="va">credential</span><span class="op">$</span><span class="va">token</span></span>
 <span>  <span class="op">)</span><span class="op">$</span><span class="va">data</span></span>
-<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; 3 instrument metadata records were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
 <span><span class="co">#&gt; 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span>
-<span><span class="co">#&gt; Starting to read 5 records  at 2024-09-07 01:07:41.823374.</span></span>
+<span><span class="co">#&gt; 5 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span>
+<span><span class="co">#&gt; Starting to read 5 records  at 2024-09-07 05:09:31.297113.</span></span>
 <span><span class="co">#&gt; Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).</span></span>
-<span><span class="co">#&gt; 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span></span></code></pre></div>
+<span><span class="co">#&gt; 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span></span></code></pre></div>
 <p>At this point, the data.frame <code>ds_1</code> has everything you
 need to start analyzing the project.</p>
 <div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
diff --git a/authors.html b/authors.html
index 603c54b9..4ab689c5 100644
--- a/authors.html
+++ b/authors.html
@@ -110,13 +110,13 @@ <h2 id="citation">Citation</h2>
 
       <p>Beasley W (2024).
 <em>REDCapR: Interaction Between R and REDCap</em>.
-R package version 1.1.9007, https://github.com/OuhscBbmc/REDCapR, https://www.ouhsc.edu/bbmc/, https://project-redcap.org, <a href="https://ouhscbbmc.github.io/REDCapR/">https://ouhscbbmc.github.io/REDCapR/</a>.
+R package version 1.1.9007, https://github.com/OuhscBbmc/REDCapR, https://www.ouhsc.edu/bbmc/, https://projectredcap.org, <a href="https://ouhscbbmc.github.io/REDCapR/">https://ouhscbbmc.github.io/REDCapR/</a>.
 </p>
       <pre>@Manual{,
   title = {REDCapR: Interaction Between R and REDCap},
   author = {Will Beasley},
   year = {2024},
-  note = {R package version 1.1.9007, https://github.com/OuhscBbmc/REDCapR, https://www.ouhsc.edu/bbmc/, https://project-redcap.org},
+  note = {R package version 1.1.9007, https://github.com/OuhscBbmc/REDCapR, https://www.ouhsc.edu/bbmc/, https://projectredcap.org},
   url = {https://ouhscbbmc.github.io/REDCapR/},
 }</pre>
     </div>
diff --git a/pkgdown.yml b/pkgdown.yml
index 33b5fb9d..bcaf0612 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -9,7 +9,7 @@ articles:
   TroubleshootingApiCalls: TroubleshootingApiCalls.html
   workflow-read: workflow-read.html
   workflow-write: workflow-write.html
-last_built: 2024-09-07T01:05Z
+last_built: 2024-09-07T05:07Z
 urls:
   reference: https://ouhscbbmc.github.io/REDCapR/reference
   article: https://ouhscbbmc.github.io/REDCapR/articles
diff --git a/reference/REDCapR-package.html b/reference/REDCapR-package.html
index a94993a1..12976bfb 100644
--- a/reference/REDCapR-package.html
+++ b/reference/REDCapR-package.html
@@ -151,7 +151,7 @@ <h2 id="see-also">See also<a class="anchor" aria-label="anchor" href="#see-also"
     <div class="dont-index"><p>Useful links:</p><ul><li><p><a href="https://ouhscbbmc.github.io/REDCapR/">https://ouhscbbmc.github.io/REDCapR/</a></p></li>
 <li><p><a href="https://github.com/OuhscBbmc/REDCapR" class="external-link">https://github.com/OuhscBbmc/REDCapR</a></p></li>
 <li><p><a href="https://www.ouhsc.edu/bbmc/" class="external-link">https://www.ouhsc.edu/bbmc/</a></p></li>
-<li><p><a href="https://project-redcap.org" class="external-link">https://project-redcap.org</a></p></li>
+<li><p><a href="https://projectredcap.org" class="external-link">https://projectredcap.org</a></p></li>
 <li><p>Report bugs at <a href="https://github.com/OuhscBbmc/REDCapR/issues" class="external-link">https://github.com/OuhscBbmc/REDCapR/issues</a></p></li>
 </ul></div>
     </div>
diff --git a/reference/kernel_api.html b/reference/kernel_api.html
index f11957b4..f33cd96a 100644
--- a/reference/kernel_api.html
+++ b/reference/kernel_api.html
@@ -124,7 +124,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="co"># Consume the results in a few different ways.</span></span></span>
 <span class="r-in"><span><span class="va">kernel</span><span class="op">$</span><span class="va">result</span></span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> Response [https://bbmc.ouhsc.edu/redcap/api/]</span>
-<span class="r-out co"><span class="r-pr">#&gt;</span>   Date: 2024-09-07 01:06</span>
+<span class="r-out co"><span class="r-pr">#&gt;</span>   Date: 2024-09-07 05:07</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   Status: 200</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   Content-Type: text/csv; charset=utf-8</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   Size: 717 B</span>
diff --git a/reference/redcap_arm_export.html b/reference/redcap_arm_export.html
index 8546eeed..976a1741 100644
--- a/reference/redcap_arm_export.html
+++ b/reference/redcap_arm_export.html
@@ -125,7 +125,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="co"># Query a classic project with 3 arms</span></span></span>
 <span class="r-in"><span><span class="va">token_1</span>  <span class="op">&lt;-</span> <span class="st">"CDF9F3767E413FDBAA31D92E9F36730A"</span></span></span>
 <span class="r-in"><span><span class="va">result_1</span> <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_arm_export</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token_1</span><span class="op">)</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> The list of arms was retrieved from the REDCap project in 0.2 seconds. The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> The list of arms was retrieved from the REDCap project in 0.4 seconds. The http status code was 200.</span>
 <span class="r-in"><span><span class="va">result_1</span><span class="op">$</span><span class="va">has_arms</span></span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE</span>
 <span class="r-in"><span><span class="va">result_1</span><span class="op">$</span><span class="va">data</span></span></span>
@@ -139,7 +139,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="co"># Query a classic project without arms</span></span></span>
 <span class="r-in"><span><span class="va">token_2</span>  <span class="op">&lt;-</span> <span class="st">"D70F9ACD1EDD6F151C6EA78683944E98"</span></span></span>
 <span class="r-in"><span><span class="va">result_2</span> <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_arm_export</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token_2</span><span class="op">)</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> A 'classic' REDCap project has no arms.  Retrieved in 0.2 seconds. The http status code was 400.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> A 'classic' REDCap project has no arms.  Retrieved in 0.1 seconds. The http status code was 400.</span>
 <span class="r-in"><span><span class="va">result_2</span><span class="op">$</span><span class="va">has_arms</span></span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] FALSE</span>
 <span class="r-in"><span><span class="va">result_2</span><span class="op">$</span><span class="va">data</span></span></span>
diff --git a/reference/redcap_dag_read.html b/reference/redcap_dag_read.html
index c2b93746..997a0489 100644
--- a/reference/redcap_dag_read.html
+++ b/reference/redcap_dag_read.html
@@ -134,7 +134,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="va">uri</span>     <span class="op">&lt;-</span> <span class="st">"https://bbmc.ouhsc.edu/redcap/api/"</span></span></span>
 <span class="r-in"><span><span class="va">token</span>   <span class="op">&lt;-</span> <span class="st">"9A81268476645C4E5F03428B8AC3AA7B"</span></span></span>
 <span class="r-in"><span><span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_dag_read</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 3</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   data_access_group_name unique_group_name data_access_group_id</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>                  <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>                            <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span></span>
diff --git a/reference/redcap_event_instruments.html b/reference/redcap_event_instruments.html
index 219f39d2..c3d0d9d0 100644
--- a/reference/redcap_event_instruments.html
+++ b/reference/redcap_event_instruments.html
@@ -168,7 +168,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span>          1 Drug A  </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span>          2 Drug B  </span>
 <span class="r-in"><span><span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_event_instruments</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token_2</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 25 event instrument metadata records were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 25 event instrument metadata records were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 25 × 3</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>    arm_num unique_event_name form                        </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>      <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>             <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>                       </span>
@@ -184,7 +184,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span>       1 visit_2_arm_1     visit_lab_data              </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 15 more rows</span></span>
 <span class="r-in"><span><span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_event_instruments</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token_2</span>, arms <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"1"</span>, <span class="st">"2"</span><span class="op">)</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 25 event instrument metadata records were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 25 event instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 25 × 3</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>    arm_num unique_event_name form                        </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>      <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>             <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>                       </span>
@@ -218,7 +218,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="co"># Classic project (without arms) throws an error</span></span></span>
 <span class="r-in"><span><span class="va">token_3</span>  <span class="op">&lt;-</span> <span class="st">"9A81268476645C4E5F03428B8AC3AA7B"</span> <span class="co"># pid 153</span></span></span>
 <span class="r-in"><span><span class="fu">REDCapR</span><span class="fu">::</span><span class="fu"><a href="redcap_arm_export.html">redcap_arm_export</a></span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token_3</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> A 'classic' REDCap project has no arms.  Retrieved in 0.2 seconds. The http status code was 400.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> A 'classic' REDCap project has no arms.  Retrieved in 0.1 seconds. The http status code was 400.</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 0 × 2</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 2 variables: arm_number &lt;int&gt;, arm_name &lt;chr&gt;</span></span>
 <span class="r-in"><span><span class="co"># REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_3)$data</span></span></span>
diff --git a/reference/redcap_event_read.html b/reference/redcap_event_read.html
index caa7b4be..d4387c72 100644
--- a/reference/redcap_event_read.html
+++ b/reference/redcap_event_read.html
@@ -157,7 +157,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="co"># Query a classic project without events</span></span></span>
 <span class="r-in"><span><span class="va">token_3</span>  <span class="op">&lt;-</span> <span class="st">"D70F9ACD1EDD6F151C6EA78683944E98"</span></span></span>
 <span class="r-in"><span><span class="va">result_3</span> <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_event_read</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token_3</span><span class="op">)</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> A 'classic' REDCap project has no events.  Retrieved in 0.2 seconds. The http status code was 400.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> A 'classic' REDCap project has no events.  Retrieved in 0.1 seconds. The http status code was 400.</span>
 <span class="r-in"><span><span class="va">result_3</span><span class="op">$</span><span class="va">data</span></span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 0 × 5</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 5 variables: event_name &lt;chr&gt;, arm_num &lt;int&gt;, unique_event_name &lt;chr&gt;,</span></span>
diff --git a/reference/redcap_file_download_oneshot.html b/reference/redcap_file_download_oneshot.html
index 6d9af3b9..f820be7b 100644
--- a/reference/redcap_file_download_oneshot.html
+++ b/reference/redcap_file_download_oneshot.html
@@ -182,11 +182,11 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>  token         <span class="op">=</span> <span class="va">token</span></span></span>
 <span class="r-in"><span><span class="op">)</span></span></span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Preparing to download the file `mugshot-1.jpg`.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> image/jpeg; name="mugshot-1.jpg" successfully downloaded in 0.9 seconds, and saved as mugshot-1.jpg.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> image/jpeg; name="mugshot-1.jpg" successfully downloaded in 0.2 seconds, and saved as mugshot-1.jpg.</span>
 <span class="r-in"><span><span class="fu">base</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/base/unlink.html" class="external-link">unlink</a></span><span class="op">(</span><span class="st">"mugshot-1.jpg"</span><span class="op">)</span></span></span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="op">(</span><span class="va">full_name</span> <span class="op">&lt;-</span> <span class="fu">base</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/base/tempfile.html" class="external-link">tempfile</a></span><span class="op">(</span>pattern<span class="op">=</span><span class="st">"mugshot"</span>, fileext <span class="op">=</span> <span class="st">".jpg"</span><span class="op">)</span><span class="op">)</span></span></span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/mugshotdd5dfbd104.jpg"</span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/mugshot12313679b32c.jpg"</span>
 <span class="r-in"><span><span class="va">result_2</span>   <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_file_download_oneshot</span><span class="op">(</span></span></span>
 <span class="r-in"><span>  file_name     <span class="op">=</span> <span class="va">full_name</span>,</span></span>
 <span class="r-in"><span>  record        <span class="op">=</span> <span class="va">record</span>,</span></span>
@@ -194,8 +194,8 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>  redcap_uri    <span class="op">=</span> <span class="va">uri</span>,</span></span>
 <span class="r-in"><span>  token         <span class="op">=</span> <span class="va">token</span></span></span>
 <span class="r-in"><span><span class="op">)</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/mugshotdd5dfbd104.jpg`.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> image/jpeg; name="mugshot-1.jpg" successfully downloaded in 0.3 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/mugshotdd5dfbd104.jpg.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/mugshot12313679b32c.jpg`.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> image/jpeg; name="mugshot-1.jpg" successfully downloaded in 0.2 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/mugshot12313679b32c.jpg.</span>
 <span class="r-in"><span><span class="fu">base</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/base/unlink.html" class="external-link">unlink</a></span><span class="op">(</span><span class="va">full_name</span><span class="op">)</span></span></span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="op">(</span><span class="va">relative_name</span> <span class="op">&lt;-</span> <span class="st">"ssss.jpg"</span><span class="op">)</span></span></span>
@@ -208,7 +208,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>  token        <span class="op">=</span> <span class="va">token</span></span></span>
 <span class="r-in"><span><span class="op">)</span></span></span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Preparing to download the file `ssss.jpg`.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> image/jpeg; name="mugshot-1.jpg" successfully downloaded in 0.5 seconds, and saved as ssss.jpg.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> image/jpeg; name="mugshot-1.jpg" successfully downloaded in 0.3 seconds, and saved as ssss.jpg.</span>
 <span class="r-in"><span><span class="fu">base</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/base/unlink.html" class="external-link">unlink</a></span><span class="op">(</span><span class="va">relative_name</span><span class="op">)</span></span></span>
 <span class="r-in"><span><span class="co"># }</span></span></span>
 </code></pre></div>
diff --git a/reference/redcap_instrument_download.html b/reference/redcap_instrument_download.html
index 17699088..34633f02 100644
--- a/reference/redcap_instrument_download.html
+++ b/reference/redcap_instrument_download.html
@@ -179,18 +179,18 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-err co"><span class="r-pr">#&gt;</span> <span class="error">Error in eval(expr, envir, enclos):</span> object 'full_name' not found</span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="op">(</span><span class="va">full_name</span> <span class="op">&lt;-</span> <span class="fu">base</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/base/tempfile.html" class="external-link">tempfile</a></span><span class="op">(</span>pattern<span class="op">=</span><span class="st">"instruments-all-record-1-"</span>, fileext <span class="op">=</span> <span class="st">".pdf"</span><span class="op">)</span><span class="op">)</span></span></span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instruments-all-record-1-dd52c9331b3.pdf"</span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instruments-all-record-1-123119843c0d.pdf"</span>
 <span class="r-in"><span><span class="va">result_2</span>   <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_instrument_download</span><span class="op">(</span></span></span>
 <span class="r-in"><span>  record        <span class="op">=</span> <span class="fl">5</span>,</span></span>
 <span class="r-in"><span>  file_name     <span class="op">=</span> <span class="va">full_name</span>,</span></span>
 <span class="r-in"><span>  redcap_uri    <span class="op">=</span> <span class="va">uri</span>,</span></span>
 <span class="r-in"><span>  token         <span class="op">=</span> <span class="va">token</span></span></span>
 <span class="r-in"><span><span class="op">)</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instruments-all-record-1-dd52c9331b3.pdf`.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> text/html; charset=UTF-8 successfully downloaded in 0.3 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instruments-all-record-1-dd52c9331b3.pdf.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instruments-all-record-1-123119843c0d.pdf`.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> text/html; charset=UTF-8 successfully downloaded in 1.0 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instruments-all-record-1-123119843c0d.pdf.</span>
 <span class="r-in"><span><span class="fu">base</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/base/unlink.html" class="external-link">unlink</a></span><span class="op">(</span><span class="va">full_name</span><span class="op">)</span></span></span>
 <span class="r-in"><span><span class="op">(</span><span class="va">full_name</span> <span class="op">&lt;-</span> <span class="fu">base</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/base/tempfile.html" class="external-link">tempfile</a></span><span class="op">(</span>pattern<span class="op">=</span><span class="st">"instrument-1-record-1-"</span>, fileext<span class="op">=</span><span class="st">".pdf"</span><span class="op">)</span><span class="op">)</span></span></span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instrument-1-record-1-dd573a3f5a1.pdf"</span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instrument-1-record-1-123138828691.pdf"</span>
 <span class="r-in"><span><span class="va">result_3</span>   <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_instrument_download</span><span class="op">(</span></span></span>
 <span class="r-in"><span>  record        <span class="op">=</span> <span class="fl">5</span>,</span></span>
 <span class="r-in"><span>  instrument    <span class="op">=</span> <span class="st">"health"</span>,</span></span>
@@ -198,8 +198,8 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>  redcap_uri    <span class="op">=</span> <span class="va">uri</span>,</span></span>
 <span class="r-in"><span>  token         <span class="op">=</span> <span class="va">token</span></span></span>
 <span class="r-in"><span><span class="op">)</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instrument-1-record-1-dd573a3f5a1.pdf`.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> text/html; charset=UTF-8 successfully downloaded in 0.5 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instrument-1-record-1-dd573a3f5a1.pdf.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instrument-1-record-1-123138828691.pdf`.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> text/html; charset=UTF-8 successfully downloaded in 0.4 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instrument-1-record-1-123138828691.pdf.</span>
 <span class="r-in"><span><span class="fu">base</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/base/unlink.html" class="external-link">unlink</a></span><span class="op">(</span><span class="va">full_name</span><span class="op">)</span></span></span>
 <span class="r-in"><span><span class="co"># }</span></span></span>
 </code></pre></div>
diff --git a/reference/redcap_instruments.html b/reference/redcap_instruments.html
index f5322935..f150abe6 100644
--- a/reference/redcap_instruments.html
+++ b/reference/redcap_instruments.html
@@ -145,7 +145,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="va">uri</span>           <span class="op">&lt;-</span> <span class="st">"https://bbmc.ouhsc.edu/redcap/api/"</span></span></span>
 <span class="r-in"><span><span class="va">token</span>         <span class="op">&lt;-</span> <span class="st">"9A81268476645C4E5F03428B8AC3AA7B"</span></span></span>
 <span class="r-in"><span><span class="va">ds_instrument</span> <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_instruments</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-in"><span><span class="co"># }</span></span></span>
 </code></pre></div>
     </div>
diff --git a/reference/redcap_log_read.html b/reference/redcap_log_read.html
index 0e1b20a2..e5875097 100644
--- a/reference/redcap_log_read.html
+++ b/reference/redcap_log_read.html
@@ -167,17 +167,17 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="va">token</span>        <span class="op">&lt;-</span> <span class="st">"9A81268476645C4E5F03428B8AC3AA7B"</span></span></span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="va">ds_last_week</span> <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_log_read</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 13,274 rows were read from REDCap in 0.6 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 18,285 rows were read from REDCap in 0.8 seconds.  The http status code was 200.</span>
 <span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">ds_last_week</span><span class="op">)</span></span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 6 × 5</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   timestamp           username        action            details           record</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   <span style="color: #949494; font-style: italic;">&lt;dttm&gt;</span>              <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>           <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>             <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>             <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2024-09-06 <span style="color: #949494;">20:06:00</span> unittestphifree Manage/Design     Export instrumen… <span style="color: #BB0000;">NA</span>    </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2024-09-06 <span style="color: #949494;">20:06:00</span> unittestphifree Manage/Design     Download data di… <span style="color: #BB0000;">NA</span>    </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 2024-09-06 <span style="color: #949494;">20:06:00</span> unittestphifree Manage/Design     Export instrumen… <span style="color: #BB0000;">NA</span>    </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 2024-09-06 <span style="color: #949494;">20:06:00</span> unittestphifree Manage/Design     Download export … <span style="color: #BB0000;">NA</span>    </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> 2024-09-06 <span style="color: #949494;">20:06:00</span> unittestphifree Data export (API) export_format: C… <span style="color: #BB0000;">NA</span>    </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> 2024-09-06 <span style="color: #949494;">20:06:00</span> unittestphifree Data export (API) export_format: C… <span style="color: #BB0000;">NA</span>    </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> 2024-09-07 <span style="color: #949494;">00:08:00</span> unittestphifree Manage/Design     Export instrumen… <span style="color: #BB0000;">NA</span>    </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> 2024-09-07 <span style="color: #949494;">00:08:00</span> unittestphifree Data export (API) export_format: C… <span style="color: #BB0000;">NA</span>    </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> 2024-09-07 <span style="color: #949494;">00:08:00</span> unittestphifree Data export (API) export_format: C… <span style="color: #BB0000;">NA</span>    </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> 2024-09-07 <span style="color: #949494;">00:08:00</span> unittestphifree Data export (API) export_format: C… <span style="color: #BB0000;">NA</span>    </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> 2024-09-07 <span style="color: #949494;">00:07:00</span> unittestphifree Data export (API) export_format: C… <span style="color: #BB0000;">NA</span>    </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> 2024-09-07 <span style="color: #949494;">00:07:00</span> unittestphifree Manage/Design     Export DAGs (API) <span style="color: #BB0000;">NA</span>    </span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="va">ds_one_day</span> <span class="op">&lt;-</span></span></span>
 <span class="r-in"><span>  <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_log_read</span><span class="op">(</span></span></span>
diff --git a/reference/redcap_metadata_coltypes.html b/reference/redcap_metadata_coltypes.html
index 9b822557..8233ceeb 100644
--- a/reference/redcap_metadata_coltypes.html
+++ b/reference/redcap_metadata_coltypes.html
@@ -436,7 +436,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-msg co"><span class="r-pr">#&gt;</span>   bp_complete                 = readr::col_integer()    , # completion status of form/instrument</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> )</span>
 <span class="r-in"><span><span class="fu"><a href="redcap_read_oneshot.html">redcap_read_oneshot</a></span><span class="op">(</span><span class="va">uri</span>, <span class="va">token</span>, col_types <span class="op">=</span> <span class="va">col_types</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 9 records and 15 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 9 records and 15 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 9 × 15</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   record_id redcap_repeat_instrument redcap_repeat_instance date_enrolled</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>       <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>                                     <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span>       </span>
@@ -516,7 +516,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-msg co"><span class="r-pr">#&gt;</span>   form_1_complete               = readr::col_integer()                      , # completion status of form/instrument</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> )</span>
 <span class="r-in"><span><span class="fu"><a href="redcap_read_oneshot.html">redcap_read_oneshot</a></span><span class="op">(</span><span class="va">uri</span>, <span class="va">token</span>, col_types <span class="op">=</span> <span class="va">col_types</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 records and 52 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 records and 52 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 1 × 52</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   record_id f_calculated f_checkbox___0 f_checkbox___1 f_checkbox___2 f_dropdown</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>       <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>        <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span>          <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span>          <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span>          <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>     </span>
diff --git a/reference/redcap_metadata_read.html b/reference/redcap_metadata_read.html
index e620724f..602f9abb 100644
--- a/reference/redcap_metadata_read.html
+++ b/reference/redcap_metadata_read.html
@@ -186,7 +186,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] ""</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> $elapsed_seconds</span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.1772749</span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.1515701</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> $raw_text</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] ""</span>
@@ -234,7 +234,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] ""</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> $elapsed_seconds</span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.187057</span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.1680381</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> $raw_text</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] ""</span>
@@ -280,7 +280,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] ""</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> $elapsed_seconds</span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.181632</span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.1846499</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> $raw_text</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] ""</span>
diff --git a/reference/redcap_metadata_write.html b/reference/redcap_metadata_write.html
index 884dad95..d5ed5a6e 100644
--- a/reference/redcap_metadata_write.html
+++ b/reference/redcap_metadata_write.html
@@ -174,7 +174,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>  redcap_uri  <span class="op">=</span> <span class="va">uri</span>,</span></span>
 <span class="r-in"><span>  token       <span class="op">=</span> <span class="va">token</span></span></span>
 <span class="r-in"><span><span class="op">)</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 16 fields were written to the REDCap dictionary in 1.8 seconds.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 16 fields were written to the REDCap dictionary in 0.4 seconds.</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> $success</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
@@ -182,13 +182,13 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 200</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> $outcome_message</span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "16 fields were written to the REDCap dictionary in 1.8 seconds."</span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "16 fields were written to the REDCap dictionary in 0.4 seconds."</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> $field_count</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 16</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> $elapsed_seconds</span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 1.792433</span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 0.3632901</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> $raw_text</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] ""</span>
diff --git a/reference/redcap_next_free_record_name.html b/reference/redcap_next_free_record_name.html
index 6d3ddbd5..e4fc2adc 100644
--- a/reference/redcap_next_free_record_name.html
+++ b/reference/redcap_next_free_record_name.html
@@ -129,7 +129,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="va">token</span>    <span class="op">&lt;-</span> <span class="st">"9A81268476645C4E5F03428B8AC3AA7B"</span></span></span>
 <span class="r-in"><span><span class="co"># Returns 6</span></span></span>
 <span class="r-in"><span><span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_next_free_record_name</span><span class="op">(</span>redcap_uri <span class="op">=</span> <span class="va">uri</span>, token <span class="op">=</span> <span class="va">token</span><span class="op">)</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> The next free record name in REDCap was successfully determined in 0.2 seconds.  The http status code was 200.  Is is 6.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> The next free record name in REDCap was successfully determined in 0.3 seconds.  The http status code was 200.  Is is 6.</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> [1] "6"</span>
 </code></pre></div>
     </div>
diff --git a/reference/redcap_project.html b/reference/redcap_project.html
index 7fdd8d69..28017bc6 100644
--- a/reference/redcap_project.html
+++ b/reference/redcap_project.html
@@ -111,25 +111,25 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 5 records  at 2024-09-07 01:06:25.830182.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 1 columns were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 5 records  at 2024-09-07 05:08:16.648447.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="co"># Demonstrate how repeated calls are more concise when the token and</span></span></span>
 <span class="r-in"><span><span class="co">#   url aren't always passed.</span></span></span>
 <span class="r-in"><span><span class="va">ds_skinny</span> <span class="op">&lt;-</span> <span class="va">project</span><span class="op">$</span><span class="fu">read</span><span class="op">(</span>fields<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"record_id"</span>, <span class="st">"sex"</span>, <span class="st">"height"</span><span class="op">)</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 5 records  at 2024-09-07 01:06:27.358905.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 5 records  at 2024-09-07 05:08:18.168457.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records).</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 3 columns were read from REDCap in 0.5 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="va">ids_of_males</span>    <span class="op">&lt;-</span> <span class="va">ds_skinny</span><span class="op">$</span><span class="va">record_id</span><span class="op">[</span><span class="va">ds_skinny</span><span class="op">$</span><span class="va">sex</span><span class="op">==</span><span class="fl">1</span><span class="op">]</span></span></span>
 <span class="r-in"><span><span class="va">ids_of_shorties</span> <span class="op">&lt;-</span> <span class="va">ds_skinny</span><span class="op">$</span><span class="va">record_id</span><span class="op">[</span><span class="va">ds_skinny</span><span class="op">$</span><span class="va">height</span> <span class="op">&lt;</span> <span class="fl">40</span><span class="op">]</span></span></span>
@@ -137,25 +137,25 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="va">ds_males</span>        <span class="op">&lt;-</span> <span class="va">project</span><span class="op">$</span><span class="fu">read</span><span class="op">(</span>records<span class="op">=</span><span class="va">ids_of_males</span>, batch_size<span class="op">=</span><span class="fl">2</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 3 records  at 2024-09-07 01:06:29.446375.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 1.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 3 records  at 2024-09-07 05:08:20.572494.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Reading batch 1 of 2, with subjects 2 through 3 (ie, 2 unique subject records).</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Reading batch 2 of 2, with subjects 5 through 5 (ie, 1 unique subject records).</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-in"><span><span class="va">ds_shorties</span>     <span class="op">&lt;-</span> <span class="va">project</span><span class="op">$</span><span class="fu">read</span><span class="op">(</span>records<span class="op">=</span><span class="va">ids_of_shorties</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 2 records  at 2024-09-07 01:06:31.394707.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.4 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 1 columns were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 2 records  at 2024-09-07 05:08:22.725186.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Reading batch 1 of 1, with subjects 1 through 2 (ie, 2 unique subject records).</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="co"># }</span></span></span>
 <span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="cn">FALSE</span><span class="op">)</span> <span class="op">{</span></span></span>
diff --git a/reference/redcap_project_info_read.html b/reference/redcap_project_info_read.html
index 80096921..1d1cf4a5 100644
--- a/reference/redcap_project_info_read.html
+++ b/reference/redcap_project_info_read.html
@@ -173,7 +173,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="co"># ---- Simple examples</span></span></span>
 <span class="r-in"><span><span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_project_info_read</span><span class="op">(</span><span class="va">uri</span>, <span class="va">token_simple</span>      <span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 1 × 26</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   project_id project_title creation_time       production_time in_production</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>        <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>         <span style="color: #949494; font-style: italic;">&lt;dttm&gt;</span>              <span style="color: #949494; font-style: italic;">&lt;dttm&gt;</span>          <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span>        </span>
@@ -228,8 +228,11 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>  <span class="op">)</span> <span class="op">|&gt;</span></span></span>
 <span class="r-in"><span>  <span class="fu">dplyr</span><span class="fu">::</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/filter.html" class="external-link">filter</a></span><span class="op">(</span><span class="fl">32L</span> <span class="op">==</span> <span class="fu"><a href="https://rdrr.io/r/base/nchar.html" class="external-link">nchar</a></span><span class="op">(</span><span class="va">token</span><span class="op">)</span><span class="op">)</span> <span class="op">|&gt;</span></span></span>
 <span class="r-in"><span>  <span class="fu">purrr</span><span class="fu">::</span><span class="fu"><a href="https://purrr.tidyverse.org/reference/map_dfr.html" class="external-link">pmap_dfr</a></span><span class="op">(</span><span class="fu">REDCapR</span><span class="fu">::</span><span class="va">redcap_project_info_read</span>, locale <span class="op">=</span> <span class="va">server_locale</span><span class="op">)</span></span></span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
@@ -239,16 +242,12 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 1.0 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.9 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
@@ -256,6 +255,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
 <span class="r-in"><span></span></span>
@@ -288,16 +288,16 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 30 × 6</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>    data$project_id success status_code outcome_message  elapsed_seconds raw_text</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>              <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span>         <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>                      <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>   </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span>             153 TRUE            200 1 rows were rea…           0.182 <span style="color: #949494;">""</span>      </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span>             212 TRUE            200 1 rows were rea…           0.189 <span style="color: #949494;">""</span>      </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span>             213 TRUE            200 1 rows were rea…           0.206 <span style="color: #949494;">""</span>      </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span>             268 TRUE            200 1 rows were rea…           0.232 <span style="color: #949494;">""</span>      </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span>             690 TRUE            200 1 rows were rea…           0.186 <span style="color: #949494;">""</span>      </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span>             691 TRUE            200 1 rows were rea…           0.194 <span style="color: #949494;">""</span>      </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span>             753 TRUE            200 1 rows were rea…           0.240 <span style="color: #949494;">""</span>      </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span>             817 TRUE            200 1 rows were rea…           0.190 <span style="color: #949494;">""</span>      </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span>             977 TRUE            200 1 rows were rea…           0.192 <span style="color: #949494;">""</span>      </span>
-<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span>             998 TRUE            200 1 rows were rea…           0.185 <span style="color: #949494;">""</span>      </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span>             153 TRUE            200 1 rows were rea…           0.145 <span style="color: #949494;">""</span>      </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span>             212 TRUE            200 1 rows were rea…           0.155 <span style="color: #949494;">""</span>      </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span>             213 TRUE            200 1 rows were rea…           0.148 <span style="color: #949494;">""</span>      </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span>             268 TRUE            200 1 rows were rea…           0.172 <span style="color: #949494;">""</span>      </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span>             690 TRUE            200 1 rows were rea…           0.148 <span style="color: #949494;">""</span>      </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span>             691 TRUE            200 1 rows were rea…           0.173 <span style="color: #949494;">""</span>      </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span>             753 TRUE            200 1 rows were rea…           0.198 <span style="color: #949494;">""</span>      </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span>             817 TRUE            200 1 rows were rea…           0.152 <span style="color: #949494;">""</span>      </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span>             977 TRUE            200 1 rows were rea…           0.163 <span style="color: #949494;">""</span>      </span>
+<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span>             998 TRUE            200 1 rows were rea…           0.160 <span style="color: #949494;">""</span>      </span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 20 more rows</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># ℹ 25 more variables: data$project_title &lt;chr&gt;, $creation_time &lt;dttm&gt;,</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;">#   $production_time &lt;dttm&gt;, $in_production &lt;lgl&gt;, $project_language &lt;chr&gt;,</span></span>
diff --git a/reference/redcap_read.html b/reference/redcap_read.html
index b6d118c0..dd1f6191 100644
--- a/reference/redcap_read.html
+++ b/reference/redcap_read.html
@@ -387,16 +387,16 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="co"># Return the entire dataset</span></span></span>
 <span class="r-in"><span><span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_read</span><span class="op">(</span>batch_size<span class="op">=</span><span class="fl">2</span>, redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.4 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 5 records  at 2024-09-07 01:06:42.793999.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 5 records  at 2024-09-07 05:08:32.711341.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Reading batch 1 of 3, with subjects 1 through 2 (ie, 2 unique subject records).</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Reading batch 2 of 3, with subjects 3 through 4 (ie, 2 unique subject records).</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Reading batch 3 of 3, with subjects 5 through 5 (ie, 1 unique subject records).</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 5 × 25</span></span>
@@ -429,19 +429,19 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>  col_types  <span class="op">=</span> <span class="va">col_types</span>,</span></span>
 <span class="r-in"><span>  batch_size <span class="op">=</span> <span class="fl">2</span></span></span>
 <span class="r-in"><span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 5 records  at 2024-09-07 01:06:47.086525.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> Starting to read 5 records  at 2024-09-07 05:08:36.339831.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Reading batch 1 of 3, with subjects 1 through 2 (ie, 2 unique subject records).</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Reading batch 2 of 3, with subjects 3 through 4 (ie, 2 unique subject records).</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.6 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> Reading batch 3 of 3, with subjects 5 through 5 (ie, 1 unique subject records).</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 1 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 5 × 25</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   record_id name_first name_last address  telephone email dob          age   sex</span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>       <span style="color: #949494; font-style: italic;">&lt;int&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>      <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>     <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>    <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span>     <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span>     <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span></span>
diff --git a/reference/redcap_read_eav_oneshot.html b/reference/redcap_read_eav_oneshot.html
index 7c02e616..c91d7754 100644
--- a/reference/redcap_read_eav_oneshot.html
+++ b/reference/redcap_read_eav_oneshot.html
@@ -249,7 +249,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="co"># Repeating</span></span></span>
 <span class="r-in"><span><span class="va">token</span> <span class="op">&lt;-</span> <span class="st">"56F43A10D01D6578A46393394D76D88F"</span>  <span class="co"># PHI-free demo: Repeating Instruments --Sparse # 2603</span></span></span>
 <span class="r-in"><span><span class="va">ds</span> <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">:::</span><span class="fu">redcap_read_eav_oneshot</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 45 records and 5 columns were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 45 records and 5 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-in"><span><span class="co"># }</span></span></span>
 </code></pre></div>
     </div>
diff --git a/reference/redcap_read_oneshot.html b/reference/redcap_read_oneshot.html
index c267b5c2..73301ae3 100644
--- a/reference/redcap_read_oneshot.html
+++ b/reference/redcap_read_oneshot.html
@@ -294,7 +294,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="co"># Return all records and all variables.</span></span></span>
 <span class="r-in"><span><span class="va">ds</span> <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_read_oneshot</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="co"># Return only records with IDs of 1 and 3</span></span></span>
 <span class="r-in"><span><span class="va">desired_records_v1</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span>, <span class="fl">3</span><span class="op">)</span></span></span>
@@ -303,7 +303,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>  token      <span class="op">=</span> <span class="va">token</span>,</span></span>
 <span class="r-in"><span>  records    <span class="op">=</span> <span class="va">desired_records_v1</span></span></span>
 <span class="r-in"><span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="co"># Return only the fields record_id, name_first, and age</span></span></span>
 <span class="r-in"><span><span class="va">desired_fields_v1</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"record_id"</span>, <span class="st">"name_first"</span>, <span class="st">"age"</span><span class="op">)</span></span></span>
@@ -312,7 +312,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>  token      <span class="op">=</span> <span class="va">token</span>,</span></span>
 <span class="r-in"><span>  fields     <span class="op">=</span> <span class="va">desired_fields_v1</span></span></span>
 <span class="r-in"><span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 3 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="co"># Specify the column types.</span></span></span>
 <span class="r-in"><span><span class="va">col_types</span> <span class="op">&lt;-</span> <span class="fu">readr</span><span class="fu">::</span><span class="fu"><a href="https://readr.tidyverse.org/reference/cols.html" class="external-link">cols</a></span><span class="op">(</span></span></span>
@@ -329,7 +329,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>  token      <span class="op">=</span> <span class="va">token</span>,</span></span>
 <span class="r-in"><span>  col_types  <span class="op">=</span> <span class="va">col_types</span></span></span>
 <span class="r-in"><span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-in"><span><span class="co"># }</span></span></span>
 </code></pre></div>
     </div>
diff --git a/reference/redcap_read_oneshot_eav.html b/reference/redcap_read_oneshot_eav.html
index a23657a0..00d2814c 100644
--- a/reference/redcap_read_oneshot_eav.html
+++ b/reference/redcap_read_oneshot_eav.html
@@ -237,8 +237,8 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="co"># Return all records and all variables.</span></span></span>
 <span class="r-in"><span><span class="va">ds</span> <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">:::</span><span class="fu">redcap_read_oneshot_eav</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token</span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.1 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 25 columns were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="co"># Return only records with IDs of 1 and 3</span></span></span>
 <span class="r-in"><span><span class="va">desired_records_v1</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span>, <span class="fl">3</span><span class="op">)</span></span></span>
@@ -247,8 +247,8 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>   token      <span class="op">=</span> <span class="va">token</span>,</span></span>
 <span class="r-in"><span>   records    <span class="op">=</span> <span class="va">desired_records_v1</span></span></span>
 <span class="r-in"><span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.4 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 2 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="co"># Return only the fields record_id, name_first, and age</span></span></span>
@@ -258,7 +258,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>   token      <span class="op">=</span> <span class="va">token</span>,</span></span>
 <span class="r-in"><span>   fields     <span class="op">=</span> <span class="va">desired_fields_v1</span></span></span>
 <span class="r-in"><span><span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 9 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-in"><span><span class="co"># }</span></span></span>
diff --git a/reference/redcap_report.html b/reference/redcap_report.html
index 869ad729..858e82e7 100644
--- a/reference/redcap_report.html
+++ b/reference/redcap_report.html
@@ -197,7 +197,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span>    report_id  <span class="op">=</span> <span class="va">report_1_id</span>,</span></span>
 <span class="r-in"><span>    col_types  <span class="op">=</span> <span class="va">col_types_1</span></span></span>
 <span class="r-in"><span>  <span class="op">)</span><span class="op">$</span><span class="va">data</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 5 columns were read from REDCap in 0.3 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> 5 records and 5 columns were read from REDCap in 0.2 seconds.  The http status code was 200.</span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span></span></span>
 <span class="r-in"><span><span class="co"># Return condensed checkboxes Report option:</span></span></span>
diff --git a/reference/redcap_users_export.html b/reference/redcap_users_export.html
index 8f2f0c0a..a3edc572 100644
--- a/reference/redcap_users_export.html
+++ b/reference/redcap_users_export.html
@@ -118,7 +118,7 @@ <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-e
 <span class="r-in"><span><span class="va">uri</span>      <span class="op">&lt;-</span> <span class="st">"https://bbmc.ouhsc.edu/redcap/api/"</span></span></span>
 <span class="r-in"><span><span class="va">token</span>    <span class="op">&lt;-</span> <span class="st">"06DEFB601F9B46847DAA9DF0CFA951B4"</span></span></span>
 <span class="r-in"><span><span class="va">result</span>   <span class="op">&lt;-</span> <span class="fu">REDCapR</span><span class="fu">::</span><span class="fu">redcap_users_export</span><span class="op">(</span>redcap_uri<span class="op">=</span><span class="va">uri</span>, token<span class="op">=</span><span class="va">token</span><span class="op">)</span></span></span>
-<span class="r-msg co"><span class="r-pr">#&gt;</span> The REDCap users were successfully exported in 0.2 seconds.  The http status code was 200.</span>
+<span class="r-msg co"><span class="r-pr">#&gt;</span> The REDCap users were successfully exported in 0.4 seconds.  The http status code was 200.</span>
 <span class="r-in"><span><span class="va">result</span><span class="op">$</span><span class="va">data_user</span></span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 2 × 34</span></span>
 <span class="r-out co"><span class="r-pr">#&gt;</span>   username        email          firstname lastname expiration data_access_group</span>
diff --git a/reference/retrieve_credential.html b/reference/retrieve_credential.html
index f38b9c82..5f135b55 100644
--- a/reference/retrieve_credential.html
+++ b/reference/retrieve_credential.html
@@ -137,7 +137,7 @@ <h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></
 Each record represents one accessible project per user.
 Follow these steps to adapt to your desired REDCap project(s):</p><ol><li><p>Modify the credential file for the REDCap API with a text editor
 like <a href="https://notepad-plus-plus.org/" class="external-link">Notepad++</a>,
-<a href="https://code.visualstudio.com/" class="external-link">Visual Studio Code</a>, or
+<a href="https://code.visualstudio.com" class="external-link">Visual Studio Code</a>, or
 <a href="https://www.nano-editor.org/" class="external-link">nano</a>.
 Replace existing records with the information from your projects.
 Delete the remaining example records.</p></li>
diff --git a/search.json b/search.json
index dcc5a440..9dd1df75 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://ouhscbbmc.github.io/REDCapR/CONDUCT.html","id":null,"dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"Contributor Code of Conduct","text":"contributors maintainers project, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. committed making participation project harassment-free experience everyone, regardless level experience, gender, gender identity expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion. Examples unacceptable behavior participants include use sexual language imagery, derogatory comments personal attacks, trolling, public private harassment, insults, unprofessional conduct. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct. Project maintainers follow Code Conduct may removed project team. Instances abusive, harassing, otherwise unacceptable behavior may reported opening issue contacting one project maintainers. Code Conduct adapted Contributor Covenant (http:contributor-covenant.org), version 1.0.0, available https://contributor-covenant.org/version/1/0/0/.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2021 REDCapR authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"reading-redcap-data","dir":"Articles","previous_headings":"","what":"Reading REDCap Data","title":"Basic REDCapR Operations","text":"functions redcap_read() redcap_read_oneshot() use httr package call REDCap API.","code":"## Loading required namespace: kableExtra"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"set-project-wide-values","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Set project-wide values","title":"Basic REDCapR Operations","text":"information specific REDCap project, opposed individual operation. includes (1) uri server, (2) token user’s project.","code":"library(REDCapR) # Load the package into the current R session. uri   <- \"https://bbmc.ouhsc.edu/redcap/api/\" token <- \"9A81268476645C4E5F03428B8AC3AA7B\" # `UnitTestPhiFree` user and simple project (pid 153)"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"read-all-records-and-fields","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Read all records and fields","title":"Basic REDCapR Operations","text":"information passed desired records fields, entire data set returned. two parameters required, redcap_uri token. Unless verbose parameter set FALSE, message printed R console number records fields returned.","code":"# Return all records and all variables. ds_all_rows_all_fields <- redcap_read(redcap_uri = uri, token = token)$data #> 24 variable metadata records were read from REDCap in 0.3 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 01:07:09.145935. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. ds_all_rows_all_fields # Inspect the returned dataset #> # A tibble: 5 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         2 Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10    11     1 #> 3         3 Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09    80     1 #> 4         4 Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02    61     0 #> 5         5 John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15    59     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"read-a-subset-of-the-records","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Read a subset of the records","title":"Basic REDCapR Operations","text":"subset records desired, two approaches shown . first pass array (element ID) records parameter. second pass single string (elements separated commas) records_collapsed parameter. first format natural R users. second format expected REDCap API. value records specified, records_collapsed specified, redcap_read_oneshot automatically converts array format needed API.","code":"# Return only records with IDs of 1 and 3 desired_records <- c(1, 3) ds_some_rows_v1 <- redcap_read(   redcap_uri = uri,   token      = token,   records    = desired_records )$data #> 24 variable metadata records were read from REDCap in 0.3 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 2 records  at 2024-09-07 01:07:11.537467. #> Reading batch 1 of 1, with subjects 1 through 3 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200."},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"read-a-subset-of-the-fields","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Read a subset of the fields","title":"Basic REDCapR Operations","text":"subset fields desired, two approaches exist. first pass array (element field) fields parameter. second pass single string (elements separated commas) fields_collapsed parameter. Like records records_collapsed described , function converts natural format (.e., fields) format required API (.e., fields_collapsed) fields specified fields_collapsed .","code":"# Return only the fields record_id, name_first, and age desired_fields <- c(\"record_id\", \"name_first\", \"age\") ds_some_fields <- redcap_read(   redcap_uri = uri,   token      = token,   fields     = desired_fields )$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 01:07:13.796254. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200."},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"read-a-subset-of-records-conditioned-on-the-values-in-some-variables","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Read a subset of records, conditioned on the values in some variables","title":"Basic REDCapR Operations","text":"two techniques can combined datasets large don’t want pull records certain values. Suppose want select subjects previous dataset born 1960 weight 70kg. Two calls server required. first call REDCap pulls records, three columns: record_id, dob, weight. subset, identify records want pull data ; case, desired record_id values 3 & 5. second call REDCap pulls columns, identified records.","code":"###### ## Step 1: First call to REDCap desired_fields_v3 <- c(\"record_id\", \"dob\", \"weight\") ds_some_fields_v3 <- redcap_read(   redcap_uri = uri,   token      = token,   fields     = desired_fields_v3 )$data #> 24 variable metadata records were read from REDCap in 0.3 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.3 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 01:07:16.24055. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200.  ds_some_fields_v3 #Examine the these three variables. #> # A tibble: 5 × 3 #>   record_id dob        weight #>       <dbl> <date>      <dbl> #> 1         1 2003-08-30      1 #> 2         2 2003-03-10      1 #> 3         3 1934-04-09     80 #> 4         4 1952-11-02     54 #> 5         5 1955-04-15    104  ###### ## Step 2: identify desired records, based on age & weight before_1960 <- (ds_some_fields_v3$dob <= as.Date(\"1960-01-01\")) heavier_than_70_kg <- (ds_some_fields_v3$weight > 70) desired_records_v3 <- ds_some_fields_v3[before_1960 & heavier_than_70_kg, ]$record_id  desired_records_v3 #Peek at IDs of the identified records #> [1] 3 5  ###### ## Step 3: second call to REDCap #Return only records that met the age & weight criteria. ds_some_rows_v3 <- redcap_read(   redcap_uri = uri,   token      = token,   records    = desired_records_v3 )$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.4 seconds.  The http status code was 200. #> 2 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 2 records  at 2024-09-07 01:07:18.695033. #> Reading batch 1 of 1, with subjects 3 through 5 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.  ds_some_rows_v3 #Examine the results. #> # A tibble: 2 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         3 Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09    80     1 #> 2         5 John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15    59     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"additional-returned-information","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Additional Returned Information","title":"Basic REDCapR Operations","text":"examples shown resulting data frame, specifying $data end call. However, available wanting additional information, : data object data frame, previous examples. success boolean value indicates redcap_read_oneshot believes operation completed intended. status_codes collection http status codes, separated semicolons. one code batch attempted. outcome_messages: collection human readable strings indicating operations’ semicolons. one code batch attempted. unsuccessful operation, contain diagnostic information. records_collapsed field passed API. shows record subsets, , requested. fields_collapsed fields passed API. shows field subsets, , requested. elapsed_seconds measures duration call.","code":"#Return only the fields record_id, name_first, and age all_information <- redcap_read(   redcap_uri = uri,   token      = token,   fields     = desired_fields ) #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 01:07:21.096432. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200. all_information #Inspect the additional information #> $data #> # A tibble: 5 × 3 #>   record_id name_first   age #>       <dbl> <chr>      <dbl> #> 1         1 Nutmeg        11 #> 2         2 Tumtum        11 #> 3         3 Marcus        80 #> 4         4 Trudy         61 #> 5         5 John Lee      59 #>  #> $success #> [1] TRUE #>  #> $status_codes #> [1] \"200\" #>  #> $outcome_messages #> [1] \"5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200.\" #>  #> $records_collapsed #> [1] \"\" #>  #> $fields_collapsed #> [1] \"record_id,name_first,age\" #>  #> $forms_collapsed #> [1] \"\" #>  #> $events_collapsed #> [1] \"\" #>  #> $filter_logic #> [1] \"\" #>  #> $datetime_range_begin #> [1] NA #>  #> $datetime_range_end #> [1] NA #>  #> $elapsed_seconds #> [1] 2.237706"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Basic REDCapR Operations","text":"sake documentation reproducibility, current report rendered following environment. Click line expand. Report rendered runner 2024-09-07, 01:07 +0000 15 seconds.","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #>  setting  value #>  version  R version 4.4.1 (2024-06-14) #>  os       macOS Sonoma 14.6.1 #>  system   aarch64, darwin20 #>  ui       X11 #>  language en #>  collate  en_US.UTF-8 #>  ctype    en_US.UTF-8 #>  tz       UTC #>  date     2024-09-07 #>  pandoc   3.1.11 @ /usr/local/bin/ (via rmarkdown) #>  #> ─ Packages ─────────────────────────────────────────────────────────────────── #>  package     * version  date (UTC) lib source #>  backports     1.5.0    2024-05-23 [1] CRAN (R 4.4.0) #>  bit           4.0.5    2022-11-15 [1] CRAN (R 4.4.0) #>  bit64         4.0.5    2020-08-30 [1] CRAN (R 4.4.0) #>  bslib         0.8.0    2024-07-29 [1] CRAN (R 4.4.0) #>  cachem        1.1.0    2024-05-16 [1] CRAN (R 4.4.0) #>  checkmate     2.3.2    2024-07-29 [1] CRAN (R 4.4.0) #>  cli           3.6.3    2024-06-21 [1] CRAN (R 4.4.0) #>  colorspace    2.1-1    2024-07-26 [1] CRAN (R 4.4.0) #>  crayon        1.5.3    2024-06-20 [1] CRAN (R 4.4.0) #>  curl          5.2.2    2024-08-26 [1] CRAN (R 4.4.1) #>  desc          1.4.3    2023-12-10 [1] CRAN (R 4.4.0) #>  digest        0.6.37   2024-08-19 [1] CRAN (R 4.4.1) #>  dplyr         1.1.4    2023-11-17 [1] CRAN (R 4.4.0) #>  evaluate      0.24.0   2024-06-10 [1] CRAN (R 4.4.0) #>  fansi         1.0.6    2023-12-08 [1] CRAN (R 4.4.0) #>  fastmap       1.2.0    2024-05-15 [1] CRAN (R 4.4.0) #>  fs            1.6.4    2024-04-25 [1] CRAN (R 4.4.0) #>  generics      0.1.3    2022-07-05 [1] CRAN (R 4.4.0) #>  glue          1.7.0    2024-01-09 [1] CRAN (R 4.4.0) #>  hms           1.1.3    2023-03-21 [1] CRAN (R 4.4.0) #>  htmltools     0.5.8.1  2024-04-04 [1] CRAN (R 4.4.0) #>  httr          1.4.7    2023-08-15 [1] CRAN (R 4.4.0) #>  jquerylib     0.1.4    2021-04-26 [1] CRAN (R 4.4.0) #>  jsonlite      1.8.8    2023-12-04 [1] CRAN (R 4.4.0) #>  kableExtra    1.4.0    2024-01-24 [1] CRAN (R 4.4.0) #>  knitr       * 1.48     2024-07-07 [1] CRAN (R 4.4.0) #>  lifecycle     1.0.4    2023-11-07 [1] CRAN (R 4.4.0) #>  magrittr    * 2.0.3    2022-03-30 [1] CRAN (R 4.4.0) #>  munsell       0.5.1    2024-04-01 [1] CRAN (R 4.4.0) #>  pillar        1.9.0    2023-03-22 [1] CRAN (R 4.4.0) #>  pkgconfig     2.0.3    2019-09-22 [1] CRAN (R 4.4.0) #>  pkgdown       2.1.0    2024-07-06 [1] CRAN (R 4.4.0) #>  R6            2.5.1    2021-08-19 [1] CRAN (R 4.4.0) #>  ragg          1.3.2    2024-05-15 [1] CRAN (R 4.4.0) #>  readr         2.1.5    2024-01-10 [1] CRAN (R 4.4.0) #>  REDCapR     * 1.1.9007 2024-09-07 [1] local #>  rlang         1.1.4    2024-06-04 [1] CRAN (R 4.4.0) #>  rmarkdown     2.28     2024-08-17 [1] CRAN (R 4.4.0) #>  rstudioapi    0.16.0   2024-03-24 [1] CRAN (R 4.4.0) #>  sass          0.4.9    2024-03-15 [1] CRAN (R 4.4.0) #>  scales        1.3.0    2023-11-28 [1] CRAN (R 4.4.0) #>  sessioninfo   1.2.2    2021-12-06 [1] CRAN (R 4.4.0) #>  stringi       1.8.4    2024-05-06 [1] CRAN (R 4.4.0) #>  stringr       1.5.1    2023-11-14 [1] CRAN (R 4.4.0) #>  svglite       2.1.3    2023-12-08 [1] CRAN (R 4.4.0) #>  systemfonts   1.1.0    2024-05-15 [1] CRAN (R 4.4.0) #>  textshaping   0.4.0    2024-05-24 [1] CRAN (R 4.4.0) #>  tibble        3.2.1    2023-03-20 [1] CRAN (R 4.4.0) #>  tidyselect    1.2.1    2024-03-11 [1] CRAN (R 4.4.0) #>  tzdb          0.4.0    2023-05-12 [1] CRAN (R 4.4.0) #>  utf8          1.2.4    2023-10-22 [1] CRAN (R 4.4.0) #>  vctrs         0.6.5    2023-12-01 [1] CRAN (R 4.4.0) #>  viridisLite   0.4.2    2023-05-02 [1] CRAN (R 4.4.0) #>  vroom         1.6.5    2023-12-05 [1] CRAN (R 4.4.0) #>  withr         3.0.1    2024-07-31 [1] CRAN (R 4.4.0) #>  xfun          0.47     2024-08-17 [1] CRAN (R 4.4.0) #>  xml2          1.3.6    2023-12-04 [1] CRAN (R 4.4.0) #>  yaml          2.3.10   2024-07-26 [1] CRAN (R 4.4.0) #>  #>  [1] /Users/runner/work/_temp/Library #>  [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #>  #> ──────────────────────────────────────────────────────────────────────────────"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"description","dir":"Articles","previous_headings":"","what":"Description","title":"Security Database","text":"SQL code adds schemas, table two stored procedures existing Microsoft SQL Server database. second database essential calling REDCap API, helps manage tokens securely. database contains tokens sensitive content (passwords, API tokens, file paths) stored Git repository (even private Git repository). passwords can retrieved REDCapR::retrieve_credential_mssql().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"create-a-dsn-on-each-client","dir":"Articles","previous_headings":"","what":"Create a DSN on each client","title":"Security Database","text":"executing SQL code existing database, create ODBC DSN client machine calls database. Download recent drivers (Aug 2018, recent version 17 Windows Linux), run wizard. Many values wizard remain default values. important ones change. Set DSN’s name field whatever used repository’s R code. Set authenticity method Integrated Windows authentication. Set default database name database containing tokens code , DSN database named auxiliary_security.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"note","dir":"Articles","previous_headings":"","what":"Note","title":"Security Database","text":"use Microsoft SQL Server, fits university’s infrastructure easily. approach theoretically can work LDAP-enabled database server. Please contact us institution using something SQL Server (different configuration components), like help adapting approach.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"create-database","dir":"Articles","previous_headings":"","what":"Create Database","title":"Security Database","text":"SQL code run inside existing database establish schemas, table, stored procedure used REDCapR::retrieve_credential_mssql(). example, ’ve arbitrarily called database auxiliary_security.","code":"------- SQL code to create necessary components in a Microsoft SQL Sever database -------  ----------------------------------------------------------------------- -- Create two schemas. -- The first schema is accessible by all REDCap API users. -- The second schema is restricted to administrators. -- CREATE SCHEMA [redcap] CREATE SCHEMA [redcap_private] GO  ----------------------------------------------------------------------- -- Create a table to contain the token CREATE TABLE redcap_private.tbl_credential (   id            smallint        primary key,   username      varchar(30)     not null,   project_id    smallint        not null,   instance      varchar(30)     not null,   token         char(32)        not null,   redcap_uri    varchar(255)    not null )  CREATE UNIQUE NONCLUSTERED INDEX IX_tbl_credential_unique ON redcap_private.tbl_credential (   instance        asc,   project_id      asc,   username        asc )  ----------------------------------------------------------------------- -- Create a stored procedure for users to call to retrieve the token. -- Notice it should a different (and more permissive) schema than the table. -- CREATE PROCEDURE redcap.prc_credential   @project_id smallint,   @instance   varchar(30) AS BEGIN   SET NOCOUNT ON;    SELECT username, project_id, token, redcap_uri FROM redcap_private.tbl_credential   WHERE     username   = system_user -- The username from the server's OS.     AND     project_id = @project_id -- Restricts to the desired REDCap project.     AND     instance   = @instance   -- System accommodates multiple REDCap instances. END"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"create-user-credentials-to-the-auxiliary-database","dir":"Articles","previous_headings":"","what":"Create user credentials to the auxiliary database","title":"Security Database","text":"Add user’s LDAP account auxiliary_security database can query tables retrieve API. Notice gives permissions retrieve token. still must grant API privileges appropriate REDCap project. automation R file copy API token MySQL database auxiliary_security database (see ‘Transfer Credentials’ section). database admins authorization ‘redcap_private’ schema. Typical users authorized schema. current system allows typical users view tokens.","code":"----------------------------------------------------------------------- -- Add a user account to the auxiliary_security database so that they can query the tables to retrieve their API. -- Notice that this only gives the permissions to retrieve the token.  You must still: --   1) grant them API privileges to each appropriate REDCap project, and --   2) copy the API from the REDCap database into the  auxiliary_security database. -- Also, do not give typical users authorization for the 'redcap_private' schema.  The current system allows them to view only their own tokens. -----------------------------------------------------------------------  -- STEP #1: Declare the user name.  If everything runs correctly, this should be the only piece of code that you need to modify. print 'Step #1 executing....' USE [master] GO DECLARE @qualified_user_name varchar(255); SET @qualified_user_name = '[OUHSC\\lsuarez3]' print 'Resulting login name: ' + @qualified_user_name; print ''  --EXEC sp_helplogins @LoginNamePattern=@qualified_user_name --SELECT * FROM master..syslogins WHERE name = @qualified_user_name --SELECT * FROM auxiliary_security.sys.sysusers --SELECT * FROM sys.database_permissions --SELECT * FROM sys.server_principals  ----------------------------------------------------------------------- -- STEP #2: Create a login for the *server*. print 'Step #2 executing....' DECLARE @sql_create_login nvarchar(max) SET @sql_create_login = 'CREATE LOGIN ' + @qualified_user_name + ' FROM WINDOWS WITH DEFAULT_DATABASE=[auxiliary_security]' EXECUTE sp_executesql @sql_create_login DECLARE @login_count AS INT; SET @login_count = (SELECT COUNT(*) AS login_count FROM master..syslogins WHERE '[' + loginname + ']' = @qualified_user_name) print 'Logins matching desired name should equal 1.  It equals: ' + CONVERT(varchar, @login_count); print ''  ----------------------------------------------------------------------- -- STEP #3: Create a user account for the *database*, after switching the database under focus to auxiliary_security. print 'Step #3 executing....' USE [auxiliary_security] DECLARE @sql_create_user nvarchar(max) SET @sql_create_user = 'CREATE USER ' + @qualified_user_name + ' FOR LOGIN ' + @qualified_user_name EXECUTE sp_executesql @sql_create_user DECLARE @user_count AS INT; SET @user_count = (SELECT COUNT(*) AS user_count FROM auxiliary_security.sys.sysusers WHERE '[' + name + ']' = @qualified_user_name) print 'User accounts matching desired name should equal 1.  It equals: ' + CONVERT(varchar, @user_count); print ''  ----------------------------------------------------------------------- -- STEP #4: Grant appropriate privileges for the 'redcap' schema. print 'Step #4 executing....' DECLARE @sql_grant_schema_redcap nvarchar(max) SET @sql_grant_schema_redcap = 'GRANT EXECUTE ON SCHEMA::[redcap] TO ' + @qualified_user_name EXECUTE sp_executesql @sql_grant_schema_redcap print 'Step #4 executed'; print ''  ----------------------------------------------------------------------- -- STEP #5: Grant appropriate privileges for the 'Security' schema. print 'Step #5 executing....' DECLARE @sql_grant_schema_security nvarchar(max) SET @sql_grant_schema_security = 'GRANT EXECUTE ON SCHEMA::[security] TO ' + @qualified_user_name EXECUTE sp_executesql @sql_grant_schema_security print 'Step #5 executed'; print ''  ----------------------------------------------------------------------- -- OPTIONAL STEP: Delete the user from the database (the first line) and then the server (the second line). -- The person's other database user accounts (besides with the auxiliary_security database) will NOT be automatically deleted by these two lines. --USE [auxiliary_security]; DROP USER [OUHSC\\lsuarez3] --USE [master]; DROP LOGIN [OUHSC\\lsuarez3]  ----------------------------------------------------------------------- -- REFERENCES & NOTES   --The @qualified_user_name must have both (a) the 'OUHSC' domain qualification, and (b) the square brackets (to escape the backslash).   --Using sp_executesql to add users: https://www.sqlservercentral.com/Forums/Topic497615-359-1.aspx   --Check if a server login exists: https://stackoverflow.com/questions/37275/sql-query-for-logins   --Retrieve database users: https://stackoverflow.com/questions/2445444/how-to-get-a-list-of-users-for-all-instances-databases   --Concatenating strings: https://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/   --DROP USER from database: https://msdn.microsoft.com/en-us/library/ms189438.aspx   --DROP LOGIN from server: https://msdn.microsoft.com/en-us/library/ms188012.aspx   --Declaring variables (eg, the username above): https://technet.microsoft.com/en-us/library/aa258839.aspx   --A different (& non-dynamic) way to establish a user: https://pic.dhe.ibm.com/infocenter/dmndhelp/v8r5m0/index.jsp?topic=%2Fcom.ibm.wbpm.imuc.sbpm.doc%2Ftopics%2Fdb_create_users_nd_aix.html   --If the variable has to cross a 'GO' (which the current version of the script doesn't need): https://stackoverflow.com/questions/937336/is-there-a-way-to-persist-a-variable-across-a-go"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"transfer-credentials","dir":"Articles","previous_headings":"","what":"Transfer Credentials","title":"Security Database","text":"Manually transferring tokens auxiliary server becomes unmanageable institution’s collection API users grows. script demonstrates programmatically transfer tokens multiple REDCap instances. basic steps : Read MySQL database(s) underneath REDCap instance campus. Combine & groom credentials. Upload SQL Server (called auxiliary_security ).","code":"rm(list=ls(all=TRUE)) #Clear the memory for any variables set from any previous runs.  # ---- load-sources ------------------------------------------------------------  # ---- load-packages ----------------------------------------------------------- if (!require(OuhscMunge))   stop('The `OuhscMunge` package needs to be installed with `remotes::install_github(\"OuhscBbmc/OuhscMunge\")`.')  testit::assert(   \"The `OuhscMunge` package should meet a minimal version.\",   compareVersion( as.character(packageVersion(\"OuhscMunge\")), \"0.1.9.9009\") >= 0L )  library(magrittr) requireNamespace(\"DBI\") requireNamespace(\"odbc\") requireNamespace(\"dplyr\") requireNamespace(\"readr\") requireNamespace(\"tibble\") requireNamespace(\"testit\") requireNamespace(\"checkmate\") requireNamespace(\"OuhscMunge\")  # remotes::install_github(\"OuhscBbmc/OuhscMunge\")   # ---- declare-globals --------------------------------------------------------- # This file assume your campus has two REDCap instances. # Modify each (a) database name, (b) REDCap URL, and (c) DSN name.  name_production <- \"production\" name_dev        <- \"dev\"  uri_production  <- \"https://redcap-production.ouhsc.edu/redcap/api/\", uri_dev         <- \"https://redcap-dev.ouhsc.edu/redcap/api/\"  dsn_production  <- \"redcap-production\" dsn_dev         <- \"redcap-dev\" dsn_source      <- \"auxiliary_security\" # The DSN of the token server.  # The Activity Directory name that should precede each username. #   This should correspond with the result of SQL Server's `SYSTEM_USER` function #   (https://msdn.microsoft.com/en-us/library/ms179930.aspx) ldap_prefix <- \"OUHSC\\\\\"  #### # Nothing below this line should need to change, assuming: # 1. the vignette was followed exactly (https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html), # 2. your campus has exactly two REDCap instances.  # SQL sent to the MySQL database underneath each REDCap instance. sql <- \"   SELECT username, project_id, api_token   FROM redcap_user_rights   WHERE api_token IS NOT NULL \"  # Update this ad-hoc CSV.  Each row should represent one REDCap instance. ds_url <- tibble::tribble(   ~instance         , ~redcap_uri,   name_production   , uri_production,   name_dev          , uri_dev )  # Remove variables that aren't used below. rm(uri_production, uri_dev)   # ---- load-data ---------------------------------------------------------------  # Load the credentials from the first/production REDCap instance. cnn_production  <- DBI::dbConnect(odbc::odbc(), dsn=dsn_production) ds_production   <- DBI::dbGetQuery(cnn_production, sql) DBI::dbDisconnect(cnn_production); rm(cnn_production, dsn_production)  # Load the credentials from the second/dev REDCap instance. cnn_dev         <- DBI::dbConnect(odbc::odbc(), dsn=dsn_dev) ds_dev          <- DBI::dbGetQuery(cnn_dev, sql) DBI::dbDisconnect(cnn_dev); rm(cnn_dev, dsn_dev)  rm(sql)  # Assert these are valid datasets and contain at least 5 rows. #   Adjust '5' to smaller value if necessary.  It's just to catch blatant retrieval problems. checkmate::assert_data_frame(ds_production, min.rows=5) checkmate::assert_data_frame(ds_dev       , min.rows=5)   # ---- tweak-data --------------------------------------------------------------  # Label each instance, so they're distinguishable later. ds_production$instance <- name_production ds_dev$instance        <- name_dev  # Stack the token collection from each instance.  Then prefix the username and include the URL of each instance. ds <-   ds_production %>%   dplyr::union(ds_dev) %>%                                # Remove union if the dev instance isn't included.   tibble::as_tibble() %>%   dplyr::select(     username        = username,     project_id      = project_id,     instance        = instance,     token           = api_token   ) %>%   dplyr::mutate(     username        = paste0(ldap_prefix, username), # Qualify for the Active Directory.   ) %>%   dplyr::left_join( ds_url, by=\"instance\") %>%            # Include the instance URL.   dplyr::arrange(instance, project_id, username) %>%   tibble::rowid_to_column(\"id\")                           # For the sake of a clustered primary key.  rm(ds_production, ds_dev, ds_url) rm(name_production, name_dev) rm(ldap_prefix)   # ---- verify-values -----------------------------------------------------------  # Assert that the dataset is well-behaved. # OuhscMunge::verify_value_headstart(ds) checkmate::assert_integer(  ds$id         , any.missing=FALSE, lower=1, upper=.Machine$integer.max, unique=TRUE) checkmate::assert_character(ds$username   , any.missing=FALSE, pattern=\"^.{1,255}$\"                         ) checkmate::assert_integer(  ds$project_id , any.missing=FALSE, lower=1, upper=.Machine$integer.max          ) checkmate::assert_character(ds$token      , any.missing=FALSE, pattern=\"^[A-Z0-9]{32}$\"           , unique=TRUE) checkmate::assert_character(ds$instance   , any.missing=FALSE, pattern=\"^.{1,255}$\"                         ) checkmate::assert_character(ds$redcap_uri , any.missing=FALSE, pattern=\"^.{1,255}$\"                         )  testit::assert(   \"The `username` x `project_id` x `instance` must be unique.\",   sum(duplicated(paste0(ds$username, \"-\", ds$project_id, \"-\", ds$instance))) == 0L )  testit::assert(\"At least 10 tokens should be ready to write.\" , 10L <= nrow(ds))   # ---- specify-columns-to-upload -----------------------------------------------  # Dictate the exact columns and order that will be uploaded. columns_to_write <- c(\"id\", \"username\", \"project_id\", \"instance\", \"token\", \"redcap_uri\") ds_slim          <- ds[, columns_to_write] rm(columns_to_write)   # ---- upload-to-db ------------------------------------------------------------------  OuhscMunge::upload_sqls_odbc(   d               = ds_slim,   schema_name     = \"redcap_private\",   table_name      = \"tbl_credential\",   dsn_name        = dsn_source,   create_table    = FALSE,   clear_table     = TRUE,   transaction     = TRUE,   verbose         = TRUE ) # Uploading 252 tokens takes 0.004 minutes."},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"document-info","dir":"Articles","previous_headings":"","what":"Document Info","title":"Security Database","text":"document primarily based REDCap version 8.4.0, last updated 2018-08-10. development version document available GitHub: https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"server-configuration-and-authorization","dir":"Articles","previous_headings":"Language Agnostic","what":"Server Configuration and Authorization","title":"Troubleshooting REDCap API Calls","text":"first group checks primarily focuses server logins accounts. Unlike later sections, REDCap administrator privileges necessary checks. account server? can verified Browse Users section server’s Control Center. ’re REDCap admin, put user’s position –user account? ’re typical user, may consult institution’s REDCap administrator checks. permissions specific project? can verified User Rights section within project. Notice ’s possible (ultimately useful) account , server, don’t skip previous step. Can log normally interface? However username password aren’t working, API theoretically might still work uses token instead password. verified account responding automated email sent ? can verified Browse Users section server’s Control Center. (Talk REDCap admin.) email address ’ve entered, green ‘Verified’ label icon.   granted desired import /export permissions? can verified User Rights section API section (’s Manage Project Tokens tab) within project. Alternatively, can verified API Tokens section server’s Control Center.   using correct token? can verified API section (’s Manage Project Tokens tab) within project. Click magnifying glass icon user’s row. Alternatively, can verified API Tokens section server’s Control Center.   checks pass, proceed next section. , start consulting REDCap administrator.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"reading","dir":"Articles","previous_headings":"Language Agnostic","what":"Reading","title":"Troubleshooting REDCap API Calls","text":"section examines potential problems occur data leaves working server, handled programming language (e.g., Python R). Postman Chrome plugin recommended several people makes troubleshooting much efficient.  API Playground producing expected result? REDCap’s “API Playground” holds hand () offering dropdown list API methods available REDCap instance, (b) presenting series dropdown boxes appropriate selected method. Find API link visible left margin REDCap. ’ve completed inputs, click ‘Execute’ view plain-text returned server. bottom playground page, interface attempts translate specific API call different languages, like Python R. suggestions usually correct, inspect critically, auto-generated script. URL/URI correct? Notice url typically ends “api/” resembles https://bbmc.ouhsc.edu/redcap/api/ https://bbmc.ouhsc.edu/ (even https://bbmc.ouhsc.edu/ redirects https://bbmc.ouhsc.edu/redcap/). Postman installed operating correctly? helps start different REDCap server, can use dummy project containing fake data hosted OUHSC BBMC. url https://bbmc.ouhsc.edu/redcap/api/. three key-value pairs: (1) ‘token’ 9A81268476645C4E5F03428B8AC3AA7B, (2) ‘content’ record, (3) ‘format’ CSV. checking server, token value change, content format . return five records CSV format. ‘status’ 200 OK. result look roughly like . Notice line breaks included text values . Can administrator query API successfully Postman admin token? administrator, create account , verify token works server project. Can administrator query API successfully Postman user’s token? Use Postman , replace token user’s token. whole problem solved, reissue new API tokens user. Can user query API successfully Postman token? values enter exactly entered previous step. failure (assuming previous step successful) suggests network firewall issue. server behind institution’s firewall, verify connecting successfully VPN. Can user query API cURL? cURL command line tool ’s underneath lot libraries. ’s installed correctly location machine, can executed terminal command line. checks pass, proceed next section. , start consulting REDCap administrator. fails, consider creating GitHub issue package (e.g., redcapAPI REDCapR R, phpcap PHP, PyCap Python).","code":"record_id,name_first,name_last,address,telephone,email,dob,age,ethnicity,race,sex,height,weight,bmi,comments,demographics_complete \"1\",\"Nutmeg\",\"Nutmouse\",\"14 Rose Cottage St. Kenning UK, 323232\",\"(432) 456-4848\",\"nutty@mouse.com\",\"2003-08-30\",10,1,2,0,5,1,400,\"Character in a book, with some guessing\",2 \"2\",\"Tumtum\",\"Nutmouse\",\"14 Rose Cottage Blvd. Kenning UK 34243\",\"(234) 234-2343\",\"tummy@mouse.comm\",\"2003-03-10\",10,1,6,1,6,1,277.8,\"A mouse character from a good book\",2 \"3\",\"Marcus\",\"Wood\",\"243 Hill St. Guthrie OK 73402\",\"(433) 435-9865\",\"mw@mwood.net\",\"1934-04-09\",79,0,4,1,180,80,24.7,\"completely made up\",2 \"4\",\"Trudy\",\"DAG\",\"342 Elm Duncanville TX, 75116\",\"(987) 654-3210\",\"peroxide@blonde.com\",\"1952-11-02\",61,1,4,0,165,54,19.8,\"This record doesn't have a DAG assigned  So call up Trudy on the telephone Send her a letter in the mail\",2 \"5\",\"John Lee\",\"Walker\",\"Hotel Suite New Orleans LA, 70115\",\"(333) 333-4444\",\"left@hippocket.com\",\"1955-04-15\",58,1,4,1,193.04,104,27.9,\"Had a hand for trouble and a eye for cash  He had a gold watch chain and a black mustache\",2 curl -X POST -H \"Cache-Control: no-cache\" -F \"token=9A81268476645C4E5F03428B8AC3AA7B\" -F \"content=record\" -F \"format=csv\" \"https://bbmc.ouhsc.edu/redcap/api/\""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"writing","dir":"Articles","previous_headings":"Language Agnostic","what":"Writing","title":"Troubleshooting REDCap API Calls","text":"Troubleshooting import operations trickier export operations two major reasons. First, database potentially persists import mistakes. contrast, repeatedly exporting data won’t affect subsequent reads. Considering cloning REDCap project testing problem resolved. Remember create new token (’re automatically created projects cloned, even users copied), modify code’s token point new testing clone. second reason importing can trickier schema (e.g., names data types) local dataset must match project’s schema. Current recommendations include checking can write simpler projects (perhaps 1 ID field 1 string field), progressively moving mimic problematic project’s schema dataset. Also, consider exporting dataset machine, look differences. Note import calculated fields REDCap. dataset pass REDCapR::validate_for_write()? REDCapR::validate_for_write() inspects data frame anticipate problems writing REDCap’s API. reference manual contains specifics validation checks. Can import small subset project? instance, just record_id column. Can export dataset import without modifications? instance, using REDCapR: First, manually complete ~10 example record web browser, export/download records REDCapR::redcap_read_oneshot() data frame. (longitudinal repeating instruments, make sure examples cover dimensions adequately) Second, can successfully upload data.frame (without modification) REDCapR::redcap_write_oneshot()? , dataset provide template structure real dataset assign values. , helpful piece troubleshooting. longitudinal /repeating structure correct? Three variables frequently misspecified: redcap_event_name (longitudinal projects) redcap_repeat_instrument & redcap_repeat_instance (repeating instruments). values variables clearer understand complete step inspect layout. longitudinal projects: Example values redcap_event_name “admission_1_arm_1”, “admission_2_arm_1”, “admission_3_arm_1”. (Notice “_arm_1” suffix used even arms specified project.) projects repeating instruments: Examples values redcap_repeat_instrument “lab”, “vitals”, “medication”; instrument names specified REDCap Designer. Example values redcap_repeat_instance “1”, “2”, “3”, “4”, “5”; consecutive sequence within participant’s longitudinal event. participant 101 two lab results, one vitals record, three medications, dataset structure might : Can import entire project? Can columns written rows? one checks fail, please start consulting REDCap administrator.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"gotchas-agnostic","dir":"Articles","previous_headings":"Language Agnostic","what":"Common Gotchas","title":"Troubleshooting REDCap API Calls","text":"Problems project’s metadata/dictionary. exporting metadata fails (e.g., REDCapR::redcap_metadata_read() redcapAPI::exportMetaData()), manually download data dictionary REDCap browser. Inspect plain text closely text editor like Visual Studio Code; avoid programs like Excel tend interpret, align, decorate values, sometimes masks problems. Scrutinize elements, especially look nonstandard characters. See next bullet. API libraries test problematic elements project handled correctly. encounter element causes problems, please consider creating new GitHub Issue describes problem (e.g., REDCapR, redcapAPI, phpcap). issue, attach problematic fields data dictionary. ’re uncomfortable sharing dictionary world, consider emailing developer. ’s just data dictionary, PHI included. package developer can’t find way gracefully adapt, ’ll least try provide better error message. Identify problematic characters. special case previous bullet. Look fancy characters might interpreted smoothly. instance, editing data dictionary Excel, sometimes straight quotes converted curly quotes. might cause problem later, API client tries interpret character using wrong encoding. ASCII characters REDCap dictionaries appear interpreted smoothly.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"reading-without-a-package","dir":"Articles","previous_headings":"R","what":"Reading without a Package","title":"Troubleshooting REDCap API Calls","text":"several ways call REDCap’s API R. packages redcapAPI REDCapR rely httr package, calls curl package, calls cURL. httr installed user’s local machine? , running library(httr) produce error messages ’re starting fresh session R: recent version httr? several ways , easiest probably run update.packages(ask = FALSE, repos = \"https://cran.rstudio.com\"). optional argument ask prevents user needing respond ‘Y’ outdated package. Can query test project using httr? redcapAPI REDCapR packages employ something similar following function httr. ’re curious, relevant source code redcapAPI REDCapR. check fails, consider attempting url token used Postman example. Alternatively, can try using RCurl package, mostly replaced httr packages developed since 2014. Can query subset project using httr? step like previous one, two differences. First, ’s using REDCap project (instead test project). Second, pulls fewer records, smaller collection fields. Subsetting can help troubleshoot avoiding (thus identifying) cells problematic values. Notice call now passes values records fields parameters. Also notice value single long string (rather vector shorter strings, natural R users). Can query entire project using httr? two advantages trying subset data. First, small datasets avoid time-errors plague large datasets. Second, may avoid problematic values passed pipeline. current check fails previous check succeeds, experiment different expanses records fields. help determine values causing problems, ’s simply much data pulled one pass. desired dataset large, consider can prune unnecessary records fields. , one solution pull smaller, multiple batches using API, reassemble . redcap_read() function REDCapR automatically, allows user specify batch_size. checks pass, proceed next section. , start consulting REDCap administrator.","code":"library(httr) redcap_uri <- \"https://bbmc.ouhsc.edu/redcap/api/\" token      <- \"9A81268476645C4E5F03428B8AC3AA7B\"  post_body <- list(   token           = token,   content         = 'record',   format          = 'csv',   type            = 'flat' )  raw_text <- httr::POST(   url             = redcap_uri,   body            = post_body,   httr::verbose() # Remove this line to suppress the console updates. )  raw_text raw_text <- RCurl::postForm(   uri             = redcap_uri   , token         = token   , content       = 'record'   , format        = 'csv'   , type          = 'flat' ) redcap_uri         <- \"https://the.urlofyourinsitution.edu/api/\" token              <- \"your-secret-token\"  records_collapsed  <- \"1,2,3\"                             # Assumes dataset contains ID values of 1-3. fields_collapsed   <- \"record_id,name_first,name_last\"    # Assumes dataset contains these variables.  post_body <- list(   token           = token,   content         = 'record',   format          = 'csv',   type            = 'flat',   records         = records_collapsed,   fields          = fields_collapsed )  raw_text <- httr::POST(   url             = redcap_uri,   body            = post_body,   httr::verbose() # Remove this line to suppress the console updates. )  raw_text redcap_uri                  <- \"https://the.urlofyourinsitution.edu/api/\" token                       <- \"your-secret-token\"  records_collapsed           <- NULL fields_collapsed            <- NULL  post_body <- list(   token           = token,   content         = 'record',   format          = 'csv',   type            = 'flat',   records         = records_collapsed,   fields          = fields_collapsed )  raw_text <- httr::POST(   url             = redcap_uri,   body            = post_body,   httr::verbose() # Remove this line to suppress the console updates. )  raw_text"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"reading-with-the-redcapr-package","dir":"Articles","previous_headings":"R","what":"Reading with the REDCapR Package","title":"Troubleshooting REDCap API Calls","text":"REDCapR wraps convenience functions around httr reduce size complexity user’s code. package’s basic functions demonstrated vignette documented reference manual. ’re using REDCapR, can skip section proceed “Exporting REDCap R, using redcapAPI” “Importing REDCap R” . REDCapR redcapAPI different R packages, developers collaborate share advice. latest version REDCapR installed machine? Currently easiest way install REDCapR remotes package. following code installs remotes, installs REDCapR. CRAN version REDCapR updated times year, code download latest stable version. REDCapR load successfully machine? , running library(REDCapR) produce following output ’re starting fresh session R: Can export data dictionary? Sometimes problem exists within metadata/dictionary, instead actual data values. Verify structure content specific project interpretable local environment. fails, see “Problems project’s metadata/dictionary” Common Gotchas . problematic data dictionary may produce error Error inherits(ds, \"data.frame\") : object 'ds' found calling REDCapR::redcap_metadata_read(). Can export example project? fake data hosted OUHSC BBMC previous section. previous code produce similar output. Notice five rows columns wrap around console window narrow. Can export project? code similar previous check, uri token values need modified. Alternatively, redcap_project object can declared initially, makes subsequent calls cleaner token url required object declared. export operation still unsuccessful using REDCapR? “Can user query entire REDCap project using httr?” check succeeded, REDCapR checks , consider posting new GitHub issue package developers. one checks fail, please start consulting REDCap administrator.","code":"install.packages(\"remotes\", repos = \"https://cran.rstudio.com\") remotes::install_github(repo = \"OuhscBbmc/REDCapR\") library(REDCapR) # Loading required package: REDCapR library(REDCapR) # Load the package into the current R session, if you haven't already. redcap_uri       <- \"https://the.urlofyourinsitution.edu/api/\" token            <- \"your-secret-token\" redcap_metadata_read(redcap_uri = uri, token = token) library(REDCapR) # Load the package into the current R session. uri   <- \"https://bbmc.ouhsc.edu/redcap/api/\" token <- \"9A81268476645C4E5F03428B8AC3AA7B\" redcap_read(redcap_uri = uri, token = token)$data 5 records and 1 columns were read from REDCap in 0.41 seconds. Starting to read 5 records  at 2014-06-27 17:19:49 Reading batch 1 of 1, with ids 1 through 5. 5 records and 16 columns were read from REDCap in 0.42 seconds.    record_id name_first name_last                                 address      telephone               email 1         1     Nutmeg  Nutmouse 14 Rose Cottage St.\\nKenning UK, 323232 (432) 456-4848     nutty@mouse.com 2         2     Tumtum  Nutmouse 14 Rose Cottage Blvd.\\nKenning UK 34243 (234) 234-2343    tummy@mouse.comm 3         3     Marcus      Wood          243 Hill St.\\nGuthrie OK 73402 (433) 435-9865        mw@mwood.net 4         4      Trudy       DAG          342 Elm\\nDuncanville TX, 75116 (987) 654-3210 peroxide@blonde.com 5         5   John Lee    Walker      Hotel Suite\\nNew Orleans LA, 70115 (333) 333-4444  left@hippocket.com           dob age ethnicity race sex height weight   bmi 1 2003-08-30  10         1    2   0   5.00      1 400.0 2 2003-03-10  10         1    6   1   6.00      1 277.8 3 1934-04-09  79         0    4   1 180.00     80  24.7 4 1952-11-02  61         1    4   0 165.00     54  19.8 5 1955-04-15  58         1    4   1 193.04    104  27.9                                                                                                       comments 1                                                                     Character in a book, with some guessing 2                                                                          A mouse character from a good book 3                                                                                          completely made up 4 This record doesn't have a DAG assigned\\n\\nSo call up Trudy on the telephone\\nSend her a letter in the mail 5                 Had a hand for trouble and a eye for cash\\n\\nHe had a gold watch chain and a black mustache    demographics_complete 1                     2 2                     2 3                     2 4                     2 5                     2 library(REDCapR) # Load the package into the current R session, if you haven't already. redcap_uri       <- \"https://the.urlofyourinsitution.edu/api/\" token            <- \"your-secret-token\" redcap_read(redcap_uri = uri, token = token)$data library(REDCapR) # Load the package into the current R session, if you haven't already. uri               <- \"https://bbmc.ouhsc.edu/redcap/api/\" token             <- \"9A81268476645C4E5F03428B8AC3AA7B\" project           <- redcap_project$new(redcap_uri = uri, token = token)  ds_three_columns  <- project$read(fields = c(\"record_id\", \"sex\", \"age\"))$data  ids_of_males      <- ds_three_columns$record_id[ds_three_columns$sex == 1] ids_of_minors     <- ds_three_columns$record_id[ds_three_columns$age < 18]  ds_males          <- project$read(records = ids_of_males, batch_size = 2)$data ds_minors         <- project$read(records = ids_of_minors)$data"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"reading-with-the-redcapapi-package","dir":"Articles","previous_headings":"R","what":"Reading with the redcapAPI Package","title":"Troubleshooting REDCap API Calls","text":"httr redcapAPI wraps convenience functions around httr reduce size complexity user’s code. ’re using redcapAPI, can skip section proceed ‘Importing REDCap R’ . specific discussion redcapAPI can found package’s wiki. redcapAPI REDCapR different packages, developers collaborate share advice. redcapAPI installed machine? Currently, easiest way install redcapAPI CRAN. Developmental versions may available GitHub. redcapAPI load successfully machine? , running library(redcapAPI) produce following output ’re starting fresh session R: Can export data dictionary? Sometimes problem exists within metadata/dictionary, instead actual data values. Verify structure content specific project interpretable local environment. fails, see “Problems project’s metadata/dictionary.” Gotchas Can export example project? fake data hosted OUHSC BBMC previous section. previous code produce similar output. Notice five rows columns wrap around console window narrow. Can export project? code similar previous check, uri token values need modified. export operation still unsuccessful using redcapAPI? “Can user query entire REDCap project using httr?” check succeeded, redcapAPI checks , consider posting new GitHub issue package developers. one checks fail, please start consulting REDCap administrator.","code":"install.packages(\"redcapAPI\") install.packages(\"remotes\", repos = \"https://cran.rstudio.com\") remotes::install_github(repo = \"nutterb/redcapAPI\") library(redcapAPI) # Loading required package: redcapAPI library(redcapAPI) # Load the package into the current R session, if you haven't already. redcap_uri       <- \"https://the.urlofyourinsitution.edu/api/\" token            <- \"your-secret-token\" exportMetaData(rcon) library(redcapAPI) # Load the package into the current R session. rcon <- redcapConnection(   url   = \"https://bbmc.ouhsc.edu/redcap/api/\",   token = \"9A81268476645C4E5F03428B8AC3AA7B\" ) exportRecords(rcon) record_id name_first name_last                                 address      telephone               email 1         1     Nutmeg  Nutmouse 14 Rose Cottage St.\\nKenning UK, 323232 (432) 456-4848     nutty@mouse.com 2         2     Tumtum  Nutmouse 14 Rose Cottage Blvd.\\nKenning UK 34243 (234) 234-2343    tummy@mouse.comm 3         3     Marcus      Wood          243 Hill St.\\nGuthrie OK 73402 (433) 435-9865        mw@mwood.net 4         4      Trudy       DAG          342 Elm\\nDuncanville TX, 75116 (987) 654-3210 peroxide@blonde.com 5         5   John Lee    Walker      Hotel Suite\\nNew Orleans LA, 70115 (333) 333-4444  left@hippocket.com         dob age ethnicity race sex height weight   bmi 1 2003-08-30  10         1    2   0   5.00      1 400.0 2 2003-03-10  10         1    6   1   6.00      1 277.8 3 1934-04-09  79         0    4   1 180.00     80  24.7 4 1952-11-02  61         1    4   0 165.00     54  19.8 5 1955-04-15  58         1    4   1 193.04    104  27.9                                                                                                     comments 1                                                                     Character in a book, with some guessing 2                                                                          A mouse character from a good book 3                                                                                          completely made up 4 This record doesn't have a DAG assigned\\n\\nSo call up Trudy on the telephone\\nSend her a letter in the mail 5                 Had a hand for trouble and a eye for cash\\n\\nHe had a gold watch chain and a black mustache  demographics_complete 1                     2 2                     2 3                     2 4                     2 5                     2 library(redcapAPI) # Load the package into the current R session, if you haven't already. rcon <- redcapConnection(   url   = \"https://the.urlofyourinsitution.edu/api/\", # Adapt this to your server.   token = \"your-secret-token\"                         # Adapt this to your user's token. ) exportRecords(rcon)"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"troubleshooting-strategies","dir":"Articles","previous_headings":"General Information","what":"Troubleshooting Strategies","title":"Troubleshooting REDCap API Calls","text":"Simplify. Eliminate potential sources problems cumulatively. example, reduce columns & records read/write. Start fresh. ’s feasible, start new REDCap project gradually add elements original project. Identify problematic element testing API call addition.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"resources","dir":"Articles","previous_headings":"General Information","what":"Resources","title":"Troubleshooting REDCap API Calls","text":"REDCap used many environments, ’s surprising lot libraries developed cater different scenarios languages. active list maintained REDCap-Tools. entry needs added, please notify us; instructions found bottom page. basic API documentation available REDCap server, typically access REDCap wiki, newer examples might exist https://community.projectredcap.org/articles/462/api-examples.html. official documentation can found “API Help Page” “API Examples” pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material. Scott Burns, primary developer PyCap good intro http://sburns.org/2013/07/22/intro--redcap-api.html Benjamin Nutter, primary developer redcapAPI good wiki https://github.com/nutterb/redcapAPI/wiki addition troubleshooting document, REDCapR vignettes covers basic advanced operations.","code":"https://<*your server name*>/redcap/api/help"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"document-info","dir":"Articles","previous_headings":"General Information","what":"Document Info","title":"Troubleshooting REDCap API Calls","text":"document primarily based REDCap version 6.0.2 last updated 2020-01-21. development version document available GitHub: https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"set-project-wide-values","dir":"Articles","previous_headings":"","what":"Set project-wide values","title":"Advanced REDCapR Operations","text":"information specific REDCap project, opposed individual operation. includes (1) uri server, (2) token user’s project. hosted machine used REDCapR’s public test suite, can run example computer. Unless tests running. PHI-free demos, strongly suggest storing tokens securely avoiding hard-coding like . recommendation store tokens database. feasible institution, consider storing secured csv retrieving REDCapR::retrieve_credential_local().","code":"library(REDCapR) #Load the package into the current R session. uri                   <- \"https://bbmc.ouhsc.edu/redcap/api/\" token_simple          <- \"9A81268476645C4E5F03428B8AC3AA7B\" token_longitudinal    <- \"0434F0E9CF53ED0587847AB6E51DE762\""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"converting-from-talllong-to-wide","dir":"Articles","previous_headings":"","what":"Converting from tall/long to wide","title":"Advanced REDCapR Operations","text":"Disclaimer: Occasionally ’re asked longitudinal dataset converted “long/tall format” (typically row one observation participant) “wide format” (row participant). Usually advise . Besides database benefits long structure, wide structure restricts options stat routine. modern longitudinal analysis procedures (e.g., growth curve models multilevel/hierarchical models) accept wide. ’re pretty much stuck repeated measures anova, inflexible real-world medical-ish analyses. requires patient measurement every time point; otherwise anova excludes patient entirely. However like going wide produce visual tables publications, ’s one way R. First retrieve dataset REDCap. widening one variable (e.g., pmq1), code’s pretty simple: scenarios, multiple variables (e.g., pmq1 - pmq4) can widened single tidyr::pivot_wider() operation. example contains additional wrinkle REDCap event names “first_dose” “first_visit” renamed “dose_1” “visit_1”, help values dose visit values proper numbers. However, widening scenarios, can easier go even longer/taller (e.g., ds_eav) reversing direction going wide. Lots packages documentation exist. current preference tidyverse approach pivoting, data.table approach worth considering ’re comfortable package. Stack Overflow post describes several ways. recommend reshape reshape2 packages, developers replaced tidyr functions described .","code":"library(magrittr) suppressPackageStartupMessages(requireNamespace(\"dplyr\")) suppressPackageStartupMessages(requireNamespace(\"tidyr\")) events_to_retain  <- c(\"dose_1_arm_1\", \"visit_1_arm_1\", \"dose_2_arm_1\", \"visit_2_arm_1\")  ds_long <- REDCapR::redcap_read_oneshot(redcap_uri = uri, token = token_longitudinal)$data #> 18 records and 125 columns were read from REDCap in 0.4 seconds.  The http status code was 200. ds_long %>%   dplyr::select(study_id, redcap_event_name, pmq1, pmq2, pmq3, pmq4) #> # A tibble: 18 × 6 #>    study_id redcap_event_name         pmq1  pmq2  pmq3  pmq4 #>       <dbl> <chr>                    <dbl> <dbl> <dbl> <dbl> #>  1      100 enrollment_arm_1            NA    NA    NA    NA #>  2      100 dose_1_arm_1                 2     2     1     1 #>  3      100 visit_1_arm_1                1     0     0     0 #>  4      100 dose_2_arm_1                 3     1     0     0 #>  5      100 visit_2_arm_1                0     1     0     0 #>  6      100 final_visit_arm_1           NA    NA    NA    NA #>  7      220 enrollment_arm_1            NA    NA    NA    NA #>  8      220 dose_1_arm_1                 0     1     0     2 #>  9      220 visit_1_arm_1                0     3     1     0 #> 10      220 dose_2_arm_1                 1     2     0     1 #> 11      220 visit_2_arm_1                3     4     1     0 #> 12      220 final_visit_arm_1           NA    NA    NA    NA #> 13      304 enrollment_arm_2            NA    NA    NA    NA #> 14      304 deadline_to_opt_ou_arm_2    NA    NA    NA    NA #> 15      304 first_dose_arm_2             0     1     0     0 #> 16      304 first_visit_arm_2            2     0     0     0 #> 17      304 final_visit_arm_2           NA    NA    NA    NA #> 18      304 deadline_to_return_arm_2    NA    NA    NA    NA ds_wide <-   ds_long %>%   dplyr::select(study_id, redcap_event_name, pmq1) %>%   dplyr::filter(redcap_event_name %in% events_to_retain) %>%   tidyr::pivot_wider(     id_cols     = study_id,     names_from  = redcap_event_name,     values_from = pmq1   ) ds_wide #> # A tibble: 2 × 5 #>   study_id dose_1_arm_1 visit_1_arm_1 dose_2_arm_1 visit_2_arm_1 #>      <dbl>        <dbl>         <dbl>        <dbl>         <dbl> #> 1      100            2             1            3             0 #> 2      220            0             0            1             3 pattern <- \"^(\\\\w+?)_arm_(\\\\d)$\" ds_wide <-   ds_long %>%   dplyr::select(study_id, redcap_event_name, pmq1, pmq2, pmq3, pmq4) %>%   dplyr::mutate(     event = sub(pattern, \"\\\\1\", redcap_event_name),     event = dplyr::recode(event, \"first_dose\"=\"dose_1\", \"first_visit\"=\"visit_1\"),     arm   = as.integer(sub(pattern, \"\\\\2\", redcap_event_name))   ) %>%   dplyr::select(study_id, event, arm, pmq1, pmq2, pmq3, pmq4) %>%   dplyr::filter(!(event %in%      c(\"enrollment\", \"final_visit\", \"deadline_to_return\", \"deadline_to_opt_ou\")   )) %>%   tidyr::pivot_wider(     id_cols     = c(study_id, arm),     names_from  = event,     values_from = c(pmq1, pmq2, pmq3, pmq4)   )  ds_wide #> # A tibble: 3 × 18 #>   study_id   arm pmq1_dose_1 pmq1_visit_1 pmq1_dose_2 pmq1_visit_2 pmq2_dose_1 #>      <dbl> <int>       <dbl>        <dbl>       <dbl>        <dbl>       <dbl> #> 1      100     1           2            1           3            0           2 #> 2      220     1           0            0           1            3           1 #> 3      304     2           0            2          NA           NA           1 #> # ℹ 11 more variables: pmq2_visit_1 <dbl>, pmq2_dose_2 <dbl>, #> #   pmq2_visit_2 <dbl>, pmq3_dose_1 <dbl>, pmq3_visit_1 <dbl>, #> #   pmq3_dose_2 <dbl>, pmq3_visit_2 <dbl>, pmq4_dose_1 <dbl>, #> #   pmq4_visit_1 <dbl>, pmq4_dose_2 <dbl>, pmq4_visit_2 <dbl> ds_eav <-   ds_long %>%   dplyr::select(study_id, redcap_event_name, pmq1, pmq2, pmq3, pmq4) %>%   dplyr::mutate(     event = sub(pattern, \"\\\\1\", redcap_event_name),     event = dplyr::recode(event, \"first_dose\" = \"dose_1\", \"first_visit\" = \"visit_1\"),     arm   = as.integer(sub(pattern, \"\\\\2\", redcap_event_name))   ) %>%   dplyr::select(study_id, event, arm, pmq1, pmq2, pmq3, pmq4) %>%   tidyr::pivot_longer(     cols      = c(pmq1, pmq2, pmq3, pmq4),     names_to  = \"key\",     values_to = \"value\"   ) %>%   # For old versions of tidyr that predate `pivot_wider()`:   # tidyr::gather(key=key, value=value, pmq1, pmq2, pmq3, pmq4) %>%   dplyr::filter(!(event %in% c(     \"enrollment\", \"final_visit\", \"deadline_to_return\", \"deadline_to_opt_ou\")   )) %>%   dplyr::mutate( # Simulate correcting for mismatched names across arms:     key = paste0(key, \"_\", event)   ) %>%   dplyr::select(-event)  # Show the first 10 rows of the EAV table. ds_eav %>%   head(10) #> # A tibble: 10 × 4 #>    study_id   arm key          value #>       <dbl> <int> <chr>        <dbl> #>  1      100     1 pmq1_dose_1      2 #>  2      100     1 pmq2_dose_1      2 #>  3      100     1 pmq3_dose_1      1 #>  4      100     1 pmq4_dose_1      1 #>  5      100     1 pmq1_visit_1     1 #>  6      100     1 pmq2_visit_1     0 #>  7      100     1 pmq3_visit_1     0 #>  8      100     1 pmq4_visit_1     0 #>  9      100     1 pmq1_dose_2      3 #> 10      100     1 pmq2_dose_2      1 # Spread the EAV to wide. ds_wide_2 <-   ds_eav %>%   tidyr::pivot_wider(     id_cols     = c(study_id, arm),     names_from  = key,     values_from = value   ) # For old versions of tidyr that predate `pivot_wider()`: # tidyr::spread(key=key, value=value) ds_wide_2 #> # A tibble: 3 × 18 #>   study_id   arm pmq1_dose_1 pmq2_dose_1 pmq3_dose_1 pmq4_dose_1 pmq1_visit_1 #>      <dbl> <int>       <dbl>       <dbl>       <dbl>       <dbl>        <dbl> #> 1      100     1           2           2           1           1            1 #> 2      220     1           0           1           0           2            0 #> 3      304     2           0           1           0           0            2 #> # ℹ 11 more variables: pmq2_visit_1 <dbl>, pmq3_visit_1 <dbl>, #> #   pmq4_visit_1 <dbl>, pmq1_dose_2 <dbl>, pmq2_dose_2 <dbl>, #> #   pmq3_dose_2 <dbl>, pmq4_dose_2 <dbl>, pmq1_visit_2 <dbl>, #> #   pmq2_visit_2 <dbl>, pmq3_visit_2 <dbl>, pmq4_visit_2 <dbl>"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"query-the-underlying-mysql-database","dir":"Articles","previous_headings":"","what":"Query the Underlying MySQL Database","title":"Advanced REDCapR Operations","text":"require feature available instance’s API, first upgrade institution’s REDCap instance see feature added recently. Second, check someone released desired API-like features REDCap External Module. Third, may need query database underneath REDCap’s web server. Transfer Credentials section Security Database Vignette provides complete example using R query MySQL database odbc. find ’s best develop query MySQL Workbench, copy code R (alternatively, use OuhscMunge::execute_sql_file()). example retrieves first_submit_time, helpful need timestamp surveys marked completed. Replace ‘444’ pid, 1001 1003 desired events.","code":"SELECT   p.participant_id      as participant_survey_id   ,r.record             as record_id   ,p.event_id   ,e.descrip            as event_name   ,r.first_submit_time   ,r.completion_time    -- ,p.*   -- ,r.* FROM redcapv3.redcap_surveys_participants     as p   left  join redcapv3.redcap_surveys_response as r on p.participant_id = r.participant_id   left  join redcapv3.redcap_events_metadata  as e on p.event_id       = e.event_id WHERE   p.survey_id = 444   and   p.event_id in (     1001, -- start of the year     1002, -- mid term     1003  -- end of year   )"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"ssl-options","dir":"Articles","previous_headings":"","what":"SSL Options","title":"Advanced REDCapR Operations","text":"official cURL site discusses process using SSL verify server connected . Use SSL cert file come openssl package. Force connection use SSL=3 (preferred, possibly insecure).","code":"cert_location <- system.file(\"cacert.pem\", package = \"openssl\") if (file.exists(cert_location)) {   config_options         <- list(cainfo = cert_location)   ds_different_cert_file <- redcap_read_oneshot(     redcap_uri     = uri,     token          = token_simple,     config_options = config_options   )$data } #> 5 records and 25 columns were read from REDCap in 1.0 seconds.  The http status code was 200. config_options <- list(sslversion = 3) ds_ssl_3 <- redcap_read_oneshot(   redcap_uri     = uri,   token          = token_simple,   config_options = config_options )$data #> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. config_options <- list(ssl.verifypeer = FALSE) ds_no_ssl <- redcap_read_oneshot(   redcap_uri     = uri,   token          = token_simple,   config_options = config_options )$data #> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200."},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"convert-spss-output-to-redcap-data-dictionary","dir":"Articles","previous_headings":"","what":"Convert SPSS Output to REDCap data dictionary","title":"Advanced REDCapR Operations","text":"solution https://stackoverflow.com//51013678/1082435 converts levels specified SPSS output like dropdown choices REDCap data dictionary like","code":"SEX       0 Male           1 Female  LANGUAGE  1 English           2 Spanish           3 Other           6 Unknown Variable Values SEX      0, Male | 1, Female LANGUAGE 1, English | 2, Spanish | 3, Other | 6, Unknown"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Advanced REDCapR Operations","text":"sake documentation reproducibility, current report rendered following environment. Click line expand. Report rendered runner 2024-09-07, 01:07 +0000 3 seconds.","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #>  setting  value #>  version  R version 4.4.1 (2024-06-14) #>  os       macOS Sonoma 14.6.1 #>  system   aarch64, darwin20 #>  ui       X11 #>  language en #>  collate  en_US.UTF-8 #>  ctype    en_US.UTF-8 #>  tz       UTC #>  date     2024-09-07 #>  pandoc   3.1.11 @ /usr/local/bin/ (via rmarkdown) #>  #> ─ Packages ─────────────────────────────────────────────────────────────────── #>  package     * version  date (UTC) lib source #>  backports     1.5.0    2024-05-23 [1] CRAN (R 4.4.0) #>  bit           4.0.5    2022-11-15 [1] CRAN (R 4.4.0) #>  bit64         4.0.5    2020-08-30 [1] CRAN (R 4.4.0) #>  bslib         0.8.0    2024-07-29 [1] CRAN (R 4.4.0) #>  cachem        1.1.0    2024-05-16 [1] CRAN (R 4.4.0) #>  checkmate     2.3.2    2024-07-29 [1] CRAN (R 4.4.0) #>  cli           3.6.3    2024-06-21 [1] CRAN (R 4.4.0) #>  colorspace    2.1-1    2024-07-26 [1] CRAN (R 4.4.0) #>  crayon        1.5.3    2024-06-20 [1] CRAN (R 4.4.0) #>  curl          5.2.2    2024-08-26 [1] CRAN (R 4.4.1) #>  desc          1.4.3    2023-12-10 [1] CRAN (R 4.4.0) #>  digest        0.6.37   2024-08-19 [1] CRAN (R 4.4.1) #>  dplyr         1.1.4    2023-11-17 [1] CRAN (R 4.4.0) #>  evaluate      0.24.0   2024-06-10 [1] CRAN (R 4.4.0) #>  fansi         1.0.6    2023-12-08 [1] CRAN (R 4.4.0) #>  fastmap       1.2.0    2024-05-15 [1] CRAN (R 4.4.0) #>  fs            1.6.4    2024-04-25 [1] CRAN (R 4.4.0) #>  generics      0.1.3    2022-07-05 [1] CRAN (R 4.4.0) #>  glue          1.7.0    2024-01-09 [1] CRAN (R 4.4.0) #>  hms           1.1.3    2023-03-21 [1] CRAN (R 4.4.0) #>  htmltools     0.5.8.1  2024-04-04 [1] CRAN (R 4.4.0) #>  httr          1.4.7    2023-08-15 [1] CRAN (R 4.4.0) #>  jquerylib     0.1.4    2021-04-26 [1] CRAN (R 4.4.0) #>  jsonlite      1.8.8    2023-12-04 [1] CRAN (R 4.4.0) #>  kableExtra    1.4.0    2024-01-24 [1] CRAN (R 4.4.0) #>  knitr       * 1.48     2024-07-07 [1] CRAN (R 4.4.0) #>  lifecycle     1.0.4    2023-11-07 [1] CRAN (R 4.4.0) #>  magrittr    * 2.0.3    2022-03-30 [1] CRAN (R 4.4.0) #>  munsell       0.5.1    2024-04-01 [1] CRAN (R 4.4.0) #>  pillar        1.9.0    2023-03-22 [1] CRAN (R 4.4.0) #>  pkgconfig     2.0.3    2019-09-22 [1] CRAN (R 4.4.0) #>  pkgdown       2.1.0    2024-07-06 [1] CRAN (R 4.4.0) #>  purrr         1.0.2    2023-08-10 [1] CRAN (R 4.4.0) #>  R6            2.5.1    2021-08-19 [1] CRAN (R 4.4.0) #>  ragg          1.3.2    2024-05-15 [1] CRAN (R 4.4.0) #>  readr         2.1.5    2024-01-10 [1] CRAN (R 4.4.0) #>  REDCapR     * 1.1.9007 2024-09-07 [1] local #>  rlang         1.1.4    2024-06-04 [1] CRAN (R 4.4.0) #>  rmarkdown     2.28     2024-08-17 [1] CRAN (R 4.4.0) #>  rstudioapi    0.16.0   2024-03-24 [1] CRAN (R 4.4.0) #>  sass          0.4.9    2024-03-15 [1] CRAN (R 4.4.0) #>  scales        1.3.0    2023-11-28 [1] CRAN (R 4.4.0) #>  sessioninfo   1.2.2    2021-12-06 [1] CRAN (R 4.4.0) #>  stringi       1.8.4    2024-05-06 [1] CRAN (R 4.4.0) #>  stringr       1.5.1    2023-11-14 [1] CRAN (R 4.4.0) #>  svglite       2.1.3    2023-12-08 [1] CRAN (R 4.4.0) #>  systemfonts   1.1.0    2024-05-15 [1] CRAN (R 4.4.0) #>  textshaping   0.4.0    2024-05-24 [1] CRAN (R 4.4.0) #>  tibble        3.2.1    2023-03-20 [1] CRAN (R 4.4.0) #>  tidyr         1.3.1    2024-01-24 [1] CRAN (R 4.4.0) #>  tidyselect    1.2.1    2024-03-11 [1] CRAN (R 4.4.0) #>  tzdb          0.4.0    2023-05-12 [1] CRAN (R 4.4.0) #>  utf8          1.2.4    2023-10-22 [1] CRAN (R 4.4.0) #>  vctrs         0.6.5    2023-12-01 [1] CRAN (R 4.4.0) #>  viridisLite   0.4.2    2023-05-02 [1] CRAN (R 4.4.0) #>  vroom         1.6.5    2023-12-05 [1] CRAN (R 4.4.0) #>  withr         3.0.1    2024-07-31 [1] CRAN (R 4.4.0) #>  xfun          0.47     2024-08-17 [1] CRAN (R 4.4.0) #>  xml2          1.3.6    2023-12-04 [1] CRAN (R 4.4.0) #>  yaml          2.3.10   2024-07-26 [1] CRAN (R 4.4.0) #>  #>  [1] /Users/runner/work/_temp/Library #>  [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #>  #> ──────────────────────────────────────────────────────────────────────────────"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"background","dir":"Articles","previous_headings":"","what":"Background","title":"Retrieving Longitudinal and Repeating Structures","text":"vignette pertains reading REDCap records project () longitudinal events (b) repeating measure. first section conceptually discusses REDCap stores complex structures. remaining sections describe best retrieve complex structures REDCapTidyieR REDCapR packages. new R REDCap, consider start Typical REDCap Workflow Data Analyst Basic REDCapR Operations vignettes return document. reading simple project, just call REDCapR’s redcap_read(). want perform operation (writing records REDCap), review Reference REDCapR functions see currently available. REDCap project longitudinal contains repeating measures, single call API (single export browser) return dataset readily analyzed. Instead, dataset resemble Table 5. isn’t software bug, haven’t told software like data structured. isn’t good way jam multidimensional space rectangle points. advice querying REDCap querying database system: request separate datasets natural “grain” assemble fit analyses.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"possible-table-structures","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured","what":"Possible Table Structures","title":"Retrieving Longitudinal and Repeating Structures","text":"Suppose two patients (.e., “1” “2”) three intake variables (.e., height, weight, bmi). record piece paper, probably look like Table 1. table’s grain “patient”, row represents distinct patient. Understanding grain structure help understand structures re-expressions set observations.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"table-1-patient-grain","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Possible Table Structures","what":"Table 1: patient grain","title":"Retrieving Longitudinal and Repeating Structures","text":"patient-grain structure data points comfortably inputted humans REDCap, default exported browser API. However stored differently REDCap’s internal database. REDCap’s flexibility driver success. research team learns REDCap, can reuse knowledge capture anything leukemia lunch orders. achieve flexibility world REDCap EMRs, data stored along observation grain. computer science, commonly called EAV structure (stands entity-attribute-value). patient’s ID entity, variable type attribute, observed point value. can also thought “key-value store” nested within patient (“key” synonym “attribute”). Notice two wider rows morphed six skinnier rows –one row per observation. curious database administrator, peek structure rows redcap_data table. important table database.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"table-2-observation-grain-for-intake-instrument","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Possible Table Structures","what":"Table 2: observation grain for intake instrument","title":"Retrieving Longitudinal and Repeating Structures","text":"REDCap EMR databases store observations underlying table. table simplification redcap_data table, heart REDCap’s internal database. investigation gains longitudinal repeating component, becomes necessary include dimension time. Suppose protocol specifies five time points; blood pressure instrument captured times 1, 2, & 3 laboratory instrument captured times 1 & 2. record stage paper, likely resemble Tables 3a & 3b: one vitals one labs.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"table-3b-patient-time-grain-for-laboratory-instrument","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Possible Table Structures","what":"Table 3b: patient-time grain for laboratory instrument","title":"Retrieving Longitudinal and Repeating Structures","text":"measurements added REDCap’s observation table, resembles Table 4. Two new columns required uniquely distinguish instrument ordinal position. Notice first six rows copied Table 2; empty values repeating structure.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"table-4-observation-grain-for-intake-blood_pressure-and-laboratory-instruments","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Possible Table Structures","what":"Table 4: observation grain for intake, blood_pressure, and laboratory instruments","title":"Retrieving Longitudinal and Repeating Structures","text":"mentioned , isn’t universally good way coerce Tables 1, 3a, 3b single rectangle rows represent different things. REDCap’s perspective, ’s good transformation redcap_data (.e., Table 4) appropriate statistical programs. forced combine different entities, best option probably Table 5. call “block dataset”, borrowing linear algebra’s block matrix term. can see mishmash tables masquerading unified dataset. rows lack conceptual coherency Tables 1, 3a, & 3b.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"table-5-mishmashed-grain","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Possible Table Structures","what":"Table 5: mishmashed grain","title":"Retrieving Longitudinal and Repeating Structures","text":"block dataset inherently bad. , Table 5 can unambiguously transformed Table 4. Table 5’s primary limitation block dataset understood analysis software used conventional medical research. best, dataset always require additional preparation. worst, analyst model rows inappropriately, produce misleading conclusions. Table 5’s secondary limitation inefficiency. empty cells aren’t computationally free. Every cell must queried database concatenated REDCap’s web server order return Table 5 plain-text csv, json, xml format. simple example, half block dataset’s cells wasted. emptiness frequently exceeds 90% real-world REDCap projects (tend many variables repeating instances). emptiness always exceeds 99.9% real-world EMRs. reason, REDCap EMR design observation table resemble computational structure sparse matrix. (important difference REDCap’s unspecified cells interpreted null/empty, sparse matrix’s unspecified cells interpreted zero.) case sparse matrix, substantial memory requirement reductions can realized storing non-zero entries. Depending number distribution non-zero entries, different data structures can used yield huge savings memory compared basic approach. trade-accessing individual elements becomes complex additional structures needed able recover original matrix unambiguously. (source: Wikipedia: Sparse matrix - storage)","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"observation","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Terminology","what":"observation","title":"Retrieving Longitudinal and Repeating Structures","text":"term “observation” world medical databases different granular meaning tidyverse literature. REDCap medical databases, observation typically single point (heart rate systolic blood pressure) contextual variables (associated date, unit, visit ID, patient ID); see Tables 2 4 . tidyverse publications, observation roughly equivalent REDCap instrument (collection associated values); see Tables 1, 3a, 3b. (use medical terminology vignette. ’d love hear someone another term ’s unambiguous.)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"retrieving-from-redcap","dir":"Articles","previous_headings":"","what":"Retrieving from REDCap","title":"Retrieving Longitudinal and Repeating Structures","text":"Many new REDCap users submit single API call unintentionally obtain something like Table 5; try extract something resembling Tables 1, 3a, & 3b. Although can successful, strongly discourage . code difficult maintain portable REDCap projects different instruments. (code really slow ugly .) advice start Table 5 assembled –retrieve information better way. Like database systems, request three tables separately server combine desktop fit analyses necessary. Two approaches appropriate scenarios: multiple calls REDCapR’s redcap_read(), single call REDCapTidieR’s redcap_read_tidy(). code vignette requires magrittr package %>% (alternatively can use |> ’re using R 4.0.2 later). vignette uses credentials retrieve practice/fake dataset. appropriate datasets containing PHI sensitive information. Please see Part 2 - Retrieve Protected Token Typical REDCap Workflow Data Analyst vignette secure approaches.","code":"# Support pipes library(magrittr)  # Retrieve token path_credential <- system.file(\"misc/example.credentials\", package = \"REDCapR\") credential  <- REDCapR::retrieve_credential_local(   path_credential = path_credential,   project_id      = 3181 )"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"one-redcapr-call-for-each-table","dir":"Articles","previous_headings":"Retrieving from REDCap","what":"One REDCapR Call for Each Table","title":"Retrieving Longitudinal and Repeating Structures","text":"tidy datasets represented Tables 1, 3a, 3b can obtained calling REDCapR three times –one call per table. Using forms parameter, pass “intake” get Table 1, “blood_pressure” get Table 3a, “laboratory” get Table 3b. Although required, recommend specifying readr::cols() object ensure desired variable data types.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"retrieve-patient-level-table-corresponding-to-table-1","dir":"Articles","previous_headings":"Retrieving from REDCap > One REDCapR Call for Each Table","what":"Retrieve patient-level table (corresponding to Table 1)","title":"Retrieving Longitudinal and Repeating Structures","text":"","code":"col_types_intake <-   readr::cols_only(     record_id                 = readr::col_integer(),     height                    = readr::col_double(),     weight                    = readr::col_double(),     bmi                       = readr::col_double()   )  ds_intake <-   REDCapR::redcap_read(     redcap_uri  = credential$redcap_uri, # From the previous code snippet.     token       = credential$token,     forms       = c(\"intake\"),     col_types   = col_types_intake,     verbose     = FALSE,   )$data  ds_intake"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"retrieve-patient-time-level-tables-corresponding-to-tables-3a-3b","dir":"Articles","previous_headings":"Retrieving from REDCap > One REDCapR Call for Each Table","what":"Retrieve patient-time-level tables (corresponding to Tables 3a & 3b)","title":"Retrieving Longitudinal and Repeating Structures","text":"","code":"col_types_blood_pressure <-   readr::cols(     record_id                 = readr::col_integer(),     redcap_repeat_instrument  = readr::col_character(),     redcap_repeat_instance    = readr::col_integer(),     sbp                       = readr::col_double(),     dbp                       = readr::col_double(),     blood_pressure_complete   = readr::col_integer()   )  ds_blood_pressure <-   REDCapR::redcap_read(     redcap_uri  = credential$redcap_uri,     token       = credential$token,     forms       = c(\"blood_pressure\"),     col_types   = col_types_blood_pressure,     verbose     = FALSE   )$data  ds_blood_pressure %>%   tidyr::drop_na(redcap_repeat_instrument) col_types_laboratory  <-   readr::cols(     record_id                 = readr::col_integer(),     redcap_repeat_instrument  = readr::col_character(),     redcap_repeat_instance    = readr::col_integer(),     lab                       = readr::col_character(),     conc                      = readr::col_character(),     laboratory_complete       = readr::col_integer()   )  ds_laboratory  <-   REDCapR::redcap_read(     redcap_uri  = credential$redcap_uri,     token       = credential$token,     forms       = c(\"laboratory\"),     col_types   = col_types_laboratory,     verbose     = FALSE   )$data  ds_laboratory %>%   tidyr::drop_na(redcap_repeat_instrument)"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"retrieve-block-tables-corresponding-to-table-5","dir":"Articles","previous_headings":"Retrieving from REDCap > One REDCapR Call for Each Table","what":"Retrieve block tables (corresponding to Table 5)","title":"Retrieving Longitudinal and Repeating Structures","text":"reason need block dataset API, one call retrieve .","code":"ds_block <-   REDCapR::redcap_read(     redcap_uri  = credential$redcap_uri,     token       = credential$token,     col_types   = readr::cols(.default = readr::col_character()),     verbose     = FALSE,   )$data  ds_block"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"one-redcaptidier-call-for-all-tables","dir":"Articles","previous_headings":"Retrieving from REDCap","what":"One REDCapTidieR Call for All Tables","title":"Retrieving Longitudinal and Repeating Structures","text":"REDCapTidieR’s initial motivation facilitate longitudinal analyses promote tidy data hygiene. {Stephan Kadauke & Richard Hanna, please represent package wish. Tell ’ve positioned differently .}","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"choosing-between-the-approaches","dir":"Articles","previous_headings":"Retrieving from REDCap","what":"Choosing between the Approaches","title":"Retrieving Longitudinal and Repeating Structures","text":"retrieving data REDCap, recommend calling REDCapTidieR many scenarios, : new managing analyzing data R, analyses require dataset’s rows columns, ’d benefit auxiliary information REDCapTidieR’s supertibble, instrument’s structure. However recommend calling REDCapR scenarios. worth calling REDCapR multiple times : performing operation retrieving/reading data REDCap, comfortable managing analyzing data R, analyses require fraction data (() need first event, (b) analyses don’t involve instruments), want specify variables’ data types readr::cols(). doubt, start REDCapTidieR. Escalate REDCapR download time long might decreased reducing information retrieved server transported across network. course many scenarios solved best combination packages, () REDCapR populates initial demographics REDCap, (b) research staff enter measures collected patients time, (c) REDCapTidieR retrieves complete longitudinal dataset, (d) dplyr joins tibbles, finally (e) lme4 tests hypotheses involving patient trajectories time.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"escalating-to-redcapr","dir":"Articles","previous_headings":"Retrieving from REDCap","what":"Escalating to REDCapR","title":"Retrieving Longitudinal and Repeating Structures","text":"Even think ’ll need REDCapR’s low-level control, consider starting REDCapTidieR anyway. …particularly unsure specify grain table. structure REDCapTidieR’s tables easily compatible conventional analyses. need performance REDCapR unsure tables look, simply execute something like REDCapTidieR::redcap_read_tidy(url, project_token) study output. try mimic exactly REDCapR::redcap_read() calls. Finally, cull unwanted cells using parameters REDCapR::redcap_read(). data points even leave REDCap instance, improve performance. possible strategies include passing arguments forms: retrieve specified instruments/forms. Beginners start . easy conceptualize usually big increase speed just little development work. events: retrieve desired events within longitudinal project. instance analyses involve “intake” “follow #1” events, leave follow ups #2, #3, #4 server. fields: granular forms. can combined calls forms, passing \"bmi\" fields c(\"blood_pressure\", \"laboratory\") forms. records: example scenario, pluck individual patients associated events repeating instances. useful research, ’s usually combined REDCapR calls. See Read subset records, conditioned values variables section REDCapR’s Basic REDCapR Operations vignette. filter_logic: leverage observation values limit rows returned. underlying table index obs values, less computationally efficient options . datetime_range_begin & datetime_range_end: return records created modified specified window. Note efficiency gain moving block dataset REDCapTidieR different gain moving REDCapTidieR REDCapR. moving Table 5 REDCapTidieR Supertibble, eliminating empty cells never contain worthwhile data. moving REDCapTidieR Supertibble call collection REDCapR calls, eliminating cells contain data, may relevant analysis (patient’s name time lab specimen collected). {paragraph needs work.}","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"longitudinal","dir":"Articles","previous_headings":"Advanced","what":"Longitudinal","title":"Retrieving Longitudinal and Repeating Structures","text":"{TODO: Generalize argument longitudinal events}","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"caching-results-to-improve-performance","dir":"Articles","previous_headings":"Advanced","what":"Caching Results to Improve Performance","title":"Retrieving Longitudinal and Repeating Structures","text":"escalating REDCapR didn’t decrease duration enough, consider strategy calling REDCap per day (either package) saving results secured disk. efficient analyses require large dataset, real-time dataset. many retrospective projects, multiple analyses day can reuse dataset retrieved night (function like readr::write_rds()). helped complicated investigations multiple statisticians frantically tackle overlapping aspects funder’s deadline. Essentially transferring security responsibilities REDCap file server. balance advantages, approach’s drawbacks include: extra effort required create, secure, maintain networked drive accessible authorized analysts. take 15-60 minutes, depending institution. extra effort required create automated program retrieve cache dataset every night. See [CDS] head start. REDCap’s logs support meaningful audit human accessing API. User access audits now responsibility file system.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"caching-results-for-other-languages","dir":"Articles","previous_headings":"Advanced","what":"Caching Results for other Languages","title":"Retrieving Longitudinal and Repeating Structures","text":"Packages programming languages developed access REDCap’s API, PyCap PhpCap. Please see complete list https://redcap-tools.github.io/projects/. caching strategy described may also benefit investigation : uses language like SAS support packages. strongly discourage deploying loose scripts call API. something fixed original script, must distributed developer ~50 client institutions, must copied ~100 projects within institution. contrast, developer updates package distributed repository like CRAN, client needs run base::update.packages() per machine update packages –just REDCap packages. Data scientists already regularly. uses language like Julia lacks stable updated package. REDCap developers always releasing useful features (e.g., repeated measures) improve quality efficiency research. Leverage . investigation incorporates multiple programming languages like analysis team use consistent dataset. scenario, recommend code save R dataset multiple file formats, csv file feather file.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Retrieving Longitudinal and Repeating Structures","text":"sake documentation reproducibility, current report rendered following environment. Click line expand.","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #>  setting  value #>  version  R version 4.4.1 (2024-06-14) #>  os       macOS Sonoma 14.6.1 #>  system   aarch64, darwin20 #>  ui       X11 #>  language en #>  collate  en_US.UTF-8 #>  ctype    en_US.UTF-8 #>  tz       UTC #>  date     2024-09-07 #>  pandoc   3.1.11 @ /usr/local/bin/ (via rmarkdown) #>  #> ─ Packages ─────────────────────────────────────────────────────────────────── #>  package     * version  date (UTC) lib source #>  backports     1.5.0    2024-05-23 [1] CRAN (R 4.4.0) #>  bit           4.0.5    2022-11-15 [1] CRAN (R 4.4.0) #>  bit64         4.0.5    2020-08-30 [1] CRAN (R 4.4.0) #>  bslib         0.8.0    2024-07-29 [1] CRAN (R 4.4.0) #>  cachem        1.1.0    2024-05-16 [1] CRAN (R 4.4.0) #>  checkmate     2.3.2    2024-07-29 [1] CRAN (R 4.4.0) #>  cli           3.6.3    2024-06-21 [1] CRAN (R 4.4.0) #>  colorspace    2.1-1    2024-07-26 [1] CRAN (R 4.4.0) #>  crayon        1.5.3    2024-06-20 [1] CRAN (R 4.4.0) #>  curl          5.2.2    2024-08-26 [1] CRAN (R 4.4.1) #>  desc          1.4.3    2023-12-10 [1] CRAN (R 4.4.0) #>  digest        0.6.37   2024-08-19 [1] CRAN (R 4.4.1) #>  dplyr         1.1.4    2023-11-17 [1] CRAN (R 4.4.0) #>  evaluate      0.24.0   2024-06-10 [1] CRAN (R 4.4.0) #>  fansi         1.0.6    2023-12-08 [1] CRAN (R 4.4.0) #>  fastmap       1.2.0    2024-05-15 [1] CRAN (R 4.4.0) #>  fs            1.6.4    2024-04-25 [1] CRAN (R 4.4.0) #>  generics      0.1.3    2022-07-05 [1] CRAN (R 4.4.0) #>  glue          1.7.0    2024-01-09 [1] CRAN (R 4.4.0) #>  hms           1.1.3    2023-03-21 [1] CRAN (R 4.4.0) #>  htmltools     0.5.8.1  2024-04-04 [1] CRAN (R 4.4.0) #>  httr          1.4.7    2023-08-15 [1] CRAN (R 4.4.0) #>  jquerylib     0.1.4    2021-04-26 [1] CRAN (R 4.4.0) #>  jsonlite      1.8.8    2023-12-04 [1] CRAN (R 4.4.0) #>  kableExtra    1.4.0    2024-01-24 [1] CRAN (R 4.4.0) #>  knitr       * 1.48     2024-07-07 [1] CRAN (R 4.4.0) #>  lifecycle     1.0.4    2023-11-07 [1] CRAN (R 4.4.0) #>  magrittr    * 2.0.3    2022-03-30 [1] CRAN (R 4.4.0) #>  munsell       0.5.1    2024-04-01 [1] CRAN (R 4.4.0) #>  pillar        1.9.0    2023-03-22 [1] CRAN (R 4.4.0) #>  pkgconfig     2.0.3    2019-09-22 [1] CRAN (R 4.4.0) #>  pkgdown       2.1.0    2024-07-06 [1] CRAN (R 4.4.0) #>  purrr         1.0.2    2023-08-10 [1] CRAN (R 4.4.0) #>  R6            2.5.1    2021-08-19 [1] CRAN (R 4.4.0) #>  ragg          1.3.2    2024-05-15 [1] CRAN (R 4.4.0) #>  readr         2.1.5    2024-01-10 [1] CRAN (R 4.4.0) #>  REDCapR       1.1.9007 2024-09-07 [1] local #>  rlang         1.1.4    2024-06-04 [1] CRAN (R 4.4.0) #>  rmarkdown     2.28     2024-08-17 [1] CRAN (R 4.4.0) #>  rstudioapi    0.16.0   2024-03-24 [1] CRAN (R 4.4.0) #>  sass          0.4.9    2024-03-15 [1] CRAN (R 4.4.0) #>  scales        1.3.0    2023-11-28 [1] CRAN (R 4.4.0) #>  sessioninfo   1.2.2    2021-12-06 [1] CRAN (R 4.4.0) #>  stringi       1.8.4    2024-05-06 [1] CRAN (R 4.4.0) #>  stringr       1.5.1    2023-11-14 [1] CRAN (R 4.4.0) #>  svglite       2.1.3    2023-12-08 [1] CRAN (R 4.4.0) #>  systemfonts   1.1.0    2024-05-15 [1] CRAN (R 4.4.0) #>  textshaping   0.4.0    2024-05-24 [1] CRAN (R 4.4.0) #>  tibble        3.2.1    2023-03-20 [1] CRAN (R 4.4.0) #>  tidyr         1.3.1    2024-01-24 [1] CRAN (R 4.4.0) #>  tidyselect    1.2.1    2024-03-11 [1] CRAN (R 4.4.0) #>  tzdb          0.4.0    2023-05-12 [1] CRAN (R 4.4.0) #>  utf8          1.2.4    2023-10-22 [1] CRAN (R 4.4.0) #>  vctrs         0.6.5    2023-12-01 [1] CRAN (R 4.4.0) #>  viridisLite   0.4.2    2023-05-02 [1] CRAN (R 4.4.0) #>  vroom         1.6.5    2023-12-05 [1] CRAN (R 4.4.0) #>  withr         3.0.1    2024-07-31 [1] CRAN (R 4.4.0) #>  xfun          0.47     2024-08-17 [1] CRAN (R 4.4.0) #>  xml2          1.3.6    2023-12-04 [1] CRAN (R 4.4.0) #>  yaml          2.3.10   2024-07-26 [1] CRAN (R 4.4.0) #>  #>  [1] /Users/runner/work/_temp/Library #>  [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #>  #> ──────────────────────────────────────────────────────────────────────────────"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"verify-redcapr-is-installed","dir":"Articles","previous_headings":"Part 1 - Pre-requisites","what":"Verify REDCapR is installed","title":"Typical REDCap Workflow for a Data Analyst","text":"First confirm REDCapR package installed local machine. , following line throw error Loading required namespace: REDCapR.  Failed error: ‘package called ‘REDCapR’’. call fails, follow installation instructions REDCapR website. ’re workshop attendee, can use vignette copy snippets code local machine follow along examples: https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html.","code":"requireNamespace(\"REDCapR\") #> Loading required namespace: REDCapR  # If this fails, run `install.packages(\"REDCapR\")` or `remotes::install_github(repo=\"OuhscBbmc/REDCapR\")`"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"verify-redcap-access","dir":"Articles","previous_headings":"Part 1 - Pre-requisites","what":"Verify REDCap Access","title":"Typical REDCap Workflow for a Data Analyst","text":"Check institution’s REDCap administrator ensure access REDCap server, access specific REDCap project, API token appropriate privileges specific REDCap project. might first time ’ve ever needed request token, institution may formal process API approval. REDCap admin can help. vignette, ’ll use fake dataset hosted https://bbmc.ouhsc.edu/redcap/api/ accessible token “9A81268476645C4E5F03428B8AC3AA7B”. Note REDCap Admins: REDCapR::redcap_read() function properly, user must Export permissions ‘Full Data Set’. Users ‘De-Identified’ export privileges can still use REDCapR::redcap_read_oneshot(). grant appropriate permissions: go ‘User Rights’ REDCap project site, select desired user, select ‘Edit User Privileges’, ‘Data Exports’ radio buttons, select ‘Full Data Set’.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"review-codebook","dir":"Articles","previous_headings":"Part 1 - Pre-requisites","what":"Review Codebook","title":"Typical REDCap Workflow for a Data Analyst","text":"developing REDCap analysis code, spend least 10 minutes review codebook, whose link near top left corner REDCap project page, “Project Home Design” heading. Learning details save time later improve quality research. ’re new project, meet investigator least 30 minutes learn context, collection process, idiosyncrasies dataset. conversation, develop plan grooming dataset ready analysis. part standard advice analyst’s involvement start early investigation’s life span.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"part-2---retrieve-protected-token","dir":"Articles","previous_headings":"","what":"Part 2 - Retrieve Protected Token","title":"Typical REDCap Workflow for a Data Analyst","text":"REDCap API token essentially combination personal password ID specific project ’re requesting data . Protect like password PHI (protected health information). project PHI, never hard-code password directly R file. words, PHI project accessed R file includes line Instead, suggest storing token location can accessed . two recommendations.","code":"my_secret_token <- \"9A81268476645C4E5F03428B8AC3AA7B\""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"security-method-1-token-file","dir":"Articles","previous_headings":"Part 2 - Retrieve Protected Token","what":"Security Method 1: Token File","title":"Typical REDCap Workflow for a Data Analyst","text":"basic goals () separate secret values R file dedicated file (b) secure dedicated file. using git repository, prevent file committed entry .gitignore. Ask institution’s security team recommendation. retrieve_credential_local() function REDCapR package loads relevant information csv R. plain-text file might look like : retrieve credentials first project listed , pass value “153” project_id. credential file already created vignette. next real project, call create_credential_local() start well-formed csv file can contain tokens. Compared method , one less secure easier establish.","code":"redcap_uri,username,project_id,token,comment \"https://bbmc.ouhsc.edu/redcap/api/\",\"myusername\",153,9A81268476645C4E5F03428B8AC3AA7B,\"simple\" \"https://bbmc.ouhsc.edu/redcap/api/\",\"myusername\",212,0434F0E9CF53ED0587847AB6E51DE762,\"longitudinal\" \"https://bbmc.ouhsc.edu/redcap/api/\",\"myusername\",213,D70F9ACD1EDD6F151C6EA78683944E98,\"write data\" path_credential <- system.file(\"misc/example.credentials\", package = \"REDCapR\") credential  <- REDCapR::retrieve_credential_local(   path_credential = path_credential,   project_id      = 153 )  credential #> $redcap_uri #> [1] \"https://bbmc.ouhsc.edu/redcap/api/\" #>  #> $username #> [1] \"myusername\" #>  #> $project_id #> [1] 153 #>  #> $token #> [1] \"9A81268476645C4E5F03428B8AC3AA7B\" #>  #> $comment #> [1] \"simple static (read-only) test project\""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"security-method-2-token-server","dir":"Articles","previous_headings":"Part 2 - Retrieve Protected Token","what":"Security Method 2: Token Server","title":"Typical REDCap Workflow for a Data Analyst","text":"preferred method involves saving tokens separate database uses something like Active Directory authenticate requests. method described detail Security Database vignette. approach realistically requires someone institution least basic database administration experience.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"part-3---read-data-unstructured-approach","dir":"Articles","previous_headings":"","what":"Part 3 - Read Data: Unstructured Approach","title":"Typical REDCap Workflow for a Data Analyst","text":"redcap_uri token fields required arguments REDCapR::redcap_read(); credential object created previous section. point, data.frame ds_1 everything need start analyzing project.  Pause workshop minutes. Raise hand ’re trouble.","code":"ds_1 <-   REDCapR::redcap_read(     redcap_uri  = credential$redcap_uri,     token       = credential$token   )$data #> 24 variable metadata records were read from REDCap in 0.3 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 01:07:41.823374. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. ds_1 #> # A tibble: 5 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         2 Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10    11     1 #> 3         3 Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09    80     1 #> 4         4 Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02    61     0 #> 5         5 John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15    59     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>  hist(ds_1$weight) summary(ds_1) #>    record_id  name_first         name_last           address          #>  Min.   :1   Length:5           Length:5           Length:5           #>  1st Qu.:2   Class :character   Class :character   Class :character   #>  Median :3   Mode  :character   Mode  :character   Mode  :character   #>  Mean   :3                                                            #>  3rd Qu.:4                                                            #>  Max.   :5                                                            #>                                                                       #>   telephone            email                dob                  age       #>  Length:5           Length:5           Min.   :1934-04-09   Min.   :11.0   #>  Class :character   Class :character   1st Qu.:1952-11-02   1st Qu.:11.0   #>  Mode  :character   Mode  :character   Median :1955-04-15   Median :59.0   #>                                        Mean   :1969-11-06   Mean   :44.4   #>                                        3rd Qu.:2003-03-10   3rd Qu.:61.0   #>                                        Max.   :2003-08-30   Max.   :80.0   #>                                                                            #>       sex      demographics_complete     height          weight    #>  Min.   :0.0   Min.   :2             Min.   :  6.0   Min.   :  1   #>  1st Qu.:0.0   1st Qu.:2             1st Qu.:  7.0   1st Qu.:  1   #>  Median :1.0   Median :2             Median :165.0   Median : 54   #>  Mean   :0.6   Mean   :2             Mean   :110.2   Mean   : 48   #>  3rd Qu.:1.0   3rd Qu.:2             3rd Qu.:180.0   3rd Qu.: 80   #>  Max.   :1.0   Max.   :2             Max.   :193.0   Max.   :104   #>                                                                    #>       bmi          comments           mugshot          health_complete #>  Min.   : 19.8   Length:5           Length:5           Min.   :0       #>  1st Qu.: 24.7   Class :character   Class :character   1st Qu.:0       #>  Median : 27.9   Mode  :character   Mode  :character   Median :1       #>  Mean   :110.9                                         Mean   :1       #>  3rd Qu.:204.1                                         3rd Qu.:2       #>  Max.   :277.8                                         Max.   :2       #>                                                                        #>     race___1      race___2      race___3      race___4      race___5   #>  Min.   :0.0   Min.   :0.0   Min.   :0.0   Min.   :0.0   Min.   :0.0   #>  1st Qu.:0.0   1st Qu.:0.0   1st Qu.:0.0   1st Qu.:0.0   1st Qu.:1.0   #>  Median :0.0   Median :0.0   Median :0.0   Median :0.0   Median :1.0   #>  Mean   :0.2   Mean   :0.2   Mean   :0.2   Mean   :0.2   Mean   :0.8   #>  3rd Qu.:0.0   3rd Qu.:0.0   3rd Qu.:0.0   3rd Qu.:0.0   3rd Qu.:1.0   #>  Max.   :1.0   Max.   :1.0   Max.   :1.0   Max.   :1.0   Max.   :1.0   #>                                                                        #>     race___6     ethnicity interpreter_needed race_and_ethnicity_complete #>  Min.   :0.0   Min.   :0   Min.   :0.00       Min.   :0.0                 #>  1st Qu.:0.0   1st Qu.:1   1st Qu.:0.00       1st Qu.:2.0                 #>  Median :0.0   Median :1   Median :0.00       Median :2.0                 #>  Mean   :0.2   Mean   :1   Mean   :0.25       Mean   :1.6                 #>  3rd Qu.:0.0   3rd Qu.:1   3rd Qu.:0.25       3rd Qu.:2.0                 #>  Max.   :1.0   Max.   :2   Max.   :1.00       Max.   :2.0                 #>                            NA's   :1  summary(lm(age ~ 1 + sex + bmi, data = ds_1)) #>  #> Call: #> lm(formula = age ~ 1 + sex + bmi, data = ds_1) #>  #> Residuals: #>       1       2       3       4       5  #>  -2.491   1.954   9.132   2.491 -11.086  #>  #> Coefficients: #>             Estimate Std. Error t value Pr(>|t|)   #> (Intercept) 63.34496    8.89980   7.118   0.0192 * #> sex         13.55626    9.62958   1.408   0.2945   #> bmi         -0.24426    0.04337  -5.632   0.0301 * #> --- #> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #>  #> Residual standard error: 10.55 on 2 degrees of freedom #> Multiple R-squared:  0.9442, Adjusted R-squared:  0.8884  #> F-statistic: 16.92 on 2 and 2 DF,  p-value: 0.05581"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"part-4---read-data-choosing-columns-and-rows","dir":"Articles","previous_headings":"","what":"Part 4 - Read Data: Choosing Columns and Rows","title":"Typical REDCap Workflow for a Data Analyst","text":"read dataset first time, probably haven’t decided columns needed makes sense retrieve everything. gain familiarity data analytic objectives, consider selective variables rows transported remote server local machine. Advantages include: server almost always efficient filtering language like R Python. REDCap’s PHP code retrieves less data REDCap’s database translates less text format (like csv json). Fewer bytes transmitted across network. local machine better performance, R smaller dataset manage. brain doesn’t look past unnecessary columns. R code doesn’t filter server already removed. Highly-sensitive PHI columns unnecessary analysis remain server.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"specify-record-ids","dir":"Articles","previous_headings":"Part 4 - Read Data: Choosing Columns and Rows","what":"Specify Record IDs","title":"Typical REDCap Workflow for a Data Analyst","text":"basic operation limit rows passing exact record identifiers.","code":"# Return only records with IDs of 1 and 4 desired_records <- c(1, 4) REDCapR::redcap_read(   redcap_uri  = credential$redcap_uri,   token       = credential$token,   records     = desired_records,   verbose     = FALSE )$data #> # A tibble: 2 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         4 Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02    61     0 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"specify-row-filter","dir":"Articles","previous_headings":"Part 4 - Read Data: Choosing Columns and Rows","what":"Specify Row Filter","title":"Typical REDCap Workflow for a Data Analyst","text":"useful operation limit rows passing expression filter records returning. See server’s documentation syntax rules filter statements. Remember enclose variable names square brackets. Also aware differences strings numbers.","code":"# Return only records with a birth date after January 2003 REDCapR::redcap_read(   redcap_uri    = credential$redcap_uri,   token         = credential$token,   filter_logic  = \"'2003-01-01' < [dob]\",   verbose       = FALSE )$data #> # A tibble: 2 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         2 Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10    11     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"specify-column-names","dir":"Articles","previous_headings":"Part 4 - Read Data: Choosing Columns and Rows","what":"Specify Column Names","title":"Typical REDCap Workflow for a Data Analyst","text":"Limit returned fields passing vector desired names.","code":"# Return only the fields record_id, name_first, and age desired_fields <- c(\"record_id\", \"name_first\", \"age\") REDCapR::redcap_read(   redcap_uri  = credential$redcap_uri,   token       = credential$token,   fields      = desired_fields,   verbose     = FALSE )$data #> # A tibble: 5 × 3 #>   record_id name_first   age #>       <dbl> <chr>      <dbl> #> 1         1 Nutmeg        11 #> 2         2 Tumtum        11 #> 3         3 Marcus        80 #> 4         4 Trudy         61 #> 5         5 John Lee      59"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"part-5---read-data-structured-approach","dir":"Articles","previous_headings":"","what":"Part 5 - Read Data: Structured Approach","title":"Typical REDCap Workflow for a Data Analyst","text":"automation scripts matures institutional resources depend output, output stable. One way make predictable specify column names column data types. previous example, notice R (specifically readr::read_csv()) made best guess reported “Column specification” section. following example, REDCapR passes col_types readr::read_csv() converts plain-text output returned REDCap R data frame. (precise, tibble returned.) readr sees column values like 1, 2, 3, 4, make reasonable guess column double precision floating-point data type. However recommend using simplest data type reasonable simpler data type less likely contain unintended values ’s typically faster, consumes less memory, translates cleanly across platforms. specifically identifiers like record_id specify either integer character.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"specify-column-names-types","dir":"Articles","previous_headings":"Part 5 - Read Data: Structured Approach","what":"Specify Column Names & Types","title":"Typical REDCap Workflow for a Data Analyst","text":"","code":"# Specify the column types. desired_fields <- c(\"record_id\", \"race\") col_types <- readr::cols(   record_id  = readr::col_integer(),   race___1   = readr::col_logical(),   race___2   = readr::col_logical(),   race___3   = readr::col_logical(),   race___4   = readr::col_logical(),   race___5   = readr::col_logical(),   race___6   = readr::col_logical() ) REDCapR::redcap_read(   redcap_uri  = credential$redcap_uri,   token       = credential$token,   fields      = desired_fields,   verbose     = FALSE,   col_types   = col_types )$data #> # A tibble: 5 × 7 #>   record_id race___1 race___2 race___3 race___4 race___5 race___6 #>       <int> <lgl>    <lgl>    <lgl>    <lgl>    <lgl>    <lgl>    #> 1         1 FALSE    FALSE    FALSE    FALSE    TRUE     FALSE    #> 2         2 FALSE    FALSE    TRUE     FALSE    TRUE     FALSE    #> 3         3 FALSE    FALSE    FALSE    TRUE     TRUE     FALSE    #> 4         4 FALSE    TRUE     FALSE    FALSE    TRUE     FALSE    #> 5         5 TRUE     FALSE    FALSE    FALSE    FALSE    TRUE"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"specify-everything-is-a-character","dir":"Articles","previous_headings":"Part 5 - Read Data: Structured Approach","what":"Specify Everything is a Character","title":"Typical REDCap Workflow for a Data Analyst","text":"REDCap internally stores every value string. accept full responsibility data types, tell readr::cols() keep strings.","code":"# Specify the column types. desired_fields <- c(\"record_id\", \"race\") col_types <- readr::cols(.default = readr::col_character()) REDCapR::redcap_read(   redcap_uri  = credential$redcap_uri,   token       = credential$token,   fields      = desired_fields,   verbose     = FALSE,   col_types   = col_types )$data #> # A tibble: 5 × 7 #>   record_id race___1 race___2 race___3 race___4 race___5 race___6 #>   <chr>     <chr>    <chr>    <chr>    <chr>    <chr>    <chr>    #> 1 1         0        0        0        0        1        0        #> 2 2         0        0        1        0        1        0        #> 3 3         0        0        0        1        1        0        #> 4 4         0        1        0        0        1        0        #> 5 5         1        0        0        0        0        1"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"other-redcapr-resources","dir":"Articles","previous_headings":"Part 6 - Next Steps","what":"Other REDCapR Resources","title":"Typical REDCap Workflow for a Data Analyst","text":"addition documentation function REDCapR package contains handful vignettes including troubleshooting guide.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"create-an-arch-for-reuse","dir":"Articles","previous_headings":"Part 6 - Next Steps","what":"Create an Arch for Reuse","title":"Typical REDCap Workflow for a Data Analyst","text":"multiple R files use REDCapR call REDCap dataset, consider refactoring scripts extraction code written , called multiple analysis files. “arch” pattern described slides 9-16 2014 REDCapCon presentation, Literate Programming Patterns Practices Continuous Quality Improvement (CQI).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"downstream-reproducible-reports","dir":"Articles","previous_headings":"Part 6 - Next Steps","what":"Downstream Reproducible Reports","title":"Typical REDCap Workflow for a Data Analyst","text":"dataset R, take advantage reproducible research tools available. Tomorrow, R/Medicine workshop topic using exciting new Quarto program ’s similar R Markdown. Also see relevant R/Medicine 2020 presentation videos. course, book Yihui Xie colleagues.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"batching","dir":"Articles","previous_headings":"Part 6 - Next Steps","what":"Batching","title":"Typical REDCap Workflow for a Data Analyst","text":"default, REDCapR::redcap_read() requests datasets 100 patients time, stacks resulting subsets together returning data.frame. can adjusted improve performance; ‘Details’ section REDCapR::redcap_read() discusses trade offs.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"writing-to-the-server","dir":"Articles","previous_headings":"Part 6 - Next Steps","what":"Writing to the Server","title":"Typical REDCap Workflow for a Data Analyst","text":"Reading record data one API capability. REDCapR exposes 20+ API functions, reading metadata, retrieving survey links, writing records back REDCap. last operation relevant Kenneth McLean’s presentation following five-minute break.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"notes","dir":"Articles","previous_headings":"","what":"Notes","title":"Typical REDCap Workflow for a Data Analyst","text":"vignette originally designed 2021 R/Medicine REDCap workshop Peter Higgins, Amanda Miller, Kenneth McLean. work made possible part NIH grant U54GM104938 Oklahoma Shared Clinical Translational Resource).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Typical REDCap Workflow for a Data Analyst","text":"sake documentation reproducibility, current report rendered following environment. Click line expand.","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #>  setting  value #>  version  R version 4.4.1 (2024-06-14) #>  os       macOS Sonoma 14.6.1 #>  system   aarch64, darwin20 #>  ui       X11 #>  language en #>  collate  en_US.UTF-8 #>  ctype    en_US.UTF-8 #>  tz       UTC #>  date     2024-09-07 #>  pandoc   3.1.11 @ /usr/local/bin/ (via rmarkdown) #>  #> ─ Packages ─────────────────────────────────────────────────────────────────── #>  package     * version  date (UTC) lib source #>  backports     1.5.0    2024-05-23 [1] CRAN (R 4.4.0) #>  bit           4.0.5    2022-11-15 [1] CRAN (R 4.4.0) #>  bit64         4.0.5    2020-08-30 [1] CRAN (R 4.4.0) #>  bslib         0.8.0    2024-07-29 [1] CRAN (R 4.4.0) #>  cachem        1.1.0    2024-05-16 [1] CRAN (R 4.4.0) #>  checkmate     2.3.2    2024-07-29 [1] CRAN (R 4.4.0) #>  cli           3.6.3    2024-06-21 [1] CRAN (R 4.4.0) #>  crayon        1.5.3    2024-06-20 [1] CRAN (R 4.4.0) #>  curl          5.2.2    2024-08-26 [1] CRAN (R 4.4.1) #>  desc          1.4.3    2023-12-10 [1] CRAN (R 4.4.0) #>  digest        0.6.37   2024-08-19 [1] CRAN (R 4.4.1) #>  dplyr         1.1.4    2023-11-17 [1] CRAN (R 4.4.0) #>  evaluate      0.24.0   2024-06-10 [1] CRAN (R 4.4.0) #>  fansi         1.0.6    2023-12-08 [1] CRAN (R 4.4.0) #>  fastmap       1.2.0    2024-05-15 [1] CRAN (R 4.4.0) #>  fs            1.6.4    2024-04-25 [1] CRAN (R 4.4.0) #>  generics      0.1.3    2022-07-05 [1] CRAN (R 4.4.0) #>  glue          1.7.0    2024-01-09 [1] CRAN (R 4.4.0) #>  highr         0.11     2024-05-26 [1] CRAN (R 4.4.0) #>  hms           1.1.3    2023-03-21 [1] CRAN (R 4.4.0) #>  htmltools     0.5.8.1  2024-04-04 [1] CRAN (R 4.4.0) #>  httr          1.4.7    2023-08-15 [1] CRAN (R 4.4.0) #>  jquerylib     0.1.4    2021-04-26 [1] CRAN (R 4.4.0) #>  jsonlite      1.8.8    2023-12-04 [1] CRAN (R 4.4.0) #>  knitr         1.48     2024-07-07 [1] CRAN (R 4.4.0) #>  lifecycle     1.0.4    2023-11-07 [1] CRAN (R 4.4.0) #>  magrittr      2.0.3    2022-03-30 [1] CRAN (R 4.4.0) #>  pillar        1.9.0    2023-03-22 [1] CRAN (R 4.4.0) #>  pkgconfig     2.0.3    2019-09-22 [1] CRAN (R 4.4.0) #>  pkgdown       2.1.0    2024-07-06 [1] CRAN (R 4.4.0) #>  R6            2.5.1    2021-08-19 [1] CRAN (R 4.4.0) #>  ragg          1.3.2    2024-05-15 [1] CRAN (R 4.4.0) #>  readr         2.1.5    2024-01-10 [1] CRAN (R 4.4.0) #>  REDCapR       1.1.9007 2024-09-07 [1] local #>  rlang         1.1.4    2024-06-04 [1] CRAN (R 4.4.0) #>  rmarkdown     2.28     2024-08-17 [1] CRAN (R 4.4.0) #>  sass          0.4.9    2024-03-15 [1] CRAN (R 4.4.0) #>  sessioninfo   1.2.2    2021-12-06 [1] CRAN (R 4.4.0) #>  systemfonts   1.1.0    2024-05-15 [1] CRAN (R 4.4.0) #>  textshaping   0.4.0    2024-05-24 [1] CRAN (R 4.4.0) #>  tibble        3.2.1    2023-03-20 [1] CRAN (R 4.4.0) #>  tidyselect    1.2.1    2024-03-11 [1] CRAN (R 4.4.0) #>  tzdb          0.4.0    2023-05-12 [1] CRAN (R 4.4.0) #>  utf8          1.2.4    2023-10-22 [1] CRAN (R 4.4.0) #>  vctrs         0.6.5    2023-12-01 [1] CRAN (R 4.4.0) #>  vroom         1.6.5    2023-12-05 [1] CRAN (R 4.4.0) #>  withr         3.0.1    2024-07-31 [1] CRAN (R 4.4.0) #>  xfun          0.47     2024-08-17 [1] CRAN (R 4.4.0) #>  yaml          2.3.10   2024-07-26 [1] CRAN (R 4.4.0) #>  #>  [1] /Users/runner/work/_temp/Library #>  [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #>  #> ──────────────────────────────────────────────────────────────────────────────"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"strategy","dir":"Articles","previous_headings":"Part 1 - Intro","what":"Strategy","title":"Writing to a REDCap Project","text":"described Retrieving Longitudinal Repeating Structures vignette, best way read write data projects longitudinal/repeating elements break “block matrix” dataset individual datasets. rectangle coherent grain. Following strategy, ’ll write REDCap server two distinct steps: Upload patient-level instrument(s) Upload repeating instrument separately. actual upload phase pretty straight-forward –’s just call REDCapR::redcap_write(). vignette’s code prepares dataset upload run smoothly.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"pre-requisites","dir":"Articles","previous_headings":"Part 1 - Intro","what":"Pre-requisites","title":"Writing to a REDCap Project","text":"See Typical REDCap Workflow Data Analyst vignette Verify REDCapR installed Verify REDCap Access Review Codebook","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"retrieve-token","dir":"Articles","previous_headings":"Part 1 - Intro","what":"Retrieve Token","title":"Writing to a REDCap Project","text":"Please closely read Retrieve Protected Token section, important security implications. current vignette imports fake dataset REDCap, ’ll use token stored local file.","code":"# retrieve-credential path_credential <- system.file(\"misc/example.credentials\", package = \"REDCapR\") credential  <- REDCapR::retrieve_credential_local(   path_credential = path_credential,   project_id      = 3748 )  c(credential$redcap_uri, credential$token)"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"datasets-to-write-to-server","dir":"Articles","previous_headings":"Part 1 - Intro","what":"Datasets to Write to Server","title":"Writing to a REDCap Project","text":"keep vignette focused writing/importing/uploading server, ’ll start data needs written. example tables prepared Raymond Balise 2023 R/Medicine workshop, “Using REDCap R Rapidly Produce Biomedical Publications”. two tables, different granularity: ds_patient: row represents one patient, ds_daily: row represents one daily measurement per patient.","code":"# load-patient ds_patient <-   \"test-data/vignette-repeating-write/data-patient.rds\" |>   system.file(package = \"REDCapR\") |>   readr::read_rds()  ds_patient # load-repeating ds_daily <-   \"test-data/vignette-repeating-write/data-daily.rds\" |>   system.file(package = \"REDCapR\") |>   readr::read_rds()  ds_daily"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"part-2---write-data-one-row-per-patient","dir":"Articles","previous_headings":"","what":"Part 2 - Write Data: One row per patient","title":"Writing to a REDCap Project","text":"Besides data.frame write REDCap, required arguments REDCapR::redcap_write() function redcap_uri token; contained credential object created previous section. discussed Troubleshooting vignette, recommend running two preliminary checks trying write dataset server first time.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"prep-stoplight-fields","dir":"Articles","previous_headings":"Part 2 - Write Data: One row per patient","what":"Prep: Stoplight Fields","title":"Writing to a REDCap Project","text":"REDCap project isn’t longitudinal doesn’t arms, uploading patient-level data.frame REDCap doesn’t require adding variables. However typically populate *_complete variables communicate record’s status. row needs human add values inspect existing values consider marking instrument “incomplete” “unverified”; patient’s instrument record appear red yellow REDCap’s Record Dashboard. Otherwise consider marking instrument “complete” appear green. example project, patient-level instrument “enrollment”, corresponding variable enrollment_complete.","code":"# patient-complete ds_patient <-   ds_patient |>   dplyr::mutate(     enrollment_complete   = REDCapR::constant(\"form_complete\"),   )"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"prep-redcaprvalidate_for_write","dir":"Articles","previous_headings":"Part 2 - Write Data: One row per patient","what":"Prep: REDCapR::validate_for_write()","title":"Writing to a REDCap Project","text":"REDCapR::validate_for_write() inspects data frame anticipate potential problems writing REDCap’s API. tibble returned, one row per potential problem (suggestion avoid ). Ideally 0-row tibble returned. encounter problems can checked automation, please tell us issue. ’ll work incorporate new check REDCapR::validate_for_write(). dataset’s problems caught reaching server, solutions easier identify implement.","code":"REDCapR::validate_for_write(ds_patient, convert_logical_to_integer = TRUE)"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"prep-write-small-subset-first","dir":"Articles","previous_headings":"Part 2 - Write Data: One row per patient","what":"Prep: Write Small Subset First","title":"Writing to a REDCap Project","text":"first time complicated project, consider loading small subset rows columns. case, start three columns two rows.","code":"# patient-subset ds_patient |>   dplyr::select(              # First three columns     id_code,     date,     is_mobile,   ) |>   dplyr::slice(1:2) |>        # First two rows   REDCapR::redcap_write(     ds_to_write = _,     redcap_uri  = credential$redcap_uri,     token       = credential$token,     convert_logical_to_integer = TRUE   )"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"prep-recode-variables-where-necessary","dir":"Articles","previous_headings":"Part 2 - Write Data: One row per patient","what":"Prep: Recode Variables where Necessary","title":"Writing to a REDCap Project","text":"variables data.frame might represented differently REDCap. common transformation changing strings integers underlie radio buttons. Common approaches dplyr::case_match() using joining lookup tables (mappings expressed csv). ’s -line example dplyr::case_match().","code":"ds_patient <-   ds_patient |>   dplyr::mutate(     race =       dplyr::case_match(         race,         \"White\"                       ~  1L,         \"Black or African American\"   ~  2L,         \"Asian\"                       ~  3L,         \"Native American\"             ~  4L,         \"Pacific Islander\"            ~  5L,         \"Multiracial\"                 ~  6L,         \"Refused or don't know\"       ~  7L       )   )"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"write-entire-patient-level-table","dir":"Articles","previous_headings":"Part 2 - Write Data: One row per patient","what":"Write Entire Patient-level Table","title":"Writing to a REDCap Project","text":"small subset works, usually jump ahead try columns rows. larger table fails, split difference () smaller working example (b) larger failing example. See middle point (fewer rows /columns failing point) succeeds fails. repeat. “bisection” “binary search” debugging technique helpful many areas programming statistical modeling.","code":"# patient-entire ds_patient |>   REDCapR::redcap_write(     ds_to_write = _,     redcap_uri  = credential$redcap_uri,     token       = credential$token,     convert_logical_to_integer = TRUE   )"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"add-plumbing-variables","dir":"Articles","previous_headings":"Part 3 - Write Data: Repeating Instrument","what":"Add Plumbing Variables","title":"Writing to a REDCap Project","text":"stated vignette’s intro, structure dataset uploaded server must precise. uploading repeating instruments, several important columns: record_id: typically indicates patient’s id. (field can renamed project.) redcap_event_name: project longitudinal arms, indicates event. Otherwise, don’t need add variable. redcap_repeat_instrument: Indicates instrument/form repeating columns. redcap_repeat_instance: Typically sequential positive integer (e.g., 1, 2, 3, …) indicating order. combination variables needs unique. Please read Retrieving Longitudinal Repeating Structures vignette details variables meanings. need pass specific variables REDCap server understands hierarchical structure data points.","code":"# repeat-plumbing ds_daily <-   ds_daily |>   dplyr::group_by(id_code) |>   dplyr::mutate(     redcap_repeat_instrument  = \"daily\",     redcap_repeat_instance    = dplyr::row_number(da_date),     daily_complete            = REDCapR::constant(\"form_complete\"),   ) |>   dplyr::ungroup() |>   dplyr::select(     id_code,                        # Or `record_id`, if you didn't rename it     # redcap_event_name,            # If the project is longitudinal or has arms     redcap_repeat_instrument,       # The name of the repeating instrument/form     redcap_repeat_instance,         # The sequence of the repeating instrument     tidyselect::everything(),       # All columns not explicitly passed to `dplyr::select()`     daily_complete,                 # Indicates incomplete, unverified, or complete   )  # Check for potential problems.  (Remember zero rows are good.) REDCapR::validate_for_write(ds_daily, convert_logical_to_integer = TRUE)  ds_daily"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"writing-repeating-instrument-variables","dir":"Articles","previous_headings":"Part 3 - Write Data: Repeating Instrument","what":"Writing Repeating Instrument Variables","title":"Writing to a REDCap Project","text":"","code":"# daily-entire ds_daily |>   REDCapR::redcap_write(     ds_to_write = _,     redcap_uri  = credential$redcap_uri,     token       = credential$token,     convert_logical_to_integer = TRUE   )"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"more-complexity","dir":"Articles","previous_headings":"Part 4 - Next Steps","what":"More Complexity","title":"Writing to a REDCap Project","text":"vignette required two data.frames, complex projects sometimes need . example, repeating instrument data.frame writing step. Arms longitudinal events need considered .","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"batching","dir":"Articles","previous_headings":"Part 4 - Next Steps","what":"Batching","title":"Writing to a REDCap Project","text":"default, REDCapR::redcap_write() requests datasets 100 patients time, stacks resulting subsets together returning data.frame. can adjusted improve performance; ‘Details’ section REDCapR::redcap_write() discusses trade offs. usually shoot ~10 seconds per batch.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"manual-vs-api","dir":"Articles","previous_headings":"Part 4 - Next Steps","what":"Manual vs API","title":"Writing to a REDCap Project","text":"Manual downloading/uploading might make sense ’re operation . ever stop first time? trouble uploading, consider adding fake patients & measurements download csv. might reveal something didn’t anticipate. aware block matrix format (.e., everything jammed one rectangle.)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"redcaps-cdis","dir":"Articles","previous_headings":"Part 4 - Next Steps","what":"REDCap’s CDIS","title":"Writing to a REDCap Project","text":"Clinical Data Interoperability Services (CDIS) use FHIR move data institution’s EMR/EHR (eg, Epic, Cerner) REDCap. Research staff control patient records selected eligible. Conceptually ’s similar writing REDCap’s API, much bigger scale. Realistically, takes months get institution’s human layers. established, project populated EMR data much less development time –assuming desired data models corresponds FHIR endpoints.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"notes","dir":"Articles","previous_headings":"","what":"Notes","title":"Writing to a REDCap Project","text":"vignette originally designed 2023 R/Medicine workshop, Using REDCap R Rapidly Produce Biomedical Publications Cleaning Medical Data Raymond R. Balise, Belén Hervera, Daniel Maya, Anna Calderon, Tyler Bartholomew, Stephan Kadauke, João Pedro Carmezim Correia 2024 R/Medicine workshop, REDCap + R: Teaming Tidyverse, Stephan Kadauke. workshop slides 2023 2024. work made possible part NIH grant U54GM104938 Oklahoma Shared Clinical Translational Resource).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Writing to a REDCap Project","text":"sake documentation reproducibility, current report rendered following environment. Click line expand.","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #>  setting  value #>  version  R version 4.4.1 (2024-06-14) #>  os       macOS Sonoma 14.6.1 #>  system   aarch64, darwin20 #>  ui       X11 #>  language en #>  collate  en_US.UTF-8 #>  ctype    en_US.UTF-8 #>  tz       UTC #>  date     2024-09-07 #>  pandoc   3.1.11 @ /usr/local/bin/ (via rmarkdown) #>  #> ─ Packages ─────────────────────────────────────────────────────────────────── #>  package     * version date (UTC) lib source #>  bslib         0.8.0   2024-07-29 [1] CRAN (R 4.4.0) #>  cachem        1.1.0   2024-05-16 [1] CRAN (R 4.4.0) #>  cli           3.6.3   2024-06-21 [1] CRAN (R 4.4.0) #>  desc          1.4.3   2023-12-10 [1] CRAN (R 4.4.0) #>  digest        0.6.37  2024-08-19 [1] CRAN (R 4.4.1) #>  evaluate      0.24.0  2024-06-10 [1] CRAN (R 4.4.0) #>  fastmap       1.2.0   2024-05-15 [1] CRAN (R 4.4.0) #>  fs            1.6.4   2024-04-25 [1] CRAN (R 4.4.0) #>  highr         0.11    2024-05-26 [1] CRAN (R 4.4.0) #>  htmltools     0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0) #>  jquerylib     0.1.4   2021-04-26 [1] CRAN (R 4.4.0) #>  jsonlite      1.8.8   2023-12-04 [1] CRAN (R 4.4.0) #>  knitr         1.48    2024-07-07 [1] CRAN (R 4.4.0) #>  lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.4.0) #>  pkgdown       2.1.0   2024-07-06 [1] CRAN (R 4.4.0) #>  R6            2.5.1   2021-08-19 [1] CRAN (R 4.4.0) #>  ragg          1.3.2   2024-05-15 [1] CRAN (R 4.4.0) #>  rlang         1.1.4   2024-06-04 [1] CRAN (R 4.4.0) #>  rmarkdown     2.28    2024-08-17 [1] CRAN (R 4.4.0) #>  sass          0.4.9   2024-03-15 [1] CRAN (R 4.4.0) #>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.4.0) #>  systemfonts   1.1.0   2024-05-15 [1] CRAN (R 4.4.0) #>  textshaping   0.4.0   2024-05-24 [1] CRAN (R 4.4.0) #>  xfun          0.47    2024-08-17 [1] CRAN (R 4.4.0) #>  yaml          2.3.10  2024-07-26 [1] CRAN (R 4.4.0) #>  #>  [1] /Users/runner/work/_temp/Library #>  [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #>  #> ──────────────────────────────────────────────────────────────────────────────"},{"path":"https://ouhscbbmc.github.io/REDCapR/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Beasley. Author, maintainer. David Bard. Contributor. Thomas Wilson. Contributor. John J Aponte. Contributor. Rollie Parrish. Contributor. Benjamin Nutter. Contributor. Andrew Peters. Contributor. Hao Zhu. Contributor. Janosch Linkersdörfer. Contributor. Jonathan Mang. Contributor. Felix Torres. Contributor. Philip Chase. Contributor. Victor Castro. Contributor. Greg Botwin. Contributor. Stephan Kadauke. Contributor. Ezra Porter. Contributor. Matthew Schuelke. Contributor.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Beasley W (2024). REDCapR: Interaction R REDCap. R package version 1.1.9007, https://github.com/OuhscBbmc/REDCapR, https://www.ouhsc.edu/bbmc/, https://project-redcap.org, https://ouhscbbmc.github.io/REDCapR/.","code":"@Manual{,   title = {REDCapR: Interaction Between R and REDCap},   author = {Will Beasley},   year = {2024},   note = {R package version 1.1.9007, https://github.com/OuhscBbmc/REDCapR, https://www.ouhsc.edu/bbmc/, https://project-redcap.org},   url = {https://ouhscbbmc.github.io/REDCapR/}, }"},{"path":"https://ouhscbbmc.github.io/REDCapR/index.html","id":"redcapr-","dir":"","previous_headings":"","what":"Interaction Between R and REDCap","title":"Interaction Between R and REDCap","text":"’ve using R REDCap’s API since 2012 developed REDCapR. encapsulating functions package, replicating 50+ lines code contact REDCap robustly transform returned csv R data.frame; took twice much implement batching. can done one call redcap_read(): redcap_read() function also accepts values subsetting/filtering records fields. two examples; first selects portion rows, second selects portion columns. Documentation additional 20+ functions found ouhscbbmc.github.io/REDCapR/reference. REDCapR package includes SSL certificate retrieved httr::find_cert_bundle(). REDCap server’s identity always verified, unless setting overridden (alternative certificates can also provided). keep maintenance efforts manageable, package implements REDCap API functions requested. ’s feature help projects, please tell us new issue REDCapR’s GitHub repository. troubleshooting document helps diagnose issues API.","code":"ds <- redcap_read(redcap_uri=uri, token=token)$data # Return only records with IDs of 1 and 4 desired_records <- c(1, 4) ds_some_rows <- redcap_read(   redcap_uri   = uri,   token        = token,   records      = desired_records )$data  # Return only the fields record_id, name_first, and age desired_fields <- c(\"record_id\", \"name_first\", \"age\") ds_some_fields <- redcap_read(   redcap_uri  = uri,   token       = token,   fields      = desired_fields )$data"},{"path":"https://ouhscbbmc.github.io/REDCapR/index.html","id":"installation-and-documentation","dir":"","previous_headings":"","what":"Installation and Documentation","title":"Interaction Between R and REDCap","text":"release version can installed CRAN. development version can installed GitHub installing remotes package. ouhscbbmc.github.io/REDCapR site describes package functions, includes documents involving basic operations, advanced operations, token security, troubleshooting. Also checkout packages exist communicating REDCap, listed REDCap Tools directory.","code":"install.packages(\"REDCapR\") install.packages(\"remotes\") # Run this line if the 'remotes' package isn't installed already. remotes::install_github(\"OuhscBbmc/REDCapR\")"},{"path":"https://ouhscbbmc.github.io/REDCapR/index.html","id":"collaborative-development","dir":"","previous_headings":"","what":"Collaborative Development","title":"Interaction Between R and REDCap","text":"encourage input collaboration. ’re familiar GitHub R packages, feel free submit pull request. ’d like report bug make suggestion, please create GitHub issue; issues usually good place ask public questions . However, feel free email (wibeasley@hotmail.com). Please note project released Contributor Code Conduct; participating project agree abide terms. starting material described ./documentation--developers/ directory. ’d like thank following developers advice code contributions: Benjamin Nutter, Rollie Parrish, Scott Burns, John Aponte, Andrew Peters, Hao Zhu.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/index.html","id":"funders","dir":"","previous_headings":"","what":"Funders","title":"Interaction Between R and REDCap","text":"Much package developed support needs following projects. appreciate support. (far) primary developers REDCapR external evaluators Oklahoma’s MIECHV program. See preliminary CQI reports (many use REDCapR) https://ouhscbbmc.github.io/MReportingPublic/. OUHSC CCAN Independent Evaluation State Oklahoma Competitive Maternal, Infant, Early Childhood Home Visiting (MIECHV) Project. HRSA/ACF D89MC23154. David Bard, PI, OUHSC; 2011-2015. Independent Evaluation State OK MIECHV Evidence Based Home Visitation Project, NIH-sponsored collaboration OSDH. David Bard, PI, OUHSC; 2015-2017. OSDH ParentPRO Pilot Evaluation, federally-sponsored collaboration OSDH. David Bard, PI, OUHSC; 2015-2017. Title IV-E Waiver Project, HRSA/MCHB-sponsored collaboration OKDHS; David Bard, PI, OUHSC; 2014-2017. Integrative Analysis Longitudinal Studies Aging (IALSA), sponsored NIH 5P01AG043362. Scott Hofer, PI, University Victoria; Beasley, PI site-award, OUHSC; 2013-2018. Oklahoma Shared Clinical Translational Resources, sponsored NIH NIGMS; U54 GM104938. Judith . James, PI, OUHSC; 2013-2018. Oklahoma Shared Clinical Translational Resources, sponsored NIH U54GM104938; 2020-2021. Additional Institutional Support OUHSC Dept Pediatrics; 2013-2021. Thanks, Beasley, David Bard, & Thomas WilsonUniversity Oklahoma Health Sciences Center, Department Pediatrics, Biomedical & Behavioral Research Core.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/REDCapR-package.html","id":null,"dir":"Reference","previous_headings":"","what":"REDCapR: Interaction Between R and REDCap — REDCapR-package","title":"REDCapR: Interaction Between R and REDCap — REDCapR-package","text":"Encapsulates functions streamline calls R REDCap API. REDCap (Research Electronic Data CAPture) web application building managing online surveys databases developed Vanderbilt University. Application Programming Interface (API) offers avenue access modify data programmatically, improving capacity literate reproducible programming. Comprehensive documentation also available https://ouhscbbmc.github.io/REDCapR/. Much package developed support needs following projects.  appreciate support. OUHSC CCAN Independent Evaluation State Oklahoma Competitive Maternal, Infant, Early Childhood Home Visiting (MIECHV) Project. HRSA/ACF D89MC23154. David Bard, PI, OUHSC; 2011-2015. Independent Evaluation State OK MIECHV Evidence Based Home Visitation Project, NIH-sponsored collaboration OSDH. David Bard, PI, OUHSC; 2015-2017. OSDH ParentPRO Pilot Evaluation, federally-sponsored collaboration OSDH. David Bard, PI, OUHSC; 2015-2017. Title IV-E Waiver Project, HRSA/MCHB-sponsored collaboration OKDHS; David Bard, PI, OUHSC; 2014-2017. Integrative Analysis Longitudinal Studies Aging (IALSA), sponsored NIH 5P01AG043362. Scott Hofer, PI, University Victoria; Beasley, PI site-award, OUHSC; 2013-2018. Oklahoma Shared Clinical Translational Resources, sponsored NIH NIGMS; U54 GM104938. Judith . James, PI, OUHSC; 2013-2018. Additional Institutional Support OUHSC Dept Pediatrics; 2013-2017.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/REDCapR-package.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"REDCapR: Interaction Between R and REDCap — REDCapR-package","text":"release version available CRAN running install.packages('REDCapR').  recent development version available GitHub running remotes::install_github('OuhscBbmc/REDCapR') (make sure remotes already installed). trouble package, please install development version.  solve problem, please create new issue, email . See REDCapR's advanced vignette information examples overriding default SSL options.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/REDCapR-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"REDCapR: Interaction Between R and REDCap — REDCapR-package","text":"Maintainer: Beasley wibeasley@hotmail.com (ORCID) contributors: David Bard (ORCID) [contributor] Thomas Wilson [contributor] John J Aponte john.aponte@isglobal.org [contributor] Rollie Parrish rparrish@flightweb.com (ORCID) [contributor] Benjamin Nutter [contributor] Andrew Peters (ORCID) [contributor] Hao Zhu (ORCID) [contributor] Janosch Linkersdörfer (ORCID) [contributor] Jonathan Mang (ORCID) [contributor] Felix Torres fetorres@ucsd.edu [contributor] Philip Chase pbc@ufl.edu (ORCID) [contributor] Victor Castro vcastro@mgh.harvard.edu (ORCID) [contributor] Greg Botwin [contributor] Stephan Kadauke (ORCID) [contributor] Ezra Porter (ORCID) [contributor] Matthew Schuelke matt@themadstatter.com (ORCID) [contributor]","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/REDCapR-package.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"REDCapR: Interaction Between R and REDCap — REDCapR-package","text":"","code":"# \\dontrun{ # Install/update REDCapR with the release version from CRAN. # install.packages('REDCapR')  # Install/update REDCapR with the development version from GitHub # install.packages(\"remotes\") # Uncomment if `remotes` isn't installed already. # remotes::install_github('OuhscBbmc/REDCapR') # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Collapse a vector of values into a single string when necessary — collapse_vector","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"REDCap's API frequently specifies series values separated commas. R world, easier keep values separate elements vector. functions squashes together single character element (presumably right return value passed API)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"","code":"collapse_vector(elements)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"elements array values.  Can NULL.  Required.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"single character element, values separated commas.  Can blank. (.e., \"\").","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"","code":"library(REDCapR) # Load the package into the current R session. REDCapR:::collapse_vector(elements = NULL   ) #> [1] \"\" REDCapR:::collapse_vector(elements = letters) #> [1] \"a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":null,"dir":"Reference","previous_headings":"","what":"Collection of REDCap-specific constants — constant","title":"Collection of REDCap-specific constants — constant","text":"Collection constants defined REDCap developers.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collection of REDCap-specific constants — constant","text":"","code":"constant(name)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collection of REDCap-specific constants — constant","text":"name Name constant.  Required character.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collection of REDCap-specific constants — constant","text":"constant's value.  Currently single integers, expanded future.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Collection of REDCap-specific constants — constant","text":"Form Completeness current constants relate 'complete' variable end form. form_incomplete: 0L (.e., integer) form_unverified: 1L form_complete: 2L Export Rights See https://-server/redcap/api/help/?content=exp_users. data_export_rights_no_access    : 0L data_export_rights_deidentified : 1L data_export_rights_full         : 2L Form Rights See https://-server/redcap/api/help/?content=exp_users. order digits may unexpected. form_rights_no_access    : 0L form_rights_readonly     : 2L form_rights_edit_form    : 1L form_rights_edit_survey  : 3L Access Rights See https://-server/redcap/api/help/?content=exp_users. access_no    : 0L access_yes   : 1L add , please edit constant.R GitHub submit pull request.  instructions, please see Editing files another user's repository # nolint GitHub documentation.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Collection of REDCap-specific constants — constant","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collection of REDCap-specific constants — constant","text":"","code":"REDCapR::constant(\"form_incomplete\")  # Returns 0L #> [1] 0 REDCapR::constant(\"form_unverified\")  # Returns 1L #> [1] 1 REDCapR::constant(\"form_complete\"  )  # Returns 2L #> [1] 2  REDCapR::constant(\"data_export_rights_no_access\"   )  # Returns 0L #> [1] 0 REDCapR::constant(\"data_export_rights_deidentified\")  # Returns 1L #> [1] 1 REDCapR::constant(\"data_export_rights_full\"        )  # Returns 2L #> [1] 2  REDCapR::constant(\"form_rights_no_access\")   # Returns 0L #> [1] 0 REDCapR::constant(\"form_rights_readonly\" )   # Returns 2L --Notice the order #> [1] 2 REDCapR::constant(\"form_rights_edit_form\")   # Returns 1L #> [1] 1 REDCapR::constant(\"form_rights_edit_survey\") # Returns 3L #> [1] 3  REDCapR::constant(\"access_no\" )  # Returns 0L #> [1] 0 REDCapR::constant(\"access_yes\")  # Returns 1L #> [1] 1  REDCapR::constant(c(   \"form_complete\",   \"form_complete\",   \"form_incomplete\" )) # Returns c(2L, 2L, 0L) #> [1] 2 2 0 REDCapR::constant(c(   \"form_rights_no_access\",   \"form_rights_readonly\",   \"form_rights_edit_form\",   \"form_rights_edit_survey\" )) # Returns c(0L, 2L, 1L, 3L) #> [1] 0 2 1 3   constant_to_form_completion( c(0, 2, 1, 2, NA)) #> [1] incomplete complete   unverified complete   unknown    #> Levels: incomplete unverified complete unknown constant_to_form_rights(     c(0, 2, 1, 2, NA)) #> [1] no_access readonly  edit_form readonly  unknown   #> Levels: no_access readonly edit_form edit_survey unknown constant_to_export_rights(   c(0, 2, 1, 3, NA)) #> [1] no_access    rights_full  deidentified <NA>         unknown      #> Levels: no_access deidentified rights_full unknown constant_to_access(          c(0, 1, 1, 0, NA)) #> [1] no      yes     yes     no      unknown #> Levels: no yes unknown  # \\dontrun{ # The following line returns an error: #     Assertion on 'name' failed: Must be a subset of #     {'form_complete','form_incomplete','form_unverified'}, #     but is {'bad-name'}.  REDCapR::constant(\"bad-name\")    # Returns an error #> Error in REDCapR::constant(\"bad-name\"): Assertion on 'name' failed: Must be a subset of {'form_incomplete','form_unverified','form_complete','data_export_rights_no_access','data_export_rights_deidentified','data_export_rights_full','form_rights_no_access','form_rights_readonly','form_rights_edit_form','form_rights_edit_survey','access_no','access_yes'}, but has additional elements {'bad-name'}.  REDCapR::constant(c(\"form_complete\", \"bad-name\")) # Returns an error #> Error in REDCapR::constant(c(\"form_complete\", \"bad-name\")): Assertion on 'name' failed: Must be a subset of {'form_incomplete','form_unverified','form_complete','data_export_rights_no_access','data_export_rights_deidentified','data_export_rights_full','form_rights_no_access','form_rights_readonly','form_rights_edit_form','form_rights_edit_survey','access_no','access_yes'}, but has additional elements {'bad-name'}. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"function returns base::data.frame() functions use separate long-running read write REDCap calls multiple, smaller REDCap calls.  goal (1) reduce chance time-outs, (2) introduce little breaks batches server continually tied .","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"","code":"create_batch_glossary(row_count, batch_size)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"row_count number records large dataset, split. batch_size maximum number subject records single batch contain.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"Currently, base::data.frame() returned following columns, id: integer uniquely identifies batch, starting 1. start_index: index first row batch. integer. stop_index: index last row batch. integer. id_pretty: character representation id, padded zeros. start_index: character representation start_index, padded zeros. stop_index: character representation stop_index, padded zeros. label: character concatenation id_pretty, start_index, stop_index_pretty.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"function can also assist splitting saving large data frame disk smaller files (.csv).  padded columns allow OS sort batches/files sequential order.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"","code":"REDCapR::create_batch_glossary(100, 50) #> # A tibble: 2 × 7 #>      id start_index stop_index index_pretty start_index_pretty stop_index_pretty #>   <int>       <int>      <int> <chr>        <chr>              <chr>             #> 1     1           1         50 1            001                050               #> 2     2          51        100 2            051                100               #> # ℹ 1 more variable: label <chr> REDCapR::create_batch_glossary(100, 25) #> # A tibble: 4 × 7 #>      id start_index stop_index index_pretty start_index_pretty stop_index_pretty #>   <int>       <int>      <int> <chr>        <chr>              <chr>             #> 1     1           1         25 1            001                025               #> 2     2          26         50 2            026                050               #> 3     3          51         75 3            051                075               #> 4     4          76        100 4            076                100               #> # ℹ 1 more variable: label <chr> REDCapR::create_batch_glossary(100,  3) #> # A tibble: 34 × 7 #>       id start_index stop_index index_pretty start_index_pretty #>    <int>       <int>      <int> <chr>        <chr>              #>  1     1           1          3 01           001                #>  2     2           4          6 02           004                #>  3     3           7          9 03           007                #>  4     4          10         12 04           010                #>  5     5          13         15 05           013                #>  6     6          16         18 06           016                #>  7     7          19         21 07           019                #>  8     8          22         24 08           022                #>  9     9          25         27 09           025                #> 10    10          28         30 10           028                #> # ℹ 24 more rows #> # ℹ 2 more variables: stop_index_pretty <chr>, label <chr> REDCapR::create_batch_glossary(  0,  3) #> # A tibble: 0 × 7 #> # ℹ 7 variables: id <int>, start_index <int>, stop_index <int>, #> #   index_pretty <chr>, start_index_pretty <chr>, stop_index_pretty <chr>, #> #   label <chr> d <- data.frame(   record_id = 1:100,   iv        = sample(x=4, size=100, replace=TRUE),   dv        = rnorm(n=100) ) REDCapR::create_batch_glossary(nrow(d), batch_size=40) #> # A tibble: 3 × 7 #>      id start_index stop_index index_pretty start_index_pretty stop_index_pretty #>   <int>       <int>      <int> <chr>        <chr>              <chr>             #> 1     1           1         40 1            001                040               #> 2     2          41         80 2            041                080               #> 3     3          81        100 3            081                100               #> # ℹ 1 more variable: label <chr>"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":null,"dir":"Reference","previous_headings":"","what":"REDCapR internal function for calling the REDCap API — kernel_api","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"function used functions read write values.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"","code":"kernel_api(   redcap_uri,   post_body,   config_options,   encoding = \"UTF-8\",   content_type = \"text/csv\",   handle_httr = NULL,   encode_httr = \"form\" )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. post_body List contents expected REDCap API.  Required. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. encoding encoding value passed httr::content().  Defaults 'UTF-8'. content_type MIME value passed httr::content().  Defaults 'text/csv'. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions. encode_httr value passed encode parameter httr::POST(). Defaults \"form\", appropriate actions. (Currently, exception importing file, uses \"multipart\".)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"utils::packageVersion.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"API call unsuccessful, value base::package_version(\"0.0.0\") returned.  ensures function always return object class base::package_version. guarantees value can always used utils::compareVersion().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"","code":"config_options <- NULL uri            <- \"https://bbmc.ouhsc.edu/redcap/api/\" token          <- \"9A81268476645C4E5F03428B8AC3AA7B\" post_body      <- list(   token    = token,   content  = \"project\",   format   = \"csv\" ) # \\dontrun{ kernel <- REDCapR:::kernel_api(uri, post_body, config_options)  # Consume the results in a few different ways. kernel$result #> Response [https://bbmc.ouhsc.edu/redcap/api/] #>   Date: 2024-09-07 01:06 #>   Status: 200 #>   Content-Type: text/csv; charset=utf-8 #>   Size: 717 B #> project_id,project_title,creation_time,production_time,in_production,project_... #> 153,\"REDCapR Target Simple Static -see https://github.com/OuhscBbmc/REDCapR\",... read.csv(text = kernel$raw_text) #>   project_id #> 1        153 #>                                                            project_title #> 1 REDCapR Target Simple Static -see https://github.com/OuhscBbmc/REDCapR #>         creation_time production_time in_production project_language purpose #> 1 2013-11-29 15:58:20              NA             0          English       0 #>   purpose_other project_notes custom_record_label secondary_unique_field #> 1            NA            NA                  NA                     NA #>   is_longitudinal has_repeating_instruments_or_events surveys_enabled #> 1               0                                   0               0 #>   scheduling_enabled record_autonumbering_enabled randomization_enabled #> 1                  0                            1                     0 #>   ddp_enabled project_irb_number project_grant_number project_pi_firstname #> 1           0                 NA                   NA                   NA #>   project_pi_lastname display_today_now_button missing_data_codes #> 1                  NA                        1                 NA #>                                                                     external_modules #> 1 cross_project_piping,form_status_tweaks,redcap_autofill,data_driven_project_banner #>   bypass_branching_erase_field_prompt #> 1                                   0 as.list(read.csv(text = kernel$raw_text)) #> $project_id #> [1] 153 #>  #> $project_title #> [1] \"REDCapR Target Simple Static -see https://github.com/OuhscBbmc/REDCapR\" #>  #> $creation_time #> [1] \"2013-11-29 15:58:20\" #>  #> $production_time #> [1] NA #>  #> $in_production #> [1] 0 #>  #> $project_language #> [1] \"English\" #>  #> $purpose #> [1] 0 #>  #> $purpose_other #> [1] NA #>  #> $project_notes #> [1] NA #>  #> $custom_record_label #> [1] NA #>  #> $secondary_unique_field #> [1] NA #>  #> $is_longitudinal #> [1] 0 #>  #> $has_repeating_instruments_or_events #> [1] 0 #>  #> $surveys_enabled #> [1] 0 #>  #> $scheduling_enabled #> [1] 0 #>  #> $record_autonumbering_enabled #> [1] 1 #>  #> $randomization_enabled #> [1] 0 #>  #> $ddp_enabled #> [1] 0 #>  #> $project_irb_number #> [1] NA #>  #> $project_grant_number #> [1] NA #>  #> $project_pi_firstname #> [1] NA #>  #> $project_pi_lastname #> [1] NA #>  #> $display_today_now_button #> [1] 1 #>  #> $missing_data_codes #> [1] NA #>  #> $external_modules #> [1] \"cross_project_piping,form_status_tweaks,redcap_autofill,data_driven_project_banner\" #>  #> $bypass_branching_erase_field_prompt #> [1] 0 #>  # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":null,"dir":"Reference","previous_headings":"","what":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"collection functions assists handling REDCap project metadata.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"","code":"regex_named_captures(pattern, text, perl = TRUE)  checkbox_choices(select_choices)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"pattern regular expression pattern.  Required. text text apply regex .  Required. perl Indicates perl-compatible regexps used. Default TRUE. Optional. select_choices text containing choices parsed determine id label values.  Required.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"Currently, tibble::tibble() returned row match, column named group within match.  retrieve_checkbox_choices() function, columns . id: numeric value assigned choice (data dictionary). label: label assigned choice (data dictionary).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"regex_named_captures() function general, specific REDCap; accepts arbitrary regular expression. returns tibble::tibble() many columns named matches. checkbox_choices() function specialized, accommodates \"select choices\" single REDCap checkbox group (multiple boxes can selected).  returns tibble::tibble() two columns, one numeric id one text label. parse probably fail label contains pipe (.e., |), since delimiter REDCap uses separate choices presented user.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"See official documentation permissible characters checkbox label. bluffing , know located. know, please tell .","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"","code":"# The weird ranges are to avoid the pipe character; #   PCRE doesn't support character negation. pattern_boxes <- \"(?<=\\\\A| \\\\| )(?<id>\\\\d{1,}), (?<label>[\\x20-\\x7B\\x7D-\\x7E]{1,})(?= \\\\| |\\\\Z)\"  choices_1 <- paste0(   \"1, American Indian/Alaska Native | \",   \"2, Asian | \",   \"3, Native Hawaiian or Other Pacific Islander | \",   \"4, Black or African American | \",   \"5, White | \",   \"6, Unknown / Not Reported\" )  # This calls the general function, and requires the correct regex pattern. REDCapR::regex_named_captures(pattern=pattern_boxes, text=choices_1) #> # A tibble: 6 × 2 #>   id    label                                     #>   <chr> <chr>                                     #> 1 1     American Indian/Alaska Native             #> 2 2     Asian                                     #> 3 3     Native Hawaiian or Other Pacific Islander #> 4 4     Black or African American                 #> 5 5     White                                     #> 6 6     Unknown / Not Reported                     # This function is designed specifically for the checkbox values. REDCapR::checkbox_choices(select_choices=choices_1) #> # A tibble: 6 × 2 #>   id    label                                     #>   <chr> <chr>                                     #> 1 1     American Indian/Alaska Native             #> 2 2     Asian                                     #> 3 3     Native Hawaiian or Other Pacific Islander #> 4 4     Black or African American                 #> 5 5     White                                     #> 6 6     Unknown / Not Reported                     # \\dontrun{ uri         <- \"https://bbmc.ouhsc.edu/redcap/api/\" token       <- \"9A81268476645C4E5F03428B8AC3AA7B\"  ds_metadata <- redcap_metadata_read(uri, token)$data #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. choices_2   <- ds_metadata[ds_metadata$field_name == \"race\", ]$select_choices_or_calculations  REDCapR::regex_named_captures(pattern = pattern_boxes, text = choices_2) #> # A tibble: 6 × 2 #>   id    label                                     #>   <chr> <chr>                                     #> 1 1     American Indian/Alaska Native             #> 2 2     Asian                                     #> 3 3     Native Hawaiian or Other Pacific Islander #> 4 4     Black or African American                 #> 5 5     White                                     #> 6 6     Unknown / Not Reported                    # }  path_3     <- system.file(package = \"REDCapR\", \"test-data/project-simple/metadata.csv\") ds_metadata_3  <- read.csv(path_3) choices_3  <- ds_metadata_3[ds_metadata_3$field_name==\"race\", \"select_choices_or_calculations\"] REDCapR::regex_named_captures(pattern = pattern_boxes, text = choices_3) #> # A tibble: 6 × 2 #>   id    label                                     #>   <chr> <chr>                                     #> 1 1     American Indian/Alaska Native             #> 2 2     Asian                                     #> 3 3     Native Hawaiian or Other Pacific Islander #> 4 4     Black or African American                 #> 5 5     White                                     #> 6 6     Unknown / Not Reported"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":null,"dir":"Reference","previous_headings":"","what":"Export Arms — redcap_arm_export","title":"Export Arms — redcap_arm_export","text":"Export Arms REDCap project","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export Arms — redcap_arm_export","text":"","code":"redcap_arm_export(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export Arms — redcap_arm_export","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export Arms — redcap_arm_export","text":"Currently, list returned following elements: has_arms: logical value indicating REDCap project arms (.e., \"TRUE\") classic non-longitudinal project (.e., \"FALSE\"). data: tibble::tibble() one row per arm.  columns arm_number (integer) arm_name (human-friendly string). success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Export Arms — redcap_arm_export","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export Arms — redcap_arm_export","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export Arms — redcap_arm_export","text":"","code":"# \\dontrun{ uri            <- \"https://bbmc.ouhsc.edu/redcap/api/\"  # Query a classic project with 3 arms token_1  <- \"CDF9F3767E413FDBAA31D92E9F36730A\" result_1 <- REDCapR::redcap_arm_export(redcap_uri=uri, token=token_1) #> The list of arms was retrieved from the REDCap project in 0.2 seconds. The http status code was 200. result_1$has_arms #> [1] TRUE result_1$data #> # A tibble: 3 × 2 #>   arm_number arm_name #>        <int> <chr>    #> 1          1 Arm 1    #> 2          2 Arm 2    #> 3          3 Arm 3     # Query a classic project without arms token_2  <- \"D70F9ACD1EDD6F151C6EA78683944E98\" result_2 <- REDCapR::redcap_arm_export(redcap_uri=uri, token=token_2) #> A 'classic' REDCap project has no arms.  Retrieved in 0.2 seconds. The http status code was 400. result_2$has_arms #> [1] FALSE result_2$data #> # A tibble: 0 × 2 #> # ℹ 2 variables: arm_number <int>, arm_name <chr> # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":null,"dir":"Reference","previous_headings":"","what":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"Replace non-ASCII characters legal characters cause problems writing REDCap project.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"","code":"redcap_column_sanitize(   d,   column_names = colnames(d),   encoding_initial = \"latin1\",   substitution_character = \"?\" )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"d base::data.frame() tibble::tibble() containing dataset used update REDCap project.  Required. column_names array character values indicating names variables sanitize.  Optional. encoding_initial array character values indicating names variables sanitize.  Optional. substitution_character character value replaces characters unable appropriately matched.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"data frame columns, whose character values sanitized.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"Letters like accented '' replaced plain ''. thin wrapper around base::iconv(). ASCII//TRANSLIT option actual transliteration work.  R 3.1.0, OSes use similar, different, versions convert characters.  aware case notice OS-dependent differences.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"","code":"# Typical examples are not shown because they require non-ASCII encoding, #   which makes the package documentation less portable.  dirty <- data.frame(   id     = 1:3,   names  = c(\"Ekstr\\xf8m\", \"J\\xf6reskog\", \"bi\\xdfchen Z\\xfcrcher\") )  REDCapR::redcap_column_sanitize(dirty) #>   id             names #> 1  1           Ekstrom #> 2  2         J\"oreskog #> 3  3 bisschen Z\"urcher"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Read data access groups from a REDCap project — redcap_dag_read","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"function reads available data access groups REDCap returns tibble::tibble().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"","code":"redcap_dag_read(   redcap_uri,   token,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"Currently, list returned following elements: data: tibble::tibble() data access groups project. success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"Jonathan M. Mang","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"","code":"# \\dontrun{ uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"9A81268476645C4E5F03428B8AC3AA7B\" REDCapR::redcap_dag_read(redcap_uri=uri, token=token)$data #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 2 × 3 #>   data_access_group_name unique_group_name data_access_group_id #>   <chr>                  <chr>                            <dbl> #> 1 dag_1                  dag_1                               36 #> 2 dag_2                  dag_2                               37 # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":null,"dir":"Reference","previous_headings":"","what":"Delete records in a REDCap project — redcap_delete","title":"Delete records in a REDCap project — redcap_delete","text":"Delete existing records ID REDCap.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Delete records in a REDCap project — redcap_delete","text":"","code":"redcap_delete(   redcap_uri,   token,   records_to_delete,   arm_of_records_to_delete = NULL,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Delete records in a REDCap project — redcap_delete","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. records_to_delete character vector project's record_id values delete.  Required. arm_of_records_to_delete single integer reflecting arm containing records deleted.  Leave NULL project arms longitudinal. Required REDCap project arms.  See Details . verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Delete records in a REDCap project — redcap_delete","text":"Currently, list returned following elements: success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_affected_count: number records inserted updated. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Delete records in a REDCap project — redcap_delete","text":"REDCap requires least one record_id value passed delete call. project arms, REDCapR stricter requirements REDCap. REDCap project arms, value must passed arm_of_records_to_delete.  different behavior calling server cURL – arm number specified, arms cleared specified record_ids. Note longitudinal projects technically arms, even one arm defined.  Therefore value arm_number must specified longitudinal projects.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Delete records in a REDCap project — redcap_delete","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Delete records in a REDCap project — redcap_delete","text":"Jonathan Mang, Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Delete records in a REDCap project — redcap_delete","text":"","code":"if (FALSE) { records_to_delete <- c(102, 103, 105, 120)  # Deleting from a non-longitudinal project with no defined arms: REDCapR::redcap_delete(   redcap_uri               = uri,   token                    = token,   records_to_delete        = records_to_delete, )  # Deleting from a project that has arms or is longitudinal: arm_number <- 2L # Not the arm name REDCapR::redcap_delete(   redcap_uri               = uri,   token                    = token,   records_to_delete        = records_to_delete,   arm_of_records_to_delete = arm_number ) }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":null,"dir":"Reference","previous_headings":"","what":"Enumerate the instruments to event mappings — redcap_event_instruments","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"Export instrument-event mappings project (.e., data collection instruments designated certain events longitudinal project). (Copied \"Export Instrument-Event Mappings\" method REDCap API documentation, v.10.5.1)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"","code":"redcap_event_instruments(   redcap_uri,   token,   arms = NULL,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. arms character string arms retrieve. Defaults arms project. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"Currently, list returned following elements, data: tibble::tibble() row represents one column REDCap dataset. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"Victor Castro, Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"","code":"# \\dontrun{ uri                 <- \"https://bbmc.ouhsc.edu/redcap/api/\"  # Longitudinal project with one arm token_1  <- \"786334BEB4A87D572DD0E99C4BFCE144\" # pid 2629 REDCapR::redcap_arm_export(redcap_uri=uri, token=token_1)$data #> The list of arms was retrieved from the REDCap project in 0.2 seconds. The http status code was 200. #> # A tibble: 1 × 2 #>   arm_number arm_name #>        <int> <chr>    #> 1          1 Arm 1    REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_1)$data #> 3 event instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 3 × 3 #>   arm_num unique_event_name form       #>     <int> <chr>             <chr>      #> 1       1 intake_arm_1      collection #> 2       1 dischage_arm_1    collection #> 3       1 follow_up_arm_1   collection  # Project with two arms token_2  <- \"0434F0E9CF53ED0587847AB6E51DE762\" # pid 212 REDCapR::redcap_arm_export(redcap_uri=uri, token=token_2)$data #> The list of arms was retrieved from the REDCap project in 0.2 seconds. The http status code was 200. #> # A tibble: 2 × 2 #>   arm_number arm_name #>        <int> <chr>    #> 1          1 Drug A   #> 2          2 Drug B   REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_2)$data #> 25 event instrument metadata records were read from REDCap in 0.3 seconds.  The http status code was 200. #> # A tibble: 25 × 3 #>    arm_num unique_event_name form                         #>      <int> <chr>             <chr>                        #>  1       1 enrollment_arm_1  demographics                 #>  2       1 enrollment_arm_1  contact_info                 #>  3       1 enrollment_arm_1  baseline_data                #>  4       1 dose_1_arm_1      patient_morale_questionnaire #>  5       1 visit_1_arm_1     visit_lab_data               #>  6       1 visit_1_arm_1     patient_morale_questionnaire #>  7       1 visit_1_arm_1     visit_blood_workup           #>  8       1 visit_1_arm_1     visit_observed_behavior      #>  9       1 dose_2_arm_1      patient_morale_questionnaire #> 10       1 visit_2_arm_1     visit_lab_data               #> # ℹ 15 more rows REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_2, arms = c(\"1\", \"2\"))$data #> 25 event instrument metadata records were read from REDCap in 0.3 seconds.  The http status code was 200. #> # A tibble: 25 × 3 #>    arm_num unique_event_name form                         #>      <int> <chr>             <chr>                        #>  1       1 enrollment_arm_1  demographics                 #>  2       1 enrollment_arm_1  contact_info                 #>  3       1 enrollment_arm_1  baseline_data                #>  4       1 dose_1_arm_1      patient_morale_questionnaire #>  5       1 visit_1_arm_1     visit_lab_data               #>  6       1 visit_1_arm_1     patient_morale_questionnaire #>  7       1 visit_1_arm_1     visit_blood_workup           #>  8       1 visit_1_arm_1     visit_observed_behavior      #>  9       1 dose_2_arm_1      patient_morale_questionnaire #> 10       1 visit_2_arm_1     visit_lab_data               #> # ℹ 15 more rows REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_2, arms = \"2\")$data #> 10 event instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 10 × 3 #>    arm_num unique_event_name        form                             #>      <int> <chr>                    <chr>                            #>  1       2 enrollment_arm_2         demographics                     #>  2       2 enrollment_arm_2         contact_info                     #>  3       2 enrollment_arm_2         baseline_data                    #>  4       2 deadline_to_opt_ou_arm_2 contact_info                     #>  5       2 first_dose_arm_2         patient_morale_questionnaire     #>  6       2 first_visit_arm_2        patient_morale_questionnaire     #>  7       2 first_visit_arm_2        visit_observed_behavior          #>  8       2 final_visit_arm_2        visit_observed_behavior          #>  9       2 final_visit_arm_2        completion_project_questionnaire #> 10       2 deadline_to_return_arm_2 contact_info                      # Classic project (without arms) throws an error token_3  <- \"9A81268476645C4E5F03428B8AC3AA7B\" # pid 153 REDCapR::redcap_arm_export(redcap_uri=uri, token=token_3)$data #> A 'classic' REDCap project has no arms.  Retrieved in 0.2 seconds. The http status code was 400. #> # A tibble: 0 × 2 #> # ℹ 2 variables: arm_number <int>, arm_name <chr> # REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_3)$data # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Export Events — redcap_event_read","title":"Export Events — redcap_event_read","text":"Export Events REDCap project","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export Events — redcap_event_read","text":"","code":"redcap_event_read(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export Events — redcap_event_read","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export Events — redcap_event_read","text":"Currently, list returned following elements: data: tibble::tibble() one row per arm-event combination.  columns event_name (human-friendly string), arm_num (integer), unique_event_name (string), custom_event_label (string), event_id (integer). success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Export Events — redcap_event_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export Events — redcap_event_read","text":"Ezra Porter, Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export Events — redcap_event_read","text":"","code":"# \\dontrun{ uri            <- \"https://bbmc.ouhsc.edu/redcap/api/\"  # Query a longitudinal project with a single arm and 3 events token_1  <- \"786334BEB4A87D572DD0E99C4BFCE144\" result_1 <- REDCapR::redcap_event_read(redcap_uri=uri, token=token_1) #> The list of events was retrieved from the REDCap project in 0.2 seconds. The http status code was 200. result_1$data #> # A tibble: 3 × 5 #>   event_name arm_num unique_event_name custom_event_label event_id #>   <chr>        <int> <chr>             <chr>                 <int> #> 1 Intake           1 intake_arm_1      NA                    12357 #> 2 Dischage         1 dischage_arm_1    NA                    12358 #> 3 Follow up        1 follow_up_arm_1   NA                    12359  # Query a longitudinal project with 2 arms and complex arm-event mappings token_2  <- \"0434F0E9CF53ED0587847AB6E51DE762\" result_2 <- REDCapR::redcap_event_read(redcap_uri=uri, token=token_2) #> The list of events was retrieved from the REDCap project in 0.2 seconds. The http status code was 200. result_2$data #> # A tibble: 12 × 5 #>    event_name              arm_num unique_event_name custom_event_label event_id #>    <chr>                     <int> <chr>             <chr>                 <int> #>  1 Enrollment                    1 enrollment_arm_1  NA                     2888 #>  2 Dose 1                        1 dose_1_arm_1      NA                     2889 #>  3 Visit 1                       1 visit_1_arm_1     NA                     2890 #>  4 Dose 2                        1 dose_2_arm_1      NA                     2891 #>  5 Visit 2                       1 visit_2_arm_1     NA                     2892 #>  6 Final visit                   1 final_visit_arm_1 NA                     2895 #>  7 Enrollment                    2 enrollment_arm_2  NA                     2896 #>  8 Deadline to opt out of…       2 deadline_to_opt_… NA                     2897 #>  9 First dose                    2 first_dose_arm_2  NA                     2898 #> 10 First visit                   2 first_visit_arm_2 NA                     2899 #> 11 Final visit                   2 final_visit_arm_2 NA                     2902 #> 12 Deadline to return fee…       2 deadline_to_retu… NA                     2903  # Query a classic project without events token_3  <- \"D70F9ACD1EDD6F151C6EA78683944E98\" result_3 <- REDCapR::redcap_event_read(redcap_uri=uri, token=token_3) #> A 'classic' REDCap project has no events.  Retrieved in 0.2 seconds. The http status code was 400. result_3$data #> # A tibble: 0 × 5 #> # ℹ 5 variables: event_name <chr>, arm_num <int>, unique_event_name <chr>, #> #   custom_event_label <chr>, event_id <int> # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Download a file from a REDCap project record — redcap_file_download_oneshot","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"function uses REDCap's API download file.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"","code":"redcap_file_download_oneshot(   file_name = NULL,   directory = NULL,   overwrite = FALSE,   redcap_uri,   token,   record,   field,   event = \"\",   repeat_instance = NULL,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"file_name name file downloaded file saved. empty original name file used saved default directory.  Optional. directory directory file saved. default current directory. Optional overwrite Boolean value indicating existing files overwritten. Optional redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. record record ID file imported. Required field name field file saved REDCap. Required event name event file saved REDCap. Optional repeat_instance (projects repeating instruments/events) repeat instance number repeating event (longitudinal) repeating instrument (classic longitudinal). Default value '1'. Optional verbose boolean value indicating messages printed R console operation.  Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"Currently, list returned following elements, success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_affected_count: number records inserted updated. affected_ids: subject IDs inserted updated records. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM. file_name: name file persisted disk. useful name stored REDCap used (default).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"files repeating instrument, specify repeating_instrument. server needs field (name) repeating_instance. function redcap_download_file_oneshot() soft-deprecated REDCapR 1.2.0. Please rename redcap_file_download_oneshot().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"Beasley, John J. Aponte","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"","code":"# \\dontrun{ uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"D70F9ACD1EDD6F151C6EA78683944E98\" # pid=213 record  <- 1 field   <- \"mugshot\" # event <- \"\" # only for longitudinal projects  result_1 <- REDCapR::redcap_file_download_oneshot(   record        = record,   field         = field,   redcap_uri    = uri,   token         = token ) #> Preparing to download the file `mugshot-1.jpg`. #> image/jpeg; name=\"mugshot-1.jpg\" successfully downloaded in 0.9 seconds, and saved as mugshot-1.jpg. base::unlink(\"mugshot-1.jpg\")  (full_name <- base::tempfile(pattern=\"mugshot\", fileext = \".jpg\")) #> [1] \"/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/mugshotdd5dfbd104.jpg\" result_2   <- REDCapR::redcap_file_download_oneshot(   file_name     = full_name,   record        = record,   field         = field,   redcap_uri    = uri,   token         = token ) #> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/mugshotdd5dfbd104.jpg`. #> image/jpeg; name=\"mugshot-1.jpg\" successfully downloaded in 0.3 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/mugshotdd5dfbd104.jpg. base::unlink(full_name)  (relative_name <- \"ssss.jpg\") #> [1] \"ssss.jpg\" result_3 <- REDCapR::redcap_file_download_oneshot(   file_name    = relative_name,   record       = record,   field        = field,   redcap_uri   = uri,   token        = token ) #> Preparing to download the file `ssss.jpg`. #> image/jpeg; name=\"mugshot-1.jpg\" successfully downloaded in 0.5 seconds, and saved as ssss.jpg. base::unlink(relative_name) # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"function uses REDCap's API upload file.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"","code":"redcap_file_upload_oneshot(   file_name,   record,   redcap_uri,   token,   field,   event = \"\",   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"file_name name relative full file uploaded REDCap project.  Required. record record ID file imported.  Required redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. field name field file saved REDCap. Required event name event file saved REDCap. Optional verbose boolean value indicating messages printed R console operation.  Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"Currently, list returned following elements: success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_affected_count: number records inserted updated. affected_ids: subject IDs inserted updated records. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"Currently, function modify variable types conform REDCap's supported variables.  See validate_for_write() helper function checks common important conflicts. function redcap_upload_file_oneshot() soft-deprecated REDCapR 1.2.0. Please rename redcap_file_upload_oneshot().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (ie, https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"Beasley, John J. Aponte","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"","code":"# \\dontrun{ # Define some constants uri    <- \"https://bbmc.ouhsc.edu/redcap/api/\" token  <- \"D70F9ACD1EDD6F151C6EA78683944E98\" # The simple project -pid 213 field  <- \"mugshot\" event  <- \"\" # only for longitudinal events  # Upload a single image file. record    <- 1 file_path <- system.file(\"test-data/mugshot-1.jpg\", package = \"REDCapR\")  REDCapR::redcap_file_upload_oneshot(   file_name  = file_path,   record     = record,   field      = field,   redcap_uri = redcap_uri,   token      = token ) #> Error in eval(expr, envir, enclos): object 'redcap_uri' not found  # Upload a collection of five images. records    <- 1:5 file_paths <- system.file(   paste0(\"test-data/mugshot-\", records, \".jpg\"),   package=\"REDCapR\" )  for (i in seq_along(records)) {   record    <- records[i]   file_path <- file_paths[i]   REDCapR::redcap_file_upload_oneshot(     file_name  = file_path,     record     = record,     field      = field,     redcap_uri = redcap_uri,     token      = token   ) } #> Error in eval(expr, envir, enclos): object 'redcap_uri' not found # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":null,"dir":"Reference","previous_headings":"","what":"Download REDCap Instruments — redcap_instrument_download","title":"Download REDCap Instruments — redcap_instrument_download","text":"Download instruments pdf, without responses.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download REDCap Instruments — redcap_instrument_download","text":"","code":"redcap_instrument_download(   file_name = NULL,   directory = NULL,   overwrite = FALSE,   redcap_uri,   token,   record = character(0),   instrument = \"\",   event = \"\",   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download REDCap Instruments — redcap_instrument_download","text":"file_name name file downloaded pdf saved. Optional. directory directory file saved. default current directory. Optional. overwrite Boolean value indicating existing files overwritten. Optional. redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. record record ID instrument(s).  empty, responses blank.  Optional. instrument instrument(s) download.  empty, instruments returned.  Optional. event unique event name. longitudinal project, record blank event blank, return data events record. record blank event blank, return data specified event record. Optional. verbose boolean value indicating messages printed R console operation.  Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download REDCap Instruments — redcap_instrument_download","text":"Currently, list returned following elements, success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. record_id: record_id instrument. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM. file_name: name file persisted disk. useful name stored REDCap used (default).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download REDCap Instruments — redcap_instrument_download","text":"Currently, function modify variable types conform REDCap's supported variables.  See validate_for_write() helper function checks common important conflicts. function redcap_download_instrument() soft-deprecated REDCapR 1.2.0. Please rename redcap_instrument_download().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Download REDCap Instruments — redcap_instrument_download","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Download REDCap Instruments — redcap_instrument_download","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download REDCap Instruments — redcap_instrument_download","text":"","code":"# \\dontrun{ uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"D70F9ACD1EDD6F151C6EA78683944E98\" # pid=213 # event <- \"\" # only for longitudinal projects  (full_name <- base::temp(pattern=\"instruments-all-records-all\", fileext = \".pdf\")) #> Error in eval(expr, envir, enclos): object 'temp' not found result_1   <- REDCapR::redcap_instrument_download(   file_name     = full_name,   redcap_uri    = uri,   token         = token ) #> Error in eval(expr, envir, enclos): object 'full_name' not found base::unlink(full_name) #> Error in eval(expr, envir, enclos): object 'full_name' not found  (full_name <- base::tempfile(pattern=\"instruments-all-record-1-\", fileext = \".pdf\")) #> [1] \"/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instruments-all-record-1-dd52c9331b3.pdf\" result_2   <- REDCapR::redcap_instrument_download(   record        = 5,   file_name     = full_name,   redcap_uri    = uri,   token         = token ) #> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instruments-all-record-1-dd52c9331b3.pdf`. #> text/html; charset=UTF-8 successfully downloaded in 0.3 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instruments-all-record-1-dd52c9331b3.pdf. base::unlink(full_name) (full_name <- base::tempfile(pattern=\"instrument-1-record-1-\", fileext=\".pdf\")) #> [1] \"/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instrument-1-record-1-dd573a3f5a1.pdf\" result_3   <- REDCapR::redcap_instrument_download(   record        = 5,   instrument    = \"health\",   file_name     = full_name,   redcap_uri    = uri,   token         = token ) #> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instrument-1-record-1-dd573a3f5a1.pdf`. #> text/html; charset=UTF-8 successfully downloaded in 0.5 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmphKboea/instrument-1-record-1-dd573a3f5a1.pdf. base::unlink(full_name) # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":null,"dir":"Reference","previous_headings":"","what":"Enumerate the instruments (forms) — redcap_instruments","title":"Enumerate the instruments (forms) — redcap_instruments","text":"Export list data collection instruments project. includes unique instrument name seen second column Data Dictionary, well instrument's corresponding instrument label, seen project's left-hand menu entering data. instruments ordered according order project. (Copied \"Export Instruments (Data Entry Forms)\" method REDCap API documentation, v.10.5.1)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enumerate the instruments (forms) — redcap_instruments","text":"","code":"redcap_instruments(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enumerate the instruments (forms) — redcap_instruments","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enumerate the instruments (forms) — redcap_instruments","text":"Currently, list returned following elements, data: tibble::tibble() row represents one column REDCap dataset. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Enumerate the instruments (forms) — redcap_instruments","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Enumerate the instruments (forms) — redcap_instruments","text":"Victor Castro, Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enumerate the instruments (forms) — redcap_instruments","text":"","code":"# \\dontrun{ uri           <- \"https://bbmc.ouhsc.edu/redcap/api/\" token         <- \"9A81268476645C4E5F03428B8AC3AA7B\" ds_instrument <- REDCapR::redcap_instruments(redcap_uri=uri, token=token)$data #> 3 instrument metadata records were read from REDCap in 0.3 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the logging of a project. — redcap_log_read","title":"Get the logging of a project. — redcap_log_read","text":"function reads available logging messages REDCap tibble::tibble().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the logging of a project. — redcap_log_read","text":"","code":"redcap_log_read(   redcap_uri,   token,   log_begin_date = Sys.Date() - 7L,   log_end_date = Sys.Date(),   record = NULL,   user = NULL,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the logging of a project. — redcap_log_read","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. log_begin_date Return events occurring midnight date. Defaults past week; default mimics behavior browser also reduces strain server. log_end_date Return events occurring 24:00 date. Defaults today. record Return events belonging specific record (referring existing record name). Defaults NULL returns logging activity related records. record value passed, must single value. user Return events belonging specific user (referring existing username). Defaults NULL returns logging activity related users. user value passed, must single value. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the logging of a project. — redcap_log_read","text":"Currently, list returned following elements: data: R tibble::tibble() data access groups project. success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Get the logging of a project. — redcap_log_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get the logging of a project. — redcap_log_read","text":"Jonathan M. Mang, Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the logging of a project. — redcap_log_read","text":"","code":"# \\dontrun{ uri          <- \"https://bbmc.ouhsc.edu/redcap/api/\" token        <- \"9A81268476645C4E5F03428B8AC3AA7B\"  ds_last_week <- REDCapR::redcap_log_read(redcap_uri=uri, token=token)$data #> 13,274 rows were read from REDCap in 0.6 seconds.  The http status code was 200. head(ds_last_week) #> # A tibble: 6 × 5 #>   timestamp           username        action            details           record #>   <dttm>              <chr>           <chr>             <chr>             <chr>  #> 1 2024-09-06 20:06:00 unittestphifree Manage/Design     Export instrumen… NA     #> 2 2024-09-06 20:06:00 unittestphifree Manage/Design     Download data di… NA     #> 3 2024-09-06 20:06:00 unittestphifree Manage/Design     Export instrumen… NA     #> 4 2024-09-06 20:06:00 unittestphifree Manage/Design     Download export … NA     #> 5 2024-09-06 20:06:00 unittestphifree Data export (API) export_format: C… NA     #> 6 2024-09-06 20:06:00 unittestphifree Data export (API) export_format: C… NA      ds_one_day <-   REDCapR::redcap_log_read(     redcap_uri     = uri,     token          = token,     log_begin_date = as.Date(\"2020-08-10\"),     log_end_date   = as.Date(\"2020-08-10\")   )$data #> 96 rows were read from REDCap in 0.2 seconds.  The http status code was 200. head(ds_one_day) #> # A tibble: 6 × 5 #>   timestamp           username        action            details           record #>   <dttm>              <chr>           <chr>             <chr>             <chr>  #> 1 2020-08-10 19:25:00 unittestphifree Data export (API) export_format: C… NA     #> 2 2020-08-10 19:25:00 unittestphifree Data export (API) export_format: C… NA     #> 3 2020-08-10 19:25:00 unittestphifree Data export (API) export_format: C… NA     #> 4 2020-08-10 19:25:00 unittestphifree Data export (API) export_format: C… NA     #> 5 2020-08-10 19:25:00 unittestphifree Data export (API) export_format: C… NA     #> 6 2020-08-10 19:25:00 unittestphifree Manage/Design     Download data di… NA      ds_one_day_single_record_single_user <-   REDCapR::redcap_log_read(     redcap_uri     = uri,     token          = token,     log_begin_date = as.Date(\"2021-07-11\"),     log_end_date   = as.Date(\"2021-07-11\"),     record         = as.character(3),     user           = \"unittestphifree\"   )$data #> 12 rows were read from REDCap in 0.2 seconds.  The http status code was 200. head(ds_one_day_single_record_single_user) #> # A tibble: 6 × 5 #>   timestamp           username        action        details             record #>   <dttm>              <chr>           <chr>         <chr>               <chr>  #> 1 2021-07-11 23:08:00 unittestphifree Manage/Design Download file (API) NA     #> 2 2021-07-11 23:08:00 unittestphifree Manage/Design Download file (API) NA     #> 3 2021-07-11 23:04:00 unittestphifree Manage/Design Download file (API) NA     #> 4 2021-07-11 23:04:00 unittestphifree Manage/Design Download file (API) NA     #> 5 2021-07-11 22:56:00 unittestphifree Manage/Design Download file (API) NA     #> 6 2021-07-11 22:56:00 unittestphifree Manage/Design Download file (API) NA     # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":null,"dir":"Reference","previous_headings":"","what":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"function inspects REDCap project determine readr::cols() object compatible project's current definition.  can copied pasted R code future calls server produce tibble::tibble() equivalent set data types.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"","code":"redcap_metadata_coltypes(   redcap_uri,   token,   print_col_types_to_console = TRUE,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = FALSE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. print_col_types_to_console readr::cols() object printed console? http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"readr::cols() object returned, can passed redcap_read() redcap_read_oneshot(). Additionally objected printed console, see Details .","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"redcap_metadata_coltypes() returns readr::cols() object two ways. First, literal object returned can passed redcap_read() redcap_read_oneshot(). Second, function acts code generator. prints text console can copied pasted R file.  useful () document fields data types expected, (b) adjust fields data types defaults can customized needs. instance, may choose exclude variables tweak data type (e.g., changing patient's height integer double). printing console, data type decision accompanied explanation far right.  See output examples .  Please file issue think something restrictive can improved. overall heuristic assign data type waterfall decisions: field built REDCap? includes autonumber record_id, redcap_event_name, redcap_repeat_instrument, redcap_repeat_instance, instrument's completion status. field's type?  example, sliders integer, check marks logical(https://stat.ethz.ch/R-manual/R-devel/library/base/html/logical.html. field type \"text\", validation type? instance, postal code character (even though looks like number), \"mdy\" cast date, \"number_2dp\" cast floating point field type validation type recognized, field cast character. happen REDCap develops & releases new type. see something like, \"# validation associated col_type. Tell us new REDCapR issue\", please make sure REDCapR running newest GitHub release file new issue still recognized. details current implementation, decision logic starts half-way function's source code *Validation Guarantee Conformity coming REDCap database world, unexpected. validation type guarantee retrieved values conform complementary data type. validation setting affects values entered validation set. example, values like \"abcd\" entered field months, project manager selected \"integer\" validation option, \"abcd\" values remain untouched. one reason redcap_metadata_coltypes() prints suggestions console. allows developer adjust specifications match values returned API.  \"abcd\" scenario, consider () changing type col_integer col_character, (b) excluding trash values, (c) dplyr::mutate() statement, use readr::parse_integer() cast desired type.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"Beasley, Philip Chase","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"","code":"# \\dontrun{ uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\"  # A simple project token      <- \"9A81268476645C4E5F03428B8AC3AA7B\" # 153 col_types  <- redcap_metadata_coltypes(uri, token) #> # col_types <- readr::cols_only( # Use `readr::cols_only()` to restrict the retrieval to only these columns #> col_types <- readr::cols( # Use `readr::cols()` to include unspecified columns #>   # [field]                       [readr col_type]            [explanation for col_type] #>   record_id                     = readr::col_character()  , # DAGs are enabled for the project #>   name_first                    = readr::col_character()  , # field_type is text and validation isn't set #>   name_last                     = readr::col_character()  , # field_type is text and validation isn't set #>   address                       = readr::col_character()  , # field_type is note #>   telephone                     = readr::col_character()  , # validation is 'phone' #>   email                         = readr::col_character()  , # validation is 'email' #>   dob                           = readr::col_date()       , # validation is 'date_ymd' #>   age                           = readr::col_character()  , # field_type is text and validation isn't set #>   sex                           = readr::col_character()  , # field_type is radio #>   demographics_complete         = readr::col_integer()    , # completion status of form/instrument #>   height                        = readr::col_double()     , # validation is 'number' #>   weight                        = readr::col_integer()    , # validation is 'integer' #>   bmi                           = readr::col_character()  , # field_type is calc #>   comments                      = readr::col_character()  , # field_type is note #>   mugshot                       = readr::col_character()  , # field_type is file #>   health_complete               = readr::col_integer()    , # completion status of form/instrument #>   race___1                      = readr::col_logical()    , # field_type is checkbox #>   race___2                      = readr::col_logical()    , # field_type is checkbox #>   race___3                      = readr::col_logical()    , # field_type is checkbox #>   race___4                      = readr::col_logical()    , # field_type is checkbox #>   race___5                      = readr::col_logical()    , # field_type is checkbox #>   race___6                      = readr::col_logical()    , # field_type is checkbox #>   ethnicity                     = readr::col_character()  , # field_type is radio #>   interpreter_needed            = readr::col_logical()    , # field_type is truefalse #>   race_and_ethnicity_complete   = readr::col_integer()    , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data #> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> # A tibble: 5 × 25 #>   record_id name_first name_last address  telephone email dob        age   sex   #>   <chr>     <chr>      <chr>     <chr>    <chr>     <chr> <date>     <chr> <chr> #> 1 1         Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30 11    0     #> 2 2         Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10 11    1     #> 3 3         Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09 80    1     #> 4 4         Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02 61    0     #> 5 5         John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15 59    1     #> # ℹ 16 more variables: demographics_complete <int>, height <dbl>, weight <int>, #> #   bmi <chr>, comments <chr>, mugshot <chr>, health_complete <int>, #> #   race___1 <lgl>, race___2 <lgl>, race___3 <lgl>, race___4 <lgl>, #> #   race___5 <lgl>, race___6 <lgl>, ethnicity <chr>, interpreter_needed <lgl>, #> #   race_and_ethnicity_complete <int>  # A longitudinal project token      <- \"0434F0E9CF53ED0587847AB6E51DE762\" # 212 col_types  <- redcap_metadata_coltypes(uri, token) #> # col_types <- readr::cols_only( # Use `readr::cols_only()` to restrict the retrieval to only these columns #> col_types <- readr::cols( # Use `readr::cols()` to include unspecified columns #>   # [field]                                     [readr col_type]            [explanation for col_type] #>   study_id                                    = readr::col_character()  , # field_type is text and validation isn't set #>   redcap_event_name                           = readr::col_character()  , # longitudinal event_name #>   date_enrolled                               = readr::col_date()       , # validation is 'date_ymd' #>   patient_document                            = readr::col_character()  , # field_type is file #>   first_name                                  = readr::col_character()  , # field_type is text and validation isn't set #>   last_name                                   = readr::col_character()  , # field_type is text and validation isn't set #>   telephone_1                                 = readr::col_character()  , # validation is 'phone' #>   email                                       = readr::col_character()  , # validation is 'email' #>   dob                                         = readr::col_date()       , # validation is 'date_ymd' #>   age                                         = readr::col_character()  , # field_type is calc #>   ethnicity                                   = readr::col_character()  , # field_type is radio #>   race                                        = readr::col_character()  , # field_type is dropdown #>   sex                                         = readr::col_character()  , # field_type is radio #>   given_birth                                 = readr::col_logical()    , # field_type is yesno #>   num_children                                = readr::col_integer()    , # validation is 'integer' #>   gym___0                                     = readr::col_logical()    , # field_type is checkbox #>   gym___1                                     = readr::col_logical()    , # field_type is checkbox #>   gym___2                                     = readr::col_logical()    , # field_type is checkbox #>   gym___3                                     = readr::col_logical()    , # field_type is checkbox #>   gym___4                                     = readr::col_logical()    , # field_type is checkbox #>   aerobics___0                                = readr::col_logical()    , # field_type is checkbox #>   aerobics___1                                = readr::col_logical()    , # field_type is checkbox #>   aerobics___2                                = readr::col_logical()    , # field_type is checkbox #>   aerobics___3                                = readr::col_logical()    , # field_type is checkbox #>   aerobics___4                                = readr::col_logical()    , # field_type is checkbox #>   eat___0                                     = readr::col_logical()    , # field_type is checkbox #>   eat___1                                     = readr::col_logical()    , # field_type is checkbox #>   eat___2                                     = readr::col_logical()    , # field_type is checkbox #>   eat___3                                     = readr::col_logical()    , # field_type is checkbox #>   eat___4                                     = readr::col_logical()    , # field_type is checkbox #>   drink___0                                   = readr::col_logical()    , # field_type is checkbox #>   drink___1                                   = readr::col_logical()    , # field_type is checkbox #>   drink___2                                   = readr::col_logical()    , # field_type is checkbox #>   drink___3                                   = readr::col_logical()    , # field_type is checkbox #>   drink___4                                   = readr::col_logical()    , # field_type is checkbox #>   specify_mood                                = readr::col_integer()    , # field_type is slider #>   meds___1                                    = readr::col_logical()    , # field_type is checkbox #>   meds___2                                    = readr::col_logical()    , # field_type is checkbox #>   meds___3                                    = readr::col_logical()    , # field_type is checkbox #>   meds___4                                    = readr::col_logical()    , # field_type is checkbox #>   meds___5                                    = readr::col_logical()    , # field_type is checkbox #>   height                                      = readr::col_double()     , # validation is 'number' #>   weight                                      = readr::col_integer()    , # validation is 'integer' #>   bmi                                         = readr::col_character()  , # field_type is calc #>   comments                                    = readr::col_character()  , # field_type is note #>   demographics_complete                       = readr::col_integer()    , # completion status of form/instrument #>   ec_phone                                    = readr::col_character()  , # validation is 'phone' #>   ec_confirmed                                = readr::col_character()  , # field_type is radio #>   next_of_kin_contact_name                    = readr::col_character()  , # field_type is text and validation isn't set #>   next_of_kin_contact_address                 = readr::col_character()  , # field_type is note #>   next_of_kin_contact_phone                   = readr::col_character()  , # validation is 'phone' #>   next_of_kin_confirmed                       = readr::col_character()  , # field_type is radio #>   contact_info_complete                       = readr::col_integer()    , # completion status of form/instrument #>   height2                                     = readr::col_double()     , # validation is 'number' #>   weight2                                     = readr::col_integer()    , # validation is 'integer' #>   bmi2                                        = readr::col_character()  , # field_type is calc #>   prealb_b                                    = readr::col_double()     , # validation is 'number' #>   creat_b                                     = readr::col_double()     , # validation is 'number' #>   npcr_b                                      = readr::col_double()     , # validation is 'number' #>   chol_b                                      = readr::col_double()     , # validation is 'number' #>   transferrin_b                               = readr::col_double()     , # validation is 'number' #>   baseline_data_complete                      = readr::col_integer()    , # completion status of form/instrument #>   vld1                                        = readr::col_double()     , # validation is 'number' #>   vld2                                        = readr::col_double()     , # validation is 'number' #>   vld3                                        = readr::col_double()     , # validation is 'number' #>   vld4                                        = readr::col_double()     , # validation is 'number' #>   vld5                                        = readr::col_double()     , # validation is 'number' #>   visit_lab_data_complete                     = readr::col_integer()    , # completion status of form/instrument #>   pmq1                                        = readr::col_character()  , # field_type is dropdown #>   pmq2                                        = readr::col_character()  , # field_type is dropdown #>   pmq3                                        = readr::col_character()  , # field_type is radio #>   pmq4                                        = readr::col_character()  , # field_type is dropdown #>   patient_morale_questionnaire_complete       = readr::col_integer()    , # completion status of form/instrument #>   vbw1                                        = readr::col_double()     , # validation is 'number' #>   vbw2                                        = readr::col_double()     , # validation is 'number' #>   vbw3                                        = readr::col_double()     , # validation is 'number' #>   vbw4                                        = readr::col_double()     , # validation is 'number' #>   vbw5                                        = readr::col_double()     , # validation is 'number' #>   vbw6                                        = readr::col_character()  , # field_type is radio #>   vbw7                                        = readr::col_character()  , # field_type is radio #>   vbw8                                        = readr::col_character()  , # field_type is dropdown #>   vbw9                                        = readr::col_character()  , # field_type is dropdown #>   visit_blood_workup_complete                 = readr::col_integer()    , # completion status of form/instrument #>   vob1                                        = readr::col_character()  , # field_type is radio #>   vob2                                        = readr::col_character()  , # field_type is radio #>   vob3                                        = readr::col_character()  , # field_type is radio #>   vob4                                        = readr::col_character()  , # field_type is radio #>   vob5                                        = readr::col_character()  , # field_type is radio #>   vob6                                        = readr::col_character()  , # field_type is radio #>   vob7                                        = readr::col_character()  , # field_type is note #>   vob8                                        = readr::col_character()  , # field_type is radio #>   vob9                                        = readr::col_character()  , # field_type is radio #>   vob10                                       = readr::col_character()  , # field_type is radio #>   vob11                                       = readr::col_character()  , # field_type is radio #>   vob12                                       = readr::col_character()  , # field_type is radio #>   vob13                                       = readr::col_character()  , # field_type is radio #>   vob14                                       = readr::col_character()  , # field_type is note #>   visit_observed_behavior_complete            = readr::col_integer()    , # completion status of form/instrument #>   study_comments                              = readr::col_character()  , # field_type is note #>   complete_study                              = readr::col_character()  , # field_type is dropdown #>   withdraw_date                               = readr::col_date()       , # validation is 'date_ymd' #>   date_visit_4                                = readr::col_date()       , # validation is 'date_ymd' #>   alb_4                                       = readr::col_double()     , # validation is 'number' #>   prealb_4                                    = readr::col_double()     , # validation is 'number' #>   creat_4                                     = readr::col_date()       , # validation is 'date_ymd' #>   discharge_date_4                            = readr::col_date()       , # validation is 'date_ymd' #>   discharge_summary_4                         = readr::col_character()  , # field_type is dropdown #>   npcr_4                                      = readr::col_integer()    , # validation is 'integer' #>   chol_4                                      = readr::col_integer()    , # validation is 'integer' #>   withdraw_reason                             = readr::col_character()  , # field_type is dropdown #>   completion_data_complete                    = readr::col_integer()    , # completion status of form/instrument #>   cpq1                                        = readr::col_date()       , # validation is 'date_ymd' #>   cpq2                                        = readr::col_integer()    , # validation is 'integer' #>   cpq3                                        = readr::col_integer()    , # validation is 'integer' #>   cpq4                                        = readr::col_integer()    , # validation is 'integer' #>   cpq5                                        = readr::col_integer()    , # validation is 'integer' #>   cpq6                                        = readr::col_character()  , # field_type is dropdown #>   cpq7                                        = readr::col_character()  , # field_type is dropdown #>   cpq8                                        = readr::col_character()  , # field_type is dropdown #>   cpq9                                        = readr::col_date()       , # validation is 'date_ymd' #>   cpq10                                       = readr::col_character()  , # field_type is dropdown #>   cpq11                                       = readr::col_character()  , # field_type is dropdown #>   cpq12                                       = readr::col_character()  , # field_type is radio #>   cpq13                                       = readr::col_character()  , # field_type is dropdown #>   completion_project_questionnaire_complete   = readr::col_integer()    , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data #> 18 records and 125 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> # A tibble: 18 × 125 #>    study_id redcap_event_name        date_enrolled patient_document   first_name #>    <chr>    <chr>                    <date>        <chr>              <chr>      #>  1 100      enrollment_arm_1         2015-04-02    NA                 Zharko     #>  2 100      dose_1_arm_1             NA            NA                 NA         #>  3 100      visit_1_arm_1            NA            NA                 NA         #>  4 100      dose_2_arm_1             NA            NA                 NA         #>  5 100      visit_2_arm_1            NA            NA                 NA         #>  6 100      final_visit_arm_1        NA            NA                 NA         #>  7 220      enrollment_arm_1         2015-04-02    NA                 Milivoj    #>  8 220      dose_1_arm_1             NA            NA                 NA         #>  9 220      visit_1_arm_1            NA            NA                 NA         #> 10 220      dose_2_arm_1             NA            NA                 NA         #> 11 220      visit_2_arm_1            NA            NA                 NA         #> 12 220      final_visit_arm_1        NA            NA                 NA         #> 13 304      enrollment_arm_2         2015-04-02    levon_and_barry.j… Melech     #> 14 304      deadline_to_opt_ou_arm_2 NA            NA                 NA         #> 15 304      first_dose_arm_2         NA            NA                 NA         #> 16 304      first_visit_arm_2        NA            NA                 NA         #> 17 304      final_visit_arm_2        NA            NA                 NA         #> 18 304      deadline_to_return_arm_2 NA            NA                 NA         #> # ℹ 120 more variables: last_name <chr>, telephone_1 <chr>, email <chr>, #> #   dob <date>, age <chr>, ethnicity <chr>, race <chr>, sex <chr>, #> #   given_birth <lgl>, num_children <int>, gym___0 <lgl>, gym___1 <lgl>, #> #   gym___2 <lgl>, gym___3 <lgl>, gym___4 <lgl>, aerobics___0 <lgl>, #> #   aerobics___1 <lgl>, aerobics___2 <lgl>, aerobics___3 <lgl>, #> #   aerobics___4 <lgl>, eat___0 <lgl>, eat___1 <lgl>, eat___2 <lgl>, #> #   eat___3 <lgl>, eat___4 <lgl>, drink___0 <lgl>, drink___1 <lgl>, …  # A repeating instruments project token      <- \"56F43A10D01D6578A46393394D76D88F\" # 2603 col_types  <- redcap_metadata_coltypes(uri, token) #> # col_types <- readr::cols_only( # Use `readr::cols_only()` to restrict the retrieval to only these columns #> col_types <- readr::cols( # Use `readr::cols()` to include unspecified columns #>   # [field]                     [readr col_type]            [explanation for col_type] #>   record_id                   = readr::col_integer()    , # record_autonumbering is enabled and DAGs are disabled for the project #>   redcap_repeat_instrument    = readr::col_character()  , # repeat_instrument #>   redcap_repeat_instance      = readr::col_integer()    , # repeat_instance #>   date_enrolled               = readr::col_date()       , # validation is 'date_ymd' #>   first_name                  = readr::col_character()  , # field_type is text and validation isn't set #>   dob                         = readr::col_date()       , # validation is 'date_ymd' #>   age                         = readr::col_character()  , # field_type is calc #>   ethnicity                   = readr::col_character()  , # field_type is radio #>   race                        = readr::col_character()  , # field_type is dropdown #>   sex                         = readr::col_character()  , # field_type is radio #>   demographics_complete       = readr::col_integer()    , # completion status of form/instrument #>   date_bp                     = readr::col_date()       , # validation is 'date_ymd' #>   bp_systolic                 = readr::col_integer()    , # validation is 'integer' #>   bp_diastolic                = readr::col_integer()    , # validation is 'integer' #>   bp_complete                 = readr::col_integer()    , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data #> 9 records and 15 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> # A tibble: 9 × 15 #>   record_id redcap_repeat_instrument redcap_repeat_instance date_enrolled #>       <int> <chr>                                     <int> <date>        #> 1         1 NA                                           NA 2019-10-14    #> 2         1 bp                                            1 NA            #> 3         1 bp                                            2 NA            #> 4         1 bp                                            3 NA            #> 5         2 NA                                           NA 2019-02-02    #> 6         2 bp                                            1 NA            #> 7         3 NA                                           NA 2021-11-04    #> 8         4 NA                                           NA 2021-11-04    #> 9         5 NA                                           NA NA            #> # ℹ 11 more variables: first_name <chr>, dob <date>, age <chr>, #> #   ethnicity <chr>, race <chr>, sex <chr>, demographics_complete <int>, #> #   date_bp <date>, bp_systolic <int>, bp_diastolic <int>, bp_complete <int>  # A project with every field type and validation type. #   Notice it throws a warning that some fields use a comma for a decimal, #   while other fields use a period/dot as a decimal token      <- \"8F5313CAA266789F560D79EFCEE2E2F1\" # 2634 - Validation Types col_types  <- redcap_metadata_coltypes(uri, token) #> Warning: The metadata for the REDCap project has validation types for at least one field that specifies a comma for a decimal for at least one field that specifies a period for a decimal.  Mixing these two formats in the same project can cause confusion and problems.  Consider passing `readr::col_character()` for this field (to REDCapR's `col_types` parameter) and then convert the desired fields to R's numeric type.  The function `readr::parse_double()` is useful for this. #> # col_types <- readr::cols_only( # Use `readr::cols_only()` to restrict the retrieval to only these columns #> col_types <- readr::cols( # Use `readr::cols()` to include unspecified columns #>   # [field]                       [readr col_type]                              [explanation for col_type] #>   record_id                     = readr::col_integer()                      , # record_autonumbering is enabled and DAGs are disabled for the project #>   f_calculated                  = readr::col_character()                    , # field_type is calc #>   f_checkbox___0                = readr::col_logical()                      , # field_type is checkbox #>   f_checkbox___1                = readr::col_logical()                      , # field_type is checkbox #>   f_checkbox___2                = readr::col_logical()                      , # field_type is checkbox #>   f_dropdown                    = readr::col_character()                    , # field_type is dropdown #>   f_file_upload                 = readr::col_character()                    , # field_type is file #>   f_notes                       = readr::col_character()                    , # field_type is note #>   f_radio                       = readr::col_character()                    , # field_type is radio #>   f_signature                   = readr::col_character()                    , # field_type is file #>   f_slider                      = readr::col_integer()                      , # field_type is slider #>   f_sql                         = readr::col_character()                    , # field_type is sql #>   f_text                        = readr::col_character()                    , # field_type is text and validation isn't set #>   f_true_false                  = readr::col_logical()                      , # field_type is truefalse #>   f_yes_no                      = readr::col_logical()                      , # field_type is yesno #>   v_alpha_only                  = readr::col_character()                    , # validation is 'alpha_only' #>   v_date_dmy                    = readr::col_date()                         , # validation is 'date_dmy' #>   v_date_mdy                    = readr::col_date()                         , # validation is 'date_mdy' #>   v_date_ymd                    = readr::col_date()                         , # validation is 'date_ymd' #>   v_datetime_dmy                = readr::col_datetime(\"%Y-%m-%d %H:%M\")     , # validation is 'datetime_dmy' #>   v_datetime_mdy                = readr::col_datetime(\"%Y-%m-%d %H:%M\")     , # validation is 'datetime_mdy' #>   v_datetime_seconds_dmy        = readr::col_datetime(\"%Y-%m-%d %H:%M:%S\")  , # validation is 'datetime_seconds_dmy' #>   v_datetime_seconds_mdy        = readr::col_datetime(\"%Y-%m-%d %H:%M:%S\")  , # validation is 'datetime_seconds_mdy' #>   v_datetime_seconds_ymd        = readr::col_datetime(\"%Y-%m-%d %H:%M:%S\")  , # validation is 'datetime_seconds_ymd' #>   v_datetime_ymd                = readr::col_datetime(\"%Y-%m-%d %H:%M\")     , # validation is 'datetime_ymd' #>   v_email                       = readr::col_character()                    , # validation is 'email' #>   v_integer                     = readr::col_integer()                      , # validation is 'integer' #>   v_mrn_10d                     = readr::col_character()                    , # validation is 'mrn_10d' #>   v_mrn_generic                 = readr::col_character()                    , # validation is 'mrn_generic' #>   v_number                      = readr::col_double()                       , # validation is 'number' #>   v_number_1dp                  = readr::col_double()                       , # validation is 'number_1dp' #>   v_number_2dp                  = readr::col_double()                       , # validation is 'number_2dp' #>   v_number_3dp                  = readr::col_double()                       , # validation is 'number_3dp' #>   v_number_4dp                  = readr::col_double()                       , # validation is 'number_4dp' #>   v_number_comma_decimal        = readr::col_character()                    , # locale's decimal mark isn't a comma, yet validation is 'number_comma_decimal' #>   v_number_1dp_comma_decimal    = readr::col_character()                    , # locale's decimal mark isn't a comma, yet validation is 'number_1dp_comma_decimal' #>   v_number_2dp_comma_decimal    = readr::col_character()                    , # locale's decimal mark isn't a comma, yet validation is 'number_2dp_comma_decimal' #>   v_number_3dp_comma_decimal    = readr::col_character()                    , # locale's decimal mark isn't a comma, yet validation is 'number_3dp_comma_decimal' #>   v_number_4dp_comma_decimal    = readr::col_character()                    , # locale's decimal mark isn't a comma, yet validation is 'number_4dp_comma_decimal' #>   v_phone                       = readr::col_character()                    , # validation is 'phone' #>   v_phone_australia             = readr::col_character()                    , # validation is 'phone_australia' #>   v_postalcode_australia        = readr::col_character()                    , # validation is 'postalcode_australia' #>   v_postalcode_canada           = readr::col_character()                    , # validation is 'postalcode_canada' #>   v_postalcode_french           = readr::col_character()                    , # validation is 'postalcode_french' #>   v_postalcode_germany          = readr::col_character()                    , # validation is 'postalcode_germany' #>   v_ssn                         = readr::col_character()                    , # validation is 'ssn' #>   v_time_hh_mm                  = readr::col_time(\"%H:%M\")                  , # validation is 'time' #>   v_time_hh_mm_ss               = readr::col_time(\"%H:%M:%S\")               , # validation is 'time_hh_mm_ss' #>   v_time_mm_ss                  = readr::col_time(\"%M:%S\")                  , # validation is 'time_mm_ss' #>   v_vmrn                        = readr::col_character()                    , # validation is 'vmrn' #>   v_zipcode                     = readr::col_character()                    , # validation is 'zipcode' #>   form_1_complete               = readr::col_integer()                      , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data #> 1 records and 52 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> # A tibble: 1 × 52 #>   record_id f_calculated f_checkbox___0 f_checkbox___1 f_checkbox___2 f_dropdown #>       <int> <chr>        <lgl>          <lgl>          <lgl>          <chr>      #> 1         1 NA           FALSE          FALSE          FALSE          NA         #> # ℹ 46 more variables: f_file_upload <chr>, f_notes <chr>, f_radio <chr>, #> #   f_signature <chr>, f_slider <int>, f_sql <chr>, f_text <chr>, #> #   f_true_false <lgl>, f_yes_no <lgl>, v_alpha_only <chr>, v_date_dmy <date>, #> #   v_date_mdy <date>, v_date_ymd <date>, v_datetime_dmy <dttm>, #> #   v_datetime_mdy <dttm>, v_datetime_seconds_dmy <dttm>, #> #   v_datetime_seconds_mdy <dttm>, v_datetime_seconds_ymd <dttm>, #> #   v_datetime_ymd <dttm>, v_email <chr>, v_integer <int>, v_mrn_10d <chr>, … # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Export the metadata of a REDCap project — redcap_metadata_read","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"Export metadata (data dictionary) REDCap project tibble::tibble(). row data dictionary corresponds one field project's dataset.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"","code":"redcap_metadata_read(   redcap_uri,   token,   forms = NULL,   fields = NULL,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. forms array, element corresponds REDCap form desired fields.  Optional. fields array, element corresponds desired project field.  Optional. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"Currently, list returned following elements: data: R tibble::tibble() desired fields (rows). success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. forms_collapsed: desired records IDs, collapsed single string, separated commas. fields_collapsed: desired field names, collapsed single string, separated commas. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"","code":"# \\dontrun{ uri   <- \"https://bbmc.ouhsc.edu/redcap/api/\"  # A simple project (pid 153) token <- \"9A81268476645C4E5F03428B8AC3AA7B\" REDCapR::redcap_metadata_read(redcap_uri=uri, token=token) #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> $data #> # A tibble: 17 × 18 #>    field_name         form_name          section_header   field_type field_label #>    <chr>              <chr>              <chr>            <chr>      <chr>       #>  1 record_id          demographics       NA               text       Study ID    #>  2 name_first         demographics       Contact Informa… text       First Name  #>  3 name_last          demographics       NA               text       Last Name   #>  4 address            demographics       NA               notes      Street, Ci… #>  5 telephone          demographics       NA               text       Phone numb… #>  6 email              demographics       NA               text       E-mail      #>  7 dob                demographics       NA               text       Date of bi… #>  8 age                demographics       NA               text       Age (years) #>  9 sex                demographics       NA               radio      Gender      #> 10 height             health             NA               text       Height (cm) #> 11 weight             health             NA               text       Weight (ki… #> 12 bmi                health             NA               calc       BMI         #> 13 comments           health             General Comments notes      Comments    #> 14 mugshot            health             NA               file       Mugshot     #> 15 race               race_and_ethnicity NA               checkbox   Race (Sele… #> 16 ethnicity          race_and_ethnicity NA               radio      Ethnicity   #> 17 interpreter_needed race_and_ethnicity NA               truefalse  Are interp… #> # ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <chr>, #> #   text_validation_type_or_show_slider_number <chr>, #> #   text_validation_min <chr>, text_validation_max <chr>, identifier <chr>, #> #   branching_logic <chr>, required_field <chr>, custom_alignment <chr>, #> #   question_number <chr>, matrix_group_name <chr>, matrix_ranking <chr>, #> #   field_annotation <chr> #>  #> $success #> [1] TRUE #>  #> $status_code #> [1] 200 #>  #> $outcome_message #> [1] \"The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.\" #>  #> $forms_collapsed #> [1] \"\" #>  #> $fields_collapsed #> [1] \"\" #>  #> $elapsed_seconds #> [1] 0.1772749 #>  #> $raw_text #> [1] \"\" #>   # A longitudinal project (pid 212) token <- \"0434F0E9CF53ED0587847AB6E51DE762\" REDCapR::redcap_metadata_read(redcap_uri=uri, token=token) #> The data dictionary describing 95 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> $data #> # A tibble: 95 × 18 #>    field_name       form_name    section_header      field_type field_label      #>    <chr>            <chr>        <chr>               <chr>      <chr>            #>  1 study_id         demographics NA                  text       Study ID         #>  2 date_enrolled    demographics Consent Information text       Date subject si… #>  3 patient_document demographics NA                  file       Upload the pati… #>  4 first_name       demographics Contact Information text       First Name       #>  5 last_name        demographics NA                  text       Last Name        #>  6 telephone_1      demographics NA                  text       Phone number     #>  7 email            demographics NA                  text       E-mail           #>  8 dob              demographics NA                  text       Date of birth    #>  9 age              demographics NA                  calc       Age (years)      #> 10 ethnicity        demographics NA                  radio      Ethnicity        #> # ℹ 85 more rows #> # ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <chr>, #> #   text_validation_type_or_show_slider_number <chr>, #> #   text_validation_min <chr>, text_validation_max <chr>, identifier <chr>, #> #   branching_logic <chr>, required_field <chr>, custom_alignment <chr>, #> #   question_number <chr>, matrix_group_name <chr>, matrix_ranking <chr>, #> #   field_annotation <chr> #>  #> $success #> [1] TRUE #>  #> $status_code #> [1] 200 #>  #> $outcome_message #> [1] \"The data dictionary describing 95 fields was read from REDCap in 0.2 seconds.  The http status code was 200.\" #>  #> $forms_collapsed #> [1] \"\" #>  #> $fields_collapsed #> [1] \"\" #>  #> $elapsed_seconds #> [1] 0.187057 #>  #> $raw_text #> [1] \"\" #>   # A repeating measures (pid 3181) token <- \"22C3FF1C8B08899FB6F86D91D874A159\" REDCapR::redcap_metadata_read(redcap_uri=uri, token=token) #> The data dictionary describing 9 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> $data #> # A tibble: 9 × 18 #>   field_name    form_name      section_header field_type field_label             #>   <chr>         <chr>          <chr>          <chr>      <chr>                   #> 1 record_id     intake         NA             text       Record ID               #> 2 height        intake         NA             text       patient height          #> 3 weight        intake         NA             text       patient weight          #> 4 bmi           intake         NA             text       patient bmi             #> 5 sbp           blood_pressure NA             text       systolic blood pressure #> 6 dbp           blood_pressure NA             text       diastolic blood pressu… #> 7 lab           laboratory     NA             text       lab value               #> 8 conc          laboratory     NA             text       concentration           #> 9 image_profile image          NA             file       Picture of Patient      #> # ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <chr>, #> #   text_validation_type_or_show_slider_number <chr>, #> #   text_validation_min <chr>, text_validation_max <chr>, identifier <chr>, #> #   branching_logic <chr>, required_field <chr>, custom_alignment <chr>, #> #   question_number <chr>, matrix_group_name <chr>, matrix_ranking <chr>, #> #   field_annotation <chr> #>  #> $success #> [1] TRUE #>  #> $status_code #> [1] 200 #>  #> $outcome_message #> [1] \"The data dictionary describing 9 fields was read from REDCap in 0.2 seconds.  The http status code was 200.\" #>  #> $forms_collapsed #> [1] \"\" #>  #> $fields_collapsed #> [1] \"\" #>  #> $elapsed_seconds #> [1] 0.181632 #>  #> $raw_text #> [1] \"\" #>  # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":null,"dir":"Reference","previous_headings":"","what":"Import metadata of a REDCap project — redcap_metadata_write","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"Import metadata (.e., data dictionary) project. method's destructive nature, works projects Development status.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"","code":"redcap_metadata_write(   ds,   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"ds base::data.frame() tibble::tibble() imported REDCap project. Required. redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"Currently, list returned following elements: success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. field_count: Number fields imported. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki. account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"","code":"# \\dontrun{ # Please don't run this example without changing the token to # point to your server.  It could interfere with our testing suite. uri            <- \"https://bbmc.ouhsc.edu/redcap/api/\" token          <- \"457C24AB91B7FCF5B1A7DA67E70E24C7\"  # Read in the dictionary in R's memory from a csv file. ds_to_write <-   readr::read_csv(     file = system.file(       \"test-data/project-simple/metadata.csv\",       package = \"REDCapR\"     ),     col_types = readr::cols(.default = readr::col_character())   ) ds_to_write #> # A tibble: 16 × 18 #>    field_name form_name          section_header      field_type field_label      #>    <chr>      <chr>              <chr>               <chr>      <chr>            #>  1 record_id  demographics       NA                  text       Study ID         #>  2 name_first demographics       Contact Information text       First Name       #>  3 name_last  demographics       NA                  text       Last Name        #>  4 address    demographics       NA                  notes      Street, City, S… #>  5 telephone  demographics       NA                  text       Phone number     #>  6 email      demographics       NA                  text       E-mail           #>  7 dob        demographics       NA                  text       Date of birth    #>  8 age        demographics       NA                  calc       Age (years)      #>  9 sex        demographics       NA                  radio      Gender           #> 10 height     health             NA                  text       Height (cm)      #> 11 weight     health             NA                  text       Weight (kilogra… #> 12 bmi        health             NA                  calc       BMI              #> 13 comments   health             General Comments    notes      Comments         #> 14 mugshot    health             NA                  file       Mugshot          #> 15 race       race_and_ethnicity NA                  checkbox   Race (Select al… #> 16 ethnicity  race_and_ethnicity NA                  radio      Ethnicity        #> # ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <chr>, #> #   text_validation_type_or_show_slider_number <chr>, #> #   text_validation_min <chr>, text_validation_max <chr>, identifier <chr>, #> #   branching_logic <chr>, required_field <chr>, custom_alignment <chr>, #> #   question_number <chr>, matrix_group_name <chr>, matrix_ranking <chr>, #> #   field_annotation <chr>  # Import the dictionary into the REDCap project REDCapR::redcap_metadata_write(   ds          = ds_to_write,   redcap_uri  = uri,   token       = token ) #> 16 fields were written to the REDCap dictionary in 1.8 seconds. #> $success #> [1] TRUE #>  #> $status_code #> [1] 200 #>  #> $outcome_message #> [1] \"16 fields were written to the REDCap dictionary in 1.8 seconds.\" #>  #> $field_count #> [1] 16 #>  #> $elapsed_seconds #> [1] 1.792433 #>  #> $raw_text #> [1] \"\" #>  # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine free available record ID — redcap_next_free_record_name","title":"Determine free available record ID — redcap_next_free_record_name","text":"Determines next available record ID.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine free available record ID — redcap_next_free_record_name","text":"","code":"redcap_next_free_record_name(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine free available record ID — redcap_next_free_record_name","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine free available record ID — redcap_next_free_record_name","text":"base::character vector either length 1 (successful) length 0 (successful).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Determine free available record ID — redcap_next_free_record_name","text":"API call unsuccessful, value character(0) returned (.e., empty vector).  ensures function always return object class base::character.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Determine free available record ID — redcap_next_free_record_name","text":"Documentation REDCap 8.4.0 used projects record auto-numbering enabled, method exports next potential record ID project. generates next record name determining current maximum numerical record ID incrementing one.","code":"Note: This method does not create a new record, but merely determines what the next record name would be.  If using Data Access Groups (DAGs) in the project, this method accounts for the special formatting of the record name for users in DAGs (e.g., DAG-ID); in this case, it only assigns the next value for ID for all numbers inside a DAG. For example, if a DAG has a corresponding DAG number of 223 wherein records 223-1 and 223-2 already exist, then the next record will be 223-3 if the API user belongs to the DAG that has DAG number 223. (The DAG number is auto-assigned by REDCap for each DAG when the DAG is first created.)  When generating a new record name in a DAG, the method considers all records in the entire project when determining the maximum record ID, including those that might have been originally created in that DAG but then later reassigned to another DAG.  Note: This method functions the same even for projects that do not have record auto-numbering enabled."},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine free available record ID — redcap_next_free_record_name","text":"","code":"uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"9A81268476645C4E5F03428B8AC3AA7B\" # Returns 6 REDCapR::redcap_next_free_record_name(redcap_uri = uri, token = token) #> The next free record name in REDCap was successfully determined in 0.2 seconds.  The http status code was 200.  Is is 6. #> [1] \"6\""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project.html","id":null,"dir":"Reference","previous_headings":"","what":"A Reference Class to make later calls to REDCap more convenient — redcap_project","title":"A Reference Class to make later calls to REDCap more convenient — redcap_project","text":"Reference Class represents REDCap project. values set specific REDCap project (URI token), later calls less verbose (reading writing data).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"A Reference Class to make later calls to REDCap more convenient — redcap_project","text":"redcap_uri URI (uniform resource identifier) REDCap project.  Required. token token user-specific string serves password project.  Required.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"A Reference Class to make later calls to REDCap more convenient — redcap_project","text":"read(   batch_size = 100L,   interbatch_delay = 0,   records = NULL,   fields = NULL,   forms = NULL,   events = NULL,   raw_or_label = \"raw\",   raw_or_label_headers = \"raw\",   export_checkbox_label = FALSE,   export_survey_fields = FALSE,   export_data_access_groups = FALSE,   filter_logic = \"\",   col_types = NULL,   guess_type = TRUE,   guess_max = 1000,   verbose = TRUE,   config_options = NULL ) Exports records REDCap project. write(   ds_to_write,   batch_size = 100L,   interbatch_delay = 0,   continue_on_error = FALSE,   verbose = TRUE,   config_options = NULL ) Imports records REDCap project.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"A Reference Class to make later calls to REDCap more convenient — redcap_project","text":"","code":"uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"9A81268476645C4E5F03428B8AC3AA7B\" # \\dontrun{ project <- REDCapR::redcap_project$new(redcap_uri=uri, token=token) ds_all  <- project$read() #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 01:06:25.830182. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.  # Demonstrate how repeated calls are more concise when the token and #   url aren't always passed. ds_skinny <- project$read(fields=c(\"record_id\", \"sex\", \"height\"))$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 01:06:27.358905. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 3 columns were read from REDCap in 0.5 seconds.  The http status code was 200.  ids_of_males    <- ds_skinny$record_id[ds_skinny$sex==1] ids_of_shorties <- ds_skinny$record_id[ds_skinny$height < 40]  ds_males        <- project$read(records=ids_of_males, batch_size=2)$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.4 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 3 records  at 2024-09-07 01:06:29.446375. #> Reading batch 1 of 2, with subjects 2 through 3 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Reading batch 2 of 2, with subjects 5 through 5 (ie, 1 unique subject records). #> 1 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. ds_shorties     <- project$read(records=ids_of_shorties)$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 2 records  at 2024-09-07 01:06:31.394707. #> Reading batch 1 of 1, with subjects 1 through 2 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.  # } if (FALSE) { # Switch the Genders sex_original   <- ds_skinny$sex ds_skinny$sex  <- (1 - ds_skinny$sex) project$write(ds_skinny)  # Switch the Genders back ds_skinny$sex <- sex_original project$write(ds_skinny) }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Export project information. — redcap_project_info_read","title":"Export project information. — redcap_project_info_read","text":"function exports basic attributes given REDCap project, project's title, longitudinal, surveys enabled, time project created moved production.  Returns tibble::tibble().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export project information. — redcap_project_info_read","text":"","code":"redcap_project_info_read(   redcap_uri,   token,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export project information. — redcap_project_info_read","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export project information. — redcap_project_info_read","text":"Currently, list returned following elements: data: R tibble::tibble() data access groups project. success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Export project information. — redcap_project_info_read","text":"Timezones Several datetime variables returned, project's creation_time.  time meaningful, need set time zone function uses readr::read_csv(), assigns UTC timezone specified.  Find server's location listed base::OlsonNames(), pass readr's readr::locale() function, pass redcap_project_info_read().  See examples timezone details see Timezones section readr's locales vignette. Columns yet added function casts columns data types think natural use.  example, in_production cast 0/1 boolean TRUE/FALSE.  columns (yet) recognized REDCapR still returned client, cast character. REDCap API adds new column future, please alert us REDCapR issue expand casting specifications. External Modules project's external_modules cell contains approved EMs, separated column.  Consider using function like tidyr::separate_rows() create long data structure.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Export project information. — redcap_project_info_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export project information. — redcap_project_info_read","text":"Beasley, Stephan Kadauke","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export project information. — redcap_project_info_read","text":"","code":"# \\dontrun{ # Specify your project uri and token(s). uri                  <- \"https://bbmc.ouhsc.edu/redcap/api/\" token_simple         <- \"9A81268476645C4E5F03428B8AC3AA7B\" token_longitudinal   <- \"0434F0E9CF53ED0587847AB6E51DE762\"  # ---- Simple examples REDCapR::redcap_project_info_read(uri, token_simple      )$data #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 1 × 26 #>   project_id project_title creation_time       production_time in_production #>        <int> <chr>         <dttm>              <dttm>          <lgl>         #> 1        153 REDCapR Targ… 2013-11-29 15:58:20 NA              FALSE         #> # ℹ 21 more variables: project_language <chr>, purpose <int>, #> #   purpose_other <chr>, project_notes <chr>, custom_record_label <chr>, #> #   secondary_unique_field <chr>, is_longitudinal <lgl>, #> #   has_repeating_instruments_or_events <lgl>, surveys_enabled <lgl>, #> #   scheduling_enabled <lgl>, record_autonumbering_enabled <lgl>, #> #   randomization_enabled <lgl>, ddp_enabled <lgl>, project_irb_number <chr>, #> #   project_grant_number <chr>, project_pi_firstname <chr>, … REDCapR::redcap_project_info_read(uri, token_longitudinal)$data #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 1 × 26 #>   project_id project_title creation_time       production_time in_production #>        <int> <chr>         <dttm>              <dttm>          <lgl>         #> 1        212 REDCapR Targ… 2014-08-31 13:07:55 NA              FALSE         #> # ℹ 21 more variables: project_language <chr>, purpose <int>, #> #   purpose_other <chr>, project_notes <chr>, custom_record_label <chr>, #> #   secondary_unique_field <chr>, is_longitudinal <lgl>, #> #   has_repeating_instruments_or_events <lgl>, surveys_enabled <lgl>, #> #   scheduling_enabled <lgl>, record_autonumbering_enabled <lgl>, #> #   randomization_enabled <lgl>, ddp_enabled <lgl>, project_irb_number <chr>, #> #   project_grant_number <chr>, project_pi_firstname <chr>, …  # ---- Specify timezone # Specify the server's timezone, for example, US Central server_locale <- readr::locale(tz = \"America/Chicago\") d3 <-   REDCapR::redcap_project_info_read(     uri,     token_simple,     locale     = server_locale   )$data #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. d3$creation_time #> [1] \"2013-11-29 15:58:20 CST\"  # Alternatively, set timezone to the client's location. client_locale <- readr::locale(tz = Sys.timezone())  # ---- Inspect multiple projects in the same tibble # Stack all the projects on top of each other in a (nested) tibble, #   starting from a csv of REDCapR test projects. # The native pipes in this snippet require R 4.1+. d_all <-   system.file(\"misc/example.credentials\", package = \"REDCapR\") |>   readr::read_csv(     comment     = \"#\",     col_select  = c(redcap_uri, token),     col_types   = readr::cols(.default = readr::col_character())   ) |>   dplyr::filter(32L == nchar(token)) |>   purrr::pmap_dfr(REDCapR::redcap_project_info_read, locale = server_locale) #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.4 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 1.0 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.4 seconds.  The http status code was 200.  # Inspect values stored on the server. d_all$data #> # A tibble: 30 × 26 #>    project_id project_title              creation_time       production_time #>         <int> <chr>                      <dttm>              <dttm>          #>  1        153 REDCapR Target Simple Sta… 2013-11-29 15:58:20 NA              #>  2        212 REDCapR Target Longitudin… 2014-08-31 13:07:55 NA              #>  3        213 REDCapR Target Simple -Wr… 2014-08-31 13:34:06 NA              #>  4        268 REDCapR Russian -see http… 2015-02-21 12:18:27 NA              #>  5        690 REDCapR Target Empty Rows… 2017-08-21 22:14:37 NA              #>  6        691 REDCapR Target Empty Colu… 2017-08-21 22:24:45 NA              #>  7        753 REDCapR Target Super-wide… 2017-12-01 08:58:07 NA              #>  8        817 REDCapR Target Survey Sta… 2018-03-06 15:46:24 NA              #>  9        977 REDCap Target Fake Clinic… 2018-08-24 11:30:21 NA              #> 10        998 REDCapR Target -nonumeric… 2018-09-11 18:21:14 NA              #> # ℹ 20 more rows #> # ℹ 22 more variables: in_production <lgl>, project_language <chr>, #> #   purpose <int>, purpose_other <chr>, project_notes <chr>, #> #   custom_record_label <chr>, secondary_unique_field <chr>, #> #   is_longitudinal <lgl>, has_repeating_instruments_or_events <lgl>, #> #   surveys_enabled <lgl>, scheduling_enabled <lgl>, #> #   record_autonumbering_enabled <lgl>, randomization_enabled <lgl>, … # or: View(d_all$data)  # Inspect everything returned, including values like the http status code. d_all #> # A tibble: 30 × 6 #>    data$project_id success status_code outcome_message  elapsed_seconds raw_text #>              <int> <lgl>         <int> <chr>                      <dbl> <chr>    #>  1             153 TRUE            200 1 rows were rea…           0.182 \"\"       #>  2             212 TRUE            200 1 rows were rea…           0.189 \"\"       #>  3             213 TRUE            200 1 rows were rea…           0.206 \"\"       #>  4             268 TRUE            200 1 rows were rea…           0.232 \"\"       #>  5             690 TRUE            200 1 rows were rea…           0.186 \"\"       #>  6             691 TRUE            200 1 rows were rea…           0.194 \"\"       #>  7             753 TRUE            200 1 rows were rea…           0.240 \"\"       #>  8             817 TRUE            200 1 rows were rea…           0.190 \"\"       #>  9             977 TRUE            200 1 rows were rea…           0.192 \"\"       #> 10             998 TRUE            200 1 rows were rea…           0.185 \"\"       #> # ℹ 20 more rows #> # ℹ 25 more variables: data$project_title <chr>, $creation_time <dttm>, #> #   $production_time <dttm>, $in_production <lgl>, $project_language <chr>, #> #   $purpose <int>, $purpose_other <chr>, $project_notes <chr>, #> #   $custom_record_label <chr>, $secondary_unique_field <chr>, #> #   $is_longitudinal <lgl>, $has_repeating_instruments_or_events <lgl>, #> #   $surveys_enabled <lgl>, $scheduling_enabled <lgl>, … # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"external perspective, function similar redcap_read_oneshot().  internals differ redcap_read retrieves subsets data, combines returning (among objects) single tibble::tibble().  function can appropriate redcap_read_oneshot() returning large datasets tie server.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"","code":"redcap_read(   batch_size = 100L,   interbatch_delay = 0.5,   continue_on_error = FALSE,   redcap_uri,   token,   records = NULL,   fields = NULL,   forms = NULL,   events = NULL,   raw_or_label = \"raw\",   raw_or_label_headers = \"raw\",   export_checkbox_label = FALSE,   export_survey_fields = FALSE,   export_data_access_groups = FALSE,   filter_logic = \"\",   datetime_range_begin = as.POSIXct(NA),   datetime_range_end = as.POSIXct(NA),   blank_for_gray_form_status = FALSE,   col_types = NULL,   na = c(\"\", \"NA\"),   guess_type = TRUE,   guess_max = NULL,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL,   id_position = 1L )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"batch_size maximum number subject records single batch contain.  default 100. interbatch_delay number seconds function wait requesting new subset REDCap. default 0.5 seconds. continue_on_error error occurs reading, records subsequent batches attempted.  default FALSE, prevents subsequent batches running.  Required. redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. records array, element corresponds ID desired record.  Optional. fields array, element corresponds desired project field.  Optional. forms array, element corresponds desired project form.  Optional. events array, element corresponds desired project event.  Optional. raw_or_label string (either 'raw' 'label' specifies whether export raw coded values labels options multiple choice fields.  Default 'raw'. raw_or_label_headers string (either 'raw' 'label' specifies CSV headers whether export variable/field names (raw) field labels (label).  Default 'raw'. export_checkbox_label specifies format checkbox field values specifically exporting data labels.  raw_or_label 'label' export_checkbox_label TRUE, values text displayed users.  Otherwise, values 0/1. export_survey_fields boolean specifies whether export survey identifier field (e.g., 'redcap_survey_identifier') survey timestamp fields (e.g., instrument+'_timestamp'). timestamp outputs reflect survey's completion time (according time timezone REDCap server.) export_data_access_groups boolean value specifies whether export redcap_data_access_group field data access groups utilized project. Default FALSE. See details . filter_logic String logic text (e.g., [gender] = 'male') filtering data returned API method, API return records (record-events, longitudinal project) logic evaluates TRUE.   blank/empty string returns records. datetime_range_begin return records created modified given datetime, provide POSIXct value. specified, REDCap assume begin time. datetime_range_end return records created modified given datetime, provide POSIXct value. specified, REDCap assume end time. blank_for_gray_form_status boolean value specifies whether export blank values instrument complete status fields gray status icon. instrument complete status fields gray icon can exported either blank value \"0\" (Incomplete). Blank values recommended data export data re-imported REDCap project. Default FALSE. col_types readr::cols() object passed internally readr::read_csv().  Optional. na character vector passed internally readr::read_csv(). Defaults c(\"\", \"NA\"). guess_type boolean value indicating columns returned character.  true, readr::read_csv() guesses intended data type column.  Ignored col_types null. guess_max Deprecated. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional. id_position column position variable unique identifies subject (typically record_id). defaults first variable dataset.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"Currently, list returned following elements: data: tibble::tibble() desired records columns. success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. records_collapsed: desired records IDs, collapsed single string, separated commas. fields_collapsed: desired field names, collapsed single string, separated commas. filter_logic: filter statement passed argument. elapsed_seconds: duration function. records retrieved (records meet filter criteria), zero-row tibble returned. Currently empty tibble zero columns, may change future.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"batching-subsets-of-data","dir":"Reference","previous_headings":"","what":"Batching subsets of data","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"redcap_read() internally uses multiple calls redcap_read_oneshot() select return data.  Initially, primary key queried REDCap API.  long list subsetted batches, whose sizes determined batch_size parameter.  REDCap queried variables subset's subjects.  repeated subset, returning unified tibble::tibble(). function allows delay calls, allows server attend users' requests (users entering data browser).  words, delay batches bog webserver exporting/importing large dataset. second benefit less RAM required webserver.  batch smaller entire dataset, webserver tackles manageably sized objects memory.  Consider batching encounter error:   third benefit (compared redcap_read()) important fields included, even explicitly requested.  result: record_id (customized name) always returned redcap_event_name returned longitudinal projects redcap_repeat_instrument redcap_repeat_instance returned projects repeating instruments","code":"ERROR: REDCap ran out of server memory. The request cannot be processed. Please try importing/exporting a smaller amount of data."},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"export-permissions","dir":"Reference","previous_headings":"","what":"Export permissions","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"redcap_read_oneshot() function properly, user must Export permissions 'Full Data Set'.  Users 'De-Identified' export privileges can still use redcap_read_oneshot.  grant appropriate permissions: go 'User Rights' REDCap project site, select desired user, select 'Edit User Privileges', 'Data Exports' radio buttons, select 'Full Data Set'.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"pseudofields","dir":"Reference","previous_headings":"","what":"Pseudofields","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"REDCap project may contain \"pseudofields\", depending structure. Pseudofields exported certain project structures, defined users appear codebook. recognized pseudofield passed fields api parameter, suppressed redcap_read() redcap_read_oneshot() server throw error. Requesting pseudofield discouraged, message returned user. Pseudofields include: redcap_event_name: longitudinal projects multi-arm projects. redcap_repeat_instrument:  projects repeating instruments. redcap_repeat_instance:   projects repeating instruments. redcap_data_access_group: projects DAGs export_data_access_groups api parameter TRUE. redcap_survey_identifier:  projects surveys export_survey_fields api parameter TRUE. instrument_name_timestamp: projects surveys. example, instrument called \"demographics\" pseudofield named demographics_timestamp. REDCapR suppress requests timestamps, server throw error like","code":"ERROR: The following values in the parameter fields are not valid: 'demographics_timestamp'"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"events","dir":"Reference","previous_headings":"","what":"Events","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"event argument vector characters passed server. \"event-name\", \"event-label\". event-label value presented users, contains uppercase letters spaces, event-name can contain lowercase letters, digits, underscores. event nonnull project longitudinal, redcap_read() throw error. Similarly, value event vector current event-name, redcap_read() throw error. simpler redcap_read_oneshot() function check invalid event values, throw errors.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"","code":"# \\dontrun{ uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"9A81268476645C4E5F03428B8AC3AA7B\"  # Return the entire dataset REDCapR::redcap_read(batch_size=2, redcap_uri=uri, token=token)$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.3 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 01:06:42.793999. #> Reading batch 1 of 3, with subjects 1 through 2 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Reading batch 2 of 3, with subjects 3 through 4 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Reading batch 3 of 3, with subjects 5 through 5 (ie, 1 unique subject records). #> 1 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> # A tibble: 5 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         2 Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10    11     1 #> 3         3 Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09    80     1 #> 4         4 Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02    61     0 #> 5         5 John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15    59     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>  # Return a subset of columns while also specifying the column types. col_types <- readr::cols(   record_id  = readr::col_integer(),   race___1   = readr::col_logical(),   race___2   = readr::col_logical(),   race___3   = readr::col_logical(),   race___4   = readr::col_logical(),   race___5   = readr::col_logical(),   race___6   = readr::col_logical() ) REDCapR::redcap_read(   redcap_uri = uri,   token      = token,   col_types  = col_types,   batch_size = 2 )$data #> 24 variable metadata records were read from REDCap in 0.4 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 01:06:47.086525. #> Reading batch 1 of 3, with subjects 1 through 2 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Reading batch 2 of 3, with subjects 3 through 4 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Reading batch 3 of 3, with subjects 5 through 5 (ie, 1 unique subject records). #> 1 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> # A tibble: 5 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <int> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         2 Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10    11     1 #> 3         3 Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09    80     1 #> 4         4 Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02    61     0 #> 5         5 John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15    59     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <lgl>, race___2 <lgl>, race___3 <lgl>, race___4 <lgl>, #> #   race___5 <lgl>, race___6 <lgl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl> # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"function uses REDCap's API select return data eav","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"","code":"redcap_read_eav_oneshot(   redcap_uri,   token,   records = NULL,   fields = NULL,   forms = NULL,   events = NULL,   export_survey_fields = FALSE,   export_data_access_groups = FALSE,   filter_logic = \"\",   datetime_range_begin = as.POSIXct(NA),   datetime_range_end = as.POSIXct(NA),   blank_for_gray_form_status = FALSE,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. records array, element corresponds ID desired record.  Optional. fields array, element corresponds desired project field.  Optional. forms array, element corresponds desired project form.  Optional. events array, element corresponds desired project event.  Optional. export_survey_fields boolean specifies whether export survey identifier field (e.g., 'redcap_survey_identifier') survey timestamp fields (e.g., instrument+'_timestamp'). timestamp outputs reflect survey's completion time (according time timezone REDCap server.) export_data_access_groups boolean value specifies whether export redcap_data_access_group field data access groups utilized project. Default FALSE. See details . filter_logic String logic text (e.g., [gender] = 'male') filtering data returned API method, API return records (record-events, longitudinal project) logic evaluates TRUE.   blank/empty string returns records. datetime_range_begin return records created modified given datetime, provide POSIXct value. specified, REDCap assume begin time. datetime_range_end return records created modified given datetime, provide POSIXct value. specified, REDCap assume end time. blank_for_gray_form_status boolean value specifies whether export blank values instrument complete status fields gray status icon. instrument complete status fields gray icon can exported either blank value \"0\" (Incomplete). Blank values recommended data export data re-imported REDCap project. Default FALSE. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"Currently, list returned following elements: data: tibble::tibble() desired records columns. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_collapsed: desired records IDs, collapsed single string, separated commas. fields_collapsed: desired field names, collapsed single string, separated commas. filter_logic: filter statement passed argument. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"pass export_data_access_groups value, default FALSE. following API help page version 10.5.1: flag viable user whose token used make API request data access group. user group, flag revert default value.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"","code":"# \\dontrun{ uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"9A81268476645C4E5F03428B8AC3AA7B\"  # Return all records and all variables. ds <- REDCapR:::redcap_read_eav_oneshot(redcap_uri=uri, token=token)$data #> 103 records and 3 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Return only records with IDs of 1 and 3 desired_records_v1 <- c(1, 3) ds_some_rows_v1 <- REDCapR:::redcap_read_eav_oneshot(   redcap_uri = uri,   token      = token,   records    = desired_records_v1 )$data #> 41 records and 3 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Return only the fields record_id, name_first, and age desired_fields_v1 <- c(\"record_id\", \"name_first\", \"age\") ds_some_fields_v1 <- REDCapR:::redcap_read_eav_oneshot(   redcap_uri = uri,   token      = token,   fields     = desired_fields_v1 )$data #> 15 records and 3 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Repeating token <- \"56F43A10D01D6578A46393394D76D88F\"  # PHI-free demo: Repeating Instruments --Sparse # 2603 ds <- REDCapR:::redcap_read_eav_oneshot(redcap_uri=uri, token=token)$data #> 45 records and 5 columns were read from REDCap in 0.4 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Read/Export records from a REDCap project — redcap_read_oneshot","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"function uses REDCap's API select return data.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"","code":"redcap_read_oneshot(   redcap_uri,   token,   records = NULL,   fields = NULL,   forms = NULL,   events = NULL,   raw_or_label = \"raw\",   raw_or_label_headers = \"raw\",   export_checkbox_label = FALSE,   export_survey_fields = FALSE,   export_data_access_groups = FALSE,   filter_logic = \"\",   datetime_range_begin = as.POSIXct(NA),   datetime_range_end = as.POSIXct(NA),   blank_for_gray_form_status = FALSE,   col_types = NULL,   na = c(\"\", \"NA\"),   guess_type = TRUE,   guess_max = 1000,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. records array, element corresponds ID desired record.  Optional. fields array, element corresponds desired project field.  Optional. forms array, element corresponds desired project form.  Optional. events array, element corresponds desired project event.  Optional. raw_or_label string (either 'raw' 'label') specifies whether export raw coded values labels options multiple choice fields.  Default 'raw'. raw_or_label_headers string (either 'raw' 'label' specifies CSV headers whether export variable/field names (raw) field labels (label).  Default 'raw'. export_checkbox_label specifies format checkbox field values specifically exporting data labels.  raw_or_label 'label' export_checkbox_label TRUE, values text displayed users.  Otherwise, values 0/1. export_survey_fields boolean specifies whether export survey identifier field (e.g., 'redcap_survey_identifier') survey timestamp fields (e.g., instrument+'_timestamp'). timestamp outputs reflect survey's completion time (according time timezone REDCap server.) export_data_access_groups boolean value specifies whether export redcap_data_access_group field data access groups utilized project. Default FALSE. See details . filter_logic String logic text (e.g., [gender] = 'male') filtering data returned API method, API return records (record-events, longitudinal project) logic evaluates TRUE.   blank/empty string returns records. datetime_range_begin return records created modified given datetime, provide POSIXct value. specified, REDCap assume begin time. datetime_range_end return records created modified given datetime, provide POSIXct value. specified, REDCap assume end time. blank_for_gray_form_status boolean value specifies whether export blank values instrument complete status fields gray status icon. instrument complete status fields gray icon can exported either blank value \"0\" (Incomplete). Blank values recommended data export data re-imported REDCap project. Default FALSE. col_types readr::cols() object passed internally readr::read_csv().  Optional. na character vector passed internally readr::read_csv(). Defaults c(\"\", \"NA\"). guess_type boolean value indicating columns returned character.  true, readr::read_csv() guesses intended data type column.  Ignored col_types null. guess_max positive base::numeric value passed readr::read_csv() specifies maximum number records use guessing column types. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"Currently, list returned following elements: data: tibble::tibble() desired records columns. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_collapsed: desired records IDs, collapsed single string, separated commas. fields_collapsed: desired field names, collapsed single string, separated commas. filter_logic: filter statement passed argument. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM. records retrieved (records meet filter criteria), zero-row tibble returned. Currently empty tibble zero columns, may change future.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"pass export_data_access_groups value, default FALSE. following API help page version 10.5.1: flag viable user whose token used make API request data access group. user group, flag revert default value. REDCap project may contain \"pseudofields\", depending structure. Pseudofields exported certain project structures, defined users appear codebook. recognized pseudofield passed fields api parameter, suppressed redcap_read() redcap_read_oneshot() server throw error. Requesting pseudofield discouraged, message returned user. Pseudofields include: redcap_event_name: longitudinal projects multi-arm projects. redcap_repeat_instrument:  projects repeating instruments. redcap_repeat_instance:   projects repeating instruments. redcap_data_access_group: projects DAGs export_data_access_groups api parameter TRUE. redcap_survey_identifier:  projects surveys export_survey_fields api parameter TRUE. instrument_name_timestamp: projects surveys. example, instrument called \"demographics\" pseudofield named demographics_timestamp. REDCapR suppress requests timestamps, server throw error like","code":"ERROR: The following values in the parameter fields are not valid: 'demographics_timestamp'"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"","code":"# \\dontrun{ uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"9A81268476645C4E5F03428B8AC3AA7B\"  # Return all records and all variables. ds <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token)$data #> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.  # Return only records with IDs of 1 and 3 desired_records_v1 <- c(1, 3) ds_some_rows_v1 <- REDCapR::redcap_read_oneshot(   redcap_uri = uri,   token      = token,   records    = desired_records_v1 )$data #> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200.  # Return only the fields record_id, name_first, and age desired_fields_v1 <- c(\"record_id\", \"name_first\", \"age\") ds_some_fields_v1 <- REDCapR::redcap_read_oneshot(   redcap_uri = uri,   token      = token,   fields     = desired_fields_v1 )$data #> 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200.  # Specify the column types. col_types <- readr::cols(   record_id  = readr::col_integer(),   race___1   = readr::col_logical(),   race___2   = readr::col_logical(),   race___3   = readr::col_logical(),   race___4   = readr::col_logical(),   race___5   = readr::col_logical(),   race___6   = readr::col_logical() ) ds_col_types <- REDCapR::redcap_read_oneshot(   redcap_uri = uri,   token      = token,   col_types  = col_types )$data #> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":null,"dir":"Reference","previous_headings":"","what":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"function uses REDCap's API select return data. function still development.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"","code":"redcap_read_oneshot_eav(   redcap_uri,   token,   records = NULL,   fields = NULL,   forms = NULL,   events = NULL,   raw_or_label = \"raw\",   raw_or_label_headers = \"raw\",   export_data_access_groups = FALSE,   filter_logic = \"\",   datetime_range_begin = as.POSIXct(NA),   datetime_range_end = as.POSIXct(NA),   blank_for_gray_form_status = FALSE,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. records array, element corresponds ID desired record.  Optional. fields array, element corresponds desired project field.  Optional. forms array, element corresponds desired project field.  Optional. events array, element corresponds desired project event.  Optional. raw_or_label string (either 'raw' 'label' specifies whether export raw coded values labels options multiple choice fields.  Default 'raw'. raw_or_label_headers string (either 'raw' 'label' specifies CSV headers whether export variable/field names (raw) field labels (label).  Default 'raw'. export_data_access_groups boolean value specifies whether export redcap_data_access_group field data access groups utilized project. Default FALSE. See details . filter_logic String logic text (e.g., [gender] = 'male') filtering data returned API method, API return records (record-events, longitudinal project) logic evaluates TRUE.   blank/empty string returns records. datetime_range_begin return records created modified given datetime, provide POSIXct (https://stat.ethz.ch/R-manual/R-devel/library/base/html/.POSIXlt.html) value. specified, REDCap assume begin time. datetime_range_end return records created modified given datetime, provide POSIXct (https://stat.ethz.ch/R-manual/R-devel/library/base/html/.POSIXlt.html) value. specified, REDCap assume end time. blank_for_gray_form_status boolean value specifies whether export blank values instrument complete status fields gray status icon. instrument complete status fields gray icon can exported either blank value \"0\" (Incomplete). Blank values recommended data export data re-imported REDCap project. Default FALSE. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"Currently, list returned following elements: data: tibble::tibble() desired records columns. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_collapsed: desired records IDs, collapsed single string, separated commas. fields_collapsed: desired field names, collapsed single string, separated commas. filter_logic: filter statement passed argument. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"pass export_data_access_groups value, default FALSE. following API help page version 5.2.3: flag viable user whose token used make API request data access group. user group, flag revert default value. REDCap 6.14.3, field exported EAV API call.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"","code":"# \\dontrun{ uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"9A81268476645C4E5F03428B8AC3AA7B\"  # Return all records and all variables. ds <- REDCapR:::redcap_read_oneshot_eav(redcap_uri=uri, token=token)$data #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Return only records with IDs of 1 and 3 desired_records_v1 <- c(1, 3) ds_some_rows_v1    <- REDCapR:::redcap_read_oneshot_eav(    redcap_uri = uri,    token      = token,    records    = desired_records_v1 )$data #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 24 variable metadata records were read from REDCap in 0.4 seconds.  The http status code was 200. #> 2 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Return only the fields record_id, name_first, and age desired_fields_v1 <- c(\"record_id\", \"name_first\", \"age\") ds_some_fields_v1 <- REDCapR:::redcap_read_oneshot_eav(    redcap_uri = uri,    token      = token,    fields     = desired_fields_v1 )$data #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 9 columns were read from REDCap in 0.2 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":null,"dir":"Reference","previous_headings":"","what":"Read/Export records that populate a REDCap report — redcap_report","title":"Read/Export records that populate a REDCap report — redcap_report","text":"Exports data set report created project's 'Data Exports, Reports, Stats' page.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read/Export records that populate a REDCap report — redcap_report","text":"","code":"redcap_report(   redcap_uri,   token,   report_id,   raw_or_label = \"raw\",   raw_or_label_headers = \"raw\",   export_checkbox_label = FALSE,   col_types = NULL,   guess_type = TRUE,   guess_max = 1000,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read/Export records that populate a REDCap report — redcap_report","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. report_id single integer, provided next report name report list page.  Required. raw_or_label string (either 'raw' 'label') specifies whether export raw coded values labels options multiple choice fields.  Default 'raw'. raw_or_label_headers string (either 'raw' 'label' specifies CSV headers whether export variable/field names (raw) field labels (label).  Default 'raw'. export_checkbox_label specifies format checkbox field values specifically exporting data labels.  raw_or_label 'label' export_checkbox_label TRUE, values text displayed users.  Otherwise, values 0/1. col_types readr::cols() object passed internally readr::read_csv().  Optional. guess_type boolean value indicating columns returned character.  true, readr::read_csv() guesses intended data type column.  Ignored col_types null. guess_max positive base::numeric value passed readr::read_csv() specifies maximum number records use guessing column types. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read/Export records that populate a REDCap report — redcap_report","text":"Currently, list returned following elements: data: tibble::tibble() desired records columns. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read/Export records that populate a REDCap report — redcap_report","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read/Export records that populate a REDCap report — redcap_report","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read/Export records that populate a REDCap report — redcap_report","text":"","code":"# \\dontrun{ uri          <- \"https://bbmc.ouhsc.edu/redcap/api/\" token        <- \"9A81268476645C4E5F03428B8AC3AA7B\" report_1_id  <- 5980L report_2_id  <- 6431L  # Return all records and all variables. ds_1a <-   REDCapR::redcap_report(     redcap_uri = uri,     token      = token,     report_id  = report_1_id   )$data #> 5 records and 5 columns were read from REDCap in 0.3 seconds.  The http status code was 200.   # Specify the column types. col_types_1 <- readr::cols(   record_id          = readr::col_integer(),   height             = readr::col_double(),   health_complete    = readr::col_integer(),   address            = readr::col_character(),   ethnicity          = readr::col_integer() ) ds_1b <-   REDCapR::redcap_report(     redcap_uri = uri,     token      = token,     report_id  = report_1_id,     col_types  = col_types_1   )$data #> 5 records and 5 columns were read from REDCap in 0.3 seconds.  The http status code was 200.   # Return condensed checkboxes Report option: #   \"Combine checkbox options into single column of only the checked-off #   options (will be formatted as a text field when exported to #   stats packages)\" col_types_2 <- readr::cols(   record_id          = readr::col_integer(),   race               = readr::col_character() ) ds_2 <-   REDCapR::redcap_report(     redcap_uri = uri,     token      = token,     report_id  = report_2_id,     col_types  = col_types_2   )$data #> 5 records and 2 columns were read from REDCap in 0.3 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Get survey link from REDCap — redcap_survey_link_export_oneshot","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"function uses REDCap's API get link survey.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"","code":"redcap_survey_link_export_oneshot(   redcap_uri,   token,   record,   instrument,   event = \"\",   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. record record ID associated survey link. Required instrument name instrument associated survey link.  Required event name event associated survey link. Optional verbose boolean value indicating messages printed R console operation.  Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"Currently, list returned following elements, survey_link: character string containing URL survey. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. instrument: instrument associated survey link. records_affected_count: number records associated survey link. affected_ids: subject IDs associated survey link. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"Currently, function modify variable types conform REDCap's supported variables.  See validate_for_write() helper function checks common important conflicts. Permissions Required use method, must API Export privileges project. (stated 9.0.0 documentation.)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"","code":"# \\dontrun{ uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"8FA9A6BDAE2C0B5DD3CB472DD8E8918C\" # pid=817 record  <- 1 instrument   <- \"participant_morale_questionnaire\" # event <- \"\" # only for longitudinal projects  result <- REDCapR::redcap_survey_link_export_oneshot(   record         = record,   instrument     = instrument,   redcap_uri     = uri,   token          = token ) #> Preparing to export the survey link for the instrument `participant_morale_questionnaire`. #> exported the survey link in 0.2 seconds, for instrument `participant_morale_questionnaire`, record `1`. result$survey_link #> [1] \"https://bbmc.ouhsc.edu/redcap/surveys/?s=8KuzSLMHf6\" # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":null,"dir":"Reference","previous_headings":"","what":"List authorized users — redcap_users_export","title":"List authorized users — redcap_users_export","text":"List users authorized project.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List authorized users — redcap_users_export","text":"","code":"redcap_users_export(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List authorized users — redcap_users_export","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List authorized users — redcap_users_export","text":"data_user: tibble::tibble() users associated project. One row represents one user. data_user_form: tibble::tibble() permissions users forms. One row represents unique user--form combination. success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"List authorized users — redcap_users_export","text":"Documentation REDCap 8.4.0","code":"This method allows you to export the list of users for a project, including their user privileges and also email address, first name, and last name.  Note: If the user has been assigned to a user role, it will return the user with the role's defined privileges."},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"List authorized users — redcap_users_export","text":"","code":"# \\dontrun{ uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"06DEFB601F9B46847DAA9DF0CFA951B4\" result   <- REDCapR::redcap_users_export(redcap_uri=uri, token=token) #> The REDCap users were successfully exported in 0.2 seconds.  The http status code was 200. result$data_user #> # A tibble: 2 × 34 #>   username        email          firstname lastname expiration data_access_group #>   <chr>           <chr>          <chr>     <chr>    <date>     <chr>             #> 1 unittestphifree wibeasley@hot… Unit Test PHI Free NA         daga              #> 2 wbeasleya       william-beasl… Will      Beasley… NA         NA                #> # ℹ 28 more variables: data_access_group_id <chr>, design <lgl>, alerts <dbl>, #> #   user_rights <int>, data_access_groups <lgl>, reports <lgl>, #> #   stats_and_charts <lgl>, manage_survey_participants <lgl>, calendar <lgl>, #> #   data_import_tool <lgl>, data_comparison_tool <lgl>, logging <lgl>, #> #   email_logging <lgl>, file_repository <lgl>, data_quality_create <lgl>, #> #   data_quality_execute <lgl>, api_export <lgl>, api_import <lgl>, #> #   api_modules <lgl>, mobile_app <lgl>, mobile_app_download_data <lgl>, … result$data_user_form #> # A tibble: 2 × 4 #>   username        form_name    permission_id permission #>   <chr>           <chr>                <int> <fct>      #> 1 unittestphifree demographics             1 edit_form  #> 2 wbeasleya       NA                      NA unknown    # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":null,"dir":"Reference","previous_headings":"","what":"Enumerate the exported variables — redcap_variables","title":"Enumerate the exported variables — redcap_variables","text":"function calls 'exportFieldNames' function REDCap API.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enumerate the exported variables — redcap_variables","text":"","code":"redcap_variables(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enumerate the exported variables — redcap_variables","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enumerate the exported variables — redcap_variables","text":"Currently, list returned following elements, data: tibble::tibble() row represents one column REDCap dataset. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Enumerate the exported variables — redcap_variables","text":"REDCap version 6.14.2, three variable types returned call: calculated, file, descriptive.  variables returned writable/uploadable.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Enumerate the exported variables — redcap_variables","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Enumerate the exported variables — redcap_variables","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enumerate the exported variables — redcap_variables","text":"","code":"# \\dontrun{ uri         <- \"https://bbmc.ouhsc.edu/redcap/api/\" token       <- \"9A81268476645C4E5F03428B8AC3AA7B\" ds_variable <- REDCapR::redcap_variables(redcap_uri=uri, token=token)$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine version of REDCap instance — redcap_version","title":"Determine version of REDCap instance — redcap_version","text":"function uses REDCap's API query version.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine version of REDCap instance — redcap_version","text":"","code":"redcap_version(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine version of REDCap instance — redcap_version","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine version of REDCap instance — redcap_version","text":"utils::packageDescription","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Determine version of REDCap instance — redcap_version","text":"API call unsuccessful, value base::package_version(\"0.0.0\") returned. ensures function always return object class base::numeric_version.  guarantees value can always used utils::compareVersion().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine version of REDCap instance — redcap_version","text":"","code":"uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"9A81268476645C4E5F03428B8AC3AA7B\" REDCapR::redcap_version(redcap_uri = uri, token = token) #> The REDCap version was successfully determined in 0.2 seconds. The http status code was 200.  Is is 14.6.4. #> [1] ‘14.6.4’"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":null,"dir":"Reference","previous_headings":"","what":"Write/Import records to a REDCap project — redcap_write","title":"Write/Import records to a REDCap project — redcap_write","text":"function uses REDCap's APIs select return data.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write/Import records to a REDCap project — redcap_write","text":"","code":"redcap_write(   ds_to_write,   batch_size = 100L,   interbatch_delay = 0.5,   continue_on_error = FALSE,   redcap_uri,   token,   overwrite_with_blanks = TRUE,   convert_logical_to_integer = FALSE,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write/Import records to a REDCap project — redcap_write","text":"ds_to_write base::data.frame() tibble::tibble() imported REDCap project.  Required. batch_size maximum number subject records single batch contain.  default 100. interbatch_delay number seconds function wait requesting new subset REDCap. default 0.5 seconds. continue_on_error error occurs writing, records subsequent batches attempted.  default FALSE, prevents subsequent batches running.  Required. redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. overwrite_with_blanks boolean value indicating blank/NA values R data frame overwrite data server. default behavior REDCapR, essentially deletes cell's value FALSE, blank/NA values data.frame ignored.  Optional. convert_logical_to_integer TRUE, base::logical columns ds cast integer uploading REDCap. Boolean values typically represented 0/1 REDCap radio buttons. Optional. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Write/Import records to a REDCap project — redcap_write","text":"Currently, list returned following elements: success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_affected_count: number records inserted updated. affected_ids: subject IDs inserted updated records. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Write/Import records to a REDCap project — redcap_write","text":"Currently, function modify variable types conform REDCap's supported variables. See validate_for_write() helper function checks common important conflicts. redcap_write function properly, user must Export permissions 'Full Data Set'.  Users 'De-Identified' export privileges can still use redcap_write_oneshot().  grant appropriate permissions: go 'User Rights' REDCap project site, select desired user, select 'Edit User Privileges', 'Data Exports' radio buttons, select 'Full Data Set'.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Write/Import records to a REDCap project — redcap_write","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Write/Import records to a REDCap project — redcap_write","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Write/Import records to a REDCap project — redcap_write","text":"","code":"if (FALSE) { # Define some constants uri           <- \"https://bbmc.ouhsc.edu/redcap/api/\" token         <- \"D70F9ACD1EDD6F151C6EA78683944E98\"  # Read the dataset for the first time. result_read1  <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token) ds1           <- result_read1$data ds1$telephone  # Manipulate a field in the dataset in a VALID way ds1$telephone <- paste0(\"(405) 321-000\", seq_len(nrow(ds1)))  ds1 <- ds1[1:3, ] ds1$age       <- NULL; ds1$bmi <- NULL # Drop the calculated fields before writing. result_write  <- REDCapR::redcap_write(ds1, redcap_uri=uri, token=token)  # Read the dataset for the second time. result_read2  <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token) ds2           <- result_read2$data ds2$telephone  # Manipulate a field in the dataset in an INVALID way.  A US exchange can't be '111'. ds1$telephone <- paste0(\"(405) 321-000\", seq_len(nrow(ds1)))  # This next line will throw an error. result_write <- REDCapR::redcap_write(ds1, redcap_uri=uri, token=token) result_write$raw_text }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Write/Import records to a REDCap project — redcap_write_oneshot","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"function uses REDCap's API select return data.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"","code":"redcap_write_oneshot(   ds,   redcap_uri,   token,   overwrite_with_blanks = TRUE,   convert_logical_to_integer = FALSE,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"ds base::data.frame() tibble::tibble() imported REDCap project. Required. redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. overwrite_with_blanks boolean value indicating blank/NA values R data frame overwrite data server. default behavior REDCapR, essentially deletes cell's value FALSE, blank/NA values data frame ignored.  Optional. convert_logical_to_integer TRUE, base::logical columns ds cast integer uploading REDCap. Boolean values typically represented 0/1 REDCap radio buttons. Optional. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"Currently, list returned following elements: success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_affected_count: number records inserted updated. affected_ids: subject IDs inserted updated records. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"Currently, function modify variable types conform REDCap's supported variables.  See validate_for_write() helper function checks common important conflicts.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"","code":"if (FALSE) { # Define some constants uri            <- \"https://bbmc.ouhsc.edu/redcap/api/\" token          <- \"D70F9ACD1EDD6F151C6EA78683944E98\"  # Read the dataset for the first time. result_read1   <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token) ds1            <- result_read1$data ds1$telephone  # Manipulate a field in the dataset in a VALID way ds1$telephone  <- paste0(\"(405) 321-000\", seq_len(nrow(ds1)))  ds1 <- ds1[1:3, ] ds1$age        <- NULL; ds1$bmi <- NULL # Drop the calculated fields before writing. result_write   <- REDCapR::redcap_write_oneshot(ds=ds1, redcap_uri=uri, token=token)  # Read the dataset for the second time. result_read2   <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token) ds2            <- result_read2$data ds2$telephone  # Manipulate a field in the dataset in an INVALID way.  A US exchange can't be '111'. ds1$telephone  <- paste0(\"(405) 321-000\", seq_len(nrow(ds1)))  # This next line will throw an error. result_write   <- REDCapR::redcap_write_oneshot(ds=ds1, redcap_uri=uri, token=token) result_write$raw_text }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":null,"dir":"Reference","previous_headings":"","what":"Create explicit factor level for missing values — replace_nas_with_explicit","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"Missing values converted factor level. explicit assignment can reduce chances missing values inadvertently ignored. also allows presence missing become predictor models.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"","code":"replace_nas_with_explicit(   scores,   new_na_label = \"Unknown\",   create_factor = FALSE,   add_unknown_level = FALSE )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"scores array values, ideally either factor character. Required new_na_label factor label assigned missing value. Defaults Unknown. create_factor Converts scores factor, one already. Defaults FALSE. add_unknown_level new factor level created? (Specify TRUE already exists.)   Defaults FALSE.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"array values, NA values now factor level, label specified new_na_label value.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"create_factor parameter respected scores already factor. Otherwise, levels without values lost. stop error thrown operation fails convert NA values.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"","code":"library(REDCapR) # Load the package into the current R session."},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":null,"dir":"Reference","previous_headings":"","what":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"functions essential calling REDCap API, instead functions help manage tokens securely.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"","code":"retrieve_credential_local(   path_credential,   project_id,   check_url            = TRUE,   check_username       = FALSE,   check_token_pattern  = TRUE,   username             = NA_character_ )  retrieve_credential_mssql(   project_id,   instance,   dsn,   channel    = NULL )  create_credential_local(   path_credential )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"path_credential file path CSV containing credentials. Required. project_id ID assigned project withing REDCap.  allows user store tokens multiple REDCap projects one file. Required check_url logical value indicates url credential file checked approximately correct form.  Defaults TRUE. retrieve_credential_local(). check_username logical value indicates username credential file checked username returned R. Defaults FALSE. check_token_pattern logical value indicates token credential file 32-character hexadecimal string.  Defaults FALSE. username character value used retrieve credential. See Notes . Optional. instance casual name associated REDCap instance campus.  allows one credential system accommodate multiple instances campus.  Required dsn DSN local machine points desired MSSQL database. Required. channel optional connection handle returned DBI::dbConnect().  See Details . Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"list following elements returned retrieve_credential_local() retrieve_credential_mssql(): redcap_uri: URI REDCap Server. username: Username. project_id: ID assigned project within REDCap. token: token pass REDCap server comment: optional string ignored REDCapR can helpful humans.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"database elements created script provided package's 'Security Database' vignette, default values work. create_credential_local() function copies static file location specified path_credential argument. record represents one accessible project per user. Follow steps adapt desired REDCap project(s): Modify credential file REDCap API text editor like Notepad++, Visual Studio Code, nano. Replace existing records information projects. Delete remaining example records. Make sure file (sensitive password-like) tokens stored securely! Contact REDCap admin request URI & token discuss institutional policies. Ask institution's security team recommendation info, see https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html Double-check file secured accessible users.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"Storing credentials server preferred Although strongly encourage storing tokens central server (e.g., see retrieve_credential_mssql() function \"SecurityDatabase\" vignette), times approach feasible token must stored locally.  Please contact us institution using something SQL Server, like help adapting approach infrastructure. Storing credentials locally storing credentials locally, typically credential file dedicated just one user. Occasionally makes sense store tokens multiple users –usually purpose testing. username field connected local credential file. need official username REDCap.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"","code":"# ---- Local File Example ---------------------------- path <- system.file(\"misc/example.credentials\", package = \"REDCapR\") (p1  <- REDCapR::retrieve_credential_local(path, 153L)) #> $redcap_uri #> [1] \"https://bbmc.ouhsc.edu/redcap/api/\" #>  #> $username #> [1] \"myusername\" #>  #> $project_id #> [1] 153 #>  #> $token #> [1] \"9A81268476645C4E5F03428B8AC3AA7B\" #>  #> $comment #> [1] \"simple static (read-only) test project\" #>  (p2  <- REDCapR::retrieve_credential_local(path, 212L)) #> $redcap_uri #> [1] \"https://bbmc.ouhsc.edu/redcap/api/\" #>  #> $username #> [1] \"myusername\" #>  #> $project_id #> [1] 212 #>  #> $token #> [1] \"0434F0E9CF53ED0587847AB6E51DE762\" #>  #> $comment #> [1] \"longitudinal (read-only) ARM test project\" #>    # \\dontrun{ # Create a skeleton of the local credential file to modify path_demo <- base::tempfile(pattern = \"temp\", fileext = \".credentials\")  create_credential_local(path_demo) #> [1] TRUE  base::unlink(path_demo) # This is just a demo; don't delete the real file! # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate and sanitize the user's REDCap token — sanitize_token","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"Verifies token nonmissing conforms legal pattern 32-character hexadecimal value. character must () digit 0-9, (b) uppercase letter -F, (c) lowercase letter -f. Trailing line endings removed. typical user call function directly.  However functions like redcap_read() call provide informative error message user. institutions create tokens –standard 32-character hexadecimal value.  pattern validates tokens can specified system environmental variable REDCAP_TOKEN_PATTERN using base::Sys.setenv. example, following regex pattern captures base64 encoded value 40 characters (opposed hexadecimal/base16 value 32 characters): ^([-Za-z\\\\d+/\\\\+=]{40})$. See https://rgxdb.com/r/1NUN74O6 https://regex101.com/library/lXFWqM alternative approaches validate base64 values. pattern specified, default 32-character hex token: ^([0-9A-Fa-f]{32})(?:\\\\n)?$.  important segment contained first () capturing group (.e., [0-9A-Fa-f]{32}). trailing newline character removed.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"","code":"sanitize_token(token)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"token REDCap token. Required.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"token, without terminal newline character.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"Although function accept parameter, influenced REDCAP_TOKEN_PATTERN environmental variable.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"Contact institution's REDCap administrator information project-specific token.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"Hao Zhu, Benjamin Nutter, Beasley, Jordan Mark Barbone","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"","code":"secret_token_1 <- \"12345678901234567890123456ABCDEF\" secret_token_2 <- \"12345678901234567890123456ABCDEF\\n\" secret_token_3 <- \"12345678901234567890123456abcdef\" REDCapR::sanitize_token(secret_token_1) #> [1] \"12345678901234567890123456ABCDEF\" REDCapR::sanitize_token(secret_token_2) #> [1] \"12345678901234567890123456ABCDEF\" REDCapR::sanitize_token(secret_token_3) #> [1] \"12345678901234567890123456abcdef\"  # Some institutions use a token system that follows a different pattern Sys.setenv(\"REDCAP_TOKEN_PATTERN\" = \"^([A-Za-z\\\\d+/\\\\+=]{10})$\")  secret_token_4 <- \"abcde1234=\" REDCapR::sanitize_token(secret_token_4) #> [1] \"abcde1234=\" Sys.getenv(\"REDCAP_TOKEN_PATTERN\") #> [1] \"^([A-Za-z\\\\d+/\\\\+=]{10})$\" Sys.unsetenv(\"REDCAP_TOKEN_PATTERN\")"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/to_api_array.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a vector to the array format expected by the REDCap API — to_api_array","title":"Convert a vector to the array format expected by the REDCap API — to_api_array","text":"Utility function convert vector array format expected REDCap API calls.  called internally REDCapR functions, intended called directly.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/to_api_array.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a vector to the array format expected by the REDCap API — to_api_array","text":"","code":"to_api_array(x, element_names)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/to_api_array.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a vector to the array format expected by the REDCap API — to_api_array","text":"x vector convert array format.  Can NULL. element_names string containing name API request parameter array.  Must either \"fields\" \"forms\".","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/to_api_array.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert a vector to the array format expected by the REDCap API — to_api_array","text":"x NULL list returned one element element x format: list(`element_names[0]` = x[1], `element_names[1]` = x[2], ...). x NULL NULL returned.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":null,"dir":"Reference","previous_headings":"","what":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"set functions inspect data frame anticipate problems writing REDCap's API.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"","code":"validate_for_write( d, convert_logical_to_integer, record_id_name )  validate_data_frame_inherits( d )  validate_no_logical( d, stop_on_error = FALSE )  validate_field_names( d, stop_on_error = FALSE )  validate_record_id_name( d, record_id_name = \"record_id\", stop_on_error = FALSE )  validate_repeat_instance( d, stop_on_error = FALSE )  validate_uniqueness( d, record_id_name, stop_on_error = FALSE)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"d base::data.frame() tibble::tibble() containing dataset used update REDCap project. record_id_name name field represents one record. default name REDCap \"record_id\". stop_on_error TRUE, error thrown violations. Otherwise, dataset summarizing problems returned. convert_logical_to_integer mimics convert_logical_to_integer parameter  redcap_write() checking potential importing problems. Defaults FALSE.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"tibble::tibble(), potential violation row. two columns : field_name: name field/column/variable might cause problems upload. field_index: position field.  (example, value '1' indicates first column, '3' indicates third column.) concern: description problem potentially caused field. suggestion: potential solution concern.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"functions listed Usage section inspect specific aspect dataset.  validate_for_write() function executes individual validation checks.  allows client check everything one call. Currently, individual checks include: validate_data_frame_inherits(d): d inherits base::data.frame() validate_field_names(d): columns d start lowercase letter, subsequent optional characters sequence () lowercase letters, (b) digits 0-9, /(c) underscores. (exact regex ^[-z][0-9a-z_]*$.) validate_record_id_name(d): d contains field called \"record_id\", whatever value passed record_id_name. validate_no_logical(d) (unless convert_logical_to_integer TRUE): d contain logical values (REDCap typically wants 0/1 values instead FALSE/TRUE). validate_repeat_instance(d): d integer redcap_repeat_instance, column present. validate_uniqueness(d, record_id_name = record_id_name): d contain multiple rows duplicate values record_id, redcap_event_name, redcap_repeat_instrument, redcap_repeat_instance (depending longitudinal & repeating structure project). Technically duplicate rows errors, feel almost always unintentional, lead irrecoverable corruption data. encounter additional types problems attempting write REDCap, please tell us creating new issue, incorporate new validation check function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"","code":"d1 <- data.frame(   record_id      = 1:4,   flag_logical   = c(TRUE, TRUE, FALSE, TRUE),   flag_Uppercase = c(4, 6, 8, 2) ) REDCapR::validate_for_write(d = d1) #> # A tibble: 2 × 4 #>   field_name     field_index concern                                  suggestion #>   <chr>          <chr>       <chr>                                    <chr>      #> 1 flag_Uppercase 3           A REDCap project does not allow field n… Change th… #> 2 flag_logical   2           The REDCap API does not automatically c… Convert t…  REDCapR::validate_for_write(d = d1, convert_logical_to_integer = TRUE) #> # A tibble: 1 × 4 #>   field_name     field_index concern                                  suggestion #>   <chr>          <chr>       <chr>                                    <chr>      #> 1 flag_Uppercase 3           A REDCap project does not allow field n… Change th…  # If `d1` is not a data.frame, the remaining validation checks are skipped: # REDCapR::validate_for_write(as.matrix(mtcars)) # REDCapR::validate_for_write(c(mtcars, iris))  d2 <- tibble::tribble(   ~record_id, ~redcap_event_name, ~redcap_repeat_instrument, ~redcap_repeat_instance,   1L, \"e1\", \"i1\", 1L,   1L, \"e1\", \"i1\", 2L,   1L, \"e1\", \"i1\", 3L,   1L, \"e1\", \"i1\", 4L,   1L, \"e1\", \"i2\", 1L,   1L, \"e1\", \"i2\", 2L,   1L, \"e1\", \"i2\", 3L,   1L, \"e1\", \"i2\", 4L,   2L, \"e1\", \"i1\", 1L,   2L, \"e1\", \"i1\", 2L,   2L, \"e1\", \"i1\", 3L,   2L, \"e1\", \"i1\", 4L, ) validate_uniqueness(d2) #> # A tibble: 0 × 4 #> # ℹ 4 variables: field_name <chr>, field_index <chr>, concern <chr>, #> #   suggestion <chr> validate_for_write(d2) #> # A tibble: 0 × 4 #> # ℹ 4 variables: field_name <chr>, field_index <chr>, concern <chr>, #> #   suggestion <chr>  d3 <- tibble::tribble(   ~record_id, ~redcap_event_name, ~redcap_repeat_instrument, ~redcap_repeat_instance,   1L, \"e1\", \"i1\", 1L,   1L, \"e1\", \"i1\", 3L,   1L, \"e1\", \"i1\", 3L, # Notice this duplicates the row above ) # validate_uniqueness(d3) # Throws error: # validate_uniqueness(d3, stop_on_error = TRUE)"},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"upcoming-changes-in-v120","dir":"Changelog","previous_headings":"","what":"Upcoming Changes in v1.2.0","title":"Upcoming Changes in v1.2.0","text":"features yet CRAN. Install remotes::install_github(\"OuhscBbmc/REDCapR\")","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"possibly-breaking-change-1-2-0","dir":"Changelog","previous_headings":"","what":"Possibly Breaking Change","title":"Upcoming Changes in v1.2.0","text":"changes possibly break existing code –’s unlikely. feel (directly indirectly) improve package considerably. redcap_read(), redcap_read_oneshot(), redcap_dag_read(), redcap_log_read(), redcap_report() return tibble instead data.frame. (#415) affect client code expect call like ds[, 3] return vector instead single-column data.frame/tibble. One solution upcast tibble data.frame (something like .data.frame()). recommend using approach works data.frames tibbles, ds[[3]] dplyr::pull(ds, \"gender\"). information, read short chapter R Data Science. *_collapsed parameters deprecated. want limit records/fields/forms/events, pass vector characters, scalar character separated commas (think everyone already). words use c(\"demographics\", \"blood_pressure\") instead \"demographics,blood_pressure\". relationships four pairs variables: someone using *_collapsed parameter, can programmatically convert vector like: redcap_read() automatically include “plumbing” variables, even ’re included list requested fields & forms. (#442). Specifically: record_id (’s customized name) always returned redcap_event_name returned longitudinal projects redcap_repeat_instrument redcap_repeat_instance returned projects repeating instruments help extract forms longitudinal & repeating projects. redcap_read() redcap_read_oneshot() now return empty dataset records retrieved (records meet filter criteria). Currently 0x0 tibble returned, may change future. now error deliberately thrown. (#452) redcap_event_instruments() now default returns mappings arms. previous default return mappings first arm. recreate previous behavior use call like REDCapR::redcap_event_instruments(uri, token_2, arms = \"1\"). (Suggested @januz, #482) redcap_users_export() used return boolean user_rights, now can 0, 1, 2. (#523)","code":"records_collapsed   <- collapse_vector(records  , records_collapsed) fields_collapsed    <- collapse_vector(fields   , fields_collapsed) forms_collapsed     <- collapse_vector(forms    , forms_collapsed) events_collapsed    <- collapse_vector(events   , events_collapsed) field_names <- trimws(unlist(strsplit(field_names_collapsed, \",\")))"},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-1-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"Upcoming Changes in v1.2.0","text":"New redcap_metadata_coltypes() function. Inspects fields types validation text field generate suggested readr::col_types object reflects project’s current data dictionary. object can passed col_types parameter redcap_read() redcap_read_oneshot(). (Suggested discussed @pbchase, @nutterb, @skadauke, & others, #405 & #294) New redcap_log_read() function. Exports project’s log. (Thanks @joundso, #383, #320) New redcap_project_info_read() function. Exports project’s information, language production status. (Suggested @skadauke, @timothytsai, @pbchase, #236, #410) New parameter blank_for_gray_form_status functions redcap_read(), redcap_read_oneshot(), redcap_read_oneshot_eav(). (@greg-botwin, #386, #389) httr::handle value accepted functions contact server. accommodate institutions unconventional environments. (Suggested @brandonpotvin, #429) sanitized_token() now accepts alternative regex pattern. (Suggested @maeon & @michalkouril, #370) redcap_read_eav_oneshot() UNexported function returns data EAV format (#437) redcap_metadata_read() now correctly subsets forms (identified & corrected @ezraporter, #431 & #445) New redcap_event_read() function. Exports metadata associated project’s longitudinal events (@ezraporter, #457 & #460)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-enhancements-1-2-0","dir":"Changelog","previous_headings":"","what":"Minor Enhancements","title":"Upcoming Changes in v1.2.0","text":"Better documentation server url (suggested @sutzig #395) read_read_oneshot()’s parameter guess_max now allows floating point values support readr::read_csv() ability accept Inf value. (Suggested @eveyp, #392) pkgdown pages run & display examples, CRAN still doesn’t run . ’s illegal call external resources/APIs CRAN computers –mostly occasionally unavailable, code breaks. (#419) redcap_download_file_oneshot() redcap_file_download_oneshot() redcap_file_upload_oneshot() redcap_file_upload_oneshot() redcap_download_instrument() redcap_instrument_download() redcap_dag_read() new data_access_group_id field (introduced maybe 13.1.0) (#459) redcap_users_export() new mycap_participants field (introduced maybe 13.0.0) (#459) Accommodate older versions REDCap don’t return project-level variable, like has_repeating_instruments_or_events, missing_data_codes, external_modules, bypass_branching_erase_field_prompt (@-mad-statter, #465, #466) redcap_meta_coltypes() correctly determines data type autonumber record_id fields. suggests character project DAGs, integer . (@pwildenhain, #472) redcap_log_read() now returns new column reflecting affected record id value (ref #478) redcap_read() redcap_read_oneshot() now remove “pseudofields” (e.g., redcap_event_name, redcap_repeat_instrument, & redcap_repeat_instance) fields parameter. Starting REDCap v13.4.10, error thrown server. REDCap return message common pseudofield requested explicitly user. (#477) redcap_event_instruments() now can return mappings arms, instead one arm per call.(Suggested @januz, #482) validate_data_frame_inherits() validate_field_names() validate_record_id_name() validate_uniqueness() validate_repeat_instance() validate_no_logical() redcap_read() checks event parameter throws error value recognized, project longitudinal (#493) regex regex_named_captures() forgiving ’s unnecessary leading space (@BlairCooper, #495, #501) redcap_log_read() assumes columns character, except timestamp (#525) redcap_file_download_oneshot() longer asks unnecessary parameter repeating_instrument (REDCap server ignores). (@BlairCooper, #506, #530) redcap_read() redcap_read_oneshot() accommodate readr::read_csv()’s parameter na. (Suggested @rmtrane #529)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-110-released-2022-08-10","dir":"Changelog","previous_headings":"","what":"Version 1.1.0 (released 2022-08-10)","title":"Version 1.1.0 (released 2022-08-10)","text":"CRAN release: 2022-08-10","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-1-1-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 1.1.0 (released 2022-08-10)","text":"New redcap_delete() function. deletes vector records. (Thanks @joundso, #372, #373) New redcap_arm_export() function. retrieves list REDCap project arms. (#375) redcap_read() redcap_read_oneshot() accept new locale parameter specifies date, time, number formats, like using comma decimal separator. readr::locale object. (#377, suggested @joundso) New redcap_instruments() function exports list data collection instruments project. (#381, @vcastro) New redcap_event_instruments() function exports instrument-event mappings project (.e., data collection instruments designated certain events longitudinal project). (#381, @vcastro) New redcap_dag_read() function returns Data Access Groups project (#382, @joundso) New detection REDCap trouble large request drops records. (#400 w/ @TimMonahan)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-enhancements-1-1-0","dir":"Changelog","previous_headings":"","what":"Minor Enhancements","title":"Version 1.1.0 (released 2022-08-10)","text":"sanitize_token() now allows lowercase characters –addition uppercase characters & digits. (#347, @jmbarbone) redcap_metadata_read() now uses json (instead csv) transfer dictionary server & client. accommodates super-wide dictionaries 35k+ variables. user shouldn’t notice difference, still receive data.frame. (#335, @januz & @datalorax) Include testthat::skip_on_cran() calls comply CRAN’s “fail gracefully” policy. Similarly, skip remaining examples depend external resources. (#352) retrieve_credential_local() can now user username identify desired credential row (#364) redcap_read() redcap_read_oneshot() gain http_response_encoding parameter ’s passed httr::content(). default value remains “UTF-8”. (#354, @lrasmus) Accommodate single-character REDCap variable names (#367 & #368, @daynefiler) Modify redcap_users_export() (calls REDCap’s user export). API dropped data_export variable added forms_export variable. (#396) redcap_read_oneshot_eav(): project isn’t longitudinal, dummy value event_id used internally (#396) testing server & projects, http errors little different, testing code adjusted (#396) Set httr::user_agent, following advice httr’s vignette (#397)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"test-suite-1-1-0","dir":"Changelog","previous_headings":"","what":"Test Suite","title":"Version 1.1.0 (released 2022-08-10)","text":"Added two dictionaries super wide -5k & 35k variables (#335 & #360, @januz & @datalorax) Read, modify, & read projects DAGs (#353, daniela.wolkersdorfer, #353)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-100-released-2021-07-21","dir":"Changelog","previous_headings":"","what":"Version 1.0.0 (released 2021-07-21)","title":"Version 1.0.0 (released 2021-07-21)","text":"CRAN release: 2021-07-22 package stable years reflected major version number.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-enhancements-1-0-0","dir":"Changelog","previous_headings":"","what":"Minor Enhancements","title":"Version 1.0.0 (released 2021-07-21)","text":"writing records server, functions redcap_write() redcap_write_oneshot() new parameter converts R’s logical/boolean columns integers. meshes well T/F Y/N items coded 1/0 underneath. default FALSE (ie, integers converted default), doesn’t break existing code. (#305) writing records server, functions redcap_write() redcap_write_oneshot() can toggle ability overwrite blank/NA cells (suggested @auricap, #315) functions redcap_read_oneshot(), redcap_read(), & redcap_read_oneshot_eav() now support parameters datetime_range_begin datetime_range_end. passed REDCap parameters dateRangeBegin dateRangeEnd, restricts records returned, based last modified date server. (Thanks @pbchase, #321 & #323.) Better documentation export_survey_fields parameter functions redcap_read() & redcap_read_oneshot(). (Thanks @isaactpetersen, #333) New function redcap_report() export records populate REDCap report. (#326.) New vignette Typical REDCap Workflow Data Analyst developed support workshop 2021 R/Medicine Conference (#332, @higgi13425, @kamclean, & Amanda Miller) New function create_credential_local() starts well-formed csv file can contain tokens. (#340, conversations @higgi13425 & @kamclean.)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"stability-features-1-0-0","dir":"Changelog","previous_headings":"","what":"Stability Features","title":"Version 1.0.0 (released 2021-07-21)","text":"update newer version testthat -v3.0.0 (#312) update newer version readr 2.0.0 (#343) update newer version readr 1.4.0 (#313) update newer version REDCap test server (#310) save expected datasets files -instead included actual test code (#308)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"corrections--bug-fixes-1-0-0","dir":"Changelog","previous_headings":"","what":"Corrections & Bug Fixes","title":"Version 1.0.0 (released 2021-07-21)","text":"Accepts one config_option element. (Proposed @BastienRance, #307) Fixed calculation success value returned redcap_read() redcap_write() parameter continue_on_error true. (Bug found @llrs, #317) redcap_survey_link_export_oneshot() documentation corrected & improved (@jrob95, #526)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-0110-released-2020-04-20","dir":"Changelog","previous_headings":"","what":"Version 0.11.0 (Released 2020-04-20)","title":"Version 0.11.0 (Released 2020-04-20)","text":"CRAN release: 2020-04-21","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"breaking-changes-possible-but-unlikely-0-11-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes (possible, but unlikely)","title":"Version 0.11.0 (Released 2020-04-20)","text":"kernel_api() defaults “text/csv” UTF-8 encoding. Formerly, function decide content-type encoding. details ‘Stability Features’ subsection. constant() longer accepts simplify options. integer vector always returned. (#280)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-11-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.11.0 (Released 2020-04-20)","text":"’s now possible specify exact col_types (readr::cols object) passed readr::read_csv() inside redcap_read_oneshot(). (#258) reader::type_convert() used batches stacked top . way, batches incompatible data types ’re combined. (#257; thanks @isaactpetersen #245) Consequently, guess_max parameter redcap_read() longer serves purpose, soft-deprecated. (#267) redcap_metadata_write() writes project’s metadata. (#274, @felixetorres) redcap_survey_link_export_oneshot() retrieves URL specific record’s survey (e.g., “https://bbmc.ouhsc.edu/redcap/surveys/?s=8KuzSLMHf6”) (#293) convert_logical_to_integer new parameter redcap_write() redcap_write_oneshot(). TRUE, [base::logical] columns ds cast integer uploading REDCap. Boolean values typically represented 0/1 REDCap radio buttons. Defaults FALSE maintain backwards compatibility. (#305)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"stability-features-0-11-0","dir":"Changelog","previous_headings":"","what":"Stability Features","title":"Version 0.11.0 (Released 2020-04-20)","text":"httr::content() (inside kernel_api()) now processes returned value “text/csv”, default. prevent strange characters tricking process internal variable raw_text formed. See [httr::content()](https://httr.r-lib.org/reference/content.html) documentation list possible values thecontent_type` parameter. (Thanks great debugging @vortexing #269, @sybandrew #272, & @begavett, #290) Similarly, kernel_api() now encoding parameter, defaults “UTF-8”. (#270)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-enhancements-0-11-0","dir":"Changelog","previous_headings":"","what":"Minor Enhancements","title":"Version 0.11.0 (Released 2020-04-20)","text":"check bad field names passed read records functions (#288)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"corrections-0-11-0","dir":"Changelog","previous_headings":"","what":"Corrections","title":"Version 0.11.0 (Released 2020-04-20)","text":"‘checkmate’ package now imported, suggested (Thanks @dtenenba, #255). Allow one httr::config() parameter passed (Thanks @BastienRance, #307).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-0102-released-2019-09-22","dir":"Changelog","previous_headings":"","what":"Version 0.10.2 (Released 2019-09-22)","title":"Version 0.10.2 (Released 2019-09-22)","text":"CRAN release: 2019-09-23","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-new-features-0-10-2","dir":"Changelog","previous_headings":"","what":"Minor New Features","title":"Version 0.10.2 (Released 2019-09-22)","text":"export survey time-stamps optionally (Issue #159) redcap_next_free_record_name(): API call ‘Generate Next Record Name’, returns next available record ID (Issue #237) redcap_read() redcap_read_oneshot() allow user specify variables returned character data type. default allow readr::read_csv() guess data type. (#194) redcap_read_oneshot() allows use specify many rows considered readr::read_csv() guesses data type. (#194) redcap_read(), redcap_read_oneshot(), redcap_read_oneshot_eav() always return Linux-style line endings (ie \\n) instead Windows style line endings (ie, \\r\\n) OSes. (#198) read_metadata() always returns character vectors variables. readr 1.2.0, column returned differently . (#193) ‘raw_or_label_headers’ now supported (Thanks Hatem Hosny - hatemhosny, #183 & #203) ‘export_checkbox_labels’ now supported (#186) redcap_users_export() now included (#163) ‘forms’ now supported redcap_read(), redcap_read_oneshot(), & redcap_read_oneshot_eav()(#206). already implemented redcap_metadata_read(). records affected, zero-length character vector returned (instead sometimes zero-length numeric vector) (#212) New function (called constants()) easily exposes REDCap-specific constants. (#217) id_position allows user specify record_id isn’t first position (#207). However, recommend REDCap projects keep important variable first data dictionary. Link new secure Zenodo DOI resolver (@katrinleinweber #191) parameters redcap_read() redcap_read_oneshot() consistent order raw REDCap API. (#204) verbose parameter NULL, value getOption(“verbose”) used. (#215) guess_max parameter provided redcap_read() (longer just redcap_read_oneshot()). Suggested @isaactpetersen #245. Documentation website constructed pkgdown (#224). redcap_variables() now throws error passed bad URI (commit e542155639bbb7).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"modified-internals-0-10-2","dir":"Changelog","previous_headings":"","what":"Modified Internals","title":"Version 0.10.2 (Released 2019-09-22)","text":"interaction REDCap server goes new kernal_api() function, uses ‘httr’ ‘curl’ packages underneath. now, function called packages directly. (#213) converting REDCap’s CSV R’s data.frame, readr::read_csv() used instead utils::read.csv() (Issue #127). updated readr 1.2.0 (#200). changed data variables assigned data types. uses odbc package retrieve credentials token server. Remove RODBC RODBCext (#188). Thanks @krlmlr error checking advice https://stackoverflow.com//50419403/1082435. data.table::rbindlist() replaced dplyr::bind_rows() checkmate package inspects function parameters now (instead testit::assert() base:stop() ) (#190 & #208). collapse_vector() refactored tested (#209) remove dependency pkgload package (#218) Update Markdown syntax new formatting problems (#253)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"deprecated-features-0-10-2","dir":"Changelog","previous_headings":"","what":"Deprecated Features","title":"Version 0.10.2 (Released 2019-09-22)","text":"retrieve_token_mssql(), retrieve_credential_mssql() general useful.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-098-released-2017-05-18","dir":"Changelog","previous_headings":"","what":"Version 0.9.8 (Released 2017-05-18)","title":"Version 0.9.8 (Released 2017-05-18)","text":"CRAN release: 2017-05-18","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-9-8","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.9.8 (Released 2017-05-18)","text":"Enumerate exported variables. redcap_variables(). Experimental EAV export redcap_read_oneshot_eav(), can accessed triple colon (ie, REDCapR::redcap_read_oneshot_eav()).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"bug-fixes-0-9-8","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"Version 0.9.8 (Released 2017-05-18)","text":"Adapted new 2.4 version curl (see #154)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-07-1-released-2014-12-17","dir":"Changelog","previous_headings":"","what":"Version 0.7-1 (Released 2014-12-17)","title":"Version 0.7-1 (Released 2014-12-17)","text":"CRAN release: 2014-12-18","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-7-1","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.7-1 (Released 2014-12-17)","text":"Updated Version 6.0.x REDCap (introduced lot improvements API behavior).","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-6","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.6 (Released 2014-11-03)","text":"config_options httr package exposed REDCapR user. See issues #55 & #58; thanks @rparrish @nutterb contributions (https://github.com/OuhscBbmc/REDCapR/issues/55 & https://github.com/OuhscBbmc/REDCapR/issues/58).","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-5","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.5 (Released 2014-10-19)","text":"redcap_metadata_read() tested public.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-updates-0-5","dir":"Changelog","previous_headings":"","what":"Minor Updates","title":"Version 0.5 (Released 2014-10-19)","text":"Test suite now uses testthat::skip_on_cran() call involving OUHSC’s REDCap server. Vignette example subsetting, conditioned second variable’s value.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-04-28-released-2014-09-20","dir":"Changelog","previous_headings":"","what":"Version 0.4-28 (Released 2014-09-20)","title":"Version 0.4-28 (Released 2014-09-20)","text":"CRAN release: 2014-09-20","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-4-28","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.4-28 (Released 2014-09-20)","text":"redcap_write() redcap_write_oneshot() now tested public. redcap_write() redcap_write_oneshot() now tested public. redcap_download_file_oneshot() function contributed John Aponte (@johnaponte; Pull request #35) redcap_upload_file_oneshot() function contributed @johnaponte (Pull request #34) Users can specify operation continue error occurs batch read write. Regardless choice, debugging output written console verbose==TRUE. Follows advice @johnaponte, Benjamin Nutter (@nutterb), Rollie Parrish (@rparrish). Closes #43.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"breaking-changes-0-4-28","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"Version 0.4-28 (Released 2014-09-20)","text":"records_collapsed default empty value now empty string (.e., \"\") instead NULL. applies records_collapsed either parameter, returned value.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"updates-0-4-28","dir":"Changelog","previous_headings":"","what":"Updates","title":"Version 0.4-28 (Released 2014-09-20)","text":"default, SSL certs come httr package. However, REDCapR continue maintain copy case httr’s version CRAN gets date. tests split two collections: one ’s run CRAN checks, run manually. Thanks, Gabor Csardi. test dependency outside package code (especially REDCap test projects) run manually changes test databases won’t affect success building previous version CRAN. Corrected typo redcap_download_file_oneshot() documentation, thanks Andrew Peters (@ARPeters #45).","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-3","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.3 (Released 2014-09-01)","text":"Relies httr package, provides benefits like status code message can captured (eg, 200-OK, 403-Forbidden, 404-NotFound). See https://cran.r-project.org/package=httr.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"updates-0-3","dir":"Changelog","previous_headings":"","what":"Updates","title":"Version 0.3 (Released 2014-09-01)","text":"Renamed former status_message outcome_message. message associated http code returned conventionally called ‘status messages’ (eg, OK, Forbidden, Found). operation successful, raw_text value (formerly called raw_csv) returned empty string save RAM. ’s really necessary httr’s status message exposed.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"bug-fixes-0-3","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"Version 0.3 (Released 2014-09-01)","text":"Correct batch reads longitudinal schema #27","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-2","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.2 (Released 2014-07-02)","text":"Added redcap_column_sanitize() function address non-ASCII characters Added redcap_write() (internal function). redcap_project() object reduces repeatedly passing parameters like server URL, user token, SSL cert location.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"updates-0-2","dir":"Changelog","previous_headings":"","what":"Updates","title":"Version 0.2 (Released 2014-07-02)","text":"New Mozilla SSL Certification Bundles released cURL (released 2013-12-05) Renamed redcap_read_batch() redcap_read(). changes reflect suggestion reads typically batched. Renamed redcap_read() redcap_read_oneshot() Renamed redcap_write() redcap_write_oneshot() (internal function). Small renames parameters","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-1","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.1 (Released 2014-01-14)","text":"Introduces redcap_read() redcap_read_batch() documentation SSL verify peer default, using cert file included package Initial submission GitHub","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"enhancements-0-1","dir":"Changelog","previous_headings":"","what":"Enhancements","title":"Version 0.1 (Released 2014-01-14)","text":"redcap_read() takes parameter raw_or_label (Thanks Rollie Parrish #3) redcap_read() takes parameter export_data_access_groups thanks Rollie Parrish (@rparrish #4) GitHub Commits Releases detailed change log, please see https://github.com/OuhscBbmc/REDCapR/commits/main. list major releases, please see https://github.com/OuhscBbmc/REDCapR/releases.","code":""}]
+[{"path":"https://ouhscbbmc.github.io/REDCapR/CONDUCT.html","id":null,"dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"Contributor Code of Conduct","text":"contributors maintainers project, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. committed making participation project harassment-free experience everyone, regardless level experience, gender, gender identity expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion. Examples unacceptable behavior participants include use sexual language imagery, derogatory comments personal attacks, trolling, public private harassment, insults, unprofessional conduct. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct. Project maintainers follow Code Conduct may removed project team. Instances abusive, harassing, otherwise unacceptable behavior may reported opening issue contacting one project maintainers. Code Conduct adapted Contributor Covenant (http:contributor-covenant.org), version 1.0.0, available https://contributor-covenant.org/version/1/0/0/.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2021 REDCapR authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"reading-redcap-data","dir":"Articles","previous_headings":"","what":"Reading REDCap Data","title":"Basic REDCapR Operations","text":"functions redcap_read() redcap_read_oneshot() use httr package call REDCap API.","code":"## Loading required namespace: kableExtra"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"set-project-wide-values","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Set project-wide values","title":"Basic REDCapR Operations","text":"information specific REDCap project, opposed individual operation. includes (1) uri server, (2) token user’s project.","code":"library(REDCapR) # Load the package into the current R session. uri   <- \"https://bbmc.ouhsc.edu/redcap/api/\" token <- \"9A81268476645C4E5F03428B8AC3AA7B\" # `UnitTestPhiFree` user and simple project (pid 153)"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"read-all-records-and-fields","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Read all records and fields","title":"Basic REDCapR Operations","text":"information passed desired records fields, entire data set returned. two parameters required, redcap_uri token. Unless verbose parameter set FALSE, message printed R console number records fields returned.","code":"# Return all records and all variables. ds_all_rows_all_fields <- redcap_read(redcap_uri = uri, token = token)$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.6 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 05:08:57.132047. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200. ds_all_rows_all_fields # Inspect the returned dataset #> # A tibble: 5 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         2 Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10    11     1 #> 3         3 Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09    80     1 #> 4         4 Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02    61     0 #> 5         5 John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15    59     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"read-a-subset-of-the-records","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Read a subset of the records","title":"Basic REDCapR Operations","text":"subset records desired, two approaches shown . first pass array (element ID) records parameter. second pass single string (elements separated commas) records_collapsed parameter. first format natural R users. second format expected REDCap API. value records specified, records_collapsed specified, redcap_read_oneshot automatically converts array format needed API.","code":"# Return only records with IDs of 1 and 3 desired_records <- c(1, 3) ds_some_rows_v1 <- redcap_read(   redcap_uri = uri,   token      = token,   records    = desired_records )$data #> 24 variable metadata records were read from REDCap in 0.1 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200. #> Starting to read 2 records  at 2024-09-07 05:08:59.155095. #> Reading batch 1 of 1, with subjects 1 through 3 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.8 seconds.  The http status code was 200."},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"read-a-subset-of-the-fields","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Read a subset of the fields","title":"Basic REDCapR Operations","text":"subset fields desired, two approaches exist. first pass array (element field) fields parameter. second pass single string (elements separated commas) fields_collapsed parameter. Like records records_collapsed described , function converts natural format (.e., fields) format required API (.e., fields_collapsed) fields specified fields_collapsed .","code":"# Return only the fields record_id, name_first, and age desired_fields <- c(\"record_id\", \"name_first\", \"age\") ds_some_fields <- redcap_read(   redcap_uri = uri,   token      = token,   fields     = desired_fields )$data #> 24 variable metadata records were read from REDCap in 0.1 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.3 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 05:09:02.157745. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 3 columns were read from REDCap in 0.4 seconds.  The http status code was 200."},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"read-a-subset-of-records-conditioned-on-the-values-in-some-variables","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Read a subset of records, conditioned on the values in some variables","title":"Basic REDCapR Operations","text":"two techniques can combined datasets large don’t want pull records certain values. Suppose want select subjects previous dataset born 1960 weight 70kg. Two calls server required. first call REDCap pulls records, three columns: record_id, dob, weight. subset, identify records want pull data ; case, desired record_id values 3 & 5. second call REDCap pulls columns, identified records.","code":"###### ## Step 1: First call to REDCap desired_fields_v3 <- c(\"record_id\", \"dob\", \"weight\") ds_some_fields_v3 <- redcap_read(   redcap_uri = uri,   token      = token,   fields     = desired_fields_v3 )$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.4 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.4 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.5 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 05:09:05.091162. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200.  ds_some_fields_v3 #Examine the these three variables. #> # A tibble: 5 × 3 #>   record_id dob        weight #>       <dbl> <date>      <dbl> #> 1         1 2003-08-30      1 #> 2         2 2003-03-10      1 #> 3         3 1934-04-09     80 #> 4         4 1952-11-02     54 #> 5         5 1955-04-15    104  ###### ## Step 2: identify desired records, based on age & weight before_1960 <- (ds_some_fields_v3$dob <= as.Date(\"1960-01-01\")) heavier_than_70_kg <- (ds_some_fields_v3$weight > 70) desired_records_v3 <- ds_some_fields_v3[before_1960 & heavier_than_70_kg, ]$record_id  desired_records_v3 #Peek at IDs of the identified records #> [1] 3 5  ###### ## Step 3: second call to REDCap #Return only records that met the age & weight criteria. ds_some_rows_v3 <- redcap_read(   redcap_uri = uri,   token      = token,   records    = desired_records_v3 )$data #> 24 variable metadata records were read from REDCap in 0.3 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.4 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 records and 1 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Starting to read 2 records  at 2024-09-07 05:09:07.570098. #> Reading batch 1 of 1, with subjects 3 through 5 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  ds_some_rows_v3 #Examine the results. #> # A tibble: 2 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         3 Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09    80     1 #> 2         5 John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15    59     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"additional-returned-information","dir":"Articles","previous_headings":"Reading REDCap Data","what":"Additional Returned Information","title":"Basic REDCapR Operations","text":"examples shown resulting data frame, specifying $data end call. However, available wanting additional information, : data object data frame, previous examples. success boolean value indicates redcap_read_oneshot believes operation completed intended. status_codes collection http status codes, separated semicolons. one code batch attempted. outcome_messages: collection human readable strings indicating operations’ semicolons. one code batch attempted. unsuccessful operation, contain diagnostic information. records_collapsed field passed API. shows record subsets, , requested. fields_collapsed fields passed API. shows field subsets, , requested. elapsed_seconds measures duration call.","code":"#Return only the fields record_id, name_first, and age all_information <- redcap_read(   redcap_uri = uri,   token      = token,   fields     = desired_fields ) #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.6 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 05:09:10.115858. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200. all_information #Inspect the additional information #> $data #> # A tibble: 5 × 3 #>   record_id name_first   age #>       <dbl> <chr>      <dbl> #> 1         1 Nutmeg        11 #> 2         2 Tumtum        11 #> 3         3 Marcus        80 #> 4         4 Trudy         61 #> 5         5 John Lee      59 #>  #> $success #> [1] TRUE #>  #> $status_codes #> [1] \"200\" #>  #> $outcome_messages #> [1] \"5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200.\" #>  #> $records_collapsed #> [1] \"\" #>  #> $fields_collapsed #> [1] \"record_id,name_first,age\" #>  #> $forms_collapsed #> [1] \"\" #>  #> $events_collapsed #> [1] \"\" #>  #> $filter_logic #> [1] \"\" #>  #> $datetime_range_begin #> [1] NA #>  #> $datetime_range_end #> [1] NA #>  #> $elapsed_seconds #> [1] 2.569948"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/BasicREDCapROperations.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Basic REDCapR Operations","text":"sake documentation reproducibility, current report rendered following environment. Click line expand. Report rendered runner 2024-09-07, 05:09 +0000 16 seconds.","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #>  setting  value #>  version  R version 4.4.1 (2024-06-14) #>  os       macOS Sonoma 14.6.1 #>  system   aarch64, darwin20 #>  ui       X11 #>  language en #>  collate  en_US.UTF-8 #>  ctype    en_US.UTF-8 #>  tz       UTC #>  date     2024-09-07 #>  pandoc   3.1.11 @ /usr/local/bin/ (via rmarkdown) #>  #> ─ Packages ─────────────────────────────────────────────────────────────────── #>  package     * version  date (UTC) lib source #>  backports     1.5.0    2024-05-23 [1] CRAN (R 4.4.0) #>  bit           4.0.5    2022-11-15 [1] CRAN (R 4.4.0) #>  bit64         4.0.5    2020-08-30 [1] CRAN (R 4.4.0) #>  bslib         0.8.0    2024-07-29 [1] CRAN (R 4.4.0) #>  cachem        1.1.0    2024-05-16 [1] CRAN (R 4.4.0) #>  checkmate     2.3.2    2024-07-29 [1] CRAN (R 4.4.0) #>  cli           3.6.3    2024-06-21 [1] CRAN (R 4.4.0) #>  colorspace    2.1-1    2024-07-26 [1] CRAN (R 4.4.0) #>  crayon        1.5.3    2024-06-20 [1] CRAN (R 4.4.0) #>  curl          5.2.2    2024-08-26 [1] CRAN (R 4.4.1) #>  desc          1.4.3    2023-12-10 [1] CRAN (R 4.4.0) #>  digest        0.6.37   2024-08-19 [1] CRAN (R 4.4.1) #>  dplyr         1.1.4    2023-11-17 [1] CRAN (R 4.4.0) #>  evaluate      0.24.0   2024-06-10 [1] CRAN (R 4.4.0) #>  fansi         1.0.6    2023-12-08 [1] CRAN (R 4.4.0) #>  fastmap       1.2.0    2024-05-15 [1] CRAN (R 4.4.0) #>  fs            1.6.4    2024-04-25 [1] CRAN (R 4.4.0) #>  generics      0.1.3    2022-07-05 [1] CRAN (R 4.4.0) #>  glue          1.7.0    2024-01-09 [1] CRAN (R 4.4.0) #>  hms           1.1.3    2023-03-21 [1] CRAN (R 4.4.0) #>  htmltools     0.5.8.1  2024-04-04 [1] CRAN (R 4.4.0) #>  httr          1.4.7    2023-08-15 [1] CRAN (R 4.4.0) #>  jquerylib     0.1.4    2021-04-26 [1] CRAN (R 4.4.0) #>  jsonlite      1.8.8    2023-12-04 [1] CRAN (R 4.4.0) #>  kableExtra    1.4.0    2024-01-24 [1] CRAN (R 4.4.0) #>  knitr       * 1.48     2024-07-07 [1] CRAN (R 4.4.0) #>  lifecycle     1.0.4    2023-11-07 [1] CRAN (R 4.4.0) #>  magrittr    * 2.0.3    2022-03-30 [1] CRAN (R 4.4.0) #>  munsell       0.5.1    2024-04-01 [1] CRAN (R 4.4.0) #>  pillar        1.9.0    2023-03-22 [1] CRAN (R 4.4.0) #>  pkgconfig     2.0.3    2019-09-22 [1] CRAN (R 4.4.0) #>  pkgdown       2.1.0    2024-07-06 [1] CRAN (R 4.4.0) #>  R6            2.5.1    2021-08-19 [1] CRAN (R 4.4.0) #>  ragg          1.3.2    2024-05-15 [1] CRAN (R 4.4.0) #>  readr         2.1.5    2024-01-10 [1] CRAN (R 4.4.0) #>  REDCapR     * 1.1.9007 2024-09-07 [1] local #>  rlang         1.1.4    2024-06-04 [1] CRAN (R 4.4.0) #>  rmarkdown     2.28     2024-08-17 [1] CRAN (R 4.4.0) #>  rstudioapi    0.16.0   2024-03-24 [1] CRAN (R 4.4.0) #>  sass          0.4.9    2024-03-15 [1] CRAN (R 4.4.0) #>  scales        1.3.0    2023-11-28 [1] CRAN (R 4.4.0) #>  sessioninfo   1.2.2    2021-12-06 [1] CRAN (R 4.4.0) #>  stringi       1.8.4    2024-05-06 [1] CRAN (R 4.4.0) #>  stringr       1.5.1    2023-11-14 [1] CRAN (R 4.4.0) #>  svglite       2.1.3    2023-12-08 [1] CRAN (R 4.4.0) #>  systemfonts   1.1.0    2024-05-15 [1] CRAN (R 4.4.0) #>  textshaping   0.4.0    2024-05-24 [1] CRAN (R 4.4.0) #>  tibble        3.2.1    2023-03-20 [1] CRAN (R 4.4.0) #>  tidyselect    1.2.1    2024-03-11 [1] CRAN (R 4.4.0) #>  tzdb          0.4.0    2023-05-12 [1] CRAN (R 4.4.0) #>  utf8          1.2.4    2023-10-22 [1] CRAN (R 4.4.0) #>  vctrs         0.6.5    2023-12-01 [1] CRAN (R 4.4.0) #>  viridisLite   0.4.2    2023-05-02 [1] CRAN (R 4.4.0) #>  vroom         1.6.5    2023-12-05 [1] CRAN (R 4.4.0) #>  withr         3.0.1    2024-07-31 [1] CRAN (R 4.4.0) #>  xfun          0.47     2024-08-17 [1] CRAN (R 4.4.0) #>  xml2          1.3.6    2023-12-04 [1] CRAN (R 4.4.0) #>  yaml          2.3.10   2024-07-26 [1] CRAN (R 4.4.0) #>  #>  [1] /Users/runner/work/_temp/Library #>  [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #>  #> ──────────────────────────────────────────────────────────────────────────────"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"description","dir":"Articles","previous_headings":"","what":"Description","title":"Security Database","text":"SQL code adds schemas, table two stored procedures existing Microsoft SQL Server database. second database essential calling REDCap API, helps manage tokens securely. database contains tokens sensitive content (passwords, API tokens, file paths) stored Git repository (even private Git repository). passwords can retrieved REDCapR::retrieve_credential_mssql().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"create-a-dsn-on-each-client","dir":"Articles","previous_headings":"","what":"Create a DSN on each client","title":"Security Database","text":"executing SQL code existing database, create ODBC DSN client machine calls database. Download recent drivers (Aug 2018, recent version 17 Windows Linux), run wizard. Many values wizard remain default values. important ones change. Set DSN’s name field whatever used repository’s R code. Set authenticity method Integrated Windows authentication. Set default database name database containing tokens code , DSN database named auxiliary_security.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"note","dir":"Articles","previous_headings":"","what":"Note","title":"Security Database","text":"use Microsoft SQL Server, fits university’s infrastructure easily. approach theoretically can work LDAP-enabled database server. Please contact us institution using something SQL Server (different configuration components), like help adapting approach.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"create-database","dir":"Articles","previous_headings":"","what":"Create Database","title":"Security Database","text":"SQL code run inside existing database establish schemas, table, stored procedure used REDCapR::retrieve_credential_mssql(). example, ’ve arbitrarily called database auxiliary_security.","code":"------- SQL code to create necessary components in a Microsoft SQL Sever database -------  ----------------------------------------------------------------------- -- Create two schemas. -- The first schema is accessible by all REDCap API users. -- The second schema is restricted to administrators. -- CREATE SCHEMA [redcap] CREATE SCHEMA [redcap_private] GO  ----------------------------------------------------------------------- -- Create a table to contain the token CREATE TABLE redcap_private.tbl_credential (   id            smallint        primary key,   username      varchar(30)     not null,   project_id    smallint        not null,   instance      varchar(30)     not null,   token         char(32)        not null,   redcap_uri    varchar(255)    not null )  CREATE UNIQUE NONCLUSTERED INDEX IX_tbl_credential_unique ON redcap_private.tbl_credential (   instance        asc,   project_id      asc,   username        asc )  ----------------------------------------------------------------------- -- Create a stored procedure for users to call to retrieve the token. -- Notice it should a different (and more permissive) schema than the table. -- CREATE PROCEDURE redcap.prc_credential   @project_id smallint,   @instance   varchar(30) AS BEGIN   SET NOCOUNT ON;    SELECT username, project_id, token, redcap_uri FROM redcap_private.tbl_credential   WHERE     username   = system_user -- The username from the server's OS.     AND     project_id = @project_id -- Restricts to the desired REDCap project.     AND     instance   = @instance   -- System accommodates multiple REDCap instances. END"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"create-user-credentials-to-the-auxiliary-database","dir":"Articles","previous_headings":"","what":"Create user credentials to the auxiliary database","title":"Security Database","text":"Add user’s LDAP account auxiliary_security database can query tables retrieve API. Notice gives permissions retrieve token. still must grant API privileges appropriate REDCap project. automation R file copy API token MySQL database auxiliary_security database (see ‘Transfer Credentials’ section). database admins authorization ‘redcap_private’ schema. Typical users authorized schema. current system allows typical users view tokens.","code":"----------------------------------------------------------------------- -- Add a user account to the auxiliary_security database so that they can query the tables to retrieve their API. -- Notice that this only gives the permissions to retrieve the token.  You must still: --   1) grant them API privileges to each appropriate REDCap project, and --   2) copy the API from the REDCap database into the  auxiliary_security database. -- Also, do not give typical users authorization for the 'redcap_private' schema.  The current system allows them to view only their own tokens. -----------------------------------------------------------------------  -- STEP #1: Declare the user name.  If everything runs correctly, this should be the only piece of code that you need to modify. print 'Step #1 executing....' USE [master] GO DECLARE @qualified_user_name varchar(255); SET @qualified_user_name = '[OUHSC\\lsuarez3]' print 'Resulting login name: ' + @qualified_user_name; print ''  --EXEC sp_helplogins @LoginNamePattern=@qualified_user_name --SELECT * FROM master..syslogins WHERE name = @qualified_user_name --SELECT * FROM auxiliary_security.sys.sysusers --SELECT * FROM sys.database_permissions --SELECT * FROM sys.server_principals  ----------------------------------------------------------------------- -- STEP #2: Create a login for the *server*. print 'Step #2 executing....' DECLARE @sql_create_login nvarchar(max) SET @sql_create_login = 'CREATE LOGIN ' + @qualified_user_name + ' FROM WINDOWS WITH DEFAULT_DATABASE=[auxiliary_security]' EXECUTE sp_executesql @sql_create_login DECLARE @login_count AS INT; SET @login_count = (SELECT COUNT(*) AS login_count FROM master..syslogins WHERE '[' + loginname + ']' = @qualified_user_name) print 'Logins matching desired name should equal 1.  It equals: ' + CONVERT(varchar, @login_count); print ''  ----------------------------------------------------------------------- -- STEP #3: Create a user account for the *database*, after switching the database under focus to auxiliary_security. print 'Step #3 executing....' USE [auxiliary_security] DECLARE @sql_create_user nvarchar(max) SET @sql_create_user = 'CREATE USER ' + @qualified_user_name + ' FOR LOGIN ' + @qualified_user_name EXECUTE sp_executesql @sql_create_user DECLARE @user_count AS INT; SET @user_count = (SELECT COUNT(*) AS user_count FROM auxiliary_security.sys.sysusers WHERE '[' + name + ']' = @qualified_user_name) print 'User accounts matching desired name should equal 1.  It equals: ' + CONVERT(varchar, @user_count); print ''  ----------------------------------------------------------------------- -- STEP #4: Grant appropriate privileges for the 'redcap' schema. print 'Step #4 executing....' DECLARE @sql_grant_schema_redcap nvarchar(max) SET @sql_grant_schema_redcap = 'GRANT EXECUTE ON SCHEMA::[redcap] TO ' + @qualified_user_name EXECUTE sp_executesql @sql_grant_schema_redcap print 'Step #4 executed'; print ''  ----------------------------------------------------------------------- -- STEP #5: Grant appropriate privileges for the 'Security' schema. print 'Step #5 executing....' DECLARE @sql_grant_schema_security nvarchar(max) SET @sql_grant_schema_security = 'GRANT EXECUTE ON SCHEMA::[security] TO ' + @qualified_user_name EXECUTE sp_executesql @sql_grant_schema_security print 'Step #5 executed'; print ''  ----------------------------------------------------------------------- -- OPTIONAL STEP: Delete the user from the database (the first line) and then the server (the second line). -- The person's other database user accounts (besides with the auxiliary_security database) will NOT be automatically deleted by these two lines. --USE [auxiliary_security]; DROP USER [OUHSC\\lsuarez3] --USE [master]; DROP LOGIN [OUHSC\\lsuarez3]  ----------------------------------------------------------------------- -- REFERENCES & NOTES   --The @qualified_user_name must have both (a) the 'OUHSC' domain qualification, and (b) the square brackets (to escape the backslash).   --Using sp_executesql to add users: https://www.sqlservercentral.com/Forums/Topic497615-359-1.aspx   --Check if a server login exists: https://stackoverflow.com/questions/37275/sql-query-for-logins   --Retrieve database users: https://stackoverflow.com/questions/2445444/how-to-get-a-list-of-users-for-all-instances-databases   --Concatenating strings: https://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/   --DROP USER from database: https://msdn.microsoft.com/en-us/library/ms189438.aspx   --DROP LOGIN from server: https://msdn.microsoft.com/en-us/library/ms188012.aspx   --Declaring variables (eg, the username above): https://technet.microsoft.com/en-us/library/aa258839.aspx   --A different (& non-dynamic) way to establish a user: https://pic.dhe.ibm.com/infocenter/dmndhelp/v8r5m0/index.jsp?topic=%2Fcom.ibm.wbpm.imuc.sbpm.doc%2Ftopics%2Fdb_create_users_nd_aix.html   --If the variable has to cross a 'GO' (which the current version of the script doesn't need): https://stackoverflow.com/questions/937336/is-there-a-way-to-persist-a-variable-across-a-go"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"transfer-credentials","dir":"Articles","previous_headings":"","what":"Transfer Credentials","title":"Security Database","text":"Manually transferring tokens auxiliary server becomes unmanageable institution’s collection API users grows. script demonstrates programmatically transfer tokens multiple REDCap instances. basic steps : Read MySQL database(s) underneath REDCap instance campus. Combine & groom credentials. Upload SQL Server (called auxiliary_security ).","code":"rm(list=ls(all=TRUE)) #Clear the memory for any variables set from any previous runs.  # ---- load-sources ------------------------------------------------------------  # ---- load-packages ----------------------------------------------------------- if (!require(OuhscMunge))   stop('The `OuhscMunge` package needs to be installed with `remotes::install_github(\"OuhscBbmc/OuhscMunge\")`.')  testit::assert(   \"The `OuhscMunge` package should meet a minimal version.\",   compareVersion( as.character(packageVersion(\"OuhscMunge\")), \"0.1.9.9009\") >= 0L )  library(magrittr) requireNamespace(\"DBI\") requireNamespace(\"odbc\") requireNamespace(\"dplyr\") requireNamespace(\"readr\") requireNamespace(\"tibble\") requireNamespace(\"testit\") requireNamespace(\"checkmate\") requireNamespace(\"OuhscMunge\")  # remotes::install_github(\"OuhscBbmc/OuhscMunge\")   # ---- declare-globals --------------------------------------------------------- # This file assume your campus has two REDCap instances. # Modify each (a) database name, (b) REDCap URL, and (c) DSN name.  name_production <- \"production\" name_dev        <- \"dev\"  uri_production  <- \"https://redcap-production.ouhsc.edu/redcap/api/\", uri_dev         <- \"https://redcap-dev.ouhsc.edu/redcap/api/\"  dsn_production  <- \"redcap-production\" dsn_dev         <- \"redcap-dev\" dsn_source      <- \"auxiliary_security\" # The DSN of the token server.  # The Activity Directory name that should precede each username. #   This should correspond with the result of SQL Server's `SYSTEM_USER` function #   (https://msdn.microsoft.com/en-us/library/ms179930.aspx) ldap_prefix <- \"OUHSC\\\\\"  #### # Nothing below this line should need to change, assuming: # 1. the vignette was followed exactly (https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html), # 2. your campus has exactly two REDCap instances.  # SQL sent to the MySQL database underneath each REDCap instance. sql <- \"   SELECT username, project_id, api_token   FROM redcap_user_rights   WHERE api_token IS NOT NULL \"  # Update this ad-hoc CSV.  Each row should represent one REDCap instance. ds_url <- tibble::tribble(   ~instance         , ~redcap_uri,   name_production   , uri_production,   name_dev          , uri_dev )  # Remove variables that aren't used below. rm(uri_production, uri_dev)   # ---- load-data ---------------------------------------------------------------  # Load the credentials from the first/production REDCap instance. cnn_production  <- DBI::dbConnect(odbc::odbc(), dsn=dsn_production) ds_production   <- DBI::dbGetQuery(cnn_production, sql) DBI::dbDisconnect(cnn_production); rm(cnn_production, dsn_production)  # Load the credentials from the second/dev REDCap instance. cnn_dev         <- DBI::dbConnect(odbc::odbc(), dsn=dsn_dev) ds_dev          <- DBI::dbGetQuery(cnn_dev, sql) DBI::dbDisconnect(cnn_dev); rm(cnn_dev, dsn_dev)  rm(sql)  # Assert these are valid datasets and contain at least 5 rows. #   Adjust '5' to smaller value if necessary.  It's just to catch blatant retrieval problems. checkmate::assert_data_frame(ds_production, min.rows=5) checkmate::assert_data_frame(ds_dev       , min.rows=5)   # ---- tweak-data --------------------------------------------------------------  # Label each instance, so they're distinguishable later. ds_production$instance <- name_production ds_dev$instance        <- name_dev  # Stack the token collection from each instance.  Then prefix the username and include the URL of each instance. ds <-   ds_production %>%   dplyr::union(ds_dev) %>%                                # Remove union if the dev instance isn't included.   tibble::as_tibble() %>%   dplyr::select(     username        = username,     project_id      = project_id,     instance        = instance,     token           = api_token   ) %>%   dplyr::mutate(     username        = paste0(ldap_prefix, username), # Qualify for the Active Directory.   ) %>%   dplyr::left_join( ds_url, by=\"instance\") %>%            # Include the instance URL.   dplyr::arrange(instance, project_id, username) %>%   tibble::rowid_to_column(\"id\")                           # For the sake of a clustered primary key.  rm(ds_production, ds_dev, ds_url) rm(name_production, name_dev) rm(ldap_prefix)   # ---- verify-values -----------------------------------------------------------  # Assert that the dataset is well-behaved. # OuhscMunge::verify_value_headstart(ds) checkmate::assert_integer(  ds$id         , any.missing=FALSE, lower=1, upper=.Machine$integer.max, unique=TRUE) checkmate::assert_character(ds$username   , any.missing=FALSE, pattern=\"^.{1,255}$\"                         ) checkmate::assert_integer(  ds$project_id , any.missing=FALSE, lower=1, upper=.Machine$integer.max          ) checkmate::assert_character(ds$token      , any.missing=FALSE, pattern=\"^[A-Z0-9]{32}$\"           , unique=TRUE) checkmate::assert_character(ds$instance   , any.missing=FALSE, pattern=\"^.{1,255}$\"                         ) checkmate::assert_character(ds$redcap_uri , any.missing=FALSE, pattern=\"^.{1,255}$\"                         )  testit::assert(   \"The `username` x `project_id` x `instance` must be unique.\",   sum(duplicated(paste0(ds$username, \"-\", ds$project_id, \"-\", ds$instance))) == 0L )  testit::assert(\"At least 10 tokens should be ready to write.\" , 10L <= nrow(ds))   # ---- specify-columns-to-upload -----------------------------------------------  # Dictate the exact columns and order that will be uploaded. columns_to_write <- c(\"id\", \"username\", \"project_id\", \"instance\", \"token\", \"redcap_uri\") ds_slim          <- ds[, columns_to_write] rm(columns_to_write)   # ---- upload-to-db ------------------------------------------------------------------  OuhscMunge::upload_sqls_odbc(   d               = ds_slim,   schema_name     = \"redcap_private\",   table_name      = \"tbl_credential\",   dsn_name        = dsn_source,   create_table    = FALSE,   clear_table     = TRUE,   transaction     = TRUE,   verbose         = TRUE ) # Uploading 252 tokens takes 0.004 minutes."},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","id":"document-info","dir":"Articles","previous_headings":"","what":"Document Info","title":"Security Database","text":"document primarily based REDCap version 8.4.0, last updated 2018-08-10. development version document available GitHub: https://ouhscbbmc.github.io/REDCapR/articles/SecurityDatabase.html","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"server-configuration-and-authorization","dir":"Articles","previous_headings":"Language Agnostic","what":"Server Configuration and Authorization","title":"Troubleshooting REDCap API Calls","text":"first group checks primarily focuses server logins accounts. Unlike later sections, REDCap administrator privileges necessary checks. account server? can verified Browse Users section server’s Control Center. ’re REDCap admin, put user’s position –user account? ’re typical user, may consult institution’s REDCap administrator checks. permissions specific project? can verified User Rights section within project. Notice ’s possible (ultimately useful) account , server, don’t skip previous step. Can log normally interface? However username password aren’t working, API theoretically might still work uses token instead password. verified account responding automated email sent ? can verified Browse Users section server’s Control Center. (Talk REDCap admin.) email address ’ve entered, green ‘Verified’ label icon.   granted desired import /export permissions? can verified User Rights section API section (’s Manage Project Tokens tab) within project. Alternatively, can verified API Tokens section server’s Control Center.   using correct token? can verified API section (’s Manage Project Tokens tab) within project. Click magnifying glass icon user’s row. Alternatively, can verified API Tokens section server’s Control Center.   checks pass, proceed next section. , start consulting REDCap administrator.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"reading","dir":"Articles","previous_headings":"Language Agnostic","what":"Reading","title":"Troubleshooting REDCap API Calls","text":"section examines potential problems occur data leaves working server, handled programming language (e.g., Python R). Postman Chrome plugin recommended several people makes troubleshooting much efficient.  API Playground producing expected result? REDCap’s “API Playground” holds hand () offering dropdown list API methods available REDCap instance, (b) presenting series dropdown boxes appropriate selected method. Find API link visible left margin REDCap. ’ve completed inputs, click ‘Execute’ view plain-text returned server. bottom playground page, interface attempts translate specific API call different languages, like Python R. suggestions usually correct, inspect critically, auto-generated script. URL/URI correct? Notice url typically ends “api/” resembles https://bbmc.ouhsc.edu/redcap/api/ https://bbmc.ouhsc.edu/ (even https://bbmc.ouhsc.edu/ redirects https://bbmc.ouhsc.edu/redcap/). Postman installed operating correctly? helps start different REDCap server, can use dummy project containing fake data hosted OUHSC BBMC. url https://bbmc.ouhsc.edu/redcap/api/. three key-value pairs: (1) ‘token’ 9A81268476645C4E5F03428B8AC3AA7B, (2) ‘content’ record, (3) ‘format’ CSV. checking server, token value change, content format . return five records CSV format. ‘status’ 200 OK. result look roughly like . Notice line breaks included text values . Can administrator query API successfully Postman admin token? administrator, create account , verify token works server project. Can administrator query API successfully Postman user’s token? Use Postman , replace token user’s token. whole problem solved, reissue new API tokens user. Can user query API successfully Postman token? values enter exactly entered previous step. failure (assuming previous step successful) suggests network firewall issue. server behind institution’s firewall, verify connecting successfully VPN. Can user query API cURL? cURL command line tool ’s underneath lot libraries. ’s installed correctly location machine, can executed terminal command line. checks pass, proceed next section. , start consulting REDCap administrator. fails, consider creating GitHub issue package (e.g., redcapAPI REDCapR R, phpcap PHP, PyCap Python).","code":"record_id,name_first,name_last,address,telephone,email,dob,age,ethnicity,race,sex,height,weight,bmi,comments,demographics_complete \"1\",\"Nutmeg\",\"Nutmouse\",\"14 Rose Cottage St. Kenning UK, 323232\",\"(432) 456-4848\",\"nutty@mouse.com\",\"2003-08-30\",10,1,2,0,5,1,400,\"Character in a book, with some guessing\",2 \"2\",\"Tumtum\",\"Nutmouse\",\"14 Rose Cottage Blvd. Kenning UK 34243\",\"(234) 234-2343\",\"tummy@mouse.comm\",\"2003-03-10\",10,1,6,1,6,1,277.8,\"A mouse character from a good book\",2 \"3\",\"Marcus\",\"Wood\",\"243 Hill St. Guthrie OK 73402\",\"(433) 435-9865\",\"mw@mwood.net\",\"1934-04-09\",79,0,4,1,180,80,24.7,\"completely made up\",2 \"4\",\"Trudy\",\"DAG\",\"342 Elm Duncanville TX, 75116\",\"(987) 654-3210\",\"peroxide@blonde.com\",\"1952-11-02\",61,1,4,0,165,54,19.8,\"This record doesn't have a DAG assigned  So call up Trudy on the telephone Send her a letter in the mail\",2 \"5\",\"John Lee\",\"Walker\",\"Hotel Suite New Orleans LA, 70115\",\"(333) 333-4444\",\"left@hippocket.com\",\"1955-04-15\",58,1,4,1,193.04,104,27.9,\"Had a hand for trouble and a eye for cash  He had a gold watch chain and a black mustache\",2 curl -X POST -H \"Cache-Control: no-cache\" -F \"token=9A81268476645C4E5F03428B8AC3AA7B\" -F \"content=record\" -F \"format=csv\" \"https://bbmc.ouhsc.edu/redcap/api/\""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"writing","dir":"Articles","previous_headings":"Language Agnostic","what":"Writing","title":"Troubleshooting REDCap API Calls","text":"Troubleshooting import operations trickier export operations two major reasons. First, database potentially persists import mistakes. contrast, repeatedly exporting data won’t affect subsequent reads. Considering cloning REDCap project testing problem resolved. Remember create new token (’re automatically created projects cloned, even users copied), modify code’s token point new testing clone. second reason importing can trickier schema (e.g., names data types) local dataset must match project’s schema. Current recommendations include checking can write simpler projects (perhaps 1 ID field 1 string field), progressively moving mimic problematic project’s schema dataset. Also, consider exporting dataset machine, look differences. Note import calculated fields REDCap. dataset pass REDCapR::validate_for_write()? REDCapR::validate_for_write() inspects data frame anticipate problems writing REDCap’s API. reference manual contains specifics validation checks. Can import small subset project? instance, just record_id column. Can export dataset import without modifications? instance, using REDCapR: First, manually complete ~10 example record web browser, export/download records REDCapR::redcap_read_oneshot() data frame. (longitudinal repeating instruments, make sure examples cover dimensions adequately) Second, can successfully upload data.frame (without modification) REDCapR::redcap_write_oneshot()? , dataset provide template structure real dataset assign values. , helpful piece troubleshooting. longitudinal /repeating structure correct? Three variables frequently misspecified: redcap_event_name (longitudinal projects) redcap_repeat_instrument & redcap_repeat_instance (repeating instruments). values variables clearer understand complete step inspect layout. longitudinal projects: Example values redcap_event_name “admission_1_arm_1”, “admission_2_arm_1”, “admission_3_arm_1”. (Notice “_arm_1” suffix used even arms specified project.) projects repeating instruments: Examples values redcap_repeat_instrument “lab”, “vitals”, “medication”; instrument names specified REDCap Designer. Example values redcap_repeat_instance “1”, “2”, “3”, “4”, “5”; consecutive sequence within participant’s longitudinal event. participant 101 two lab results, one vitals record, three medications, dataset structure might : Can import entire project? Can columns written rows? one checks fail, please start consulting REDCap administrator.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"gotchas-agnostic","dir":"Articles","previous_headings":"Language Agnostic","what":"Common Gotchas","title":"Troubleshooting REDCap API Calls","text":"Problems project’s metadata/dictionary. exporting metadata fails (e.g., REDCapR::redcap_metadata_read() redcapAPI::exportMetaData()), manually download data dictionary REDCap browser. Inspect plain text closely text editor like Visual Studio Code; avoid programs like Excel tend interpret, align, decorate values, sometimes masks problems. Scrutinize elements, especially look nonstandard characters. See next bullet. API libraries test problematic elements project handled correctly. encounter element causes problems, please consider creating new GitHub Issue describes problem (e.g., REDCapR, redcapAPI, phpcap). issue, attach problematic fields data dictionary. ’re uncomfortable sharing dictionary world, consider emailing developer. ’s just data dictionary, PHI included. package developer can’t find way gracefully adapt, ’ll least try provide better error message. Identify problematic characters. special case previous bullet. Look fancy characters might interpreted smoothly. instance, editing data dictionary Excel, sometimes straight quotes converted curly quotes. might cause problem later, API client tries interpret character using wrong encoding. ASCII characters REDCap dictionaries appear interpreted smoothly.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"reading-without-a-package","dir":"Articles","previous_headings":"R","what":"Reading without a Package","title":"Troubleshooting REDCap API Calls","text":"several ways call REDCap’s API R. packages redcapAPI REDCapR rely httr package, calls curl package, calls cURL. httr installed user’s local machine? , running library(httr) produce error messages ’re starting fresh session R: recent version httr? several ways , easiest probably run update.packages(ask = FALSE, repos = \"https://cran.rstudio.com\"). optional argument ask prevents user needing respond ‘Y’ outdated package. Can query test project using httr? redcapAPI REDCapR packages employ something similar following function httr. ’re curious, relevant source code redcapAPI REDCapR. check fails, consider attempting url token used Postman example. Alternatively, can try using RCurl package, mostly replaced httr packages developed since 2014. Can query subset project using httr? step like previous one, two differences. First, ’s using REDCap project (instead test project). Second, pulls fewer records, smaller collection fields. Subsetting can help troubleshoot avoiding (thus identifying) cells problematic values. Notice call now passes values records fields parameters. Also notice value single long string (rather vector shorter strings, natural R users). Can query entire project using httr? two advantages trying subset data. First, small datasets avoid time-errors plague large datasets. Second, may avoid problematic values passed pipeline. current check fails previous check succeeds, experiment different expanses records fields. help determine values causing problems, ’s simply much data pulled one pass. desired dataset large, consider can prune unnecessary records fields. , one solution pull smaller, multiple batches using API, reassemble . redcap_read() function REDCapR automatically, allows user specify batch_size. checks pass, proceed next section. , start consulting REDCap administrator.","code":"library(httr) redcap_uri <- \"https://bbmc.ouhsc.edu/redcap/api/\" token      <- \"9A81268476645C4E5F03428B8AC3AA7B\"  post_body <- list(   token           = token,   content         = 'record',   format          = 'csv',   type            = 'flat' )  raw_text <- httr::POST(   url             = redcap_uri,   body            = post_body,   httr::verbose() # Remove this line to suppress the console updates. )  raw_text raw_text <- RCurl::postForm(   uri             = redcap_uri   , token         = token   , content       = 'record'   , format        = 'csv'   , type          = 'flat' ) redcap_uri         <- \"https://the.urlofyourinsitution.edu/api/\" token              <- \"your-secret-token\"  records_collapsed  <- \"1,2,3\"                             # Assumes dataset contains ID values of 1-3. fields_collapsed   <- \"record_id,name_first,name_last\"    # Assumes dataset contains these variables.  post_body <- list(   token           = token,   content         = 'record',   format          = 'csv',   type            = 'flat',   records         = records_collapsed,   fields          = fields_collapsed )  raw_text <- httr::POST(   url             = redcap_uri,   body            = post_body,   httr::verbose() # Remove this line to suppress the console updates. )  raw_text redcap_uri                  <- \"https://the.urlofyourinsitution.edu/api/\" token                       <- \"your-secret-token\"  records_collapsed           <- NULL fields_collapsed            <- NULL  post_body <- list(   token           = token,   content         = 'record',   format          = 'csv',   type            = 'flat',   records         = records_collapsed,   fields          = fields_collapsed )  raw_text <- httr::POST(   url             = redcap_uri,   body            = post_body,   httr::verbose() # Remove this line to suppress the console updates. )  raw_text"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"reading-with-the-redcapr-package","dir":"Articles","previous_headings":"R","what":"Reading with the REDCapR Package","title":"Troubleshooting REDCap API Calls","text":"REDCapR wraps convenience functions around httr reduce size complexity user’s code. package’s basic functions demonstrated vignette documented reference manual. ’re using REDCapR, can skip section proceed “Exporting REDCap R, using redcapAPI” “Importing REDCap R” . REDCapR redcapAPI different R packages, developers collaborate share advice. latest version REDCapR installed machine? Currently easiest way install REDCapR remotes package. following code installs remotes, installs REDCapR. CRAN version REDCapR updated times year, code download latest stable version. REDCapR load successfully machine? , running library(REDCapR) produce following output ’re starting fresh session R: Can export data dictionary? Sometimes problem exists within metadata/dictionary, instead actual data values. Verify structure content specific project interpretable local environment. fails, see “Problems project’s metadata/dictionary” Common Gotchas . problematic data dictionary may produce error Error inherits(ds, \"data.frame\") : object 'ds' found calling REDCapR::redcap_metadata_read(). Can export example project? fake data hosted OUHSC BBMC previous section. previous code produce similar output. Notice five rows columns wrap around console window narrow. Can export project? code similar previous check, uri token values need modified. Alternatively, redcap_project object can declared initially, makes subsequent calls cleaner token url required object declared. export operation still unsuccessful using REDCapR? “Can user query entire REDCap project using httr?” check succeeded, REDCapR checks , consider posting new GitHub issue package developers. one checks fail, please start consulting REDCap administrator.","code":"install.packages(\"remotes\", repos = \"https://cran.rstudio.com\") remotes::install_github(repo = \"OuhscBbmc/REDCapR\") library(REDCapR) # Loading required package: REDCapR library(REDCapR) # Load the package into the current R session, if you haven't already. redcap_uri       <- \"https://the.urlofyourinsitution.edu/api/\" token            <- \"your-secret-token\" redcap_metadata_read(redcap_uri = uri, token = token) library(REDCapR) # Load the package into the current R session. uri   <- \"https://bbmc.ouhsc.edu/redcap/api/\" token <- \"9A81268476645C4E5F03428B8AC3AA7B\" redcap_read(redcap_uri = uri, token = token)$data 5 records and 1 columns were read from REDCap in 0.41 seconds. Starting to read 5 records  at 2014-06-27 17:19:49 Reading batch 1 of 1, with ids 1 through 5. 5 records and 16 columns were read from REDCap in 0.42 seconds.    record_id name_first name_last                                 address      telephone               email 1         1     Nutmeg  Nutmouse 14 Rose Cottage St.\\nKenning UK, 323232 (432) 456-4848     nutty@mouse.com 2         2     Tumtum  Nutmouse 14 Rose Cottage Blvd.\\nKenning UK 34243 (234) 234-2343    tummy@mouse.comm 3         3     Marcus      Wood          243 Hill St.\\nGuthrie OK 73402 (433) 435-9865        mw@mwood.net 4         4      Trudy       DAG          342 Elm\\nDuncanville TX, 75116 (987) 654-3210 peroxide@blonde.com 5         5   John Lee    Walker      Hotel Suite\\nNew Orleans LA, 70115 (333) 333-4444  left@hippocket.com           dob age ethnicity race sex height weight   bmi 1 2003-08-30  10         1    2   0   5.00      1 400.0 2 2003-03-10  10         1    6   1   6.00      1 277.8 3 1934-04-09  79         0    4   1 180.00     80  24.7 4 1952-11-02  61         1    4   0 165.00     54  19.8 5 1955-04-15  58         1    4   1 193.04    104  27.9                                                                                                       comments 1                                                                     Character in a book, with some guessing 2                                                                          A mouse character from a good book 3                                                                                          completely made up 4 This record doesn't have a DAG assigned\\n\\nSo call up Trudy on the telephone\\nSend her a letter in the mail 5                 Had a hand for trouble and a eye for cash\\n\\nHe had a gold watch chain and a black mustache    demographics_complete 1                     2 2                     2 3                     2 4                     2 5                     2 library(REDCapR) # Load the package into the current R session, if you haven't already. redcap_uri       <- \"https://the.urlofyourinsitution.edu/api/\" token            <- \"your-secret-token\" redcap_read(redcap_uri = uri, token = token)$data library(REDCapR) # Load the package into the current R session, if you haven't already. uri               <- \"https://bbmc.ouhsc.edu/redcap/api/\" token             <- \"9A81268476645C4E5F03428B8AC3AA7B\" project           <- redcap_project$new(redcap_uri = uri, token = token)  ds_three_columns  <- project$read(fields = c(\"record_id\", \"sex\", \"age\"))$data  ids_of_males      <- ds_three_columns$record_id[ds_three_columns$sex == 1] ids_of_minors     <- ds_three_columns$record_id[ds_three_columns$age < 18]  ds_males          <- project$read(records = ids_of_males, batch_size = 2)$data ds_minors         <- project$read(records = ids_of_minors)$data"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"reading-with-the-redcapapi-package","dir":"Articles","previous_headings":"R","what":"Reading with the redcapAPI Package","title":"Troubleshooting REDCap API Calls","text":"httr redcapAPI wraps convenience functions around httr reduce size complexity user’s code. ’re using redcapAPI, can skip section proceed ‘Importing REDCap R’ . specific discussion redcapAPI can found package’s wiki. redcapAPI REDCapR different packages, developers collaborate share advice. redcapAPI installed machine? Currently, easiest way install redcapAPI CRAN. Developmental versions may available GitHub. redcapAPI load successfully machine? , running library(redcapAPI) produce following output ’re starting fresh session R: Can export data dictionary? Sometimes problem exists within metadata/dictionary, instead actual data values. Verify structure content specific project interpretable local environment. fails, see “Problems project’s metadata/dictionary.” Gotchas Can export example project? fake data hosted OUHSC BBMC previous section. previous code produce similar output. Notice five rows columns wrap around console window narrow. Can export project? code similar previous check, uri token values need modified. export operation still unsuccessful using redcapAPI? “Can user query entire REDCap project using httr?” check succeeded, redcapAPI checks , consider posting new GitHub issue package developers. one checks fail, please start consulting REDCap administrator.","code":"install.packages(\"redcapAPI\") install.packages(\"remotes\", repos = \"https://cran.rstudio.com\") remotes::install_github(repo = \"nutterb/redcapAPI\") library(redcapAPI) # Loading required package: redcapAPI library(redcapAPI) # Load the package into the current R session, if you haven't already. redcap_uri       <- \"https://the.urlofyourinsitution.edu/api/\" token            <- \"your-secret-token\" exportMetaData(rcon) library(redcapAPI) # Load the package into the current R session. rcon <- redcapConnection(   url   = \"https://bbmc.ouhsc.edu/redcap/api/\",   token = \"9A81268476645C4E5F03428B8AC3AA7B\" ) exportRecords(rcon) record_id name_first name_last                                 address      telephone               email 1         1     Nutmeg  Nutmouse 14 Rose Cottage St.\\nKenning UK, 323232 (432) 456-4848     nutty@mouse.com 2         2     Tumtum  Nutmouse 14 Rose Cottage Blvd.\\nKenning UK 34243 (234) 234-2343    tummy@mouse.comm 3         3     Marcus      Wood          243 Hill St.\\nGuthrie OK 73402 (433) 435-9865        mw@mwood.net 4         4      Trudy       DAG          342 Elm\\nDuncanville TX, 75116 (987) 654-3210 peroxide@blonde.com 5         5   John Lee    Walker      Hotel Suite\\nNew Orleans LA, 70115 (333) 333-4444  left@hippocket.com         dob age ethnicity race sex height weight   bmi 1 2003-08-30  10         1    2   0   5.00      1 400.0 2 2003-03-10  10         1    6   1   6.00      1 277.8 3 1934-04-09  79         0    4   1 180.00     80  24.7 4 1952-11-02  61         1    4   0 165.00     54  19.8 5 1955-04-15  58         1    4   1 193.04    104  27.9                                                                                                     comments 1                                                                     Character in a book, with some guessing 2                                                                          A mouse character from a good book 3                                                                                          completely made up 4 This record doesn't have a DAG assigned\\n\\nSo call up Trudy on the telephone\\nSend her a letter in the mail 5                 Had a hand for trouble and a eye for cash\\n\\nHe had a gold watch chain and a black mustache  demographics_complete 1                     2 2                     2 3                     2 4                     2 5                     2 library(redcapAPI) # Load the package into the current R session, if you haven't already. rcon <- redcapConnection(   url   = \"https://the.urlofyourinsitution.edu/api/\", # Adapt this to your server.   token = \"your-secret-token\"                         # Adapt this to your user's token. ) exportRecords(rcon)"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"troubleshooting-strategies","dir":"Articles","previous_headings":"General Information","what":"Troubleshooting Strategies","title":"Troubleshooting REDCap API Calls","text":"Simplify. Eliminate potential sources problems cumulatively. example, reduce columns & records read/write. Start fresh. ’s feasible, start new REDCap project gradually add elements original project. Identify problematic element testing API call addition.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"resources","dir":"Articles","previous_headings":"General Information","what":"Resources","title":"Troubleshooting REDCap API Calls","text":"REDCap used many environments, ’s surprising lot libraries developed cater different scenarios languages. active list maintained REDCap-Tools. entry needs added, please notify us; instructions found bottom page. basic API documentation available REDCap server, typically access REDCap wiki, newer examples might exist https://community.projectredcap.org/articles/462/api-examples.html. official documentation can found “API Help Page” “API Examples” pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material. Scott Burns, primary developer PyCap good intro http://sburns.org/2013/07/22/intro--redcap-api.html Benjamin Nutter, primary developer redcapAPI good wiki https://github.com/nutterb/redcapAPI/wiki addition troubleshooting document, REDCapR vignettes covers basic advanced operations.","code":"https://<*your server name*>/redcap/api/help"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html","id":"document-info","dir":"Articles","previous_headings":"General Information","what":"Document Info","title":"Troubleshooting REDCap API Calls","text":"document primarily based REDCap version 6.0.2 last updated 2020-01-21. development version document available GitHub: https://ouhscbbmc.github.io/REDCapR/articles/TroubleshootingApiCalls.html.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"set-project-wide-values","dir":"Articles","previous_headings":"","what":"Set project-wide values","title":"Advanced REDCapR Operations","text":"information specific REDCap project, opposed individual operation. includes (1) uri server, (2) token user’s project. hosted machine used REDCapR’s public test suite, can run example computer. Unless tests running. PHI-free demos, strongly suggest storing tokens securely avoiding hard-coding like . recommendation store tokens database. feasible institution, consider storing secured csv retrieving REDCapR::retrieve_credential_local().","code":"library(REDCapR) #Load the package into the current R session. uri                   <- \"https://bbmc.ouhsc.edu/redcap/api/\" token_simple          <- \"9A81268476645C4E5F03428B8AC3AA7B\" token_longitudinal    <- \"0434F0E9CF53ED0587847AB6E51DE762\""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"converting-from-talllong-to-wide","dir":"Articles","previous_headings":"","what":"Converting from tall/long to wide","title":"Advanced REDCapR Operations","text":"Disclaimer: Occasionally ’re asked longitudinal dataset converted “long/tall format” (typically row one observation participant) “wide format” (row participant). Usually advise . Besides database benefits long structure, wide structure restricts options stat routine. modern longitudinal analysis procedures (e.g., growth curve models multilevel/hierarchical models) accept wide. ’re pretty much stuck repeated measures anova, inflexible real-world medical-ish analyses. requires patient measurement every time point; otherwise anova excludes patient entirely. However like going wide produce visual tables publications, ’s one way R. First retrieve dataset REDCap. widening one variable (e.g., pmq1), code’s pretty simple: scenarios, multiple variables (e.g., pmq1 - pmq4) can widened single tidyr::pivot_wider() operation. example contains additional wrinkle REDCap event names “first_dose” “first_visit” renamed “dose_1” “visit_1”, help values dose visit values proper numbers. However, widening scenarios, can easier go even longer/taller (e.g., ds_eav) reversing direction going wide. Lots packages documentation exist. current preference tidyverse approach pivoting, data.table approach worth considering ’re comfortable package. Stack Overflow post describes several ways. recommend reshape reshape2 packages, developers replaced tidyr functions described .","code":"library(magrittr) suppressPackageStartupMessages(requireNamespace(\"dplyr\")) suppressPackageStartupMessages(requireNamespace(\"tidyr\")) events_to_retain  <- c(\"dose_1_arm_1\", \"visit_1_arm_1\", \"dose_2_arm_1\", \"visit_2_arm_1\")  ds_long <- REDCapR::redcap_read_oneshot(redcap_uri = uri, token = token_longitudinal)$data #> 18 records and 125 columns were read from REDCap in 0.3 seconds.  The http status code was 200. ds_long %>%   dplyr::select(study_id, redcap_event_name, pmq1, pmq2, pmq3, pmq4) #> # A tibble: 18 × 6 #>    study_id redcap_event_name         pmq1  pmq2  pmq3  pmq4 #>       <dbl> <chr>                    <dbl> <dbl> <dbl> <dbl> #>  1      100 enrollment_arm_1            NA    NA    NA    NA #>  2      100 dose_1_arm_1                 2     2     1     1 #>  3      100 visit_1_arm_1                1     0     0     0 #>  4      100 dose_2_arm_1                 3     1     0     0 #>  5      100 visit_2_arm_1                0     1     0     0 #>  6      100 final_visit_arm_1           NA    NA    NA    NA #>  7      220 enrollment_arm_1            NA    NA    NA    NA #>  8      220 dose_1_arm_1                 0     1     0     2 #>  9      220 visit_1_arm_1                0     3     1     0 #> 10      220 dose_2_arm_1                 1     2     0     1 #> 11      220 visit_2_arm_1                3     4     1     0 #> 12      220 final_visit_arm_1           NA    NA    NA    NA #> 13      304 enrollment_arm_2            NA    NA    NA    NA #> 14      304 deadline_to_opt_ou_arm_2    NA    NA    NA    NA #> 15      304 first_dose_arm_2             0     1     0     0 #> 16      304 first_visit_arm_2            2     0     0     0 #> 17      304 final_visit_arm_2           NA    NA    NA    NA #> 18      304 deadline_to_return_arm_2    NA    NA    NA    NA ds_wide <-   ds_long %>%   dplyr::select(study_id, redcap_event_name, pmq1) %>%   dplyr::filter(redcap_event_name %in% events_to_retain) %>%   tidyr::pivot_wider(     id_cols     = study_id,     names_from  = redcap_event_name,     values_from = pmq1   ) ds_wide #> # A tibble: 2 × 5 #>   study_id dose_1_arm_1 visit_1_arm_1 dose_2_arm_1 visit_2_arm_1 #>      <dbl>        <dbl>         <dbl>        <dbl>         <dbl> #> 1      100            2             1            3             0 #> 2      220            0             0            1             3 pattern <- \"^(\\\\w+?)_arm_(\\\\d)$\" ds_wide <-   ds_long %>%   dplyr::select(study_id, redcap_event_name, pmq1, pmq2, pmq3, pmq4) %>%   dplyr::mutate(     event = sub(pattern, \"\\\\1\", redcap_event_name),     event = dplyr::recode(event, \"first_dose\"=\"dose_1\", \"first_visit\"=\"visit_1\"),     arm   = as.integer(sub(pattern, \"\\\\2\", redcap_event_name))   ) %>%   dplyr::select(study_id, event, arm, pmq1, pmq2, pmq3, pmq4) %>%   dplyr::filter(!(event %in%      c(\"enrollment\", \"final_visit\", \"deadline_to_return\", \"deadline_to_opt_ou\")   )) %>%   tidyr::pivot_wider(     id_cols     = c(study_id, arm),     names_from  = event,     values_from = c(pmq1, pmq2, pmq3, pmq4)   )  ds_wide #> # A tibble: 3 × 18 #>   study_id   arm pmq1_dose_1 pmq1_visit_1 pmq1_dose_2 pmq1_visit_2 pmq2_dose_1 #>      <dbl> <int>       <dbl>        <dbl>       <dbl>        <dbl>       <dbl> #> 1      100     1           2            1           3            0           2 #> 2      220     1           0            0           1            3           1 #> 3      304     2           0            2          NA           NA           1 #> # ℹ 11 more variables: pmq2_visit_1 <dbl>, pmq2_dose_2 <dbl>, #> #   pmq2_visit_2 <dbl>, pmq3_dose_1 <dbl>, pmq3_visit_1 <dbl>, #> #   pmq3_dose_2 <dbl>, pmq3_visit_2 <dbl>, pmq4_dose_1 <dbl>, #> #   pmq4_visit_1 <dbl>, pmq4_dose_2 <dbl>, pmq4_visit_2 <dbl> ds_eav <-   ds_long %>%   dplyr::select(study_id, redcap_event_name, pmq1, pmq2, pmq3, pmq4) %>%   dplyr::mutate(     event = sub(pattern, \"\\\\1\", redcap_event_name),     event = dplyr::recode(event, \"first_dose\" = \"dose_1\", \"first_visit\" = \"visit_1\"),     arm   = as.integer(sub(pattern, \"\\\\2\", redcap_event_name))   ) %>%   dplyr::select(study_id, event, arm, pmq1, pmq2, pmq3, pmq4) %>%   tidyr::pivot_longer(     cols      = c(pmq1, pmq2, pmq3, pmq4),     names_to  = \"key\",     values_to = \"value\"   ) %>%   # For old versions of tidyr that predate `pivot_wider()`:   # tidyr::gather(key=key, value=value, pmq1, pmq2, pmq3, pmq4) %>%   dplyr::filter(!(event %in% c(     \"enrollment\", \"final_visit\", \"deadline_to_return\", \"deadline_to_opt_ou\")   )) %>%   dplyr::mutate( # Simulate correcting for mismatched names across arms:     key = paste0(key, \"_\", event)   ) %>%   dplyr::select(-event)  # Show the first 10 rows of the EAV table. ds_eav %>%   head(10) #> # A tibble: 10 × 4 #>    study_id   arm key          value #>       <dbl> <int> <chr>        <dbl> #>  1      100     1 pmq1_dose_1      2 #>  2      100     1 pmq2_dose_1      2 #>  3      100     1 pmq3_dose_1      1 #>  4      100     1 pmq4_dose_1      1 #>  5      100     1 pmq1_visit_1     1 #>  6      100     1 pmq2_visit_1     0 #>  7      100     1 pmq3_visit_1     0 #>  8      100     1 pmq4_visit_1     0 #>  9      100     1 pmq1_dose_2      3 #> 10      100     1 pmq2_dose_2      1 # Spread the EAV to wide. ds_wide_2 <-   ds_eav %>%   tidyr::pivot_wider(     id_cols     = c(study_id, arm),     names_from  = key,     values_from = value   ) # For old versions of tidyr that predate `pivot_wider()`: # tidyr::spread(key=key, value=value) ds_wide_2 #> # A tibble: 3 × 18 #>   study_id   arm pmq1_dose_1 pmq2_dose_1 pmq3_dose_1 pmq4_dose_1 pmq1_visit_1 #>      <dbl> <int>       <dbl>       <dbl>       <dbl>       <dbl>        <dbl> #> 1      100     1           2           2           1           1            1 #> 2      220     1           0           1           0           2            0 #> 3      304     2           0           1           0           0            2 #> # ℹ 11 more variables: pmq2_visit_1 <dbl>, pmq3_visit_1 <dbl>, #> #   pmq4_visit_1 <dbl>, pmq1_dose_2 <dbl>, pmq2_dose_2 <dbl>, #> #   pmq3_dose_2 <dbl>, pmq4_dose_2 <dbl>, pmq1_visit_2 <dbl>, #> #   pmq2_visit_2 <dbl>, pmq3_visit_2 <dbl>, pmq4_visit_2 <dbl>"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"query-the-underlying-mysql-database","dir":"Articles","previous_headings":"","what":"Query the Underlying MySQL Database","title":"Advanced REDCapR Operations","text":"require feature available instance’s API, first upgrade institution’s REDCap instance see feature added recently. Second, check someone released desired API-like features REDCap External Module. Third, may need query database underneath REDCap’s web server. Transfer Credentials section Security Database Vignette provides complete example using R query MySQL database odbc. find ’s best develop query MySQL Workbench, copy code R (alternatively, use OuhscMunge::execute_sql_file()). example retrieves first_submit_time, helpful need timestamp surveys marked completed. Replace ‘444’ pid, 1001 1003 desired events.","code":"SELECT   p.participant_id      as participant_survey_id   ,r.record             as record_id   ,p.event_id   ,e.descrip            as event_name   ,r.first_submit_time   ,r.completion_time    -- ,p.*   -- ,r.* FROM redcapv3.redcap_surveys_participants     as p   left  join redcapv3.redcap_surveys_response as r on p.participant_id = r.participant_id   left  join redcapv3.redcap_events_metadata  as e on p.event_id       = e.event_id WHERE   p.survey_id = 444   and   p.event_id in (     1001, -- start of the year     1002, -- mid term     1003  -- end of year   )"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"ssl-options","dir":"Articles","previous_headings":"","what":"SSL Options","title":"Advanced REDCapR Operations","text":"official cURL site discusses process using SSL verify server connected . Use SSL cert file come openssl package. Force connection use SSL=3 (preferred, possibly insecure).","code":"cert_location <- system.file(\"cacert.pem\", package = \"openssl\") if (file.exists(cert_location)) {   config_options         <- list(cainfo = cert_location)   ds_different_cert_file <- redcap_read_oneshot(     redcap_uri     = uri,     token          = token_simple,     config_options = config_options   )$data } #> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. config_options <- list(sslversion = 3) ds_ssl_3 <- redcap_read_oneshot(   redcap_uri     = uri,   token          = token_simple,   config_options = config_options )$data #> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. config_options <- list(ssl.verifypeer = FALSE) ds_no_ssl <- redcap_read_oneshot(   redcap_uri     = uri,   token          = token_simple,   config_options = config_options )$data #> 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200."},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"convert-spss-output-to-redcap-data-dictionary","dir":"Articles","previous_headings":"","what":"Convert SPSS Output to REDCap data dictionary","title":"Advanced REDCapR Operations","text":"solution https://stackoverflow.com//51013678/1082435 converts levels specified SPSS output like dropdown choices REDCap data dictionary like","code":"SEX       0 Male           1 Female  LANGUAGE  1 English           2 Spanish           3 Other           6 Unknown Variable Values SEX      0, Male | 1, Female LANGUAGE 1, English | 2, Spanish | 3, Other | 6, Unknown"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/advanced-redcapr-operations.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Advanced REDCapR Operations","text":"sake documentation reproducibility, current report rendered following environment. Click line expand. Report rendered runner 2024-09-07, 05:08 +0000 2 seconds.","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #>  setting  value #>  version  R version 4.4.1 (2024-06-14) #>  os       macOS Sonoma 14.6.1 #>  system   aarch64, darwin20 #>  ui       X11 #>  language en #>  collate  en_US.UTF-8 #>  ctype    en_US.UTF-8 #>  tz       UTC #>  date     2024-09-07 #>  pandoc   3.1.11 @ /usr/local/bin/ (via rmarkdown) #>  #> ─ Packages ─────────────────────────────────────────────────────────────────── #>  package     * version  date (UTC) lib source #>  backports     1.5.0    2024-05-23 [1] CRAN (R 4.4.0) #>  bit           4.0.5    2022-11-15 [1] CRAN (R 4.4.0) #>  bit64         4.0.5    2020-08-30 [1] CRAN (R 4.4.0) #>  bslib         0.8.0    2024-07-29 [1] CRAN (R 4.4.0) #>  cachem        1.1.0    2024-05-16 [1] CRAN (R 4.4.0) #>  checkmate     2.3.2    2024-07-29 [1] CRAN (R 4.4.0) #>  cli           3.6.3    2024-06-21 [1] CRAN (R 4.4.0) #>  colorspace    2.1-1    2024-07-26 [1] CRAN (R 4.4.0) #>  crayon        1.5.3    2024-06-20 [1] CRAN (R 4.4.0) #>  curl          5.2.2    2024-08-26 [1] CRAN (R 4.4.1) #>  desc          1.4.3    2023-12-10 [1] CRAN (R 4.4.0) #>  digest        0.6.37   2024-08-19 [1] CRAN (R 4.4.1) #>  dplyr         1.1.4    2023-11-17 [1] CRAN (R 4.4.0) #>  evaluate      0.24.0   2024-06-10 [1] CRAN (R 4.4.0) #>  fansi         1.0.6    2023-12-08 [1] CRAN (R 4.4.0) #>  fastmap       1.2.0    2024-05-15 [1] CRAN (R 4.4.0) #>  fs            1.6.4    2024-04-25 [1] CRAN (R 4.4.0) #>  generics      0.1.3    2022-07-05 [1] CRAN (R 4.4.0) #>  glue          1.7.0    2024-01-09 [1] CRAN (R 4.4.0) #>  hms           1.1.3    2023-03-21 [1] CRAN (R 4.4.0) #>  htmltools     0.5.8.1  2024-04-04 [1] CRAN (R 4.4.0) #>  httr          1.4.7    2023-08-15 [1] CRAN (R 4.4.0) #>  jquerylib     0.1.4    2021-04-26 [1] CRAN (R 4.4.0) #>  jsonlite      1.8.8    2023-12-04 [1] CRAN (R 4.4.0) #>  kableExtra    1.4.0    2024-01-24 [1] CRAN (R 4.4.0) #>  knitr       * 1.48     2024-07-07 [1] CRAN (R 4.4.0) #>  lifecycle     1.0.4    2023-11-07 [1] CRAN (R 4.4.0) #>  magrittr    * 2.0.3    2022-03-30 [1] CRAN (R 4.4.0) #>  munsell       0.5.1    2024-04-01 [1] CRAN (R 4.4.0) #>  pillar        1.9.0    2023-03-22 [1] CRAN (R 4.4.0) #>  pkgconfig     2.0.3    2019-09-22 [1] CRAN (R 4.4.0) #>  pkgdown       2.1.0    2024-07-06 [1] CRAN (R 4.4.0) #>  purrr         1.0.2    2023-08-10 [1] CRAN (R 4.4.0) #>  R6            2.5.1    2021-08-19 [1] CRAN (R 4.4.0) #>  ragg          1.3.2    2024-05-15 [1] CRAN (R 4.4.0) #>  readr         2.1.5    2024-01-10 [1] CRAN (R 4.4.0) #>  REDCapR     * 1.1.9007 2024-09-07 [1] local #>  rlang         1.1.4    2024-06-04 [1] CRAN (R 4.4.0) #>  rmarkdown     2.28     2024-08-17 [1] CRAN (R 4.4.0) #>  rstudioapi    0.16.0   2024-03-24 [1] CRAN (R 4.4.0) #>  sass          0.4.9    2024-03-15 [1] CRAN (R 4.4.0) #>  scales        1.3.0    2023-11-28 [1] CRAN (R 4.4.0) #>  sessioninfo   1.2.2    2021-12-06 [1] CRAN (R 4.4.0) #>  stringi       1.8.4    2024-05-06 [1] CRAN (R 4.4.0) #>  stringr       1.5.1    2023-11-14 [1] CRAN (R 4.4.0) #>  svglite       2.1.3    2023-12-08 [1] CRAN (R 4.4.0) #>  systemfonts   1.1.0    2024-05-15 [1] CRAN (R 4.4.0) #>  textshaping   0.4.0    2024-05-24 [1] CRAN (R 4.4.0) #>  tibble        3.2.1    2023-03-20 [1] CRAN (R 4.4.0) #>  tidyr         1.3.1    2024-01-24 [1] CRAN (R 4.4.0) #>  tidyselect    1.2.1    2024-03-11 [1] CRAN (R 4.4.0) #>  tzdb          0.4.0    2023-05-12 [1] CRAN (R 4.4.0) #>  utf8          1.2.4    2023-10-22 [1] CRAN (R 4.4.0) #>  vctrs         0.6.5    2023-12-01 [1] CRAN (R 4.4.0) #>  viridisLite   0.4.2    2023-05-02 [1] CRAN (R 4.4.0) #>  vroom         1.6.5    2023-12-05 [1] CRAN (R 4.4.0) #>  withr         3.0.1    2024-07-31 [1] CRAN (R 4.4.0) #>  xfun          0.47     2024-08-17 [1] CRAN (R 4.4.0) #>  xml2          1.3.6    2023-12-04 [1] CRAN (R 4.4.0) #>  yaml          2.3.10   2024-07-26 [1] CRAN (R 4.4.0) #>  #>  [1] /Users/runner/work/_temp/Library #>  [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #>  #> ──────────────────────────────────────────────────────────────────────────────"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"background","dir":"Articles","previous_headings":"","what":"Background","title":"Retrieving Longitudinal and Repeating Structures","text":"vignette pertains reading REDCap records project () longitudinal events (b) repeating measure. first section conceptually discusses REDCap stores complex structures. remaining sections describe best retrieve complex structures REDCapTidyieR REDCapR packages. new R REDCap, consider start Typical REDCap Workflow Data Analyst Basic REDCapR Operations vignettes return document. reading simple project, just call REDCapR’s redcap_read(). want perform operation (writing records REDCap), review Reference REDCapR functions see currently available. REDCap project longitudinal contains repeating measures, single call API (single export browser) return dataset readily analyzed. Instead, dataset resemble Table 5. isn’t software bug, haven’t told software like data structured. isn’t good way jam multidimensional space rectangle points. advice querying REDCap querying database system: request separate datasets natural “grain” assemble fit analyses.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"possible-table-structures","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured","what":"Possible Table Structures","title":"Retrieving Longitudinal and Repeating Structures","text":"Suppose two patients (.e., “1” “2”) three intake variables (.e., height, weight, bmi). record piece paper, probably look like Table 1. table’s grain “patient”, row represents distinct patient. Understanding grain structure help understand structures re-expressions set observations.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"table-1-patient-grain","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Possible Table Structures","what":"Table 1: patient grain","title":"Retrieving Longitudinal and Repeating Structures","text":"patient-grain structure data points comfortably inputted humans REDCap, default exported browser API. However stored differently REDCap’s internal database. REDCap’s flexibility driver success. research team learns REDCap, can reuse knowledge capture anything leukemia lunch orders. achieve flexibility world REDCap EMRs, data stored along observation grain. computer science, commonly called EAV structure (stands entity-attribute-value). patient’s ID entity, variable type attribute, observed point value. can also thought “key-value store” nested within patient (“key” synonym “attribute”). Notice two wider rows morphed six skinnier rows –one row per observation. curious database administrator, peek structure rows redcap_data table. important table database.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"table-2-observation-grain-for-intake-instrument","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Possible Table Structures","what":"Table 2: observation grain for intake instrument","title":"Retrieving Longitudinal and Repeating Structures","text":"REDCap EMR databases store observations underlying table. table simplification redcap_data table, heart REDCap’s internal database. investigation gains longitudinal repeating component, becomes necessary include dimension time. Suppose protocol specifies five time points; blood pressure instrument captured times 1, 2, & 3 laboratory instrument captured times 1 & 2. record stage paper, likely resemble Tables 3a & 3b: one vitals one labs.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"table-3b-patient-time-grain-for-laboratory-instrument","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Possible Table Structures","what":"Table 3b: patient-time grain for laboratory instrument","title":"Retrieving Longitudinal and Repeating Structures","text":"measurements added REDCap’s observation table, resembles Table 4. Two new columns required uniquely distinguish instrument ordinal position. Notice first six rows copied Table 2; empty values repeating structure.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"table-4-observation-grain-for-intake-blood_pressure-and-laboratory-instruments","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Possible Table Structures","what":"Table 4: observation grain for intake, blood_pressure, and laboratory instruments","title":"Retrieving Longitudinal and Repeating Structures","text":"mentioned , isn’t universally good way coerce Tables 1, 3a, 3b single rectangle rows represent different things. REDCap’s perspective, ’s good transformation redcap_data (.e., Table 4) appropriate statistical programs. forced combine different entities, best option probably Table 5. call “block dataset”, borrowing linear algebra’s block matrix term. can see mishmash tables masquerading unified dataset. rows lack conceptual coherency Tables 1, 3a, & 3b.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"table-5-mishmashed-grain","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Possible Table Structures","what":"Table 5: mishmashed grain","title":"Retrieving Longitudinal and Repeating Structures","text":"block dataset inherently bad. , Table 5 can unambiguously transformed Table 4. Table 5’s primary limitation block dataset understood analysis software used conventional medical research. best, dataset always require additional preparation. worst, analyst model rows inappropriately, produce misleading conclusions. Table 5’s secondary limitation inefficiency. empty cells aren’t computationally free. Every cell must queried database concatenated REDCap’s web server order return Table 5 plain-text csv, json, xml format. simple example, half block dataset’s cells wasted. emptiness frequently exceeds 90% real-world REDCap projects (tend many variables repeating instances). emptiness always exceeds 99.9% real-world EMRs. reason, REDCap EMR design observation table resemble computational structure sparse matrix. (important difference REDCap’s unspecified cells interpreted null/empty, sparse matrix’s unspecified cells interpreted zero.) case sparse matrix, substantial memory requirement reductions can realized storing non-zero entries. Depending number distribution non-zero entries, different data structures can used yield huge savings memory compared basic approach. trade-accessing individual elements becomes complex additional structures needed able recover original matrix unambiguously. (source: Wikipedia: Sparse matrix - storage)","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"observation","dir":"Articles","previous_headings":"Illustration of How Data Points are Structured > Terminology","what":"observation","title":"Retrieving Longitudinal and Repeating Structures","text":"term “observation” world medical databases different granular meaning tidyverse literature. REDCap medical databases, observation typically single point (heart rate systolic blood pressure) contextual variables (associated date, unit, visit ID, patient ID); see Tables 2 4 . tidyverse publications, observation roughly equivalent REDCap instrument (collection associated values); see Tables 1, 3a, 3b. (use medical terminology vignette. ’d love hear someone another term ’s unambiguous.)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"retrieving-from-redcap","dir":"Articles","previous_headings":"","what":"Retrieving from REDCap","title":"Retrieving Longitudinal and Repeating Structures","text":"Many new REDCap users submit single API call unintentionally obtain something like Table 5; try extract something resembling Tables 1, 3a, & 3b. Although can successful, strongly discourage . code difficult maintain portable REDCap projects different instruments. (code really slow ugly .) advice start Table 5 assembled –retrieve information better way. Like database systems, request three tables separately server combine desktop fit analyses necessary. Two approaches appropriate scenarios: multiple calls REDCapR’s redcap_read(), single call REDCapTidieR’s redcap_read_tidy(). code vignette requires magrittr package %>% (alternatively can use |> ’re using R 4.0.2 later). vignette uses credentials retrieve practice/fake dataset. appropriate datasets containing PHI sensitive information. Please see Part 2 - Retrieve Protected Token Typical REDCap Workflow Data Analyst vignette secure approaches.","code":"# Support pipes library(magrittr)  # Retrieve token path_credential <- system.file(\"misc/example.credentials\", package = \"REDCapR\") credential  <- REDCapR::retrieve_credential_local(   path_credential = path_credential,   project_id      = 3181 )"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"one-redcapr-call-for-each-table","dir":"Articles","previous_headings":"Retrieving from REDCap","what":"One REDCapR Call for Each Table","title":"Retrieving Longitudinal and Repeating Structures","text":"tidy datasets represented Tables 1, 3a, 3b can obtained calling REDCapR three times –one call per table. Using forms parameter, pass “intake” get Table 1, “blood_pressure” get Table 3a, “laboratory” get Table 3b. Although required, recommend specifying readr::cols() object ensure desired variable data types.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"retrieve-patient-level-table-corresponding-to-table-1","dir":"Articles","previous_headings":"Retrieving from REDCap > One REDCapR Call for Each Table","what":"Retrieve patient-level table (corresponding to Table 1)","title":"Retrieving Longitudinal and Repeating Structures","text":"","code":"col_types_intake <-   readr::cols_only(     record_id                 = readr::col_integer(),     height                    = readr::col_double(),     weight                    = readr::col_double(),     bmi                       = readr::col_double()   )  ds_intake <-   REDCapR::redcap_read(     redcap_uri  = credential$redcap_uri, # From the previous code snippet.     token       = credential$token,     forms       = c(\"intake\"),     col_types   = col_types_intake,     verbose     = FALSE,   )$data  ds_intake"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"retrieve-patient-time-level-tables-corresponding-to-tables-3a-3b","dir":"Articles","previous_headings":"Retrieving from REDCap > One REDCapR Call for Each Table","what":"Retrieve patient-time-level tables (corresponding to Tables 3a & 3b)","title":"Retrieving Longitudinal and Repeating Structures","text":"","code":"col_types_blood_pressure <-   readr::cols(     record_id                 = readr::col_integer(),     redcap_repeat_instrument  = readr::col_character(),     redcap_repeat_instance    = readr::col_integer(),     sbp                       = readr::col_double(),     dbp                       = readr::col_double(),     blood_pressure_complete   = readr::col_integer()   )  ds_blood_pressure <-   REDCapR::redcap_read(     redcap_uri  = credential$redcap_uri,     token       = credential$token,     forms       = c(\"blood_pressure\"),     col_types   = col_types_blood_pressure,     verbose     = FALSE   )$data  ds_blood_pressure %>%   tidyr::drop_na(redcap_repeat_instrument) col_types_laboratory  <-   readr::cols(     record_id                 = readr::col_integer(),     redcap_repeat_instrument  = readr::col_character(),     redcap_repeat_instance    = readr::col_integer(),     lab                       = readr::col_character(),     conc                      = readr::col_character(),     laboratory_complete       = readr::col_integer()   )  ds_laboratory  <-   REDCapR::redcap_read(     redcap_uri  = credential$redcap_uri,     token       = credential$token,     forms       = c(\"laboratory\"),     col_types   = col_types_laboratory,     verbose     = FALSE   )$data  ds_laboratory %>%   tidyr::drop_na(redcap_repeat_instrument)"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"retrieve-block-tables-corresponding-to-table-5","dir":"Articles","previous_headings":"Retrieving from REDCap > One REDCapR Call for Each Table","what":"Retrieve block tables (corresponding to Table 5)","title":"Retrieving Longitudinal and Repeating Structures","text":"reason need block dataset API, one call retrieve .","code":"ds_block <-   REDCapR::redcap_read(     redcap_uri  = credential$redcap_uri,     token       = credential$token,     col_types   = readr::cols(.default = readr::col_character()),     verbose     = FALSE,   )$data  ds_block"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"one-redcaptidier-call-for-all-tables","dir":"Articles","previous_headings":"Retrieving from REDCap","what":"One REDCapTidieR Call for All Tables","title":"Retrieving Longitudinal and Repeating Structures","text":"REDCapTidieR’s initial motivation facilitate longitudinal analyses promote tidy data hygiene. {Stephan Kadauke & Richard Hanna, please represent package wish. Tell ’ve positioned differently .}","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"choosing-between-the-approaches","dir":"Articles","previous_headings":"Retrieving from REDCap","what":"Choosing between the Approaches","title":"Retrieving Longitudinal and Repeating Structures","text":"retrieving data REDCap, recommend calling REDCapTidieR many scenarios, : new managing analyzing data R, analyses require dataset’s rows columns, ’d benefit auxiliary information REDCapTidieR’s supertibble, instrument’s structure. However recommend calling REDCapR scenarios. worth calling REDCapR multiple times : performing operation retrieving/reading data REDCap, comfortable managing analyzing data R, analyses require fraction data (() need first event, (b) analyses don’t involve instruments), want specify variables’ data types readr::cols(). doubt, start REDCapTidieR. Escalate REDCapR download time long might decreased reducing information retrieved server transported across network. course many scenarios solved best combination packages, () REDCapR populates initial demographics REDCap, (b) research staff enter measures collected patients time, (c) REDCapTidieR retrieves complete longitudinal dataset, (d) dplyr joins tibbles, finally (e) lme4 tests hypotheses involving patient trajectories time.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"escalating-to-redcapr","dir":"Articles","previous_headings":"Retrieving from REDCap","what":"Escalating to REDCapR","title":"Retrieving Longitudinal and Repeating Structures","text":"Even think ’ll need REDCapR’s low-level control, consider starting REDCapTidieR anyway. …particularly unsure specify grain table. structure REDCapTidieR’s tables easily compatible conventional analyses. need performance REDCapR unsure tables look, simply execute something like REDCapTidieR::redcap_read_tidy(url, project_token) study output. try mimic exactly REDCapR::redcap_read() calls. Finally, cull unwanted cells using parameters REDCapR::redcap_read(). data points even leave REDCap instance, improve performance. possible strategies include passing arguments forms: retrieve specified instruments/forms. Beginners start . easy conceptualize usually big increase speed just little development work. events: retrieve desired events within longitudinal project. instance analyses involve “intake” “follow #1” events, leave follow ups #2, #3, #4 server. fields: granular forms. can combined calls forms, passing \"bmi\" fields c(\"blood_pressure\", \"laboratory\") forms. records: example scenario, pluck individual patients associated events repeating instances. useful research, ’s usually combined REDCapR calls. See Read subset records, conditioned values variables section REDCapR’s Basic REDCapR Operations vignette. filter_logic: leverage observation values limit rows returned. underlying table index obs values, less computationally efficient options . datetime_range_begin & datetime_range_end: return records created modified specified window. Note efficiency gain moving block dataset REDCapTidieR different gain moving REDCapTidieR REDCapR. moving Table 5 REDCapTidieR Supertibble, eliminating empty cells never contain worthwhile data. moving REDCapTidieR Supertibble call collection REDCapR calls, eliminating cells contain data, may relevant analysis (patient’s name time lab specimen collected). {paragraph needs work.}","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"longitudinal","dir":"Articles","previous_headings":"Advanced","what":"Longitudinal","title":"Retrieving Longitudinal and Repeating Structures","text":"{TODO: Generalize argument longitudinal events}","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"caching-results-to-improve-performance","dir":"Articles","previous_headings":"Advanced","what":"Caching Results to Improve Performance","title":"Retrieving Longitudinal and Repeating Structures","text":"escalating REDCapR didn’t decrease duration enough, consider strategy calling REDCap per day (either package) saving results secured disk. efficient analyses require large dataset, real-time dataset. many retrospective projects, multiple analyses day can reuse dataset retrieved night (function like readr::write_rds()). helped complicated investigations multiple statisticians frantically tackle overlapping aspects funder’s deadline. Essentially transferring security responsibilities REDCap file server. balance advantages, approach’s drawbacks include: extra effort required create, secure, maintain networked drive accessible authorized analysts. take 15-60 minutes, depending institution. extra effort required create automated program retrieve cache dataset every night. See [CDS] head start. REDCap’s logs support meaningful audit human accessing API. User access audits now responsibility file system.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"caching-results-for-other-languages","dir":"Articles","previous_headings":"Advanced","what":"Caching Results for other Languages","title":"Retrieving Longitudinal and Repeating Structures","text":"Packages programming languages developed access REDCap’s API, PyCap PhpCap. Please see complete list https://redcap-tools.github.io/projects/. caching strategy described may also benefit investigation : uses language like SAS support packages. strongly discourage deploying loose scripts call API. something fixed original script, must distributed developer ~50 client institutions, must copied ~100 projects within institution. contrast, developer updates package distributed repository like CRAN, client needs run base::update.packages() per machine update packages –just REDCap packages. Data scientists already regularly. uses language like Julia lacks stable updated package. REDCap developers always releasing useful features (e.g., repeated measures) improve quality efficiency research. Leverage . investigation incorporates multiple programming languages like analysis team use consistent dataset. scenario, recommend code save R dataset multiple file formats, csv file feather file.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/longitudinal-and-repeating.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Retrieving Longitudinal and Repeating Structures","text":"sake documentation reproducibility, current report rendered following environment. Click line expand.","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #>  setting  value #>  version  R version 4.4.1 (2024-06-14) #>  os       macOS Sonoma 14.6.1 #>  system   aarch64, darwin20 #>  ui       X11 #>  language en #>  collate  en_US.UTF-8 #>  ctype    en_US.UTF-8 #>  tz       UTC #>  date     2024-09-07 #>  pandoc   3.1.11 @ /usr/local/bin/ (via rmarkdown) #>  #> ─ Packages ─────────────────────────────────────────────────────────────────── #>  package     * version  date (UTC) lib source #>  backports     1.5.0    2024-05-23 [1] CRAN (R 4.4.0) #>  bit           4.0.5    2022-11-15 [1] CRAN (R 4.4.0) #>  bit64         4.0.5    2020-08-30 [1] CRAN (R 4.4.0) #>  bslib         0.8.0    2024-07-29 [1] CRAN (R 4.4.0) #>  cachem        1.1.0    2024-05-16 [1] CRAN (R 4.4.0) #>  checkmate     2.3.2    2024-07-29 [1] CRAN (R 4.4.0) #>  cli           3.6.3    2024-06-21 [1] CRAN (R 4.4.0) #>  colorspace    2.1-1    2024-07-26 [1] CRAN (R 4.4.0) #>  crayon        1.5.3    2024-06-20 [1] CRAN (R 4.4.0) #>  curl          5.2.2    2024-08-26 [1] CRAN (R 4.4.1) #>  desc          1.4.3    2023-12-10 [1] CRAN (R 4.4.0) #>  digest        0.6.37   2024-08-19 [1] CRAN (R 4.4.1) #>  dplyr         1.1.4    2023-11-17 [1] CRAN (R 4.4.0) #>  evaluate      0.24.0   2024-06-10 [1] CRAN (R 4.4.0) #>  fansi         1.0.6    2023-12-08 [1] CRAN (R 4.4.0) #>  fastmap       1.2.0    2024-05-15 [1] CRAN (R 4.4.0) #>  fs            1.6.4    2024-04-25 [1] CRAN (R 4.4.0) #>  generics      0.1.3    2022-07-05 [1] CRAN (R 4.4.0) #>  glue          1.7.0    2024-01-09 [1] CRAN (R 4.4.0) #>  hms           1.1.3    2023-03-21 [1] CRAN (R 4.4.0) #>  htmltools     0.5.8.1  2024-04-04 [1] CRAN (R 4.4.0) #>  httr          1.4.7    2023-08-15 [1] CRAN (R 4.4.0) #>  jquerylib     0.1.4    2021-04-26 [1] CRAN (R 4.4.0) #>  jsonlite      1.8.8    2023-12-04 [1] CRAN (R 4.4.0) #>  kableExtra    1.4.0    2024-01-24 [1] CRAN (R 4.4.0) #>  knitr       * 1.48     2024-07-07 [1] CRAN (R 4.4.0) #>  lifecycle     1.0.4    2023-11-07 [1] CRAN (R 4.4.0) #>  magrittr    * 2.0.3    2022-03-30 [1] CRAN (R 4.4.0) #>  munsell       0.5.1    2024-04-01 [1] CRAN (R 4.4.0) #>  pillar        1.9.0    2023-03-22 [1] CRAN (R 4.4.0) #>  pkgconfig     2.0.3    2019-09-22 [1] CRAN (R 4.4.0) #>  pkgdown       2.1.0    2024-07-06 [1] CRAN (R 4.4.0) #>  purrr         1.0.2    2023-08-10 [1] CRAN (R 4.4.0) #>  R6            2.5.1    2021-08-19 [1] CRAN (R 4.4.0) #>  ragg          1.3.2    2024-05-15 [1] CRAN (R 4.4.0) #>  readr         2.1.5    2024-01-10 [1] CRAN (R 4.4.0) #>  REDCapR       1.1.9007 2024-09-07 [1] local #>  rlang         1.1.4    2024-06-04 [1] CRAN (R 4.4.0) #>  rmarkdown     2.28     2024-08-17 [1] CRAN (R 4.4.0) #>  rstudioapi    0.16.0   2024-03-24 [1] CRAN (R 4.4.0) #>  sass          0.4.9    2024-03-15 [1] CRAN (R 4.4.0) #>  scales        1.3.0    2023-11-28 [1] CRAN (R 4.4.0) #>  sessioninfo   1.2.2    2021-12-06 [1] CRAN (R 4.4.0) #>  stringi       1.8.4    2024-05-06 [1] CRAN (R 4.4.0) #>  stringr       1.5.1    2023-11-14 [1] CRAN (R 4.4.0) #>  svglite       2.1.3    2023-12-08 [1] CRAN (R 4.4.0) #>  systemfonts   1.1.0    2024-05-15 [1] CRAN (R 4.4.0) #>  textshaping   0.4.0    2024-05-24 [1] CRAN (R 4.4.0) #>  tibble        3.2.1    2023-03-20 [1] CRAN (R 4.4.0) #>  tidyr         1.3.1    2024-01-24 [1] CRAN (R 4.4.0) #>  tidyselect    1.2.1    2024-03-11 [1] CRAN (R 4.4.0) #>  tzdb          0.4.0    2023-05-12 [1] CRAN (R 4.4.0) #>  utf8          1.2.4    2023-10-22 [1] CRAN (R 4.4.0) #>  vctrs         0.6.5    2023-12-01 [1] CRAN (R 4.4.0) #>  viridisLite   0.4.2    2023-05-02 [1] CRAN (R 4.4.0) #>  vroom         1.6.5    2023-12-05 [1] CRAN (R 4.4.0) #>  withr         3.0.1    2024-07-31 [1] CRAN (R 4.4.0) #>  xfun          0.47     2024-08-17 [1] CRAN (R 4.4.0) #>  xml2          1.3.6    2023-12-04 [1] CRAN (R 4.4.0) #>  yaml          2.3.10   2024-07-26 [1] CRAN (R 4.4.0) #>  #>  [1] /Users/runner/work/_temp/Library #>  [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #>  #> ──────────────────────────────────────────────────────────────────────────────"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"verify-redcapr-is-installed","dir":"Articles","previous_headings":"Part 1 - Pre-requisites","what":"Verify REDCapR is installed","title":"Typical REDCap Workflow for a Data Analyst","text":"First confirm REDCapR package installed local machine. , following line throw error Loading required namespace: REDCapR.  Failed error: ‘package called ‘REDCapR’’. call fails, follow installation instructions REDCapR website. ’re workshop attendee, can use vignette copy snippets code local machine follow along examples: https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html.","code":"requireNamespace(\"REDCapR\") #> Loading required namespace: REDCapR  # If this fails, run `install.packages(\"REDCapR\")` or `remotes::install_github(repo=\"OuhscBbmc/REDCapR\")`"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"verify-redcap-access","dir":"Articles","previous_headings":"Part 1 - Pre-requisites","what":"Verify REDCap Access","title":"Typical REDCap Workflow for a Data Analyst","text":"Check institution’s REDCap administrator ensure access REDCap server, access specific REDCap project, API token appropriate privileges specific REDCap project. might first time ’ve ever needed request token, institution may formal process API approval. REDCap admin can help. vignette, ’ll use fake dataset hosted https://bbmc.ouhsc.edu/redcap/api/ accessible token “9A81268476645C4E5F03428B8AC3AA7B”. Note REDCap Admins: REDCapR::redcap_read() function properly, user must Export permissions ‘Full Data Set’. Users ‘De-Identified’ export privileges can still use REDCapR::redcap_read_oneshot(). grant appropriate permissions: go ‘User Rights’ REDCap project site, select desired user, select ‘Edit User Privileges’, ‘Data Exports’ radio buttons, select ‘Full Data Set’.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"review-codebook","dir":"Articles","previous_headings":"Part 1 - Pre-requisites","what":"Review Codebook","title":"Typical REDCap Workflow for a Data Analyst","text":"developing REDCap analysis code, spend least 10 minutes review codebook, whose link near top left corner REDCap project page, “Project Home Design” heading. Learning details save time later improve quality research. ’re new project, meet investigator least 30 minutes learn context, collection process, idiosyncrasies dataset. conversation, develop plan grooming dataset ready analysis. part standard advice analyst’s involvement start early investigation’s life span.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"part-2---retrieve-protected-token","dir":"Articles","previous_headings":"","what":"Part 2 - Retrieve Protected Token","title":"Typical REDCap Workflow for a Data Analyst","text":"REDCap API token essentially combination personal password ID specific project ’re requesting data . Protect like password PHI (protected health information). project PHI, never hard-code password directly R file. words, PHI project accessed R file includes line Instead, suggest storing token location can accessed . two recommendations.","code":"my_secret_token <- \"9A81268476645C4E5F03428B8AC3AA7B\""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"security-method-1-token-file","dir":"Articles","previous_headings":"Part 2 - Retrieve Protected Token","what":"Security Method 1: Token File","title":"Typical REDCap Workflow for a Data Analyst","text":"basic goals () separate secret values R file dedicated file (b) secure dedicated file. using git repository, prevent file committed entry .gitignore. Ask institution’s security team recommendation. retrieve_credential_local() function REDCapR package loads relevant information csv R. plain-text file might look like : retrieve credentials first project listed , pass value “153” project_id. credential file already created vignette. next real project, call create_credential_local() start well-formed csv file can contain tokens. Compared method , one less secure easier establish.","code":"redcap_uri,username,project_id,token,comment \"https://bbmc.ouhsc.edu/redcap/api/\",\"myusername\",153,9A81268476645C4E5F03428B8AC3AA7B,\"simple\" \"https://bbmc.ouhsc.edu/redcap/api/\",\"myusername\",212,0434F0E9CF53ED0587847AB6E51DE762,\"longitudinal\" \"https://bbmc.ouhsc.edu/redcap/api/\",\"myusername\",213,D70F9ACD1EDD6F151C6EA78683944E98,\"write data\" path_credential <- system.file(\"misc/example.credentials\", package = \"REDCapR\") credential  <- REDCapR::retrieve_credential_local(   path_credential = path_credential,   project_id      = 153 )  credential #> $redcap_uri #> [1] \"https://bbmc.ouhsc.edu/redcap/api/\" #>  #> $username #> [1] \"myusername\" #>  #> $project_id #> [1] 153 #>  #> $token #> [1] \"9A81268476645C4E5F03428B8AC3AA7B\" #>  #> $comment #> [1] \"simple static (read-only) test project\""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"security-method-2-token-server","dir":"Articles","previous_headings":"Part 2 - Retrieve Protected Token","what":"Security Method 2: Token Server","title":"Typical REDCap Workflow for a Data Analyst","text":"preferred method involves saving tokens separate database uses something like Active Directory authenticate requests. method described detail Security Database vignette. approach realistically requires someone institution least basic database administration experience.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"part-3---read-data-unstructured-approach","dir":"Articles","previous_headings":"","what":"Part 3 - Read Data: Unstructured Approach","title":"Typical REDCap Workflow for a Data Analyst","text":"redcap_uri token fields required arguments REDCapR::redcap_read(); credential object created previous section. point, data.frame ds_1 everything need start analyzing project.  Pause workshop minutes. Raise hand ’re trouble.","code":"ds_1 <-   REDCapR::redcap_read(     redcap_uri  = credential$redcap_uri,     token       = credential$token   )$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.3 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 05:09:31.297113. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200. ds_1 #> # A tibble: 5 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         2 Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10    11     1 #> 3         3 Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09    80     1 #> 4         4 Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02    61     0 #> 5         5 John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15    59     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>  hist(ds_1$weight) summary(ds_1) #>    record_id  name_first         name_last           address          #>  Min.   :1   Length:5           Length:5           Length:5           #>  1st Qu.:2   Class :character   Class :character   Class :character   #>  Median :3   Mode  :character   Mode  :character   Mode  :character   #>  Mean   :3                                                            #>  3rd Qu.:4                                                            #>  Max.   :5                                                            #>                                                                       #>   telephone            email                dob                  age       #>  Length:5           Length:5           Min.   :1934-04-09   Min.   :11.0   #>  Class :character   Class :character   1st Qu.:1952-11-02   1st Qu.:11.0   #>  Mode  :character   Mode  :character   Median :1955-04-15   Median :59.0   #>                                        Mean   :1969-11-06   Mean   :44.4   #>                                        3rd Qu.:2003-03-10   3rd Qu.:61.0   #>                                        Max.   :2003-08-30   Max.   :80.0   #>                                                                            #>       sex      demographics_complete     height          weight    #>  Min.   :0.0   Min.   :2             Min.   :  6.0   Min.   :  1   #>  1st Qu.:0.0   1st Qu.:2             1st Qu.:  7.0   1st Qu.:  1   #>  Median :1.0   Median :2             Median :165.0   Median : 54   #>  Mean   :0.6   Mean   :2             Mean   :110.2   Mean   : 48   #>  3rd Qu.:1.0   3rd Qu.:2             3rd Qu.:180.0   3rd Qu.: 80   #>  Max.   :1.0   Max.   :2             Max.   :193.0   Max.   :104   #>                                                                    #>       bmi          comments           mugshot          health_complete #>  Min.   : 19.8   Length:5           Length:5           Min.   :0       #>  1st Qu.: 24.7   Class :character   Class :character   1st Qu.:0       #>  Median : 27.9   Mode  :character   Mode  :character   Median :1       #>  Mean   :110.9                                         Mean   :1       #>  3rd Qu.:204.1                                         3rd Qu.:2       #>  Max.   :277.8                                         Max.   :2       #>                                                                        #>     race___1      race___2      race___3      race___4      race___5   #>  Min.   :0.0   Min.   :0.0   Min.   :0.0   Min.   :0.0   Min.   :0.0   #>  1st Qu.:0.0   1st Qu.:0.0   1st Qu.:0.0   1st Qu.:0.0   1st Qu.:1.0   #>  Median :0.0   Median :0.0   Median :0.0   Median :0.0   Median :1.0   #>  Mean   :0.2   Mean   :0.2   Mean   :0.2   Mean   :0.2   Mean   :0.8   #>  3rd Qu.:0.0   3rd Qu.:0.0   3rd Qu.:0.0   3rd Qu.:0.0   3rd Qu.:1.0   #>  Max.   :1.0   Max.   :1.0   Max.   :1.0   Max.   :1.0   Max.   :1.0   #>                                                                        #>     race___6     ethnicity interpreter_needed race_and_ethnicity_complete #>  Min.   :0.0   Min.   :0   Min.   :0.00       Min.   :0.0                 #>  1st Qu.:0.0   1st Qu.:1   1st Qu.:0.00       1st Qu.:2.0                 #>  Median :0.0   Median :1   Median :0.00       Median :2.0                 #>  Mean   :0.2   Mean   :1   Mean   :0.25       Mean   :1.6                 #>  3rd Qu.:0.0   3rd Qu.:1   3rd Qu.:0.25       3rd Qu.:2.0                 #>  Max.   :1.0   Max.   :2   Max.   :1.00       Max.   :2.0                 #>                            NA's   :1  summary(lm(age ~ 1 + sex + bmi, data = ds_1)) #>  #> Call: #> lm(formula = age ~ 1 + sex + bmi, data = ds_1) #>  #> Residuals: #>       1       2       3       4       5  #>  -2.491   1.954   9.132   2.491 -11.086  #>  #> Coefficients: #>             Estimate Std. Error t value Pr(>|t|)   #> (Intercept) 63.34496    8.89980   7.118   0.0192 * #> sex         13.55626    9.62958   1.408   0.2945   #> bmi         -0.24426    0.04337  -5.632   0.0301 * #> --- #> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #>  #> Residual standard error: 10.55 on 2 degrees of freedom #> Multiple R-squared:  0.9442, Adjusted R-squared:  0.8884  #> F-statistic: 16.92 on 2 and 2 DF,  p-value: 0.05581"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"part-4---read-data-choosing-columns-and-rows","dir":"Articles","previous_headings":"","what":"Part 4 - Read Data: Choosing Columns and Rows","title":"Typical REDCap Workflow for a Data Analyst","text":"read dataset first time, probably haven’t decided columns needed makes sense retrieve everything. gain familiarity data analytic objectives, consider selective variables rows transported remote server local machine. Advantages include: server almost always efficient filtering language like R Python. REDCap’s PHP code retrieves less data REDCap’s database translates less text format (like csv json). Fewer bytes transmitted across network. local machine better performance, R smaller dataset manage. brain doesn’t look past unnecessary columns. R code doesn’t filter server already removed. Highly-sensitive PHI columns unnecessary analysis remain server.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"specify-record-ids","dir":"Articles","previous_headings":"Part 4 - Read Data: Choosing Columns and Rows","what":"Specify Record IDs","title":"Typical REDCap Workflow for a Data Analyst","text":"basic operation limit rows passing exact record identifiers.","code":"# Return only records with IDs of 1 and 4 desired_records <- c(1, 4) REDCapR::redcap_read(   redcap_uri  = credential$redcap_uri,   token       = credential$token,   records     = desired_records,   verbose     = FALSE )$data #> # A tibble: 2 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         4 Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02    61     0 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"specify-row-filter","dir":"Articles","previous_headings":"Part 4 - Read Data: Choosing Columns and Rows","what":"Specify Row Filter","title":"Typical REDCap Workflow for a Data Analyst","text":"useful operation limit rows passing expression filter records returning. See server’s documentation syntax rules filter statements. Remember enclose variable names square brackets. Also aware differences strings numbers.","code":"# Return only records with a birth date after January 2003 REDCapR::redcap_read(   redcap_uri    = credential$redcap_uri,   token         = credential$token,   filter_logic  = \"'2003-01-01' < [dob]\",   verbose       = FALSE )$data #> # A tibble: 2 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         2 Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10    11     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"specify-column-names","dir":"Articles","previous_headings":"Part 4 - Read Data: Choosing Columns and Rows","what":"Specify Column Names","title":"Typical REDCap Workflow for a Data Analyst","text":"Limit returned fields passing vector desired names.","code":"# Return only the fields record_id, name_first, and age desired_fields <- c(\"record_id\", \"name_first\", \"age\") REDCapR::redcap_read(   redcap_uri  = credential$redcap_uri,   token       = credential$token,   fields      = desired_fields,   verbose     = FALSE )$data #> # A tibble: 5 × 3 #>   record_id name_first   age #>       <dbl> <chr>      <dbl> #> 1         1 Nutmeg        11 #> 2         2 Tumtum        11 #> 3         3 Marcus        80 #> 4         4 Trudy         61 #> 5         5 John Lee      59"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"part-5---read-data-structured-approach","dir":"Articles","previous_headings":"","what":"Part 5 - Read Data: Structured Approach","title":"Typical REDCap Workflow for a Data Analyst","text":"automation scripts matures institutional resources depend output, output stable. One way make predictable specify column names column data types. previous example, notice R (specifically readr::read_csv()) made best guess reported “Column specification” section. following example, REDCapR passes col_types readr::read_csv() converts plain-text output returned REDCap R data frame. (precise, tibble returned.) readr sees column values like 1, 2, 3, 4, make reasonable guess column double precision floating-point data type. However recommend using simplest data type reasonable simpler data type less likely contain unintended values ’s typically faster, consumes less memory, translates cleanly across platforms. specifically identifiers like record_id specify either integer character.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"specify-column-names-types","dir":"Articles","previous_headings":"Part 5 - Read Data: Structured Approach","what":"Specify Column Names & Types","title":"Typical REDCap Workflow for a Data Analyst","text":"","code":"# Specify the column types. desired_fields <- c(\"record_id\", \"race\") col_types <- readr::cols(   record_id  = readr::col_integer(),   race___1   = readr::col_logical(),   race___2   = readr::col_logical(),   race___3   = readr::col_logical(),   race___4   = readr::col_logical(),   race___5   = readr::col_logical(),   race___6   = readr::col_logical() ) REDCapR::redcap_read(   redcap_uri  = credential$redcap_uri,   token       = credential$token,   fields      = desired_fields,   verbose     = FALSE,   col_types   = col_types )$data #> # A tibble: 5 × 7 #>   record_id race___1 race___2 race___3 race___4 race___5 race___6 #>       <int> <lgl>    <lgl>    <lgl>    <lgl>    <lgl>    <lgl>    #> 1         1 FALSE    FALSE    FALSE    FALSE    TRUE     FALSE    #> 2         2 FALSE    FALSE    TRUE     FALSE    TRUE     FALSE    #> 3         3 FALSE    FALSE    FALSE    TRUE     TRUE     FALSE    #> 4         4 FALSE    TRUE     FALSE    FALSE    TRUE     FALSE    #> 5         5 TRUE     FALSE    FALSE    FALSE    FALSE    TRUE"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"specify-everything-is-a-character","dir":"Articles","previous_headings":"Part 5 - Read Data: Structured Approach","what":"Specify Everything is a Character","title":"Typical REDCap Workflow for a Data Analyst","text":"REDCap internally stores every value string. accept full responsibility data types, tell readr::cols() keep strings.","code":"# Specify the column types. desired_fields <- c(\"record_id\", \"race\") col_types <- readr::cols(.default = readr::col_character()) REDCapR::redcap_read(   redcap_uri  = credential$redcap_uri,   token       = credential$token,   fields      = desired_fields,   verbose     = FALSE,   col_types   = col_types )$data #> # A tibble: 5 × 7 #>   record_id race___1 race___2 race___3 race___4 race___5 race___6 #>   <chr>     <chr>    <chr>    <chr>    <chr>    <chr>    <chr>    #> 1 1         0        0        0        0        1        0        #> 2 2         0        0        1        0        1        0        #> 3 3         0        0        0        1        1        0        #> 4 4         0        1        0        0        1        0        #> 5 5         1        0        0        0        0        1"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"other-redcapr-resources","dir":"Articles","previous_headings":"Part 6 - Next Steps","what":"Other REDCapR Resources","title":"Typical REDCap Workflow for a Data Analyst","text":"addition documentation function REDCapR package contains handful vignettes including troubleshooting guide.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"create-an-arch-for-reuse","dir":"Articles","previous_headings":"Part 6 - Next Steps","what":"Create an Arch for Reuse","title":"Typical REDCap Workflow for a Data Analyst","text":"multiple R files use REDCapR call REDCap dataset, consider refactoring scripts extraction code written , called multiple analysis files. “arch” pattern described slides 9-16 2014 REDCapCon presentation, Literate Programming Patterns Practices Continuous Quality Improvement (CQI).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"downstream-reproducible-reports","dir":"Articles","previous_headings":"Part 6 - Next Steps","what":"Downstream Reproducible Reports","title":"Typical REDCap Workflow for a Data Analyst","text":"dataset R, take advantage reproducible research tools available. Tomorrow, R/Medicine workshop topic using exciting new Quarto program ’s similar R Markdown. Also see relevant R/Medicine 2020 presentation videos. course, book Yihui Xie colleagues.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"batching","dir":"Articles","previous_headings":"Part 6 - Next Steps","what":"Batching","title":"Typical REDCap Workflow for a Data Analyst","text":"default, REDCapR::redcap_read() requests datasets 100 patients time, stacks resulting subsets together returning data.frame. can adjusted improve performance; ‘Details’ section REDCapR::redcap_read() discusses trade offs.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"writing-to-the-server","dir":"Articles","previous_headings":"Part 6 - Next Steps","what":"Writing to the Server","title":"Typical REDCap Workflow for a Data Analyst","text":"Reading record data one API capability. REDCapR exposes 20+ API functions, reading metadata, retrieving survey links, writing records back REDCap. last operation relevant Kenneth McLean’s presentation following five-minute break.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"notes","dir":"Articles","previous_headings":"","what":"Notes","title":"Typical REDCap Workflow for a Data Analyst","text":"vignette originally designed 2021 R/Medicine REDCap workshop Peter Higgins, Amanda Miller, Kenneth McLean. work made possible part NIH grant U54GM104938 Oklahoma Shared Clinical Translational Resource).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Typical REDCap Workflow for a Data Analyst","text":"sake documentation reproducibility, current report rendered following environment. Click line expand.","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #>  setting  value #>  version  R version 4.4.1 (2024-06-14) #>  os       macOS Sonoma 14.6.1 #>  system   aarch64, darwin20 #>  ui       X11 #>  language en #>  collate  en_US.UTF-8 #>  ctype    en_US.UTF-8 #>  tz       UTC #>  date     2024-09-07 #>  pandoc   3.1.11 @ /usr/local/bin/ (via rmarkdown) #>  #> ─ Packages ─────────────────────────────────────────────────────────────────── #>  package     * version  date (UTC) lib source #>  backports     1.5.0    2024-05-23 [1] CRAN (R 4.4.0) #>  bit           4.0.5    2022-11-15 [1] CRAN (R 4.4.0) #>  bit64         4.0.5    2020-08-30 [1] CRAN (R 4.4.0) #>  bslib         0.8.0    2024-07-29 [1] CRAN (R 4.4.0) #>  cachem        1.1.0    2024-05-16 [1] CRAN (R 4.4.0) #>  checkmate     2.3.2    2024-07-29 [1] CRAN (R 4.4.0) #>  cli           3.6.3    2024-06-21 [1] CRAN (R 4.4.0) #>  crayon        1.5.3    2024-06-20 [1] CRAN (R 4.4.0) #>  curl          5.2.2    2024-08-26 [1] CRAN (R 4.4.1) #>  desc          1.4.3    2023-12-10 [1] CRAN (R 4.4.0) #>  digest        0.6.37   2024-08-19 [1] CRAN (R 4.4.1) #>  dplyr         1.1.4    2023-11-17 [1] CRAN (R 4.4.0) #>  evaluate      0.24.0   2024-06-10 [1] CRAN (R 4.4.0) #>  fansi         1.0.6    2023-12-08 [1] CRAN (R 4.4.0) #>  fastmap       1.2.0    2024-05-15 [1] CRAN (R 4.4.0) #>  fs            1.6.4    2024-04-25 [1] CRAN (R 4.4.0) #>  generics      0.1.3    2022-07-05 [1] CRAN (R 4.4.0) #>  glue          1.7.0    2024-01-09 [1] CRAN (R 4.4.0) #>  highr         0.11     2024-05-26 [1] CRAN (R 4.4.0) #>  hms           1.1.3    2023-03-21 [1] CRAN (R 4.4.0) #>  htmltools     0.5.8.1  2024-04-04 [1] CRAN (R 4.4.0) #>  httr          1.4.7    2023-08-15 [1] CRAN (R 4.4.0) #>  jquerylib     0.1.4    2021-04-26 [1] CRAN (R 4.4.0) #>  jsonlite      1.8.8    2023-12-04 [1] CRAN (R 4.4.0) #>  knitr         1.48     2024-07-07 [1] CRAN (R 4.4.0) #>  lifecycle     1.0.4    2023-11-07 [1] CRAN (R 4.4.0) #>  magrittr      2.0.3    2022-03-30 [1] CRAN (R 4.4.0) #>  pillar        1.9.0    2023-03-22 [1] CRAN (R 4.4.0) #>  pkgconfig     2.0.3    2019-09-22 [1] CRAN (R 4.4.0) #>  pkgdown       2.1.0    2024-07-06 [1] CRAN (R 4.4.0) #>  R6            2.5.1    2021-08-19 [1] CRAN (R 4.4.0) #>  ragg          1.3.2    2024-05-15 [1] CRAN (R 4.4.0) #>  readr         2.1.5    2024-01-10 [1] CRAN (R 4.4.0) #>  REDCapR       1.1.9007 2024-09-07 [1] local #>  rlang         1.1.4    2024-06-04 [1] CRAN (R 4.4.0) #>  rmarkdown     2.28     2024-08-17 [1] CRAN (R 4.4.0) #>  sass          0.4.9    2024-03-15 [1] CRAN (R 4.4.0) #>  sessioninfo   1.2.2    2021-12-06 [1] CRAN (R 4.4.0) #>  systemfonts   1.1.0    2024-05-15 [1] CRAN (R 4.4.0) #>  textshaping   0.4.0    2024-05-24 [1] CRAN (R 4.4.0) #>  tibble        3.2.1    2023-03-20 [1] CRAN (R 4.4.0) #>  tidyselect    1.2.1    2024-03-11 [1] CRAN (R 4.4.0) #>  tzdb          0.4.0    2023-05-12 [1] CRAN (R 4.4.0) #>  utf8          1.2.4    2023-10-22 [1] CRAN (R 4.4.0) #>  vctrs         0.6.5    2023-12-01 [1] CRAN (R 4.4.0) #>  vroom         1.6.5    2023-12-05 [1] CRAN (R 4.4.0) #>  withr         3.0.1    2024-07-31 [1] CRAN (R 4.4.0) #>  xfun          0.47     2024-08-17 [1] CRAN (R 4.4.0) #>  yaml          2.3.10   2024-07-26 [1] CRAN (R 4.4.0) #>  #>  [1] /Users/runner/work/_temp/Library #>  [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #>  #> ──────────────────────────────────────────────────────────────────────────────"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"strategy","dir":"Articles","previous_headings":"Part 1 - Intro","what":"Strategy","title":"Writing to a REDCap Project","text":"described Retrieving Longitudinal Repeating Structures vignette, best way read write data projects longitudinal/repeating elements break “block matrix” dataset individual datasets. rectangle coherent grain. Following strategy, ’ll write REDCap server two distinct steps: Upload patient-level instrument(s) Upload repeating instrument separately. actual upload phase pretty straight-forward –’s just call REDCapR::redcap_write(). vignette’s code prepares dataset upload run smoothly.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"pre-requisites","dir":"Articles","previous_headings":"Part 1 - Intro","what":"Pre-requisites","title":"Writing to a REDCap Project","text":"See Typical REDCap Workflow Data Analyst vignette Verify REDCapR installed Verify REDCap Access Review Codebook","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"retrieve-token","dir":"Articles","previous_headings":"Part 1 - Intro","what":"Retrieve Token","title":"Writing to a REDCap Project","text":"Please closely read Retrieve Protected Token section, important security implications. current vignette imports fake dataset REDCap, ’ll use token stored local file.","code":"# retrieve-credential path_credential <- system.file(\"misc/example.credentials\", package = \"REDCapR\") credential  <- REDCapR::retrieve_credential_local(   path_credential = path_credential,   project_id      = 3748 )  c(credential$redcap_uri, credential$token)"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"datasets-to-write-to-server","dir":"Articles","previous_headings":"Part 1 - Intro","what":"Datasets to Write to Server","title":"Writing to a REDCap Project","text":"keep vignette focused writing/importing/uploading server, ’ll start data needs written. example tables prepared Raymond Balise 2023 R/Medicine workshop, “Using REDCap R Rapidly Produce Biomedical Publications”. two tables, different granularity: ds_patient: row represents one patient, ds_daily: row represents one daily measurement per patient.","code":"# load-patient ds_patient <-   \"test-data/vignette-repeating-write/data-patient.rds\" |>   system.file(package = \"REDCapR\") |>   readr::read_rds()  ds_patient # load-repeating ds_daily <-   \"test-data/vignette-repeating-write/data-daily.rds\" |>   system.file(package = \"REDCapR\") |>   readr::read_rds()  ds_daily"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"part-2---write-data-one-row-per-patient","dir":"Articles","previous_headings":"","what":"Part 2 - Write Data: One row per patient","title":"Writing to a REDCap Project","text":"Besides data.frame write REDCap, required arguments REDCapR::redcap_write() function redcap_uri token; contained credential object created previous section. discussed Troubleshooting vignette, recommend running two preliminary checks trying write dataset server first time.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"prep-stoplight-fields","dir":"Articles","previous_headings":"Part 2 - Write Data: One row per patient","what":"Prep: Stoplight Fields","title":"Writing to a REDCap Project","text":"REDCap project isn’t longitudinal doesn’t arms, uploading patient-level data.frame REDCap doesn’t require adding variables. However typically populate *_complete variables communicate record’s status. row needs human add values inspect existing values consider marking instrument “incomplete” “unverified”; patient’s instrument record appear red yellow REDCap’s Record Dashboard. Otherwise consider marking instrument “complete” appear green. example project, patient-level instrument “enrollment”, corresponding variable enrollment_complete.","code":"# patient-complete ds_patient <-   ds_patient |>   dplyr::mutate(     enrollment_complete   = REDCapR::constant(\"form_complete\"),   )"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"prep-redcaprvalidate_for_write","dir":"Articles","previous_headings":"Part 2 - Write Data: One row per patient","what":"Prep: REDCapR::validate_for_write()","title":"Writing to a REDCap Project","text":"REDCapR::validate_for_write() inspects data frame anticipate potential problems writing REDCap’s API. tibble returned, one row per potential problem (suggestion avoid ). Ideally 0-row tibble returned. encounter problems can checked automation, please tell us issue. ’ll work incorporate new check REDCapR::validate_for_write(). dataset’s problems caught reaching server, solutions easier identify implement.","code":"REDCapR::validate_for_write(ds_patient, convert_logical_to_integer = TRUE)"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"prep-write-small-subset-first","dir":"Articles","previous_headings":"Part 2 - Write Data: One row per patient","what":"Prep: Write Small Subset First","title":"Writing to a REDCap Project","text":"first time complicated project, consider loading small subset rows columns. case, start three columns two rows.","code":"# patient-subset ds_patient |>   dplyr::select(              # First three columns     id_code,     date,     is_mobile,   ) |>   dplyr::slice(1:2) |>        # First two rows   REDCapR::redcap_write(     ds_to_write = _,     redcap_uri  = credential$redcap_uri,     token       = credential$token,     convert_logical_to_integer = TRUE   )"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"prep-recode-variables-where-necessary","dir":"Articles","previous_headings":"Part 2 - Write Data: One row per patient","what":"Prep: Recode Variables where Necessary","title":"Writing to a REDCap Project","text":"variables data.frame might represented differently REDCap. common transformation changing strings integers underlie radio buttons. Common approaches dplyr::case_match() using joining lookup tables (mappings expressed csv). ’s -line example dplyr::case_match().","code":"ds_patient <-   ds_patient |>   dplyr::mutate(     race =       dplyr::case_match(         race,         \"White\"                       ~  1L,         \"Black or African American\"   ~  2L,         \"Asian\"                       ~  3L,         \"Native American\"             ~  4L,         \"Pacific Islander\"            ~  5L,         \"Multiracial\"                 ~  6L,         \"Refused or don't know\"       ~  7L       )   )"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"write-entire-patient-level-table","dir":"Articles","previous_headings":"Part 2 - Write Data: One row per patient","what":"Write Entire Patient-level Table","title":"Writing to a REDCap Project","text":"small subset works, usually jump ahead try columns rows. larger table fails, split difference () smaller working example (b) larger failing example. See middle point (fewer rows /columns failing point) succeeds fails. repeat. “bisection” “binary search” debugging technique helpful many areas programming statistical modeling.","code":"# patient-entire ds_patient |>   REDCapR::redcap_write(     ds_to_write = _,     redcap_uri  = credential$redcap_uri,     token       = credential$token,     convert_logical_to_integer = TRUE   )"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"add-plumbing-variables","dir":"Articles","previous_headings":"Part 3 - Write Data: Repeating Instrument","what":"Add Plumbing Variables","title":"Writing to a REDCap Project","text":"stated vignette’s intro, structure dataset uploaded server must precise. uploading repeating instruments, several important columns: record_id: typically indicates patient’s id. (field can renamed project.) redcap_event_name: project longitudinal arms, indicates event. Otherwise, don’t need add variable. redcap_repeat_instrument: Indicates instrument/form repeating columns. redcap_repeat_instance: Typically sequential positive integer (e.g., 1, 2, 3, …) indicating order. combination variables needs unique. Please read Retrieving Longitudinal Repeating Structures vignette details variables meanings. need pass specific variables REDCap server understands hierarchical structure data points.","code":"# repeat-plumbing ds_daily <-   ds_daily |>   dplyr::group_by(id_code) |>   dplyr::mutate(     redcap_repeat_instrument  = \"daily\",     redcap_repeat_instance    = dplyr::row_number(da_date),     daily_complete            = REDCapR::constant(\"form_complete\"),   ) |>   dplyr::ungroup() |>   dplyr::select(     id_code,                        # Or `record_id`, if you didn't rename it     # redcap_event_name,            # If the project is longitudinal or has arms     redcap_repeat_instrument,       # The name of the repeating instrument/form     redcap_repeat_instance,         # The sequence of the repeating instrument     tidyselect::everything(),       # All columns not explicitly passed to `dplyr::select()`     daily_complete,                 # Indicates incomplete, unverified, or complete   )  # Check for potential problems.  (Remember zero rows are good.) REDCapR::validate_for_write(ds_daily, convert_logical_to_integer = TRUE)  ds_daily"},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"writing-repeating-instrument-variables","dir":"Articles","previous_headings":"Part 3 - Write Data: Repeating Instrument","what":"Writing Repeating Instrument Variables","title":"Writing to a REDCap Project","text":"","code":"# daily-entire ds_daily |>   REDCapR::redcap_write(     ds_to_write = _,     redcap_uri  = credential$redcap_uri,     token       = credential$token,     convert_logical_to_integer = TRUE   )"},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"more-complexity","dir":"Articles","previous_headings":"Part 4 - Next Steps","what":"More Complexity","title":"Writing to a REDCap Project","text":"vignette required two data.frames, complex projects sometimes need . example, repeating instrument data.frame writing step. Arms longitudinal events need considered .","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"batching","dir":"Articles","previous_headings":"Part 4 - Next Steps","what":"Batching","title":"Writing to a REDCap Project","text":"default, REDCapR::redcap_write() requests datasets 100 patients time, stacks resulting subsets together returning data.frame. can adjusted improve performance; ‘Details’ section REDCapR::redcap_write() discusses trade offs. usually shoot ~10 seconds per batch.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"manual-vs-api","dir":"Articles","previous_headings":"Part 4 - Next Steps","what":"Manual vs API","title":"Writing to a REDCap Project","text":"Manual downloading/uploading might make sense ’re operation . ever stop first time? trouble uploading, consider adding fake patients & measurements download csv. might reveal something didn’t anticipate. aware block matrix format (.e., everything jammed one rectangle.)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"redcaps-cdis","dir":"Articles","previous_headings":"Part 4 - Next Steps","what":"REDCap’s CDIS","title":"Writing to a REDCap Project","text":"Clinical Data Interoperability Services (CDIS) use FHIR move data institution’s EMR/EHR (eg, Epic, Cerner) REDCap. Research staff control patient records selected eligible. Conceptually ’s similar writing REDCap’s API, much bigger scale. Realistically, takes months get institution’s human layers. established, project populated EMR data much less development time –assuming desired data models corresponds FHIR endpoints.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"notes","dir":"Articles","previous_headings":"","what":"Notes","title":"Writing to a REDCap Project","text":"vignette originally designed 2023 R/Medicine workshop, Using REDCap R Rapidly Produce Biomedical Publications Cleaning Medical Data Raymond R. Balise, Belén Hervera, Daniel Maya, Anna Calderon, Tyler Bartholomew, Stephan Kadauke, João Pedro Carmezim Correia 2024 R/Medicine workshop, REDCap + R: Teaming Tidyverse, Stephan Kadauke. workshop slides 2023 2024. work made possible part NIH grant U54GM104938 Oklahoma Shared Clinical Translational Resource).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/articles/workflow-write.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session Information","title":"Writing to a REDCap Project","text":"sake documentation reproducibility, current report rendered following environment. Click line expand.","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #>  setting  value #>  version  R version 4.4.1 (2024-06-14) #>  os       macOS Sonoma 14.6.1 #>  system   aarch64, darwin20 #>  ui       X11 #>  language en #>  collate  en_US.UTF-8 #>  ctype    en_US.UTF-8 #>  tz       UTC #>  date     2024-09-07 #>  pandoc   3.1.11 @ /usr/local/bin/ (via rmarkdown) #>  #> ─ Packages ─────────────────────────────────────────────────────────────────── #>  package     * version date (UTC) lib source #>  bslib         0.8.0   2024-07-29 [1] CRAN (R 4.4.0) #>  cachem        1.1.0   2024-05-16 [1] CRAN (R 4.4.0) #>  cli           3.6.3   2024-06-21 [1] CRAN (R 4.4.0) #>  desc          1.4.3   2023-12-10 [1] CRAN (R 4.4.0) #>  digest        0.6.37  2024-08-19 [1] CRAN (R 4.4.1) #>  evaluate      0.24.0  2024-06-10 [1] CRAN (R 4.4.0) #>  fastmap       1.2.0   2024-05-15 [1] CRAN (R 4.4.0) #>  fs            1.6.4   2024-04-25 [1] CRAN (R 4.4.0) #>  highr         0.11    2024-05-26 [1] CRAN (R 4.4.0) #>  htmltools     0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0) #>  jquerylib     0.1.4   2021-04-26 [1] CRAN (R 4.4.0) #>  jsonlite      1.8.8   2023-12-04 [1] CRAN (R 4.4.0) #>  knitr         1.48    2024-07-07 [1] CRAN (R 4.4.0) #>  lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.4.0) #>  pkgdown       2.1.0   2024-07-06 [1] CRAN (R 4.4.0) #>  R6            2.5.1   2021-08-19 [1] CRAN (R 4.4.0) #>  ragg          1.3.2   2024-05-15 [1] CRAN (R 4.4.0) #>  rlang         1.1.4   2024-06-04 [1] CRAN (R 4.4.0) #>  rmarkdown     2.28    2024-08-17 [1] CRAN (R 4.4.0) #>  sass          0.4.9   2024-03-15 [1] CRAN (R 4.4.0) #>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.4.0) #>  systemfonts   1.1.0   2024-05-15 [1] CRAN (R 4.4.0) #>  textshaping   0.4.0   2024-05-24 [1] CRAN (R 4.4.0) #>  xfun          0.47    2024-08-17 [1] CRAN (R 4.4.0) #>  yaml          2.3.10  2024-07-26 [1] CRAN (R 4.4.0) #>  #>  [1] /Users/runner/work/_temp/Library #>  [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library #>  #> ──────────────────────────────────────────────────────────────────────────────"},{"path":"https://ouhscbbmc.github.io/REDCapR/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Beasley. Author, maintainer. David Bard. Contributor. Thomas Wilson. Contributor. John J Aponte. Contributor. Rollie Parrish. Contributor. Benjamin Nutter. Contributor. Andrew Peters. Contributor. Hao Zhu. Contributor. Janosch Linkersdörfer. Contributor. Jonathan Mang. Contributor. Felix Torres. Contributor. Philip Chase. Contributor. Victor Castro. Contributor. Greg Botwin. Contributor. Stephan Kadauke. Contributor. Ezra Porter. Contributor. Matthew Schuelke. Contributor.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Beasley W (2024). REDCapR: Interaction R REDCap. R package version 1.1.9007, https://github.com/OuhscBbmc/REDCapR, https://www.ouhsc.edu/bbmc/, https://projectredcap.org, https://ouhscbbmc.github.io/REDCapR/.","code":"@Manual{,   title = {REDCapR: Interaction Between R and REDCap},   author = {Will Beasley},   year = {2024},   note = {R package version 1.1.9007, https://github.com/OuhscBbmc/REDCapR, https://www.ouhsc.edu/bbmc/, https://projectredcap.org},   url = {https://ouhscbbmc.github.io/REDCapR/}, }"},{"path":"https://ouhscbbmc.github.io/REDCapR/index.html","id":"redcapr-","dir":"","previous_headings":"","what":"Interaction Between R and REDCap","title":"Interaction Between R and REDCap","text":"’ve using R REDCap’s API since 2012 developed REDCapR. encapsulating functions package, replicating 50+ lines code contact REDCap robustly transform returned csv R data.frame; took twice much implement batching. can done one call redcap_read(): redcap_read() function also accepts values subsetting/filtering records fields. two examples; first selects portion rows, second selects portion columns. Documentation additional 20+ functions found ouhscbbmc.github.io/REDCapR/reference. REDCapR package includes SSL certificate retrieved httr::find_cert_bundle(). REDCap server’s identity always verified, unless setting overridden (alternative certificates can also provided). keep maintenance efforts manageable, package implements REDCap API functions requested. ’s feature help projects, please tell us new issue REDCapR’s GitHub repository. troubleshooting document helps diagnose issues API.","code":"ds <- redcap_read(redcap_uri=uri, token=token)$data # Return only records with IDs of 1 and 4 desired_records <- c(1, 4) ds_some_rows <- redcap_read(   redcap_uri   = uri,   token        = token,   records      = desired_records )$data  # Return only the fields record_id, name_first, and age desired_fields <- c(\"record_id\", \"name_first\", \"age\") ds_some_fields <- redcap_read(   redcap_uri  = uri,   token       = token,   fields      = desired_fields )$data"},{"path":"https://ouhscbbmc.github.io/REDCapR/index.html","id":"installation-and-documentation","dir":"","previous_headings":"","what":"Installation and Documentation","title":"Interaction Between R and REDCap","text":"release version can installed CRAN. development version can installed GitHub installing remotes package. ouhscbbmc.github.io/REDCapR site describes package functions, includes documents involving basic operations, advanced operations, token security, troubleshooting. Also checkout packages exist communicating REDCap, listed REDCap Tools directory.","code":"install.packages(\"REDCapR\") install.packages(\"remotes\") # Run this line if the 'remotes' package isn't installed already. remotes::install_github(\"OuhscBbmc/REDCapR\")"},{"path":"https://ouhscbbmc.github.io/REDCapR/index.html","id":"collaborative-development","dir":"","previous_headings":"","what":"Collaborative Development","title":"Interaction Between R and REDCap","text":"encourage input collaboration. ’re familiar GitHub R packages, feel free submit pull request. ’d like report bug make suggestion, please create GitHub issue; issues usually good place ask public questions . However, feel free email (wibeasley@hotmail.com). Please note project released Contributor Code Conduct; participating project agree abide terms. starting material described ./documentation--developers/ directory. ’d like thank following developers advice code contributions: Benjamin Nutter, Rollie Parrish, Scott Burns, John Aponte, Andrew Peters, Hao Zhu.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/index.html","id":"funders","dir":"","previous_headings":"","what":"Funders","title":"Interaction Between R and REDCap","text":"Much package developed support needs following projects. appreciate support. (far) primary developers REDCapR external evaluators Oklahoma’s MIECHV program. See preliminary CQI reports (many use REDCapR) https://ouhscbbmc.github.io/MReportingPublic/. OUHSC CCAN Independent Evaluation State Oklahoma Competitive Maternal, Infant, Early Childhood Home Visiting (MIECHV) Project. HRSA/ACF D89MC23154. David Bard, PI, OUHSC; 2011-2015. Independent Evaluation State OK MIECHV Evidence Based Home Visitation Project, NIH-sponsored collaboration OSDH. David Bard, PI, OUHSC; 2015-2017. OSDH ParentPRO Pilot Evaluation, federally-sponsored collaboration OSDH. David Bard, PI, OUHSC; 2015-2017. Title IV-E Waiver Project, HRSA/MCHB-sponsored collaboration OKDHS; David Bard, PI, OUHSC; 2014-2017. Integrative Analysis Longitudinal Studies Aging (IALSA), sponsored NIH 5P01AG043362. Scott Hofer, PI, University Victoria; Beasley, PI site-award, OUHSC; 2013-2018. Oklahoma Shared Clinical Translational Resources, sponsored NIH NIGMS; U54 GM104938. Judith . James, PI, OUHSC; 2013-2018. Oklahoma Shared Clinical Translational Resources, sponsored NIH U54GM104938; 2020-2021. Additional Institutional Support OUHSC Dept Pediatrics; 2013-2021. Thanks, Beasley, David Bard, & Thomas WilsonUniversity Oklahoma Health Sciences Center, Department Pediatrics, Biomedical & Behavioral Research Core.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/REDCapR-package.html","id":null,"dir":"Reference","previous_headings":"","what":"REDCapR: Interaction Between R and REDCap — REDCapR-package","title":"REDCapR: Interaction Between R and REDCap — REDCapR-package","text":"Encapsulates functions streamline calls R REDCap API. REDCap (Research Electronic Data CAPture) web application building managing online surveys databases developed Vanderbilt University. Application Programming Interface (API) offers avenue access modify data programmatically, improving capacity literate reproducible programming. Comprehensive documentation also available https://ouhscbbmc.github.io/REDCapR/. Much package developed support needs following projects.  appreciate support. OUHSC CCAN Independent Evaluation State Oklahoma Competitive Maternal, Infant, Early Childhood Home Visiting (MIECHV) Project. HRSA/ACF D89MC23154. David Bard, PI, OUHSC; 2011-2015. Independent Evaluation State OK MIECHV Evidence Based Home Visitation Project, NIH-sponsored collaboration OSDH. David Bard, PI, OUHSC; 2015-2017. OSDH ParentPRO Pilot Evaluation, federally-sponsored collaboration OSDH. David Bard, PI, OUHSC; 2015-2017. Title IV-E Waiver Project, HRSA/MCHB-sponsored collaboration OKDHS; David Bard, PI, OUHSC; 2014-2017. Integrative Analysis Longitudinal Studies Aging (IALSA), sponsored NIH 5P01AG043362. Scott Hofer, PI, University Victoria; Beasley, PI site-award, OUHSC; 2013-2018. Oklahoma Shared Clinical Translational Resources, sponsored NIH NIGMS; U54 GM104938. Judith . James, PI, OUHSC; 2013-2018. Additional Institutional Support OUHSC Dept Pediatrics; 2013-2017.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/REDCapR-package.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"REDCapR: Interaction Between R and REDCap — REDCapR-package","text":"release version available CRAN running install.packages('REDCapR').  recent development version available GitHub running remotes::install_github('OuhscBbmc/REDCapR') (make sure remotes already installed). trouble package, please install development version.  solve problem, please create new issue, email . See REDCapR's advanced vignette information examples overriding default SSL options.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/REDCapR-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"REDCapR: Interaction Between R and REDCap — REDCapR-package","text":"Maintainer: Beasley wibeasley@hotmail.com (ORCID) contributors: David Bard (ORCID) [contributor] Thomas Wilson [contributor] John J Aponte john.aponte@isglobal.org [contributor] Rollie Parrish rparrish@flightweb.com (ORCID) [contributor] Benjamin Nutter [contributor] Andrew Peters (ORCID) [contributor] Hao Zhu (ORCID) [contributor] Janosch Linkersdörfer (ORCID) [contributor] Jonathan Mang (ORCID) [contributor] Felix Torres fetorres@ucsd.edu [contributor] Philip Chase pbc@ufl.edu (ORCID) [contributor] Victor Castro vcastro@mgh.harvard.edu (ORCID) [contributor] Greg Botwin [contributor] Stephan Kadauke (ORCID) [contributor] Ezra Porter (ORCID) [contributor] Matthew Schuelke matt@themadstatter.com (ORCID) [contributor]","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/REDCapR-package.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"REDCapR: Interaction Between R and REDCap — REDCapR-package","text":"","code":"# \\dontrun{ # Install/update REDCapR with the release version from CRAN. # install.packages('REDCapR')  # Install/update REDCapR with the development version from GitHub # install.packages(\"remotes\") # Uncomment if `remotes` isn't installed already. # remotes::install_github('OuhscBbmc/REDCapR') # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Collapse a vector of values into a single string when necessary — collapse_vector","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"REDCap's API frequently specifies series values separated commas. R world, easier keep values separate elements vector. functions squashes together single character element (presumably right return value passed API)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"","code":"collapse_vector(elements)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"elements array values.  Can NULL.  Required.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"single character element, values separated commas.  Can blank. (.e., \"\").","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/collapse_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collapse a vector of values into a single string when necessary — collapse_vector","text":"","code":"library(REDCapR) # Load the package into the current R session. REDCapR:::collapse_vector(elements = NULL   ) #> [1] \"\" REDCapR:::collapse_vector(elements = letters) #> [1] \"a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":null,"dir":"Reference","previous_headings":"","what":"Collection of REDCap-specific constants — constant","title":"Collection of REDCap-specific constants — constant","text":"Collection constants defined REDCap developers.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collection of REDCap-specific constants — constant","text":"","code":"constant(name)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collection of REDCap-specific constants — constant","text":"name Name constant.  Required character.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collection of REDCap-specific constants — constant","text":"constant's value.  Currently single integers, expanded future.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Collection of REDCap-specific constants — constant","text":"Form Completeness current constants relate 'complete' variable end form. form_incomplete: 0L (.e., integer) form_unverified: 1L form_complete: 2L Export Rights See https://-server/redcap/api/help/?content=exp_users. data_export_rights_no_access    : 0L data_export_rights_deidentified : 1L data_export_rights_full         : 2L Form Rights See https://-server/redcap/api/help/?content=exp_users. order digits may unexpected. form_rights_no_access    : 0L form_rights_readonly     : 2L form_rights_edit_form    : 1L form_rights_edit_survey  : 3L Access Rights See https://-server/redcap/api/help/?content=exp_users. access_no    : 0L access_yes   : 1L add , please edit constant.R GitHub submit pull request.  instructions, please see Editing files another user's repository # nolint GitHub documentation.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Collection of REDCap-specific constants — constant","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/constant.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Collection of REDCap-specific constants — constant","text":"","code":"REDCapR::constant(\"form_incomplete\")  # Returns 0L #> [1] 0 REDCapR::constant(\"form_unverified\")  # Returns 1L #> [1] 1 REDCapR::constant(\"form_complete\"  )  # Returns 2L #> [1] 2  REDCapR::constant(\"data_export_rights_no_access\"   )  # Returns 0L #> [1] 0 REDCapR::constant(\"data_export_rights_deidentified\")  # Returns 1L #> [1] 1 REDCapR::constant(\"data_export_rights_full\"        )  # Returns 2L #> [1] 2  REDCapR::constant(\"form_rights_no_access\")   # Returns 0L #> [1] 0 REDCapR::constant(\"form_rights_readonly\" )   # Returns 2L --Notice the order #> [1] 2 REDCapR::constant(\"form_rights_edit_form\")   # Returns 1L #> [1] 1 REDCapR::constant(\"form_rights_edit_survey\") # Returns 3L #> [1] 3  REDCapR::constant(\"access_no\" )  # Returns 0L #> [1] 0 REDCapR::constant(\"access_yes\")  # Returns 1L #> [1] 1  REDCapR::constant(c(   \"form_complete\",   \"form_complete\",   \"form_incomplete\" )) # Returns c(2L, 2L, 0L) #> [1] 2 2 0 REDCapR::constant(c(   \"form_rights_no_access\",   \"form_rights_readonly\",   \"form_rights_edit_form\",   \"form_rights_edit_survey\" )) # Returns c(0L, 2L, 1L, 3L) #> [1] 0 2 1 3   constant_to_form_completion( c(0, 2, 1, 2, NA)) #> [1] incomplete complete   unverified complete   unknown    #> Levels: incomplete unverified complete unknown constant_to_form_rights(     c(0, 2, 1, 2, NA)) #> [1] no_access readonly  edit_form readonly  unknown   #> Levels: no_access readonly edit_form edit_survey unknown constant_to_export_rights(   c(0, 2, 1, 3, NA)) #> [1] no_access    rights_full  deidentified <NA>         unknown      #> Levels: no_access deidentified rights_full unknown constant_to_access(          c(0, 1, 1, 0, NA)) #> [1] no      yes     yes     no      unknown #> Levels: no yes unknown  # \\dontrun{ # The following line returns an error: #     Assertion on 'name' failed: Must be a subset of #     {'form_complete','form_incomplete','form_unverified'}, #     but is {'bad-name'}.  REDCapR::constant(\"bad-name\")    # Returns an error #> Error in REDCapR::constant(\"bad-name\"): Assertion on 'name' failed: Must be a subset of {'form_incomplete','form_unverified','form_complete','data_export_rights_no_access','data_export_rights_deidentified','data_export_rights_full','form_rights_no_access','form_rights_readonly','form_rights_edit_form','form_rights_edit_survey','access_no','access_yes'}, but has additional elements {'bad-name'}.  REDCapR::constant(c(\"form_complete\", \"bad-name\")) # Returns an error #> Error in REDCapR::constant(c(\"form_complete\", \"bad-name\")): Assertion on 'name' failed: Must be a subset of {'form_incomplete','form_unverified','form_complete','data_export_rights_no_access','data_export_rights_deidentified','data_export_rights_full','form_rights_no_access','form_rights_readonly','form_rights_edit_form','form_rights_edit_survey','access_no','access_yes'}, but has additional elements {'bad-name'}. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"function returns base::data.frame() functions use separate long-running read write REDCap calls multiple, smaller REDCap calls.  goal (1) reduce chance time-outs, (2) introduce little breaks batches server continually tied .","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"","code":"create_batch_glossary(row_count, batch_size)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"row_count number records large dataset, split. batch_size maximum number subject records single batch contain.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"Currently, base::data.frame() returned following columns, id: integer uniquely identifies batch, starting 1. start_index: index first row batch. integer. stop_index: index last row batch. integer. id_pretty: character representation id, padded zeros. start_index: character representation start_index, padded zeros. stop_index: character representation stop_index, padded zeros. label: character concatenation id_pretty, start_index, stop_index_pretty.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"function can also assist splitting saving large data frame disk smaller files (.csv).  padded columns allow OS sort batches/files sequential order.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/create_batch_glossary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates a dataset that help batching long-running read and writes — create_batch_glossary","text":"","code":"REDCapR::create_batch_glossary(100, 50) #> # A tibble: 2 × 7 #>      id start_index stop_index index_pretty start_index_pretty stop_index_pretty #>   <int>       <int>      <int> <chr>        <chr>              <chr>             #> 1     1           1         50 1            001                050               #> 2     2          51        100 2            051                100               #> # ℹ 1 more variable: label <chr> REDCapR::create_batch_glossary(100, 25) #> # A tibble: 4 × 7 #>      id start_index stop_index index_pretty start_index_pretty stop_index_pretty #>   <int>       <int>      <int> <chr>        <chr>              <chr>             #> 1     1           1         25 1            001                025               #> 2     2          26         50 2            026                050               #> 3     3          51         75 3            051                075               #> 4     4          76        100 4            076                100               #> # ℹ 1 more variable: label <chr> REDCapR::create_batch_glossary(100,  3) #> # A tibble: 34 × 7 #>       id start_index stop_index index_pretty start_index_pretty #>    <int>       <int>      <int> <chr>        <chr>              #>  1     1           1          3 01           001                #>  2     2           4          6 02           004                #>  3     3           7          9 03           007                #>  4     4          10         12 04           010                #>  5     5          13         15 05           013                #>  6     6          16         18 06           016                #>  7     7          19         21 07           019                #>  8     8          22         24 08           022                #>  9     9          25         27 09           025                #> 10    10          28         30 10           028                #> # ℹ 24 more rows #> # ℹ 2 more variables: stop_index_pretty <chr>, label <chr> REDCapR::create_batch_glossary(  0,  3) #> # A tibble: 0 × 7 #> # ℹ 7 variables: id <int>, start_index <int>, stop_index <int>, #> #   index_pretty <chr>, start_index_pretty <chr>, stop_index_pretty <chr>, #> #   label <chr> d <- data.frame(   record_id = 1:100,   iv        = sample(x=4, size=100, replace=TRUE),   dv        = rnorm(n=100) ) REDCapR::create_batch_glossary(nrow(d), batch_size=40) #> # A tibble: 3 × 7 #>      id start_index stop_index index_pretty start_index_pretty stop_index_pretty #>   <int>       <int>      <int> <chr>        <chr>              <chr>             #> 1     1           1         40 1            001                040               #> 2     2          41         80 2            041                080               #> 3     3          81        100 3            081                100               #> # ℹ 1 more variable: label <chr>"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":null,"dir":"Reference","previous_headings":"","what":"REDCapR internal function for calling the REDCap API — kernel_api","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"function used functions read write values.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"","code":"kernel_api(   redcap_uri,   post_body,   config_options,   encoding = \"UTF-8\",   content_type = \"text/csv\",   handle_httr = NULL,   encode_httr = \"form\" )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. post_body List contents expected REDCap API.  Required. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. encoding encoding value passed httr::content().  Defaults 'UTF-8'. content_type MIME value passed httr::content().  Defaults 'text/csv'. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions. encode_httr value passed encode parameter httr::POST(). Defaults \"form\", appropriate actions. (Currently, exception importing file, uses \"multipart\".)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"utils::packageVersion.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"API call unsuccessful, value base::package_version(\"0.0.0\") returned.  ensures function always return object class base::package_version. guarantees value can always used utils::compareVersion().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/kernel_api.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"REDCapR internal function for calling the REDCap API — kernel_api","text":"","code":"config_options <- NULL uri            <- \"https://bbmc.ouhsc.edu/redcap/api/\" token          <- \"9A81268476645C4E5F03428B8AC3AA7B\" post_body      <- list(   token    = token,   content  = \"project\",   format   = \"csv\" ) # \\dontrun{ kernel <- REDCapR:::kernel_api(uri, post_body, config_options)  # Consume the results in a few different ways. kernel$result #> Response [https://bbmc.ouhsc.edu/redcap/api/] #>   Date: 2024-09-07 05:07 #>   Status: 200 #>   Content-Type: text/csv; charset=utf-8 #>   Size: 717 B #> project_id,project_title,creation_time,production_time,in_production,project_... #> 153,\"REDCapR Target Simple Static -see https://github.com/OuhscBbmc/REDCapR\",... read.csv(text = kernel$raw_text) #>   project_id #> 1        153 #>                                                            project_title #> 1 REDCapR Target Simple Static -see https://github.com/OuhscBbmc/REDCapR #>         creation_time production_time in_production project_language purpose #> 1 2013-11-29 15:58:20              NA             0          English       0 #>   purpose_other project_notes custom_record_label secondary_unique_field #> 1            NA            NA                  NA                     NA #>   is_longitudinal has_repeating_instruments_or_events surveys_enabled #> 1               0                                   0               0 #>   scheduling_enabled record_autonumbering_enabled randomization_enabled #> 1                  0                            1                     0 #>   ddp_enabled project_irb_number project_grant_number project_pi_firstname #> 1           0                 NA                   NA                   NA #>   project_pi_lastname display_today_now_button missing_data_codes #> 1                  NA                        1                 NA #>                                                                     external_modules #> 1 cross_project_piping,form_status_tweaks,redcap_autofill,data_driven_project_banner #>   bypass_branching_erase_field_prompt #> 1                                   0 as.list(read.csv(text = kernel$raw_text)) #> $project_id #> [1] 153 #>  #> $project_title #> [1] \"REDCapR Target Simple Static -see https://github.com/OuhscBbmc/REDCapR\" #>  #> $creation_time #> [1] \"2013-11-29 15:58:20\" #>  #> $production_time #> [1] NA #>  #> $in_production #> [1] 0 #>  #> $project_language #> [1] \"English\" #>  #> $purpose #> [1] 0 #>  #> $purpose_other #> [1] NA #>  #> $project_notes #> [1] NA #>  #> $custom_record_label #> [1] NA #>  #> $secondary_unique_field #> [1] NA #>  #> $is_longitudinal #> [1] 0 #>  #> $has_repeating_instruments_or_events #> [1] 0 #>  #> $surveys_enabled #> [1] 0 #>  #> $scheduling_enabled #> [1] 0 #>  #> $record_autonumbering_enabled #> [1] 1 #>  #> $randomization_enabled #> [1] 0 #>  #> $ddp_enabled #> [1] 0 #>  #> $project_irb_number #> [1] NA #>  #> $project_grant_number #> [1] NA #>  #> $project_pi_firstname #> [1] NA #>  #> $project_pi_lastname #> [1] NA #>  #> $display_today_now_button #> [1] 1 #>  #> $missing_data_codes #> [1] NA #>  #> $external_modules #> [1] \"cross_project_piping,form_status_tweaks,redcap_autofill,data_driven_project_banner\" #>  #> $bypass_branching_erase_field_prompt #> [1] 0 #>  # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":null,"dir":"Reference","previous_headings":"","what":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"collection functions assists handling REDCap project metadata.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"","code":"regex_named_captures(pattern, text, perl = TRUE)  checkbox_choices(select_choices)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"pattern regular expression pattern.  Required. text text apply regex .  Required. perl Indicates perl-compatible regexps used. Default TRUE. Optional. select_choices text containing choices parsed determine id label values.  Required.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"Currently, tibble::tibble() returned row match, column named group within match.  retrieve_checkbox_choices() function, columns . id: numeric value assigned choice (data dictionary). label: label assigned choice (data dictionary).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"regex_named_captures() function general, specific REDCap; accepts arbitrary regular expression. returns tibble::tibble() many columns named matches. checkbox_choices() function specialized, accommodates \"select choices\" single REDCap checkbox group (multiple boxes can selected).  returns tibble::tibble() two columns, one numeric id one text label. parse probably fail label contains pipe (.e., |), since delimiter REDCap uses separate choices presented user.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"See official documentation permissible characters checkbox label. bluffing , know located. know, please tell .","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/metadata_utilities.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Manipulate and interpret the metadata of a REDCap project — metadata_utilities","text":"","code":"# The weird ranges are to avoid the pipe character; #   PCRE doesn't support character negation. pattern_boxes <- \"(?<=\\\\A| \\\\| )(?<id>\\\\d{1,}), (?<label>[\\x20-\\x7B\\x7D-\\x7E]{1,})(?= \\\\| |\\\\Z)\"  choices_1 <- paste0(   \"1, American Indian/Alaska Native | \",   \"2, Asian | \",   \"3, Native Hawaiian or Other Pacific Islander | \",   \"4, Black or African American | \",   \"5, White | \",   \"6, Unknown / Not Reported\" )  # This calls the general function, and requires the correct regex pattern. REDCapR::regex_named_captures(pattern=pattern_boxes, text=choices_1) #> # A tibble: 6 × 2 #>   id    label                                     #>   <chr> <chr>                                     #> 1 1     American Indian/Alaska Native             #> 2 2     Asian                                     #> 3 3     Native Hawaiian or Other Pacific Islander #> 4 4     Black or African American                 #> 5 5     White                                     #> 6 6     Unknown / Not Reported                     # This function is designed specifically for the checkbox values. REDCapR::checkbox_choices(select_choices=choices_1) #> # A tibble: 6 × 2 #>   id    label                                     #>   <chr> <chr>                                     #> 1 1     American Indian/Alaska Native             #> 2 2     Asian                                     #> 3 3     Native Hawaiian or Other Pacific Islander #> 4 4     Black or African American                 #> 5 5     White                                     #> 6 6     Unknown / Not Reported                     # \\dontrun{ uri         <- \"https://bbmc.ouhsc.edu/redcap/api/\" token       <- \"9A81268476645C4E5F03428B8AC3AA7B\"  ds_metadata <- redcap_metadata_read(uri, token)$data #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. choices_2   <- ds_metadata[ds_metadata$field_name == \"race\", ]$select_choices_or_calculations  REDCapR::regex_named_captures(pattern = pattern_boxes, text = choices_2) #> # A tibble: 6 × 2 #>   id    label                                     #>   <chr> <chr>                                     #> 1 1     American Indian/Alaska Native             #> 2 2     Asian                                     #> 3 3     Native Hawaiian or Other Pacific Islander #> 4 4     Black or African American                 #> 5 5     White                                     #> 6 6     Unknown / Not Reported                    # }  path_3     <- system.file(package = \"REDCapR\", \"test-data/project-simple/metadata.csv\") ds_metadata_3  <- read.csv(path_3) choices_3  <- ds_metadata_3[ds_metadata_3$field_name==\"race\", \"select_choices_or_calculations\"] REDCapR::regex_named_captures(pattern = pattern_boxes, text = choices_3) #> # A tibble: 6 × 2 #>   id    label                                     #>   <chr> <chr>                                     #> 1 1     American Indian/Alaska Native             #> 2 2     Asian                                     #> 3 3     Native Hawaiian or Other Pacific Islander #> 4 4     Black or African American                 #> 5 5     White                                     #> 6 6     Unknown / Not Reported"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":null,"dir":"Reference","previous_headings":"","what":"Export Arms — redcap_arm_export","title":"Export Arms — redcap_arm_export","text":"Export Arms REDCap project","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export Arms — redcap_arm_export","text":"","code":"redcap_arm_export(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export Arms — redcap_arm_export","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export Arms — redcap_arm_export","text":"Currently, list returned following elements: has_arms: logical value indicating REDCap project arms (.e., \"TRUE\") classic non-longitudinal project (.e., \"FALSE\"). data: tibble::tibble() one row per arm.  columns arm_number (integer) arm_name (human-friendly string). success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Export Arms — redcap_arm_export","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export Arms — redcap_arm_export","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_arm_export.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export Arms — redcap_arm_export","text":"","code":"# \\dontrun{ uri            <- \"https://bbmc.ouhsc.edu/redcap/api/\"  # Query a classic project with 3 arms token_1  <- \"CDF9F3767E413FDBAA31D92E9F36730A\" result_1 <- REDCapR::redcap_arm_export(redcap_uri=uri, token=token_1) #> The list of arms was retrieved from the REDCap project in 0.4 seconds. The http status code was 200. result_1$has_arms #> [1] TRUE result_1$data #> # A tibble: 3 × 2 #>   arm_number arm_name #>        <int> <chr>    #> 1          1 Arm 1    #> 2          2 Arm 2    #> 3          3 Arm 3     # Query a classic project without arms token_2  <- \"D70F9ACD1EDD6F151C6EA78683944E98\" result_2 <- REDCapR::redcap_arm_export(redcap_uri=uri, token=token_2) #> A 'classic' REDCap project has no arms.  Retrieved in 0.1 seconds. The http status code was 400. result_2$has_arms #> [1] FALSE result_2$data #> # A tibble: 0 × 2 #> # ℹ 2 variables: arm_number <int>, arm_name <chr> # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":null,"dir":"Reference","previous_headings":"","what":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"Replace non-ASCII characters legal characters cause problems writing REDCap project.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"","code":"redcap_column_sanitize(   d,   column_names = colnames(d),   encoding_initial = \"latin1\",   substitution_character = \"?\" )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"d base::data.frame() tibble::tibble() containing dataset used update REDCap project.  Required. column_names array character values indicating names variables sanitize.  Optional. encoding_initial array character values indicating names variables sanitize.  Optional. substitution_character character value replaces characters unable appropriately matched.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"data frame columns, whose character values sanitized.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"Letters like accented '' replaced plain ''. thin wrapper around base::iconv(). ASCII//TRANSLIT option actual transliteration work.  R 3.1.0, OSes use similar, different, versions convert characters.  aware case notice OS-dependent differences.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_column_sanitize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sanitize to adhere to REDCap character encoding requirements — redcap_column_sanitize","text":"","code":"# Typical examples are not shown because they require non-ASCII encoding, #   which makes the package documentation less portable.  dirty <- data.frame(   id     = 1:3,   names  = c(\"Ekstr\\xf8m\", \"J\\xf6reskog\", \"bi\\xdfchen Z\\xfcrcher\") )  REDCapR::redcap_column_sanitize(dirty) #>   id             names #> 1  1           Ekstrom #> 2  2         J\"oreskog #> 3  3 bisschen Z\"urcher"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Read data access groups from a REDCap project — redcap_dag_read","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"function reads available data access groups REDCap returns tibble::tibble().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"","code":"redcap_dag_read(   redcap_uri,   token,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"Currently, list returned following elements: data: tibble::tibble() data access groups project. success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"Jonathan M. Mang","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_dag_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read data access groups from a REDCap project — redcap_dag_read","text":"","code":"# \\dontrun{ uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"9A81268476645C4E5F03428B8AC3AA7B\" REDCapR::redcap_dag_read(redcap_uri=uri, token=token)$data #> 2 data access groups were read from REDCap in 0.4 seconds.  The http status code was 200. #> # A tibble: 2 × 3 #>   data_access_group_name unique_group_name data_access_group_id #>   <chr>                  <chr>                            <dbl> #> 1 dag_1                  dag_1                               36 #> 2 dag_2                  dag_2                               37 # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":null,"dir":"Reference","previous_headings":"","what":"Delete records in a REDCap project — redcap_delete","title":"Delete records in a REDCap project — redcap_delete","text":"Delete existing records ID REDCap.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Delete records in a REDCap project — redcap_delete","text":"","code":"redcap_delete(   redcap_uri,   token,   records_to_delete,   arm_of_records_to_delete = NULL,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Delete records in a REDCap project — redcap_delete","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. records_to_delete character vector project's record_id values delete.  Required. arm_of_records_to_delete single integer reflecting arm containing records deleted.  Leave NULL project arms longitudinal. Required REDCap project arms.  See Details . verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Delete records in a REDCap project — redcap_delete","text":"Currently, list returned following elements: success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_affected_count: number records inserted updated. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Delete records in a REDCap project — redcap_delete","text":"REDCap requires least one record_id value passed delete call. project arms, REDCapR stricter requirements REDCap. REDCap project arms, value must passed arm_of_records_to_delete.  different behavior calling server cURL – arm number specified, arms cleared specified record_ids. Note longitudinal projects technically arms, even one arm defined.  Therefore value arm_number must specified longitudinal projects.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Delete records in a REDCap project — redcap_delete","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Delete records in a REDCap project — redcap_delete","text":"Jonathan Mang, Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_delete.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Delete records in a REDCap project — redcap_delete","text":"","code":"if (FALSE) { records_to_delete <- c(102, 103, 105, 120)  # Deleting from a non-longitudinal project with no defined arms: REDCapR::redcap_delete(   redcap_uri               = uri,   token                    = token,   records_to_delete        = records_to_delete, )  # Deleting from a project that has arms or is longitudinal: arm_number <- 2L # Not the arm name REDCapR::redcap_delete(   redcap_uri               = uri,   token                    = token,   records_to_delete        = records_to_delete,   arm_of_records_to_delete = arm_number ) }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":null,"dir":"Reference","previous_headings":"","what":"Enumerate the instruments to event mappings — redcap_event_instruments","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"Export instrument-event mappings project (.e., data collection instruments designated certain events longitudinal project). (Copied \"Export Instrument-Event Mappings\" method REDCap API documentation, v.10.5.1)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"","code":"redcap_event_instruments(   redcap_uri,   token,   arms = NULL,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. arms character string arms retrieve. Defaults arms project. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"Currently, list returned following elements, data: tibble::tibble() row represents one column REDCap dataset. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"Victor Castro, Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_instruments.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enumerate the instruments to event mappings — redcap_event_instruments","text":"","code":"# \\dontrun{ uri                 <- \"https://bbmc.ouhsc.edu/redcap/api/\"  # Longitudinal project with one arm token_1  <- \"786334BEB4A87D572DD0E99C4BFCE144\" # pid 2629 REDCapR::redcap_arm_export(redcap_uri=uri, token=token_1)$data #> The list of arms was retrieved from the REDCap project in 0.2 seconds. The http status code was 200. #> # A tibble: 1 × 2 #>   arm_number arm_name #>        <int> <chr>    #> 1          1 Arm 1    REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_1)$data #> 3 event instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 3 × 3 #>   arm_num unique_event_name form       #>     <int> <chr>             <chr>      #> 1       1 intake_arm_1      collection #> 2       1 dischage_arm_1    collection #> 3       1 follow_up_arm_1   collection  # Project with two arms token_2  <- \"0434F0E9CF53ED0587847AB6E51DE762\" # pid 212 REDCapR::redcap_arm_export(redcap_uri=uri, token=token_2)$data #> The list of arms was retrieved from the REDCap project in 0.2 seconds. The http status code was 200. #> # A tibble: 2 × 2 #>   arm_number arm_name #>        <int> <chr>    #> 1          1 Drug A   #> 2          2 Drug B   REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_2)$data #> 25 event instrument metadata records were read from REDCap in 0.4 seconds.  The http status code was 200. #> # A tibble: 25 × 3 #>    arm_num unique_event_name form                         #>      <int> <chr>             <chr>                        #>  1       1 enrollment_arm_1  demographics                 #>  2       1 enrollment_arm_1  contact_info                 #>  3       1 enrollment_arm_1  baseline_data                #>  4       1 dose_1_arm_1      patient_morale_questionnaire #>  5       1 visit_1_arm_1     visit_lab_data               #>  6       1 visit_1_arm_1     patient_morale_questionnaire #>  7       1 visit_1_arm_1     visit_blood_workup           #>  8       1 visit_1_arm_1     visit_observed_behavior      #>  9       1 dose_2_arm_1      patient_morale_questionnaire #> 10       1 visit_2_arm_1     visit_lab_data               #> # ℹ 15 more rows REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_2, arms = c(\"1\", \"2\"))$data #> 25 event instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 25 × 3 #>    arm_num unique_event_name form                         #>      <int> <chr>             <chr>                        #>  1       1 enrollment_arm_1  demographics                 #>  2       1 enrollment_arm_1  contact_info                 #>  3       1 enrollment_arm_1  baseline_data                #>  4       1 dose_1_arm_1      patient_morale_questionnaire #>  5       1 visit_1_arm_1     visit_lab_data               #>  6       1 visit_1_arm_1     patient_morale_questionnaire #>  7       1 visit_1_arm_1     visit_blood_workup           #>  8       1 visit_1_arm_1     visit_observed_behavior      #>  9       1 dose_2_arm_1      patient_morale_questionnaire #> 10       1 visit_2_arm_1     visit_lab_data               #> # ℹ 15 more rows REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_2, arms = \"2\")$data #> 10 event instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 10 × 3 #>    arm_num unique_event_name        form                             #>      <int> <chr>                    <chr>                            #>  1       2 enrollment_arm_2         demographics                     #>  2       2 enrollment_arm_2         contact_info                     #>  3       2 enrollment_arm_2         baseline_data                    #>  4       2 deadline_to_opt_ou_arm_2 contact_info                     #>  5       2 first_dose_arm_2         patient_morale_questionnaire     #>  6       2 first_visit_arm_2        patient_morale_questionnaire     #>  7       2 first_visit_arm_2        visit_observed_behavior          #>  8       2 final_visit_arm_2        visit_observed_behavior          #>  9       2 final_visit_arm_2        completion_project_questionnaire #> 10       2 deadline_to_return_arm_2 contact_info                      # Classic project (without arms) throws an error token_3  <- \"9A81268476645C4E5F03428B8AC3AA7B\" # pid 153 REDCapR::redcap_arm_export(redcap_uri=uri, token=token_3)$data #> A 'classic' REDCap project has no arms.  Retrieved in 0.1 seconds. The http status code was 400. #> # A tibble: 0 × 2 #> # ℹ 2 variables: arm_number <int>, arm_name <chr> # REDCapR::redcap_event_instruments(redcap_uri=uri, token=token_3)$data # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Export Events — redcap_event_read","title":"Export Events — redcap_event_read","text":"Export Events REDCap project","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export Events — redcap_event_read","text":"","code":"redcap_event_read(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export Events — redcap_event_read","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export Events — redcap_event_read","text":"Currently, list returned following elements: data: tibble::tibble() one row per arm-event combination.  columns event_name (human-friendly string), arm_num (integer), unique_event_name (string), custom_event_label (string), event_id (integer). success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Export Events — redcap_event_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export Events — redcap_event_read","text":"Ezra Porter, Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_event_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export Events — redcap_event_read","text":"","code":"# \\dontrun{ uri            <- \"https://bbmc.ouhsc.edu/redcap/api/\"  # Query a longitudinal project with a single arm and 3 events token_1  <- \"786334BEB4A87D572DD0E99C4BFCE144\" result_1 <- REDCapR::redcap_event_read(redcap_uri=uri, token=token_1) #> The list of events was retrieved from the REDCap project in 0.2 seconds. The http status code was 200. result_1$data #> # A tibble: 3 × 5 #>   event_name arm_num unique_event_name custom_event_label event_id #>   <chr>        <int> <chr>             <chr>                 <int> #> 1 Intake           1 intake_arm_1      NA                    12357 #> 2 Dischage         1 dischage_arm_1    NA                    12358 #> 3 Follow up        1 follow_up_arm_1   NA                    12359  # Query a longitudinal project with 2 arms and complex arm-event mappings token_2  <- \"0434F0E9CF53ED0587847AB6E51DE762\" result_2 <- REDCapR::redcap_event_read(redcap_uri=uri, token=token_2) #> The list of events was retrieved from the REDCap project in 0.2 seconds. The http status code was 200. result_2$data #> # A tibble: 12 × 5 #>    event_name              arm_num unique_event_name custom_event_label event_id #>    <chr>                     <int> <chr>             <chr>                 <int> #>  1 Enrollment                    1 enrollment_arm_1  NA                     2888 #>  2 Dose 1                        1 dose_1_arm_1      NA                     2889 #>  3 Visit 1                       1 visit_1_arm_1     NA                     2890 #>  4 Dose 2                        1 dose_2_arm_1      NA                     2891 #>  5 Visit 2                       1 visit_2_arm_1     NA                     2892 #>  6 Final visit                   1 final_visit_arm_1 NA                     2895 #>  7 Enrollment                    2 enrollment_arm_2  NA                     2896 #>  8 Deadline to opt out of…       2 deadline_to_opt_… NA                     2897 #>  9 First dose                    2 first_dose_arm_2  NA                     2898 #> 10 First visit                   2 first_visit_arm_2 NA                     2899 #> 11 Final visit                   2 final_visit_arm_2 NA                     2902 #> 12 Deadline to return fee…       2 deadline_to_retu… NA                     2903  # Query a classic project without events token_3  <- \"D70F9ACD1EDD6F151C6EA78683944E98\" result_3 <- REDCapR::redcap_event_read(redcap_uri=uri, token=token_3) #> A 'classic' REDCap project has no events.  Retrieved in 0.1 seconds. The http status code was 400. result_3$data #> # A tibble: 0 × 5 #> # ℹ 5 variables: event_name <chr>, arm_num <int>, unique_event_name <chr>, #> #   custom_event_label <chr>, event_id <int> # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Download a file from a REDCap project record — redcap_file_download_oneshot","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"function uses REDCap's API download file.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"","code":"redcap_file_download_oneshot(   file_name = NULL,   directory = NULL,   overwrite = FALSE,   redcap_uri,   token,   record,   field,   event = \"\",   repeat_instance = NULL,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"file_name name file downloaded file saved. empty original name file used saved default directory.  Optional. directory directory file saved. default current directory. Optional overwrite Boolean value indicating existing files overwritten. Optional redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. record record ID file imported. Required field name field file saved REDCap. Required event name event file saved REDCap. Optional repeat_instance (projects repeating instruments/events) repeat instance number repeating event (longitudinal) repeating instrument (classic longitudinal). Default value '1'. Optional verbose boolean value indicating messages printed R console operation.  Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"Currently, list returned following elements, success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_affected_count: number records inserted updated. affected_ids: subject IDs inserted updated records. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM. file_name: name file persisted disk. useful name stored REDCap used (default).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"files repeating instrument, specify repeating_instrument. server needs field (name) repeating_instance. function redcap_download_file_oneshot() soft-deprecated REDCapR 1.2.0. Please rename redcap_file_download_oneshot().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"Beasley, John J. Aponte","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_download_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download a file from a REDCap project record — redcap_file_download_oneshot","text":"","code":"# \\dontrun{ uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"D70F9ACD1EDD6F151C6EA78683944E98\" # pid=213 record  <- 1 field   <- \"mugshot\" # event <- \"\" # only for longitudinal projects  result_1 <- REDCapR::redcap_file_download_oneshot(   record        = record,   field         = field,   redcap_uri    = uri,   token         = token ) #> Preparing to download the file `mugshot-1.jpg`. #> image/jpeg; name=\"mugshot-1.jpg\" successfully downloaded in 0.2 seconds, and saved as mugshot-1.jpg. base::unlink(\"mugshot-1.jpg\")  (full_name <- base::tempfile(pattern=\"mugshot\", fileext = \".jpg\")) #> [1] \"/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/mugshot12313679b32c.jpg\" result_2   <- REDCapR::redcap_file_download_oneshot(   file_name     = full_name,   record        = record,   field         = field,   redcap_uri    = uri,   token         = token ) #> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/mugshot12313679b32c.jpg`. #> image/jpeg; name=\"mugshot-1.jpg\" successfully downloaded in 0.2 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/mugshot12313679b32c.jpg. base::unlink(full_name)  (relative_name <- \"ssss.jpg\") #> [1] \"ssss.jpg\" result_3 <- REDCapR::redcap_file_download_oneshot(   file_name    = relative_name,   record       = record,   field        = field,   redcap_uri   = uri,   token        = token ) #> Preparing to download the file `ssss.jpg`. #> image/jpeg; name=\"mugshot-1.jpg\" successfully downloaded in 0.3 seconds, and saved as ssss.jpg. base::unlink(relative_name) # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"function uses REDCap's API upload file.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"","code":"redcap_file_upload_oneshot(   file_name,   record,   redcap_uri,   token,   field,   event = \"\",   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"file_name name relative full file uploaded REDCap project.  Required. record record ID file imported.  Required redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. field name field file saved REDCap. Required event name event file saved REDCap. Optional verbose boolean value indicating messages printed R console operation.  Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"Currently, list returned following elements: success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_affected_count: number records inserted updated. affected_ids: subject IDs inserted updated records. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"Currently, function modify variable types conform REDCap's supported variables.  See validate_for_write() helper function checks common important conflicts. function redcap_upload_file_oneshot() soft-deprecated REDCapR 1.2.0. Please rename redcap_file_upload_oneshot().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (ie, https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"Beasley, John J. Aponte","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_file_upload_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Upload a file into to a REDCap project record — redcap_file_upload_oneshot","text":"","code":"# \\dontrun{ # Define some constants uri    <- \"https://bbmc.ouhsc.edu/redcap/api/\" token  <- \"D70F9ACD1EDD6F151C6EA78683944E98\" # The simple project -pid 213 field  <- \"mugshot\" event  <- \"\" # only for longitudinal events  # Upload a single image file. record    <- 1 file_path <- system.file(\"test-data/mugshot-1.jpg\", package = \"REDCapR\")  REDCapR::redcap_file_upload_oneshot(   file_name  = file_path,   record     = record,   field      = field,   redcap_uri = redcap_uri,   token      = token ) #> Error in eval(expr, envir, enclos): object 'redcap_uri' not found  # Upload a collection of five images. records    <- 1:5 file_paths <- system.file(   paste0(\"test-data/mugshot-\", records, \".jpg\"),   package=\"REDCapR\" )  for (i in seq_along(records)) {   record    <- records[i]   file_path <- file_paths[i]   REDCapR::redcap_file_upload_oneshot(     file_name  = file_path,     record     = record,     field      = field,     redcap_uri = redcap_uri,     token      = token   ) } #> Error in eval(expr, envir, enclos): object 'redcap_uri' not found # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":null,"dir":"Reference","previous_headings":"","what":"Download REDCap Instruments — redcap_instrument_download","title":"Download REDCap Instruments — redcap_instrument_download","text":"Download instruments pdf, without responses.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download REDCap Instruments — redcap_instrument_download","text":"","code":"redcap_instrument_download(   file_name = NULL,   directory = NULL,   overwrite = FALSE,   redcap_uri,   token,   record = character(0),   instrument = \"\",   event = \"\",   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download REDCap Instruments — redcap_instrument_download","text":"file_name name file downloaded pdf saved. Optional. directory directory file saved. default current directory. Optional. overwrite Boolean value indicating existing files overwritten. Optional. redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. record record ID instrument(s).  empty, responses blank.  Optional. instrument instrument(s) download.  empty, instruments returned.  Optional. event unique event name. longitudinal project, record blank event blank, return data events record. record blank event blank, return data specified event record. Optional. verbose boolean value indicating messages printed R console operation.  Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download REDCap Instruments — redcap_instrument_download","text":"Currently, list returned following elements, success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. record_id: record_id instrument. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM. file_name: name file persisted disk. useful name stored REDCap used (default).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download REDCap Instruments — redcap_instrument_download","text":"Currently, function modify variable types conform REDCap's supported variables.  See validate_for_write() helper function checks common important conflicts. function redcap_download_instrument() soft-deprecated REDCapR 1.2.0. Please rename redcap_instrument_download().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Download REDCap Instruments — redcap_instrument_download","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Download REDCap Instruments — redcap_instrument_download","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instrument_download.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download REDCap Instruments — redcap_instrument_download","text":"","code":"# \\dontrun{ uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"D70F9ACD1EDD6F151C6EA78683944E98\" # pid=213 # event <- \"\" # only for longitudinal projects  (full_name <- base::temp(pattern=\"instruments-all-records-all\", fileext = \".pdf\")) #> Error in eval(expr, envir, enclos): object 'temp' not found result_1   <- REDCapR::redcap_instrument_download(   file_name     = full_name,   redcap_uri    = uri,   token         = token ) #> Error in eval(expr, envir, enclos): object 'full_name' not found base::unlink(full_name) #> Error in eval(expr, envir, enclos): object 'full_name' not found  (full_name <- base::tempfile(pattern=\"instruments-all-record-1-\", fileext = \".pdf\")) #> [1] \"/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instruments-all-record-1-123119843c0d.pdf\" result_2   <- REDCapR::redcap_instrument_download(   record        = 5,   file_name     = full_name,   redcap_uri    = uri,   token         = token ) #> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instruments-all-record-1-123119843c0d.pdf`. #> text/html; charset=UTF-8 successfully downloaded in 1.0 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instruments-all-record-1-123119843c0d.pdf. base::unlink(full_name) (full_name <- base::tempfile(pattern=\"instrument-1-record-1-\", fileext=\".pdf\")) #> [1] \"/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instrument-1-record-1-123138828691.pdf\" result_3   <- REDCapR::redcap_instrument_download(   record        = 5,   instrument    = \"health\",   file_name     = full_name,   redcap_uri    = uri,   token         = token ) #> Preparing to download the file `/var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instrument-1-record-1-123138828691.pdf`. #> text/html; charset=UTF-8 successfully downloaded in 0.4 seconds, and saved as /var/folders/py/lcjn3y352g1106vf1rqk521r0000gn/T//RtmpqpLKtL/instrument-1-record-1-123138828691.pdf. base::unlink(full_name) # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":null,"dir":"Reference","previous_headings":"","what":"Enumerate the instruments (forms) — redcap_instruments","title":"Enumerate the instruments (forms) — redcap_instruments","text":"Export list data collection instruments project. includes unique instrument name seen second column Data Dictionary, well instrument's corresponding instrument label, seen project's left-hand menu entering data. instruments ordered according order project. (Copied \"Export Instruments (Data Entry Forms)\" method REDCap API documentation, v.10.5.1)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enumerate the instruments (forms) — redcap_instruments","text":"","code":"redcap_instruments(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enumerate the instruments (forms) — redcap_instruments","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enumerate the instruments (forms) — redcap_instruments","text":"Currently, list returned following elements, data: tibble::tibble() row represents one column REDCap dataset. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Enumerate the instruments (forms) — redcap_instruments","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Enumerate the instruments (forms) — redcap_instruments","text":"Victor Castro, Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_instruments.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enumerate the instruments (forms) — redcap_instruments","text":"","code":"# \\dontrun{ uri           <- \"https://bbmc.ouhsc.edu/redcap/api/\" token         <- \"9A81268476645C4E5F03428B8AC3AA7B\" ds_instrument <- REDCapR::redcap_instruments(redcap_uri=uri, token=token)$data #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the logging of a project. — redcap_log_read","title":"Get the logging of a project. — redcap_log_read","text":"function reads available logging messages REDCap tibble::tibble().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the logging of a project. — redcap_log_read","text":"","code":"redcap_log_read(   redcap_uri,   token,   log_begin_date = Sys.Date() - 7L,   log_end_date = Sys.Date(),   record = NULL,   user = NULL,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the logging of a project. — redcap_log_read","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. log_begin_date Return events occurring midnight date. Defaults past week; default mimics behavior browser also reduces strain server. log_end_date Return events occurring 24:00 date. Defaults today. record Return events belonging specific record (referring existing record name). Defaults NULL returns logging activity related records. record value passed, must single value. user Return events belonging specific user (referring existing username). Defaults NULL returns logging activity related users. user value passed, must single value. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the logging of a project. — redcap_log_read","text":"Currently, list returned following elements: data: R tibble::tibble() data access groups project. success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Get the logging of a project. — redcap_log_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get the logging of a project. — redcap_log_read","text":"Jonathan M. Mang, Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_log_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the logging of a project. — redcap_log_read","text":"","code":"# \\dontrun{ uri          <- \"https://bbmc.ouhsc.edu/redcap/api/\" token        <- \"9A81268476645C4E5F03428B8AC3AA7B\"  ds_last_week <- REDCapR::redcap_log_read(redcap_uri=uri, token=token)$data #> 18,285 rows were read from REDCap in 0.8 seconds.  The http status code was 200. head(ds_last_week) #> # A tibble: 6 × 5 #>   timestamp           username        action            details           record #>   <dttm>              <chr>           <chr>             <chr>             <chr>  #> 1 2024-09-07 00:08:00 unittestphifree Manage/Design     Export instrumen… NA     #> 2 2024-09-07 00:08:00 unittestphifree Data export (API) export_format: C… NA     #> 3 2024-09-07 00:08:00 unittestphifree Data export (API) export_format: C… NA     #> 4 2024-09-07 00:08:00 unittestphifree Data export (API) export_format: C… NA     #> 5 2024-09-07 00:07:00 unittestphifree Data export (API) export_format: C… NA     #> 6 2024-09-07 00:07:00 unittestphifree Manage/Design     Export DAGs (API) NA      ds_one_day <-   REDCapR::redcap_log_read(     redcap_uri     = uri,     token          = token,     log_begin_date = as.Date(\"2020-08-10\"),     log_end_date   = as.Date(\"2020-08-10\")   )$data #> 96 rows were read from REDCap in 0.2 seconds.  The http status code was 200. head(ds_one_day) #> # A tibble: 6 × 5 #>   timestamp           username        action            details           record #>   <dttm>              <chr>           <chr>             <chr>             <chr>  #> 1 2020-08-10 19:25:00 unittestphifree Data export (API) export_format: C… NA     #> 2 2020-08-10 19:25:00 unittestphifree Data export (API) export_format: C… NA     #> 3 2020-08-10 19:25:00 unittestphifree Data export (API) export_format: C… NA     #> 4 2020-08-10 19:25:00 unittestphifree Data export (API) export_format: C… NA     #> 5 2020-08-10 19:25:00 unittestphifree Data export (API) export_format: C… NA     #> 6 2020-08-10 19:25:00 unittestphifree Manage/Design     Download data di… NA      ds_one_day_single_record_single_user <-   REDCapR::redcap_log_read(     redcap_uri     = uri,     token          = token,     log_begin_date = as.Date(\"2021-07-11\"),     log_end_date   = as.Date(\"2021-07-11\"),     record         = as.character(3),     user           = \"unittestphifree\"   )$data #> 12 rows were read from REDCap in 0.2 seconds.  The http status code was 200. head(ds_one_day_single_record_single_user) #> # A tibble: 6 × 5 #>   timestamp           username        action        details             record #>   <dttm>              <chr>           <chr>         <chr>               <chr>  #> 1 2021-07-11 23:08:00 unittestphifree Manage/Design Download file (API) NA     #> 2 2021-07-11 23:08:00 unittestphifree Manage/Design Download file (API) NA     #> 3 2021-07-11 23:04:00 unittestphifree Manage/Design Download file (API) NA     #> 4 2021-07-11 23:04:00 unittestphifree Manage/Design Download file (API) NA     #> 5 2021-07-11 22:56:00 unittestphifree Manage/Design Download file (API) NA     #> 6 2021-07-11 22:56:00 unittestphifree Manage/Design Download file (API) NA     # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":null,"dir":"Reference","previous_headings":"","what":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"function inspects REDCap project determine readr::cols() object compatible project's current definition.  can copied pasted R code future calls server produce tibble::tibble() equivalent set data types.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"","code":"redcap_metadata_coltypes(   redcap_uri,   token,   print_col_types_to_console = TRUE,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = FALSE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. print_col_types_to_console readr::cols() object printed console? http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"readr::cols() object returned, can passed redcap_read() redcap_read_oneshot(). Additionally objected printed console, see Details .","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"redcap_metadata_coltypes() returns readr::cols() object two ways. First, literal object returned can passed redcap_read() redcap_read_oneshot(). Second, function acts code generator. prints text console can copied pasted R file.  useful () document fields data types expected, (b) adjust fields data types defaults can customized needs. instance, may choose exclude variables tweak data type (e.g., changing patient's height integer double). printing console, data type decision accompanied explanation far right.  See output examples .  Please file issue think something restrictive can improved. overall heuristic assign data type waterfall decisions: field built REDCap? includes autonumber record_id, redcap_event_name, redcap_repeat_instrument, redcap_repeat_instance, instrument's completion status. field's type?  example, sliders integer, check marks logical(https://stat.ethz.ch/R-manual/R-devel/library/base/html/logical.html. field type \"text\", validation type? instance, postal code character (even though looks like number), \"mdy\" cast date, \"number_2dp\" cast floating point field type validation type recognized, field cast character. happen REDCap develops & releases new type. see something like, \"# validation associated col_type. Tell us new REDCapR issue\", please make sure REDCapR running newest GitHub release file new issue still recognized. details current implementation, decision logic starts half-way function's source code *Validation Guarantee Conformity coming REDCap database world, unexpected. validation type guarantee retrieved values conform complementary data type. validation setting affects values entered validation set. example, values like \"abcd\" entered field months, project manager selected \"integer\" validation option, \"abcd\" values remain untouched. one reason redcap_metadata_coltypes() prints suggestions console. allows developer adjust specifications match values returned API.  \"abcd\" scenario, consider () changing type col_integer col_character, (b) excluding trash values, (c) dplyr::mutate() statement, use readr::parse_integer() cast desired type.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"Beasley, Philip Chase","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_coltypes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Suggests a col_type for each field in a REDCap project — redcap_metadata_coltypes","text":"","code":"# \\dontrun{ uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\"  # A simple project token      <- \"9A81268476645C4E5F03428B8AC3AA7B\" # 153 col_types  <- redcap_metadata_coltypes(uri, token) #> # col_types <- readr::cols_only( # Use `readr::cols_only()` to restrict the retrieval to only these columns #> col_types <- readr::cols( # Use `readr::cols()` to include unspecified columns #>   # [field]                       [readr col_type]            [explanation for col_type] #>   record_id                     = readr::col_character()  , # DAGs are enabled for the project #>   name_first                    = readr::col_character()  , # field_type is text and validation isn't set #>   name_last                     = readr::col_character()  , # field_type is text and validation isn't set #>   address                       = readr::col_character()  , # field_type is note #>   telephone                     = readr::col_character()  , # validation is 'phone' #>   email                         = readr::col_character()  , # validation is 'email' #>   dob                           = readr::col_date()       , # validation is 'date_ymd' #>   age                           = readr::col_character()  , # field_type is text and validation isn't set #>   sex                           = readr::col_character()  , # field_type is radio #>   demographics_complete         = readr::col_integer()    , # completion status of form/instrument #>   height                        = readr::col_double()     , # validation is 'number' #>   weight                        = readr::col_integer()    , # validation is 'integer' #>   bmi                           = readr::col_character()  , # field_type is calc #>   comments                      = readr::col_character()  , # field_type is note #>   mugshot                       = readr::col_character()  , # field_type is file #>   health_complete               = readr::col_integer()    , # completion status of form/instrument #>   race___1                      = readr::col_logical()    , # field_type is checkbox #>   race___2                      = readr::col_logical()    , # field_type is checkbox #>   race___3                      = readr::col_logical()    , # field_type is checkbox #>   race___4                      = readr::col_logical()    , # field_type is checkbox #>   race___5                      = readr::col_logical()    , # field_type is checkbox #>   race___6                      = readr::col_logical()    , # field_type is checkbox #>   ethnicity                     = readr::col_character()  , # field_type is radio #>   interpreter_needed            = readr::col_logical()    , # field_type is truefalse #>   race_and_ethnicity_complete   = readr::col_integer()    , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data #> 5 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> # A tibble: 5 × 25 #>   record_id name_first name_last address  telephone email dob        age   sex   #>   <chr>     <chr>      <chr>     <chr>    <chr>     <chr> <date>     <chr> <chr> #> 1 1         Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30 11    0     #> 2 2         Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10 11    1     #> 3 3         Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09 80    1     #> 4 4         Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02 61    0     #> 5 5         John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15 59    1     #> # ℹ 16 more variables: demographics_complete <int>, height <dbl>, weight <int>, #> #   bmi <chr>, comments <chr>, mugshot <chr>, health_complete <int>, #> #   race___1 <lgl>, race___2 <lgl>, race___3 <lgl>, race___4 <lgl>, #> #   race___5 <lgl>, race___6 <lgl>, ethnicity <chr>, interpreter_needed <lgl>, #> #   race_and_ethnicity_complete <int>  # A longitudinal project token      <- \"0434F0E9CF53ED0587847AB6E51DE762\" # 212 col_types  <- redcap_metadata_coltypes(uri, token) #> # col_types <- readr::cols_only( # Use `readr::cols_only()` to restrict the retrieval to only these columns #> col_types <- readr::cols( # Use `readr::cols()` to include unspecified columns #>   # [field]                                     [readr col_type]            [explanation for col_type] #>   study_id                                    = readr::col_character()  , # field_type is text and validation isn't set #>   redcap_event_name                           = readr::col_character()  , # longitudinal event_name #>   date_enrolled                               = readr::col_date()       , # validation is 'date_ymd' #>   patient_document                            = readr::col_character()  , # field_type is file #>   first_name                                  = readr::col_character()  , # field_type is text and validation isn't set #>   last_name                                   = readr::col_character()  , # field_type is text and validation isn't set #>   telephone_1                                 = readr::col_character()  , # validation is 'phone' #>   email                                       = readr::col_character()  , # validation is 'email' #>   dob                                         = readr::col_date()       , # validation is 'date_ymd' #>   age                                         = readr::col_character()  , # field_type is calc #>   ethnicity                                   = readr::col_character()  , # field_type is radio #>   race                                        = readr::col_character()  , # field_type is dropdown #>   sex                                         = readr::col_character()  , # field_type is radio #>   given_birth                                 = readr::col_logical()    , # field_type is yesno #>   num_children                                = readr::col_integer()    , # validation is 'integer' #>   gym___0                                     = readr::col_logical()    , # field_type is checkbox #>   gym___1                                     = readr::col_logical()    , # field_type is checkbox #>   gym___2                                     = readr::col_logical()    , # field_type is checkbox #>   gym___3                                     = readr::col_logical()    , # field_type is checkbox #>   gym___4                                     = readr::col_logical()    , # field_type is checkbox #>   aerobics___0                                = readr::col_logical()    , # field_type is checkbox #>   aerobics___1                                = readr::col_logical()    , # field_type is checkbox #>   aerobics___2                                = readr::col_logical()    , # field_type is checkbox #>   aerobics___3                                = readr::col_logical()    , # field_type is checkbox #>   aerobics___4                                = readr::col_logical()    , # field_type is checkbox #>   eat___0                                     = readr::col_logical()    , # field_type is checkbox #>   eat___1                                     = readr::col_logical()    , # field_type is checkbox #>   eat___2                                     = readr::col_logical()    , # field_type is checkbox #>   eat___3                                     = readr::col_logical()    , # field_type is checkbox #>   eat___4                                     = readr::col_logical()    , # field_type is checkbox #>   drink___0                                   = readr::col_logical()    , # field_type is checkbox #>   drink___1                                   = readr::col_logical()    , # field_type is checkbox #>   drink___2                                   = readr::col_logical()    , # field_type is checkbox #>   drink___3                                   = readr::col_logical()    , # field_type is checkbox #>   drink___4                                   = readr::col_logical()    , # field_type is checkbox #>   specify_mood                                = readr::col_integer()    , # field_type is slider #>   meds___1                                    = readr::col_logical()    , # field_type is checkbox #>   meds___2                                    = readr::col_logical()    , # field_type is checkbox #>   meds___3                                    = readr::col_logical()    , # field_type is checkbox #>   meds___4                                    = readr::col_logical()    , # field_type is checkbox #>   meds___5                                    = readr::col_logical()    , # field_type is checkbox #>   height                                      = readr::col_double()     , # validation is 'number' #>   weight                                      = readr::col_integer()    , # validation is 'integer' #>   bmi                                         = readr::col_character()  , # field_type is calc #>   comments                                    = readr::col_character()  , # field_type is note #>   demographics_complete                       = readr::col_integer()    , # completion status of form/instrument #>   ec_phone                                    = readr::col_character()  , # validation is 'phone' #>   ec_confirmed                                = readr::col_character()  , # field_type is radio #>   next_of_kin_contact_name                    = readr::col_character()  , # field_type is text and validation isn't set #>   next_of_kin_contact_address                 = readr::col_character()  , # field_type is note #>   next_of_kin_contact_phone                   = readr::col_character()  , # validation is 'phone' #>   next_of_kin_confirmed                       = readr::col_character()  , # field_type is radio #>   contact_info_complete                       = readr::col_integer()    , # completion status of form/instrument #>   height2                                     = readr::col_double()     , # validation is 'number' #>   weight2                                     = readr::col_integer()    , # validation is 'integer' #>   bmi2                                        = readr::col_character()  , # field_type is calc #>   prealb_b                                    = readr::col_double()     , # validation is 'number' #>   creat_b                                     = readr::col_double()     , # validation is 'number' #>   npcr_b                                      = readr::col_double()     , # validation is 'number' #>   chol_b                                      = readr::col_double()     , # validation is 'number' #>   transferrin_b                               = readr::col_double()     , # validation is 'number' #>   baseline_data_complete                      = readr::col_integer()    , # completion status of form/instrument #>   vld1                                        = readr::col_double()     , # validation is 'number' #>   vld2                                        = readr::col_double()     , # validation is 'number' #>   vld3                                        = readr::col_double()     , # validation is 'number' #>   vld4                                        = readr::col_double()     , # validation is 'number' #>   vld5                                        = readr::col_double()     , # validation is 'number' #>   visit_lab_data_complete                     = readr::col_integer()    , # completion status of form/instrument #>   pmq1                                        = readr::col_character()  , # field_type is dropdown #>   pmq2                                        = readr::col_character()  , # field_type is dropdown #>   pmq3                                        = readr::col_character()  , # field_type is radio #>   pmq4                                        = readr::col_character()  , # field_type is dropdown #>   patient_morale_questionnaire_complete       = readr::col_integer()    , # completion status of form/instrument #>   vbw1                                        = readr::col_double()     , # validation is 'number' #>   vbw2                                        = readr::col_double()     , # validation is 'number' #>   vbw3                                        = readr::col_double()     , # validation is 'number' #>   vbw4                                        = readr::col_double()     , # validation is 'number' #>   vbw5                                        = readr::col_double()     , # validation is 'number' #>   vbw6                                        = readr::col_character()  , # field_type is radio #>   vbw7                                        = readr::col_character()  , # field_type is radio #>   vbw8                                        = readr::col_character()  , # field_type is dropdown #>   vbw9                                        = readr::col_character()  , # field_type is dropdown #>   visit_blood_workup_complete                 = readr::col_integer()    , # completion status of form/instrument #>   vob1                                        = readr::col_character()  , # field_type is radio #>   vob2                                        = readr::col_character()  , # field_type is radio #>   vob3                                        = readr::col_character()  , # field_type is radio #>   vob4                                        = readr::col_character()  , # field_type is radio #>   vob5                                        = readr::col_character()  , # field_type is radio #>   vob6                                        = readr::col_character()  , # field_type is radio #>   vob7                                        = readr::col_character()  , # field_type is note #>   vob8                                        = readr::col_character()  , # field_type is radio #>   vob9                                        = readr::col_character()  , # field_type is radio #>   vob10                                       = readr::col_character()  , # field_type is radio #>   vob11                                       = readr::col_character()  , # field_type is radio #>   vob12                                       = readr::col_character()  , # field_type is radio #>   vob13                                       = readr::col_character()  , # field_type is radio #>   vob14                                       = readr::col_character()  , # field_type is note #>   visit_observed_behavior_complete            = readr::col_integer()    , # completion status of form/instrument #>   study_comments                              = readr::col_character()  , # field_type is note #>   complete_study                              = readr::col_character()  , # field_type is dropdown #>   withdraw_date                               = readr::col_date()       , # validation is 'date_ymd' #>   date_visit_4                                = readr::col_date()       , # validation is 'date_ymd' #>   alb_4                                       = readr::col_double()     , # validation is 'number' #>   prealb_4                                    = readr::col_double()     , # validation is 'number' #>   creat_4                                     = readr::col_date()       , # validation is 'date_ymd' #>   discharge_date_4                            = readr::col_date()       , # validation is 'date_ymd' #>   discharge_summary_4                         = readr::col_character()  , # field_type is dropdown #>   npcr_4                                      = readr::col_integer()    , # validation is 'integer' #>   chol_4                                      = readr::col_integer()    , # validation is 'integer' #>   withdraw_reason                             = readr::col_character()  , # field_type is dropdown #>   completion_data_complete                    = readr::col_integer()    , # completion status of form/instrument #>   cpq1                                        = readr::col_date()       , # validation is 'date_ymd' #>   cpq2                                        = readr::col_integer()    , # validation is 'integer' #>   cpq3                                        = readr::col_integer()    , # validation is 'integer' #>   cpq4                                        = readr::col_integer()    , # validation is 'integer' #>   cpq5                                        = readr::col_integer()    , # validation is 'integer' #>   cpq6                                        = readr::col_character()  , # field_type is dropdown #>   cpq7                                        = readr::col_character()  , # field_type is dropdown #>   cpq8                                        = readr::col_character()  , # field_type is dropdown #>   cpq9                                        = readr::col_date()       , # validation is 'date_ymd' #>   cpq10                                       = readr::col_character()  , # field_type is dropdown #>   cpq11                                       = readr::col_character()  , # field_type is dropdown #>   cpq12                                       = readr::col_character()  , # field_type is radio #>   cpq13                                       = readr::col_character()  , # field_type is dropdown #>   completion_project_questionnaire_complete   = readr::col_integer()    , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data #> 18 records and 125 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> # A tibble: 18 × 125 #>    study_id redcap_event_name        date_enrolled patient_document   first_name #>    <chr>    <chr>                    <date>        <chr>              <chr>      #>  1 100      enrollment_arm_1         2015-04-02    NA                 Zharko     #>  2 100      dose_1_arm_1             NA            NA                 NA         #>  3 100      visit_1_arm_1            NA            NA                 NA         #>  4 100      dose_2_arm_1             NA            NA                 NA         #>  5 100      visit_2_arm_1            NA            NA                 NA         #>  6 100      final_visit_arm_1        NA            NA                 NA         #>  7 220      enrollment_arm_1         2015-04-02    NA                 Milivoj    #>  8 220      dose_1_arm_1             NA            NA                 NA         #>  9 220      visit_1_arm_1            NA            NA                 NA         #> 10 220      dose_2_arm_1             NA            NA                 NA         #> 11 220      visit_2_arm_1            NA            NA                 NA         #> 12 220      final_visit_arm_1        NA            NA                 NA         #> 13 304      enrollment_arm_2         2015-04-02    levon_and_barry.j… Melech     #> 14 304      deadline_to_opt_ou_arm_2 NA            NA                 NA         #> 15 304      first_dose_arm_2         NA            NA                 NA         #> 16 304      first_visit_arm_2        NA            NA                 NA         #> 17 304      final_visit_arm_2        NA            NA                 NA         #> 18 304      deadline_to_return_arm_2 NA            NA                 NA         #> # ℹ 120 more variables: last_name <chr>, telephone_1 <chr>, email <chr>, #> #   dob <date>, age <chr>, ethnicity <chr>, race <chr>, sex <chr>, #> #   given_birth <lgl>, num_children <int>, gym___0 <lgl>, gym___1 <lgl>, #> #   gym___2 <lgl>, gym___3 <lgl>, gym___4 <lgl>, aerobics___0 <lgl>, #> #   aerobics___1 <lgl>, aerobics___2 <lgl>, aerobics___3 <lgl>, #> #   aerobics___4 <lgl>, eat___0 <lgl>, eat___1 <lgl>, eat___2 <lgl>, #> #   eat___3 <lgl>, eat___4 <lgl>, drink___0 <lgl>, drink___1 <lgl>, …  # A repeating instruments project token      <- \"56F43A10D01D6578A46393394D76D88F\" # 2603 col_types  <- redcap_metadata_coltypes(uri, token) #> # col_types <- readr::cols_only( # Use `readr::cols_only()` to restrict the retrieval to only these columns #> col_types <- readr::cols( # Use `readr::cols()` to include unspecified columns #>   # [field]                     [readr col_type]            [explanation for col_type] #>   record_id                   = readr::col_integer()    , # record_autonumbering is enabled and DAGs are disabled for the project #>   redcap_repeat_instrument    = readr::col_character()  , # repeat_instrument #>   redcap_repeat_instance      = readr::col_integer()    , # repeat_instance #>   date_enrolled               = readr::col_date()       , # validation is 'date_ymd' #>   first_name                  = readr::col_character()  , # field_type is text and validation isn't set #>   dob                         = readr::col_date()       , # validation is 'date_ymd' #>   age                         = readr::col_character()  , # field_type is calc #>   ethnicity                   = readr::col_character()  , # field_type is radio #>   race                        = readr::col_character()  , # field_type is dropdown #>   sex                         = readr::col_character()  , # field_type is radio #>   demographics_complete       = readr::col_integer()    , # completion status of form/instrument #>   date_bp                     = readr::col_date()       , # validation is 'date_ymd' #>   bp_systolic                 = readr::col_integer()    , # validation is 'integer' #>   bp_diastolic                = readr::col_integer()    , # validation is 'integer' #>   bp_complete                 = readr::col_integer()    , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data #> 9 records and 15 columns were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 9 × 15 #>   record_id redcap_repeat_instrument redcap_repeat_instance date_enrolled #>       <int> <chr>                                     <int> <date>        #> 1         1 NA                                           NA 2019-10-14    #> 2         1 bp                                            1 NA            #> 3         1 bp                                            2 NA            #> 4         1 bp                                            3 NA            #> 5         2 NA                                           NA 2019-02-02    #> 6         2 bp                                            1 NA            #> 7         3 NA                                           NA 2021-11-04    #> 8         4 NA                                           NA 2021-11-04    #> 9         5 NA                                           NA NA            #> # ℹ 11 more variables: first_name <chr>, dob <date>, age <chr>, #> #   ethnicity <chr>, race <chr>, sex <chr>, demographics_complete <int>, #> #   date_bp <date>, bp_systolic <int>, bp_diastolic <int>, bp_complete <int>  # A project with every field type and validation type. #   Notice it throws a warning that some fields use a comma for a decimal, #   while other fields use a period/dot as a decimal token      <- \"8F5313CAA266789F560D79EFCEE2E2F1\" # 2634 - Validation Types col_types  <- redcap_metadata_coltypes(uri, token) #> Warning: The metadata for the REDCap project has validation types for at least one field that specifies a comma for a decimal for at least one field that specifies a period for a decimal.  Mixing these two formats in the same project can cause confusion and problems.  Consider passing `readr::col_character()` for this field (to REDCapR's `col_types` parameter) and then convert the desired fields to R's numeric type.  The function `readr::parse_double()` is useful for this. #> # col_types <- readr::cols_only( # Use `readr::cols_only()` to restrict the retrieval to only these columns #> col_types <- readr::cols( # Use `readr::cols()` to include unspecified columns #>   # [field]                       [readr col_type]                              [explanation for col_type] #>   record_id                     = readr::col_integer()                      , # record_autonumbering is enabled and DAGs are disabled for the project #>   f_calculated                  = readr::col_character()                    , # field_type is calc #>   f_checkbox___0                = readr::col_logical()                      , # field_type is checkbox #>   f_checkbox___1                = readr::col_logical()                      , # field_type is checkbox #>   f_checkbox___2                = readr::col_logical()                      , # field_type is checkbox #>   f_dropdown                    = readr::col_character()                    , # field_type is dropdown #>   f_file_upload                 = readr::col_character()                    , # field_type is file #>   f_notes                       = readr::col_character()                    , # field_type is note #>   f_radio                       = readr::col_character()                    , # field_type is radio #>   f_signature                   = readr::col_character()                    , # field_type is file #>   f_slider                      = readr::col_integer()                      , # field_type is slider #>   f_sql                         = readr::col_character()                    , # field_type is sql #>   f_text                        = readr::col_character()                    , # field_type is text and validation isn't set #>   f_true_false                  = readr::col_logical()                      , # field_type is truefalse #>   f_yes_no                      = readr::col_logical()                      , # field_type is yesno #>   v_alpha_only                  = readr::col_character()                    , # validation is 'alpha_only' #>   v_date_dmy                    = readr::col_date()                         , # validation is 'date_dmy' #>   v_date_mdy                    = readr::col_date()                         , # validation is 'date_mdy' #>   v_date_ymd                    = readr::col_date()                         , # validation is 'date_ymd' #>   v_datetime_dmy                = readr::col_datetime(\"%Y-%m-%d %H:%M\")     , # validation is 'datetime_dmy' #>   v_datetime_mdy                = readr::col_datetime(\"%Y-%m-%d %H:%M\")     , # validation is 'datetime_mdy' #>   v_datetime_seconds_dmy        = readr::col_datetime(\"%Y-%m-%d %H:%M:%S\")  , # validation is 'datetime_seconds_dmy' #>   v_datetime_seconds_mdy        = readr::col_datetime(\"%Y-%m-%d %H:%M:%S\")  , # validation is 'datetime_seconds_mdy' #>   v_datetime_seconds_ymd        = readr::col_datetime(\"%Y-%m-%d %H:%M:%S\")  , # validation is 'datetime_seconds_ymd' #>   v_datetime_ymd                = readr::col_datetime(\"%Y-%m-%d %H:%M\")     , # validation is 'datetime_ymd' #>   v_email                       = readr::col_character()                    , # validation is 'email' #>   v_integer                     = readr::col_integer()                      , # validation is 'integer' #>   v_mrn_10d                     = readr::col_character()                    , # validation is 'mrn_10d' #>   v_mrn_generic                 = readr::col_character()                    , # validation is 'mrn_generic' #>   v_number                      = readr::col_double()                       , # validation is 'number' #>   v_number_1dp                  = readr::col_double()                       , # validation is 'number_1dp' #>   v_number_2dp                  = readr::col_double()                       , # validation is 'number_2dp' #>   v_number_3dp                  = readr::col_double()                       , # validation is 'number_3dp' #>   v_number_4dp                  = readr::col_double()                       , # validation is 'number_4dp' #>   v_number_comma_decimal        = readr::col_character()                    , # locale's decimal mark isn't a comma, yet validation is 'number_comma_decimal' #>   v_number_1dp_comma_decimal    = readr::col_character()                    , # locale's decimal mark isn't a comma, yet validation is 'number_1dp_comma_decimal' #>   v_number_2dp_comma_decimal    = readr::col_character()                    , # locale's decimal mark isn't a comma, yet validation is 'number_2dp_comma_decimal' #>   v_number_3dp_comma_decimal    = readr::col_character()                    , # locale's decimal mark isn't a comma, yet validation is 'number_3dp_comma_decimal' #>   v_number_4dp_comma_decimal    = readr::col_character()                    , # locale's decimal mark isn't a comma, yet validation is 'number_4dp_comma_decimal' #>   v_phone                       = readr::col_character()                    , # validation is 'phone' #>   v_phone_australia             = readr::col_character()                    , # validation is 'phone_australia' #>   v_postalcode_australia        = readr::col_character()                    , # validation is 'postalcode_australia' #>   v_postalcode_canada           = readr::col_character()                    , # validation is 'postalcode_canada' #>   v_postalcode_french           = readr::col_character()                    , # validation is 'postalcode_french' #>   v_postalcode_germany          = readr::col_character()                    , # validation is 'postalcode_germany' #>   v_ssn                         = readr::col_character()                    , # validation is 'ssn' #>   v_time_hh_mm                  = readr::col_time(\"%H:%M\")                  , # validation is 'time' #>   v_time_hh_mm_ss               = readr::col_time(\"%H:%M:%S\")               , # validation is 'time_hh_mm_ss' #>   v_time_mm_ss                  = readr::col_time(\"%M:%S\")                  , # validation is 'time_mm_ss' #>   v_vmrn                        = readr::col_character()                    , # validation is 'vmrn' #>   v_zipcode                     = readr::col_character()                    , # validation is 'zipcode' #>   form_1_complete               = readr::col_integer()                      , # completion status of form/instrument #> ) redcap_read_oneshot(uri, token, col_types = col_types)$data #> 1 records and 52 columns were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 1 × 52 #>   record_id f_calculated f_checkbox___0 f_checkbox___1 f_checkbox___2 f_dropdown #>       <int> <chr>        <lgl>          <lgl>          <lgl>          <chr>      #> 1         1 NA           FALSE          FALSE          FALSE          NA         #> # ℹ 46 more variables: f_file_upload <chr>, f_notes <chr>, f_radio <chr>, #> #   f_signature <chr>, f_slider <int>, f_sql <chr>, f_text <chr>, #> #   f_true_false <lgl>, f_yes_no <lgl>, v_alpha_only <chr>, v_date_dmy <date>, #> #   v_date_mdy <date>, v_date_ymd <date>, v_datetime_dmy <dttm>, #> #   v_datetime_mdy <dttm>, v_datetime_seconds_dmy <dttm>, #> #   v_datetime_seconds_mdy <dttm>, v_datetime_seconds_ymd <dttm>, #> #   v_datetime_ymd <dttm>, v_email <chr>, v_integer <int>, v_mrn_10d <chr>, … # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Export the metadata of a REDCap project — redcap_metadata_read","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"Export metadata (data dictionary) REDCap project tibble::tibble(). row data dictionary corresponds one field project's dataset.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"","code":"redcap_metadata_read(   redcap_uri,   token,   forms = NULL,   fields = NULL,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. forms array, element corresponds REDCap form desired fields.  Optional. fields array, element corresponds desired project field.  Optional. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"Currently, list returned following elements: data: R tibble::tibble() desired fields (rows). success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. forms_collapsed: desired records IDs, collapsed single string, separated commas. fields_collapsed: desired field names, collapsed single string, separated commas. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export the metadata of a REDCap project — redcap_metadata_read","text":"","code":"# \\dontrun{ uri   <- \"https://bbmc.ouhsc.edu/redcap/api/\"  # A simple project (pid 153) token <- \"9A81268476645C4E5F03428B8AC3AA7B\" REDCapR::redcap_metadata_read(redcap_uri=uri, token=token) #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> $data #> # A tibble: 17 × 18 #>    field_name         form_name          section_header   field_type field_label #>    <chr>              <chr>              <chr>            <chr>      <chr>       #>  1 record_id          demographics       NA               text       Study ID    #>  2 name_first         demographics       Contact Informa… text       First Name  #>  3 name_last          demographics       NA               text       Last Name   #>  4 address            demographics       NA               notes      Street, Ci… #>  5 telephone          demographics       NA               text       Phone numb… #>  6 email              demographics       NA               text       E-mail      #>  7 dob                demographics       NA               text       Date of bi… #>  8 age                demographics       NA               text       Age (years) #>  9 sex                demographics       NA               radio      Gender      #> 10 height             health             NA               text       Height (cm) #> 11 weight             health             NA               text       Weight (ki… #> 12 bmi                health             NA               calc       BMI         #> 13 comments           health             General Comments notes      Comments    #> 14 mugshot            health             NA               file       Mugshot     #> 15 race               race_and_ethnicity NA               checkbox   Race (Sele… #> 16 ethnicity          race_and_ethnicity NA               radio      Ethnicity   #> 17 interpreter_needed race_and_ethnicity NA               truefalse  Are interp… #> # ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <chr>, #> #   text_validation_type_or_show_slider_number <chr>, #> #   text_validation_min <chr>, text_validation_max <chr>, identifier <chr>, #> #   branching_logic <chr>, required_field <chr>, custom_alignment <chr>, #> #   question_number <chr>, matrix_group_name <chr>, matrix_ranking <chr>, #> #   field_annotation <chr> #>  #> $success #> [1] TRUE #>  #> $status_code #> [1] 200 #>  #> $outcome_message #> [1] \"The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200.\" #>  #> $forms_collapsed #> [1] \"\" #>  #> $fields_collapsed #> [1] \"\" #>  #> $elapsed_seconds #> [1] 0.1515701 #>  #> $raw_text #> [1] \"\" #>   # A longitudinal project (pid 212) token <- \"0434F0E9CF53ED0587847AB6E51DE762\" REDCapR::redcap_metadata_read(redcap_uri=uri, token=token) #> The data dictionary describing 95 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> $data #> # A tibble: 95 × 18 #>    field_name       form_name    section_header      field_type field_label      #>    <chr>            <chr>        <chr>               <chr>      <chr>            #>  1 study_id         demographics NA                  text       Study ID         #>  2 date_enrolled    demographics Consent Information text       Date subject si… #>  3 patient_document demographics NA                  file       Upload the pati… #>  4 first_name       demographics Contact Information text       First Name       #>  5 last_name        demographics NA                  text       Last Name        #>  6 telephone_1      demographics NA                  text       Phone number     #>  7 email            demographics NA                  text       E-mail           #>  8 dob              demographics NA                  text       Date of birth    #>  9 age              demographics NA                  calc       Age (years)      #> 10 ethnicity        demographics NA                  radio      Ethnicity        #> # ℹ 85 more rows #> # ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <chr>, #> #   text_validation_type_or_show_slider_number <chr>, #> #   text_validation_min <chr>, text_validation_max <chr>, identifier <chr>, #> #   branching_logic <chr>, required_field <chr>, custom_alignment <chr>, #> #   question_number <chr>, matrix_group_name <chr>, matrix_ranking <chr>, #> #   field_annotation <chr> #>  #> $success #> [1] TRUE #>  #> $status_code #> [1] 200 #>  #> $outcome_message #> [1] \"The data dictionary describing 95 fields was read from REDCap in 0.2 seconds.  The http status code was 200.\" #>  #> $forms_collapsed #> [1] \"\" #>  #> $fields_collapsed #> [1] \"\" #>  #> $elapsed_seconds #> [1] 0.1680381 #>  #> $raw_text #> [1] \"\" #>   # A repeating measures (pid 3181) token <- \"22C3FF1C8B08899FB6F86D91D874A159\" REDCapR::redcap_metadata_read(redcap_uri=uri, token=token) #> The data dictionary describing 9 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> $data #> # A tibble: 9 × 18 #>   field_name    form_name      section_header field_type field_label             #>   <chr>         <chr>          <chr>          <chr>      <chr>                   #> 1 record_id     intake         NA             text       Record ID               #> 2 height        intake         NA             text       patient height          #> 3 weight        intake         NA             text       patient weight          #> 4 bmi           intake         NA             text       patient bmi             #> 5 sbp           blood_pressure NA             text       systolic blood pressure #> 6 dbp           blood_pressure NA             text       diastolic blood pressu… #> 7 lab           laboratory     NA             text       lab value               #> 8 conc          laboratory     NA             text       concentration           #> 9 image_profile image          NA             file       Picture of Patient      #> # ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <chr>, #> #   text_validation_type_or_show_slider_number <chr>, #> #   text_validation_min <chr>, text_validation_max <chr>, identifier <chr>, #> #   branching_logic <chr>, required_field <chr>, custom_alignment <chr>, #> #   question_number <chr>, matrix_group_name <chr>, matrix_ranking <chr>, #> #   field_annotation <chr> #>  #> $success #> [1] TRUE #>  #> $status_code #> [1] 200 #>  #> $outcome_message #> [1] \"The data dictionary describing 9 fields was read from REDCap in 0.2 seconds.  The http status code was 200.\" #>  #> $forms_collapsed #> [1] \"\" #>  #> $fields_collapsed #> [1] \"\" #>  #> $elapsed_seconds #> [1] 0.1846499 #>  #> $raw_text #> [1] \"\" #>  # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":null,"dir":"Reference","previous_headings":"","what":"Import metadata of a REDCap project — redcap_metadata_write","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"Import metadata (.e., data dictionary) project. method's destructive nature, works projects Development status.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"","code":"redcap_metadata_write(   ds,   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"ds base::data.frame() tibble::tibble() imported REDCap project. Required. redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"Currently, list returned following elements: success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. field_count: Number fields imported. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki. account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_metadata_write.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import metadata of a REDCap project — redcap_metadata_write","text":"","code":"# \\dontrun{ # Please don't run this example without changing the token to # point to your server.  It could interfere with our testing suite. uri            <- \"https://bbmc.ouhsc.edu/redcap/api/\" token          <- \"457C24AB91B7FCF5B1A7DA67E70E24C7\"  # Read in the dictionary in R's memory from a csv file. ds_to_write <-   readr::read_csv(     file = system.file(       \"test-data/project-simple/metadata.csv\",       package = \"REDCapR\"     ),     col_types = readr::cols(.default = readr::col_character())   ) ds_to_write #> # A tibble: 16 × 18 #>    field_name form_name          section_header      field_type field_label      #>    <chr>      <chr>              <chr>               <chr>      <chr>            #>  1 record_id  demographics       NA                  text       Study ID         #>  2 name_first demographics       Contact Information text       First Name       #>  3 name_last  demographics       NA                  text       Last Name        #>  4 address    demographics       NA                  notes      Street, City, S… #>  5 telephone  demographics       NA                  text       Phone number     #>  6 email      demographics       NA                  text       E-mail           #>  7 dob        demographics       NA                  text       Date of birth    #>  8 age        demographics       NA                  calc       Age (years)      #>  9 sex        demographics       NA                  radio      Gender           #> 10 height     health             NA                  text       Height (cm)      #> 11 weight     health             NA                  text       Weight (kilogra… #> 12 bmi        health             NA                  calc       BMI              #> 13 comments   health             General Comments    notes      Comments         #> 14 mugshot    health             NA                  file       Mugshot          #> 15 race       race_and_ethnicity NA                  checkbox   Race (Select al… #> 16 ethnicity  race_and_ethnicity NA                  radio      Ethnicity        #> # ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <chr>, #> #   text_validation_type_or_show_slider_number <chr>, #> #   text_validation_min <chr>, text_validation_max <chr>, identifier <chr>, #> #   branching_logic <chr>, required_field <chr>, custom_alignment <chr>, #> #   question_number <chr>, matrix_group_name <chr>, matrix_ranking <chr>, #> #   field_annotation <chr>  # Import the dictionary into the REDCap project REDCapR::redcap_metadata_write(   ds          = ds_to_write,   redcap_uri  = uri,   token       = token ) #> 16 fields were written to the REDCap dictionary in 0.4 seconds. #> $success #> [1] TRUE #>  #> $status_code #> [1] 200 #>  #> $outcome_message #> [1] \"16 fields were written to the REDCap dictionary in 0.4 seconds.\" #>  #> $field_count #> [1] 16 #>  #> $elapsed_seconds #> [1] 0.3632901 #>  #> $raw_text #> [1] \"\" #>  # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine free available record ID — redcap_next_free_record_name","title":"Determine free available record ID — redcap_next_free_record_name","text":"Determines next available record ID.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine free available record ID — redcap_next_free_record_name","text":"","code":"redcap_next_free_record_name(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine free available record ID — redcap_next_free_record_name","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine free available record ID — redcap_next_free_record_name","text":"base::character vector either length 1 (successful) length 0 (successful).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Determine free available record ID — redcap_next_free_record_name","text":"API call unsuccessful, value character(0) returned (.e., empty vector).  ensures function always return object class base::character.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Determine free available record ID — redcap_next_free_record_name","text":"Documentation REDCap 8.4.0 used projects record auto-numbering enabled, method exports next potential record ID project. generates next record name determining current maximum numerical record ID incrementing one.","code":"Note: This method does not create a new record, but merely determines what the next record name would be.  If using Data Access Groups (DAGs) in the project, this method accounts for the special formatting of the record name for users in DAGs (e.g., DAG-ID); in this case, it only assigns the next value for ID for all numbers inside a DAG. For example, if a DAG has a corresponding DAG number of 223 wherein records 223-1 and 223-2 already exist, then the next record will be 223-3 if the API user belongs to the DAG that has DAG number 223. (The DAG number is auto-assigned by REDCap for each DAG when the DAG is first created.)  When generating a new record name in a DAG, the method considers all records in the entire project when determining the maximum record ID, including those that might have been originally created in that DAG but then later reassigned to another DAG.  Note: This method functions the same even for projects that do not have record auto-numbering enabled."},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_next_free_record_name.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine free available record ID — redcap_next_free_record_name","text":"","code":"uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"9A81268476645C4E5F03428B8AC3AA7B\" # Returns 6 REDCapR::redcap_next_free_record_name(redcap_uri = uri, token = token) #> The next free record name in REDCap was successfully determined in 0.3 seconds.  The http status code was 200.  Is is 6. #> [1] \"6\""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project.html","id":null,"dir":"Reference","previous_headings":"","what":"A Reference Class to make later calls to REDCap more convenient — redcap_project","title":"A Reference Class to make later calls to REDCap more convenient — redcap_project","text":"Reference Class represents REDCap project. values set specific REDCap project (URI token), later calls less verbose (reading writing data).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"A Reference Class to make later calls to REDCap more convenient — redcap_project","text":"redcap_uri URI (uniform resource identifier) REDCap project.  Required. token token user-specific string serves password project.  Required.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"A Reference Class to make later calls to REDCap more convenient — redcap_project","text":"read(   batch_size = 100L,   interbatch_delay = 0,   records = NULL,   fields = NULL,   forms = NULL,   events = NULL,   raw_or_label = \"raw\",   raw_or_label_headers = \"raw\",   export_checkbox_label = FALSE,   export_survey_fields = FALSE,   export_data_access_groups = FALSE,   filter_logic = \"\",   col_types = NULL,   guess_type = TRUE,   guess_max = 1000,   verbose = TRUE,   config_options = NULL ) Exports records REDCap project. write(   ds_to_write,   batch_size = 100L,   interbatch_delay = 0,   continue_on_error = FALSE,   verbose = TRUE,   config_options = NULL ) Imports records REDCap project.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"A Reference Class to make later calls to REDCap more convenient — redcap_project","text":"","code":"uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"9A81268476645C4E5F03428B8AC3AA7B\" # \\dontrun{ project <- REDCapR::redcap_project$new(redcap_uri=uri, token=token) ds_all  <- project$read() #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.3 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.4 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 05:08:16.648447. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Demonstrate how repeated calls are more concise when the token and #   url aren't always passed. ds_skinny <- project$read(fields=c(\"record_id\", \"sex\", \"height\"))$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.4 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 05:08:18.168457. #> Reading batch 1 of 1, with subjects 1 through 5 (ie, 5 unique subject records). #> 5 records and 3 columns were read from REDCap in 0.3 seconds.  The http status code was 200.  ids_of_males    <- ds_skinny$record_id[ds_skinny$sex==1] ids_of_shorties <- ds_skinny$record_id[ds_skinny$height < 40]  ds_males        <- project$read(records=ids_of_males, batch_size=2)$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 1.2 seconds.  The http status code was 200. #> 3 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200. #> Starting to read 3 records  at 2024-09-07 05:08:20.572494. #> Reading batch 1 of 2, with subjects 2 through 3 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.4 seconds.  The http status code was 200. #> Reading batch 2 of 2, with subjects 5 through 5 (ie, 1 unique subject records). #> 1 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200. ds_shorties     <- project$read(records=ids_of_shorties)$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.4 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.1 seconds.  The http status code was 200. #> 2 records and 1 columns were read from REDCap in 0.4 seconds.  The http status code was 200. #> Starting to read 2 records  at 2024-09-07 05:08:22.725186. #> Reading batch 1 of 1, with subjects 1 through 2 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.4 seconds.  The http status code was 200.  # } if (FALSE) { # Switch the Genders sex_original   <- ds_skinny$sex ds_skinny$sex  <- (1 - ds_skinny$sex) project$write(ds_skinny)  # Switch the Genders back ds_skinny$sex <- sex_original project$write(ds_skinny) }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Export project information. — redcap_project_info_read","title":"Export project information. — redcap_project_info_read","text":"function exports basic attributes given REDCap project, project's title, longitudinal, surveys enabled, time project created moved production.  Returns tibble::tibble().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export project information. — redcap_project_info_read","text":"","code":"redcap_project_info_read(   redcap_uri,   token,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export project information. — redcap_project_info_read","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export project information. — redcap_project_info_read","text":"Currently, list returned following elements: data: R tibble::tibble() data access groups project. success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Export project information. — redcap_project_info_read","text":"Timezones Several datetime variables returned, project's creation_time.  time meaningful, need set time zone function uses readr::read_csv(), assigns UTC timezone specified.  Find server's location listed base::OlsonNames(), pass readr's readr::locale() function, pass redcap_project_info_read().  See examples timezone details see Timezones section readr's locales vignette. Columns yet added function casts columns data types think natural use.  example, in_production cast 0/1 boolean TRUE/FALSE.  columns (yet) recognized REDCapR still returned client, cast character. REDCap API adds new column future, please alert us REDCapR issue expand casting specifications. External Modules project's external_modules cell contains approved EMs, separated column.  Consider using function like tidyr::separate_rows() create long data structure.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Export project information. — redcap_project_info_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export project information. — redcap_project_info_read","text":"Beasley, Stephan Kadauke","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_project_info_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export project information. — redcap_project_info_read","text":"","code":"# \\dontrun{ # Specify your project uri and token(s). uri                  <- \"https://bbmc.ouhsc.edu/redcap/api/\" token_simple         <- \"9A81268476645C4E5F03428B8AC3AA7B\" token_longitudinal   <- \"0434F0E9CF53ED0587847AB6E51DE762\"  # ---- Simple examples REDCapR::redcap_project_info_read(uri, token_simple      )$data #> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200. #> # A tibble: 1 × 26 #>   project_id project_title creation_time       production_time in_production #>        <int> <chr>         <dttm>              <dttm>          <lgl>         #> 1        153 REDCapR Targ… 2013-11-29 15:58:20 NA              FALSE         #> # ℹ 21 more variables: project_language <chr>, purpose <int>, #> #   purpose_other <chr>, project_notes <chr>, custom_record_label <chr>, #> #   secondary_unique_field <chr>, is_longitudinal <lgl>, #> #   has_repeating_instruments_or_events <lgl>, surveys_enabled <lgl>, #> #   scheduling_enabled <lgl>, record_autonumbering_enabled <lgl>, #> #   randomization_enabled <lgl>, ddp_enabled <lgl>, project_irb_number <chr>, #> #   project_grant_number <chr>, project_pi_firstname <chr>, … REDCapR::redcap_project_info_read(uri, token_longitudinal)$data #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 1 × 26 #>   project_id project_title creation_time       production_time in_production #>        <int> <chr>         <dttm>              <dttm>          <lgl>         #> 1        212 REDCapR Targ… 2014-08-31 13:07:55 NA              FALSE         #> # ℹ 21 more variables: project_language <chr>, purpose <int>, #> #   purpose_other <chr>, project_notes <chr>, custom_record_label <chr>, #> #   secondary_unique_field <chr>, is_longitudinal <lgl>, #> #   has_repeating_instruments_or_events <lgl>, surveys_enabled <lgl>, #> #   scheduling_enabled <lgl>, record_autonumbering_enabled <lgl>, #> #   randomization_enabled <lgl>, ddp_enabled <lgl>, project_irb_number <chr>, #> #   project_grant_number <chr>, project_pi_firstname <chr>, …  # ---- Specify timezone # Specify the server's timezone, for example, US Central server_locale <- readr::locale(tz = \"America/Chicago\") d3 <-   REDCapR::redcap_project_info_read(     uri,     token_simple,     locale     = server_locale   )$data #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. d3$creation_time #> [1] \"2013-11-29 15:58:20 CST\"  # Alternatively, set timezone to the client's location. client_locale <- readr::locale(tz = Sys.timezone())  # ---- Inspect multiple projects in the same tibble # Stack all the projects on top of each other in a (nested) tibble, #   starting from a csv of REDCapR test projects. # The native pipes in this snippet require R 4.1+. d_all <-   system.file(\"misc/example.credentials\", package = \"REDCapR\") |>   readr::read_csv(     comment     = \"#\",     col_select  = c(redcap_uri, token),     col_types   = readr::cols(.default = readr::col_character())   ) |>   dplyr::filter(32L == nchar(token)) |>   purrr::pmap_dfr(REDCapR::redcap_project_info_read, locale = server_locale) #> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.3 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.9 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.4 seconds.  The http status code was 200.  # Inspect values stored on the server. d_all$data #> # A tibble: 30 × 26 #>    project_id project_title              creation_time       production_time #>         <int> <chr>                      <dttm>              <dttm>          #>  1        153 REDCapR Target Simple Sta… 2013-11-29 15:58:20 NA              #>  2        212 REDCapR Target Longitudin… 2014-08-31 13:07:55 NA              #>  3        213 REDCapR Target Simple -Wr… 2014-08-31 13:34:06 NA              #>  4        268 REDCapR Russian -see http… 2015-02-21 12:18:27 NA              #>  5        690 REDCapR Target Empty Rows… 2017-08-21 22:14:37 NA              #>  6        691 REDCapR Target Empty Colu… 2017-08-21 22:24:45 NA              #>  7        753 REDCapR Target Super-wide… 2017-12-01 08:58:07 NA              #>  8        817 REDCapR Target Survey Sta… 2018-03-06 15:46:24 NA              #>  9        977 REDCap Target Fake Clinic… 2018-08-24 11:30:21 NA              #> 10        998 REDCapR Target -nonumeric… 2018-09-11 18:21:14 NA              #> # ℹ 20 more rows #> # ℹ 22 more variables: in_production <lgl>, project_language <chr>, #> #   purpose <int>, purpose_other <chr>, project_notes <chr>, #> #   custom_record_label <chr>, secondary_unique_field <chr>, #> #   is_longitudinal <lgl>, has_repeating_instruments_or_events <lgl>, #> #   surveys_enabled <lgl>, scheduling_enabled <lgl>, #> #   record_autonumbering_enabled <lgl>, randomization_enabled <lgl>, … # or: View(d_all$data)  # Inspect everything returned, including values like the http status code. d_all #> # A tibble: 30 × 6 #>    data$project_id success status_code outcome_message  elapsed_seconds raw_text #>              <int> <lgl>         <int> <chr>                      <dbl> <chr>    #>  1             153 TRUE            200 1 rows were rea…           0.145 \"\"       #>  2             212 TRUE            200 1 rows were rea…           0.155 \"\"       #>  3             213 TRUE            200 1 rows were rea…           0.148 \"\"       #>  4             268 TRUE            200 1 rows were rea…           0.172 \"\"       #>  5             690 TRUE            200 1 rows were rea…           0.148 \"\"       #>  6             691 TRUE            200 1 rows were rea…           0.173 \"\"       #>  7             753 TRUE            200 1 rows were rea…           0.198 \"\"       #>  8             817 TRUE            200 1 rows were rea…           0.152 \"\"       #>  9             977 TRUE            200 1 rows were rea…           0.163 \"\"       #> 10             998 TRUE            200 1 rows were rea…           0.160 \"\"       #> # ℹ 20 more rows #> # ℹ 25 more variables: data$project_title <chr>, $creation_time <dttm>, #> #   $production_time <dttm>, $in_production <lgl>, $project_language <chr>, #> #   $purpose <int>, $purpose_other <chr>, $project_notes <chr>, #> #   $custom_record_label <chr>, $secondary_unique_field <chr>, #> #   $is_longitudinal <lgl>, $has_repeating_instruments_or_events <lgl>, #> #   $surveys_enabled <lgl>, $scheduling_enabled <lgl>, … # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":null,"dir":"Reference","previous_headings":"","what":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"external perspective, function similar redcap_read_oneshot().  internals differ redcap_read retrieves subsets data, combines returning (among objects) single tibble::tibble().  function can appropriate redcap_read_oneshot() returning large datasets tie server.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"","code":"redcap_read(   batch_size = 100L,   interbatch_delay = 0.5,   continue_on_error = FALSE,   redcap_uri,   token,   records = NULL,   fields = NULL,   forms = NULL,   events = NULL,   raw_or_label = \"raw\",   raw_or_label_headers = \"raw\",   export_checkbox_label = FALSE,   export_survey_fields = FALSE,   export_data_access_groups = FALSE,   filter_logic = \"\",   datetime_range_begin = as.POSIXct(NA),   datetime_range_end = as.POSIXct(NA),   blank_for_gray_form_status = FALSE,   col_types = NULL,   na = c(\"\", \"NA\"),   guess_type = TRUE,   guess_max = NULL,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL,   id_position = 1L )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"batch_size maximum number subject records single batch contain.  default 100. interbatch_delay number seconds function wait requesting new subset REDCap. default 0.5 seconds. continue_on_error error occurs reading, records subsequent batches attempted.  default FALSE, prevents subsequent batches running.  Required. redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. records array, element corresponds ID desired record.  Optional. fields array, element corresponds desired project field.  Optional. forms array, element corresponds desired project form.  Optional. events array, element corresponds desired project event.  Optional. raw_or_label string (either 'raw' 'label' specifies whether export raw coded values labels options multiple choice fields.  Default 'raw'. raw_or_label_headers string (either 'raw' 'label' specifies CSV headers whether export variable/field names (raw) field labels (label).  Default 'raw'. export_checkbox_label specifies format checkbox field values specifically exporting data labels.  raw_or_label 'label' export_checkbox_label TRUE, values text displayed users.  Otherwise, values 0/1. export_survey_fields boolean specifies whether export survey identifier field (e.g., 'redcap_survey_identifier') survey timestamp fields (e.g., instrument+'_timestamp'). timestamp outputs reflect survey's completion time (according time timezone REDCap server.) export_data_access_groups boolean value specifies whether export redcap_data_access_group field data access groups utilized project. Default FALSE. See details . filter_logic String logic text (e.g., [gender] = 'male') filtering data returned API method, API return records (record-events, longitudinal project) logic evaluates TRUE.   blank/empty string returns records. datetime_range_begin return records created modified given datetime, provide POSIXct value. specified, REDCap assume begin time. datetime_range_end return records created modified given datetime, provide POSIXct value. specified, REDCap assume end time. blank_for_gray_form_status boolean value specifies whether export blank values instrument complete status fields gray status icon. instrument complete status fields gray icon can exported either blank value \"0\" (Incomplete). Blank values recommended data export data re-imported REDCap project. Default FALSE. col_types readr::cols() object passed internally readr::read_csv().  Optional. na character vector passed internally readr::read_csv(). Defaults c(\"\", \"NA\"). guess_type boolean value indicating columns returned character.  true, readr::read_csv() guesses intended data type column.  Ignored col_types null. guess_max Deprecated. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional. id_position column position variable unique identifies subject (typically record_id). defaults first variable dataset.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"Currently, list returned following elements: data: tibble::tibble() desired records columns. success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. records_collapsed: desired records IDs, collapsed single string, separated commas. fields_collapsed: desired field names, collapsed single string, separated commas. filter_logic: filter statement passed argument. elapsed_seconds: duration function. records retrieved (records meet filter criteria), zero-row tibble returned. Currently empty tibble zero columns, may change future.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"batching-subsets-of-data","dir":"Reference","previous_headings":"","what":"Batching subsets of data","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"redcap_read() internally uses multiple calls redcap_read_oneshot() select return data.  Initially, primary key queried REDCap API.  long list subsetted batches, whose sizes determined batch_size parameter.  REDCap queried variables subset's subjects.  repeated subset, returning unified tibble::tibble(). function allows delay calls, allows server attend users' requests (users entering data browser).  words, delay batches bog webserver exporting/importing large dataset. second benefit less RAM required webserver.  batch smaller entire dataset, webserver tackles manageably sized objects memory.  Consider batching encounter error:   third benefit (compared redcap_read()) important fields included, even explicitly requested.  result: record_id (customized name) always returned redcap_event_name returned longitudinal projects redcap_repeat_instrument redcap_repeat_instance returned projects repeating instruments","code":"ERROR: REDCap ran out of server memory. The request cannot be processed. Please try importing/exporting a smaller amount of data."},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"export-permissions","dir":"Reference","previous_headings":"","what":"Export permissions","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"redcap_read_oneshot() function properly, user must Export permissions 'Full Data Set'.  Users 'De-Identified' export privileges can still use redcap_read_oneshot.  grant appropriate permissions: go 'User Rights' REDCap project site, select desired user, select 'Edit User Privileges', 'Data Exports' radio buttons, select 'Full Data Set'.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"pseudofields","dir":"Reference","previous_headings":"","what":"Pseudofields","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"REDCap project may contain \"pseudofields\", depending structure. Pseudofields exported certain project structures, defined users appear codebook. recognized pseudofield passed fields api parameter, suppressed redcap_read() redcap_read_oneshot() server throw error. Requesting pseudofield discouraged, message returned user. Pseudofields include: redcap_event_name: longitudinal projects multi-arm projects. redcap_repeat_instrument:  projects repeating instruments. redcap_repeat_instance:   projects repeating instruments. redcap_data_access_group: projects DAGs export_data_access_groups api parameter TRUE. redcap_survey_identifier:  projects surveys export_survey_fields api parameter TRUE. instrument_name_timestamp: projects surveys. example, instrument called \"demographics\" pseudofield named demographics_timestamp. REDCapR suppress requests timestamps, server throw error like","code":"ERROR: The following values in the parameter fields are not valid: 'demographics_timestamp'"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"events","dir":"Reference","previous_headings":"","what":"Events","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"event argument vector characters passed server. \"event-name\", \"event-label\". event-label value presented users, contains uppercase letters spaces, event-name can contain lowercase letters, digits, underscores. event nonnull project longitudinal, redcap_read() throw error. Similarly, value event vector current event-name, redcap_read() throw error. simpler redcap_read_oneshot() function check invalid event values, throw errors.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read records from a REDCap project in subsets, and stacks them together before returning a dataset — redcap_read","text":"","code":"# \\dontrun{ uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"9A81268476645C4E5F03428B8AC3AA7B\"  # Return the entire dataset REDCapR::redcap_read(batch_size=2, redcap_uri=uri, token=token)$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.4 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.1 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 05:08:32.711341. #> Reading batch 1 of 3, with subjects 1 through 2 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Reading batch 2 of 3, with subjects 3 through 4 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200. #> Reading batch 3 of 3, with subjects 5 through 5 (ie, 1 unique subject records). #> 1 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> # A tibble: 5 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <dbl> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         2 Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10    11     1 #> 3         3 Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09    80     1 #> 4         4 Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02    61     0 #> 5         5 John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15    59     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <dbl>, race___2 <dbl>, race___3 <dbl>, race___4 <dbl>, #> #   race___5 <dbl>, race___6 <dbl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl>  # Return a subset of columns while also specifying the column types. col_types <- readr::cols(   record_id  = readr::col_integer(),   race___1   = readr::col_logical(),   race___2   = readr::col_logical(),   race___3   = readr::col_logical(),   race___4   = readr::col_logical(),   race___5   = readr::col_logical(),   race___6   = readr::col_logical() ) REDCapR::redcap_read(   redcap_uri = uri,   token      = token,   col_types  = col_types,   batch_size = 2 )$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 3 instrument metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 1 rows were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 data access groups were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 1 columns were read from REDCap in 0.2 seconds.  The http status code was 200. #> Starting to read 5 records  at 2024-09-07 05:08:36.339831. #> Reading batch 1 of 3, with subjects 1 through 2 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.3 seconds.  The http status code was 200. #> Reading batch 2 of 3, with subjects 3 through 4 (ie, 2 unique subject records). #> 2 records and 25 columns were read from REDCap in 0.6 seconds.  The http status code was 200. #> Reading batch 3 of 3, with subjects 5 through 5 (ie, 1 unique subject records). #> 1 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200. #> # A tibble: 5 × 25 #>   record_id name_first name_last address  telephone email dob          age   sex #>       <int> <chr>      <chr>     <chr>    <chr>     <chr> <date>     <dbl> <dbl> #> 1         1 Nutmeg     Nutmouse  \"14 Ros… (405) 32… nutt… 2003-08-30    11     0 #> 2         2 Tumtum     Nutmouse  \"14 Ros… (405) 32… tumm… 2003-03-10    11     1 #> 3         3 Marcus     Wood      \"243 Hi… (405) 32… mw@m… 1934-04-09    80     1 #> 4         4 Trudy      DAG       \"342 El… (405) 32… pero… 1952-11-02    61     0 #> 5         5 John Lee   Walker    \"Hotel … (405) 32… left… 1955-04-15    59     1 #> # ℹ 16 more variables: demographics_complete <dbl>, height <dbl>, weight <dbl>, #> #   bmi <dbl>, comments <chr>, mugshot <chr>, health_complete <dbl>, #> #   race___1 <lgl>, race___2 <lgl>, race___3 <lgl>, race___4 <lgl>, #> #   race___5 <lgl>, race___6 <lgl>, ethnicity <dbl>, interpreter_needed <dbl>, #> #   race_and_ethnicity_complete <dbl> # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"function uses REDCap's API select return data eav","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"","code":"redcap_read_eav_oneshot(   redcap_uri,   token,   records = NULL,   fields = NULL,   forms = NULL,   events = NULL,   export_survey_fields = FALSE,   export_data_access_groups = FALSE,   filter_logic = \"\",   datetime_range_begin = as.POSIXct(NA),   datetime_range_end = as.POSIXct(NA),   blank_for_gray_form_status = FALSE,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. records array, element corresponds ID desired record.  Optional. fields array, element corresponds desired project field.  Optional. forms array, element corresponds desired project form.  Optional. events array, element corresponds desired project event.  Optional. export_survey_fields boolean specifies whether export survey identifier field (e.g., 'redcap_survey_identifier') survey timestamp fields (e.g., instrument+'_timestamp'). timestamp outputs reflect survey's completion time (according time timezone REDCap server.) export_data_access_groups boolean value specifies whether export redcap_data_access_group field data access groups utilized project. Default FALSE. See details . filter_logic String logic text (e.g., [gender] = 'male') filtering data returned API method, API return records (record-events, longitudinal project) logic evaluates TRUE.   blank/empty string returns records. datetime_range_begin return records created modified given datetime, provide POSIXct value. specified, REDCap assume begin time. datetime_range_end return records created modified given datetime, provide POSIXct value. specified, REDCap assume end time. blank_for_gray_form_status boolean value specifies whether export blank values instrument complete status fields gray status icon. instrument complete status fields gray icon can exported either blank value \"0\" (Incomplete). Blank values recommended data export data re-imported REDCap project. Default FALSE. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"Currently, list returned following elements: data: tibble::tibble() desired records columns. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_collapsed: desired records IDs, collapsed single string, separated commas. fields_collapsed: desired field names, collapsed single string, separated commas. filter_logic: filter statement passed argument. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"pass export_data_access_groups value, default FALSE. following API help page version 10.5.1: flag viable user whose token used make API request data access group. user group, flag revert default value.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_eav_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read/Export records from a REDCap project, returned as eav — redcap_read_eav_oneshot","text":"","code":"# \\dontrun{ uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"9A81268476645C4E5F03428B8AC3AA7B\"  # Return all records and all variables. ds <- REDCapR:::redcap_read_eav_oneshot(redcap_uri=uri, token=token)$data #> 103 records and 3 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Return only records with IDs of 1 and 3 desired_records_v1 <- c(1, 3) ds_some_rows_v1 <- REDCapR:::redcap_read_eav_oneshot(   redcap_uri = uri,   token      = token,   records    = desired_records_v1 )$data #> 41 records and 3 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Return only the fields record_id, name_first, and age desired_fields_v1 <- c(\"record_id\", \"name_first\", \"age\") ds_some_fields_v1 <- REDCapR:::redcap_read_eav_oneshot(   redcap_uri = uri,   token      = token,   fields     = desired_fields_v1 )$data #> 15 records and 3 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Repeating token <- \"56F43A10D01D6578A46393394D76D88F\"  # PHI-free demo: Repeating Instruments --Sparse # 2603 ds <- REDCapR:::redcap_read_eav_oneshot(redcap_uri=uri, token=token)$data #> 45 records and 5 columns were read from REDCap in 0.2 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Read/Export records from a REDCap project — redcap_read_oneshot","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"function uses REDCap's API select return data.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"","code":"redcap_read_oneshot(   redcap_uri,   token,   records = NULL,   fields = NULL,   forms = NULL,   events = NULL,   raw_or_label = \"raw\",   raw_or_label_headers = \"raw\",   export_checkbox_label = FALSE,   export_survey_fields = FALSE,   export_data_access_groups = FALSE,   filter_logic = \"\",   datetime_range_begin = as.POSIXct(NA),   datetime_range_end = as.POSIXct(NA),   blank_for_gray_form_status = FALSE,   col_types = NULL,   na = c(\"\", \"NA\"),   guess_type = TRUE,   guess_max = 1000,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. records array, element corresponds ID desired record.  Optional. fields array, element corresponds desired project field.  Optional. forms array, element corresponds desired project form.  Optional. events array, element corresponds desired project event.  Optional. raw_or_label string (either 'raw' 'label') specifies whether export raw coded values labels options multiple choice fields.  Default 'raw'. raw_or_label_headers string (either 'raw' 'label' specifies CSV headers whether export variable/field names (raw) field labels (label).  Default 'raw'. export_checkbox_label specifies format checkbox field values specifically exporting data labels.  raw_or_label 'label' export_checkbox_label TRUE, values text displayed users.  Otherwise, values 0/1. export_survey_fields boolean specifies whether export survey identifier field (e.g., 'redcap_survey_identifier') survey timestamp fields (e.g., instrument+'_timestamp'). timestamp outputs reflect survey's completion time (according time timezone REDCap server.) export_data_access_groups boolean value specifies whether export redcap_data_access_group field data access groups utilized project. Default FALSE. See details . filter_logic String logic text (e.g., [gender] = 'male') filtering data returned API method, API return records (record-events, longitudinal project) logic evaluates TRUE.   blank/empty string returns records. datetime_range_begin return records created modified given datetime, provide POSIXct value. specified, REDCap assume begin time. datetime_range_end return records created modified given datetime, provide POSIXct value. specified, REDCap assume end time. blank_for_gray_form_status boolean value specifies whether export blank values instrument complete status fields gray status icon. instrument complete status fields gray icon can exported either blank value \"0\" (Incomplete). Blank values recommended data export data re-imported REDCap project. Default FALSE. col_types readr::cols() object passed internally readr::read_csv().  Optional. na character vector passed internally readr::read_csv(). Defaults c(\"\", \"NA\"). guess_type boolean value indicating columns returned character.  true, readr::read_csv() guesses intended data type column.  Ignored col_types null. guess_max positive base::numeric value passed readr::read_csv() specifies maximum number records use guessing column types. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"Currently, list returned following elements: data: tibble::tibble() desired records columns. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_collapsed: desired records IDs, collapsed single string, separated commas. fields_collapsed: desired field names, collapsed single string, separated commas. filter_logic: filter statement passed argument. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM. records retrieved (records meet filter criteria), zero-row tibble returned. Currently empty tibble zero columns, may change future.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"pass export_data_access_groups value, default FALSE. following API help page version 10.5.1: flag viable user whose token used make API request data access group. user group, flag revert default value. REDCap project may contain \"pseudofields\", depending structure. Pseudofields exported certain project structures, defined users appear codebook. recognized pseudofield passed fields api parameter, suppressed redcap_read() redcap_read_oneshot() server throw error. Requesting pseudofield discouraged, message returned user. Pseudofields include: redcap_event_name: longitudinal projects multi-arm projects. redcap_repeat_instrument:  projects repeating instruments. redcap_repeat_instance:   projects repeating instruments. redcap_data_access_group: projects DAGs export_data_access_groups api parameter TRUE. redcap_survey_identifier:  projects surveys export_survey_fields api parameter TRUE. instrument_name_timestamp: projects surveys. example, instrument called \"demographics\" pseudofield named demographics_timestamp. REDCapR suppress requests timestamps, server throw error like","code":"ERROR: The following values in the parameter fields are not valid: 'demographics_timestamp'"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read/Export records from a REDCap project — redcap_read_oneshot","text":"","code":"# \\dontrun{ uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"9A81268476645C4E5F03428B8AC3AA7B\"  # Return all records and all variables. ds <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token)$data #> 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Return only records with IDs of 1 and 3 desired_records_v1 <- c(1, 3) ds_some_rows_v1 <- REDCapR::redcap_read_oneshot(   redcap_uri = uri,   token      = token,   records    = desired_records_v1 )$data #> 2 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Return only the fields record_id, name_first, and age desired_fields_v1 <- c(\"record_id\", \"name_first\", \"age\") ds_some_fields_v1 <- REDCapR::redcap_read_oneshot(   redcap_uri = uri,   token      = token,   fields     = desired_fields_v1 )$data #> 5 records and 3 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Specify the column types. col_types <- readr::cols(   record_id  = readr::col_integer(),   race___1   = readr::col_logical(),   race___2   = readr::col_logical(),   race___3   = readr::col_logical(),   race___4   = readr::col_logical(),   race___5   = readr::col_logical(),   race___6   = readr::col_logical() ) ds_col_types <- REDCapR::redcap_read_oneshot(   redcap_uri = uri,   token      = token,   col_types  = col_types )$data #> 5 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":null,"dir":"Reference","previous_headings":"","what":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"function uses REDCap's API select return data. function still development.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"","code":"redcap_read_oneshot_eav(   redcap_uri,   token,   records = NULL,   fields = NULL,   forms = NULL,   events = NULL,   raw_or_label = \"raw\",   raw_or_label_headers = \"raw\",   export_data_access_groups = FALSE,   filter_logic = \"\",   datetime_range_begin = as.POSIXct(NA),   datetime_range_end = as.POSIXct(NA),   blank_for_gray_form_status = FALSE,   http_response_encoding = \"UTF-8\",   locale = readr::default_locale(),   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. records array, element corresponds ID desired record.  Optional. fields array, element corresponds desired project field.  Optional. forms array, element corresponds desired project field.  Optional. events array, element corresponds desired project event.  Optional. raw_or_label string (either 'raw' 'label' specifies whether export raw coded values labels options multiple choice fields.  Default 'raw'. raw_or_label_headers string (either 'raw' 'label' specifies CSV headers whether export variable/field names (raw) field labels (label).  Default 'raw'. export_data_access_groups boolean value specifies whether export redcap_data_access_group field data access groups utilized project. Default FALSE. See details . filter_logic String logic text (e.g., [gender] = 'male') filtering data returned API method, API return records (record-events, longitudinal project) logic evaluates TRUE.   blank/empty string returns records. datetime_range_begin return records created modified given datetime, provide POSIXct (https://stat.ethz.ch/R-manual/R-devel/library/base/html/.POSIXlt.html) value. specified, REDCap assume begin time. datetime_range_end return records created modified given datetime, provide POSIXct (https://stat.ethz.ch/R-manual/R-devel/library/base/html/.POSIXlt.html) value. specified, REDCap assume end time. blank_for_gray_form_status boolean value specifies whether export blank values instrument complete status fields gray status icon. instrument complete status fields gray icon can exported either blank value \"0\" (Incomplete). Blank values recommended data export data re-imported REDCap project. Default FALSE. http_response_encoding encoding value passed httr::content().  Defaults 'UTF-8'. locale readr::locale() object specify preferences like number, date, time formats.  object passed readr::read_csv().  Defaults readr::default_locale(). verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"Currently, list returned following elements: data: tibble::tibble() desired records columns. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_collapsed: desired records IDs, collapsed single string, separated commas. fields_collapsed: desired field names, collapsed single string, separated commas. filter_logic: filter statement passed argument. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"pass export_data_access_groups value, default FALSE. following API help page version 5.2.3: flag viable user whose token used make API request data access group. user group, flag revert default value. REDCap 6.14.3, field exported EAV API call.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_read_oneshot_eav.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read/Export records from a REDCap project –still in development — redcap_read_oneshot_eav","text":"","code":"# \\dontrun{ uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"9A81268476645C4E5F03428B8AC3AA7B\"  # Return all records and all variables. ds <- REDCapR:::redcap_read_oneshot_eav(redcap_uri=uri, token=token)$data #> The data dictionary describing 17 fields was read from REDCap in 0.2 seconds.  The http status code was 200. #> 24 variable metadata records were read from REDCap in 0.1 seconds.  The http status code was 200. #> 5 records and 25 columns were read from REDCap in 0.4 seconds.  The http status code was 200.  # Return only records with IDs of 1 and 3 desired_records_v1 <- c(1, 3) ds_some_rows_v1    <- REDCapR:::redcap_read_oneshot_eav(    redcap_uri = uri,    token      = token,    records    = desired_records_v1 )$data #> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds.  The http status code was 200. #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 2 records and 25 columns were read from REDCap in 0.2 seconds.  The http status code was 200.  # Return only the fields record_id, name_first, and age desired_fields_v1 <- c(\"record_id\", \"name_first\", \"age\") ds_some_fields_v1 <- REDCapR:::redcap_read_oneshot_eav(    redcap_uri = uri,    token      = token,    fields     = desired_fields_v1 )$data #> The data dictionary describing 17 fields was read from REDCap in 0.1 seconds.  The http status code was 200. #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. #> 5 records and 9 columns were read from REDCap in 0.2 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":null,"dir":"Reference","previous_headings":"","what":"Read/Export records that populate a REDCap report — redcap_report","title":"Read/Export records that populate a REDCap report — redcap_report","text":"Exports data set report created project's 'Data Exports, Reports, Stats' page.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read/Export records that populate a REDCap report — redcap_report","text":"","code":"redcap_report(   redcap_uri,   token,   report_id,   raw_or_label = \"raw\",   raw_or_label_headers = \"raw\",   export_checkbox_label = FALSE,   col_types = NULL,   guess_type = TRUE,   guess_max = 1000,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read/Export records that populate a REDCap report — redcap_report","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. report_id single integer, provided next report name report list page.  Required. raw_or_label string (either 'raw' 'label') specifies whether export raw coded values labels options multiple choice fields.  Default 'raw'. raw_or_label_headers string (either 'raw' 'label' specifies CSV headers whether export variable/field names (raw) field labels (label).  Default 'raw'. export_checkbox_label specifies format checkbox field values specifically exporting data labels.  raw_or_label 'label' export_checkbox_label TRUE, values text displayed users.  Otherwise, values 0/1. col_types readr::cols() object passed internally readr::read_csv().  Optional. guess_type boolean value indicating columns returned character.  true, readr::read_csv() guesses intended data type column.  Ignored col_types null. guess_max positive base::numeric value passed readr::read_csv() specifies maximum number records use guessing column types. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read/Export records that populate a REDCap report — redcap_report","text":"Currently, list returned following elements: data: tibble::tibble() desired records columns. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Read/Export records that populate a REDCap report — redcap_report","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read/Export records that populate a REDCap report — redcap_report","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_report.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read/Export records that populate a REDCap report — redcap_report","text":"","code":"# \\dontrun{ uri          <- \"https://bbmc.ouhsc.edu/redcap/api/\" token        <- \"9A81268476645C4E5F03428B8AC3AA7B\" report_1_id  <- 5980L report_2_id  <- 6431L  # Return all records and all variables. ds_1a <-   REDCapR::redcap_report(     redcap_uri = uri,     token      = token,     report_id  = report_1_id   )$data #> 5 records and 5 columns were read from REDCap in 0.3 seconds.  The http status code was 200.   # Specify the column types. col_types_1 <- readr::cols(   record_id          = readr::col_integer(),   height             = readr::col_double(),   health_complete    = readr::col_integer(),   address            = readr::col_character(),   ethnicity          = readr::col_integer() ) ds_1b <-   REDCapR::redcap_report(     redcap_uri = uri,     token      = token,     report_id  = report_1_id,     col_types  = col_types_1   )$data #> 5 records and 5 columns were read from REDCap in 0.2 seconds.  The http status code was 200.   # Return condensed checkboxes Report option: #   \"Combine checkbox options into single column of only the checked-off #   options (will be formatted as a text field when exported to #   stats packages)\" col_types_2 <- readr::cols(   record_id          = readr::col_integer(),   race               = readr::col_character() ) ds_2 <-   REDCapR::redcap_report(     redcap_uri = uri,     token      = token,     report_id  = report_2_id,     col_types  = col_types_2   )$data #> 5 records and 2 columns were read from REDCap in 0.3 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Get survey link from REDCap — redcap_survey_link_export_oneshot","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"function uses REDCap's API get link survey.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"","code":"redcap_survey_link_export_oneshot(   redcap_uri,   token,   record,   instrument,   event = \"\",   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. record record ID associated survey link. Required instrument name instrument associated survey link.  Required event name event associated survey link. Optional verbose boolean value indicating messages printed R console operation.  Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"Currently, list returned following elements, survey_link: character string containing URL survey. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. instrument: instrument associated survey link. records_affected_count: number records associated survey link. affected_ids: subject IDs associated survey link. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"Currently, function modify variable types conform REDCap's supported variables.  See validate_for_write() helper function checks common important conflicts. Permissions Required use method, must API Export privileges project. (stated 9.0.0 documentation.)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_survey_link_export_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get survey link from REDCap — redcap_survey_link_export_oneshot","text":"","code":"# \\dontrun{ uri     <- \"https://bbmc.ouhsc.edu/redcap/api/\" token   <- \"8FA9A6BDAE2C0B5DD3CB472DD8E8918C\" # pid=817 record  <- 1 instrument   <- \"participant_morale_questionnaire\" # event <- \"\" # only for longitudinal projects  result <- REDCapR::redcap_survey_link_export_oneshot(   record         = record,   instrument     = instrument,   redcap_uri     = uri,   token          = token ) #> Preparing to export the survey link for the instrument `participant_morale_questionnaire`. #> exported the survey link in 0.2 seconds, for instrument `participant_morale_questionnaire`, record `1`. result$survey_link #> [1] \"https://bbmc.ouhsc.edu/redcap/surveys/?s=8KuzSLMHf6\" # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":null,"dir":"Reference","previous_headings":"","what":"List authorized users — redcap_users_export","title":"List authorized users — redcap_users_export","text":"List users authorized project.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List authorized users — redcap_users_export","text":"","code":"redcap_users_export(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List authorized users — redcap_users_export","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List authorized users — redcap_users_export","text":"data_user: tibble::tibble() users associated project. One row represents one user. data_user_form: tibble::tibble() permissions users forms. One row represents unique user--form combination. success: boolean value indicating operation apparently successful. status_codes: collection http status codes, separated semicolons.  one code batch attempted. outcome_messages: collection human readable strings indicating operations' semicolons.  one code batch attempted.  unsuccessful operation, contain diagnostic information. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"List authorized users — redcap_users_export","text":"Documentation REDCap 8.4.0","code":"This method allows you to export the list of users for a project, including their user privileges and also email address, first name, and last name.  Note: If the user has been assigned to a user role, it will return the user with the role's defined privileges."},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_users_export.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"List authorized users — redcap_users_export","text":"","code":"# \\dontrun{ uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"06DEFB601F9B46847DAA9DF0CFA951B4\" result   <- REDCapR::redcap_users_export(redcap_uri=uri, token=token) #> The REDCap users were successfully exported in 0.4 seconds.  The http status code was 200. result$data_user #> # A tibble: 2 × 34 #>   username        email          firstname lastname expiration data_access_group #>   <chr>           <chr>          <chr>     <chr>    <date>     <chr>             #> 1 unittestphifree wibeasley@hot… Unit Test PHI Free NA         daga              #> 2 wbeasleya       william-beasl… Will      Beasley… NA         NA                #> # ℹ 28 more variables: data_access_group_id <chr>, design <lgl>, alerts <dbl>, #> #   user_rights <int>, data_access_groups <lgl>, reports <lgl>, #> #   stats_and_charts <lgl>, manage_survey_participants <lgl>, calendar <lgl>, #> #   data_import_tool <lgl>, data_comparison_tool <lgl>, logging <lgl>, #> #   email_logging <lgl>, file_repository <lgl>, data_quality_create <lgl>, #> #   data_quality_execute <lgl>, api_export <lgl>, api_import <lgl>, #> #   api_modules <lgl>, mobile_app <lgl>, mobile_app_download_data <lgl>, … result$data_user_form #> # A tibble: 2 × 4 #>   username        form_name    permission_id permission #>   <chr>           <chr>                <int> <fct>      #> 1 unittestphifree demographics             1 edit_form  #> 2 wbeasleya       NA                      NA unknown    # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":null,"dir":"Reference","previous_headings":"","what":"Enumerate the exported variables — redcap_variables","title":"Enumerate the exported variables — redcap_variables","text":"function calls 'exportFieldNames' function REDCap API.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enumerate the exported variables — redcap_variables","text":"","code":"redcap_variables(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enumerate the exported variables — redcap_variables","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enumerate the exported variables — redcap_variables","text":"Currently, list returned following elements, data: tibble::tibble() row represents one column REDCap dataset. success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Enumerate the exported variables — redcap_variables","text":"REDCap version 6.14.2, three variable types returned call: calculated, file, descriptive.  variables returned writable/uploadable.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Enumerate the exported variables — redcap_variables","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Enumerate the exported variables — redcap_variables","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_variables.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Enumerate the exported variables — redcap_variables","text":"","code":"# \\dontrun{ uri         <- \"https://bbmc.ouhsc.edu/redcap/api/\" token       <- \"9A81268476645C4E5F03428B8AC3AA7B\" ds_variable <- REDCapR::redcap_variables(redcap_uri=uri, token=token)$data #> 24 variable metadata records were read from REDCap in 0.2 seconds.  The http status code was 200. # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine version of REDCap instance — redcap_version","title":"Determine version of REDCap instance — redcap_version","text":"function uses REDCap's API query version.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine version of REDCap instance — redcap_version","text":"","code":"redcap_version(   redcap_uri,   token,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine version of REDCap instance — redcap_version","text":"redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine version of REDCap instance — redcap_version","text":"utils::packageDescription","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Determine version of REDCap instance — redcap_version","text":"API call unsuccessful, value base::package_version(\"0.0.0\") returned. ensures function always return object class base::numeric_version.  guarantees value can always used utils::compareVersion().","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_version.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine version of REDCap instance — redcap_version","text":"","code":"uri      <- \"https://bbmc.ouhsc.edu/redcap/api/\" token    <- \"9A81268476645C4E5F03428B8AC3AA7B\" REDCapR::redcap_version(redcap_uri = uri, token = token) #> The REDCap version was successfully determined in 0.2 seconds. The http status code was 200.  Is is 14.6.4. #> [1] ‘14.6.4’"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":null,"dir":"Reference","previous_headings":"","what":"Write/Import records to a REDCap project — redcap_write","title":"Write/Import records to a REDCap project — redcap_write","text":"function uses REDCap's APIs select return data.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write/Import records to a REDCap project — redcap_write","text":"","code":"redcap_write(   ds_to_write,   batch_size = 100L,   interbatch_delay = 0.5,   continue_on_error = FALSE,   redcap_uri,   token,   overwrite_with_blanks = TRUE,   convert_logical_to_integer = FALSE,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write/Import records to a REDCap project — redcap_write","text":"ds_to_write base::data.frame() tibble::tibble() imported REDCap project.  Required. batch_size maximum number subject records single batch contain.  default 100. interbatch_delay number seconds function wait requesting new subset REDCap. default 0.5 seconds. continue_on_error error occurs writing, records subsequent batches attempted.  default FALSE, prevents subsequent batches running.  Required. redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. overwrite_with_blanks boolean value indicating blank/NA values R data frame overwrite data server. default behavior REDCapR, essentially deletes cell's value FALSE, blank/NA values data.frame ignored.  Optional. convert_logical_to_integer TRUE, base::logical columns ds cast integer uploading REDCap. Boolean values typically represented 0/1 REDCap radio buttons. Optional. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Write/Import records to a REDCap project — redcap_write","text":"Currently, list returned following elements: success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_affected_count: number records inserted updated. affected_ids: subject IDs inserted updated records. elapsed_seconds: duration function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Write/Import records to a REDCap project — redcap_write","text":"Currently, function modify variable types conform REDCap's supported variables. See validate_for_write() helper function checks common important conflicts. redcap_write function properly, user must Export permissions 'Full Data Set'.  Users 'De-Identified' export privileges can still use redcap_write_oneshot().  grant appropriate permissions: go 'User Rights' REDCap project site, select desired user, select 'Edit User Privileges', 'Data Exports' radio buttons, select 'Full Data Set'.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Write/Import records to a REDCap project — redcap_write","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Write/Import records to a REDCap project — redcap_write","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Write/Import records to a REDCap project — redcap_write","text":"","code":"if (FALSE) { # Define some constants uri           <- \"https://bbmc.ouhsc.edu/redcap/api/\" token         <- \"D70F9ACD1EDD6F151C6EA78683944E98\"  # Read the dataset for the first time. result_read1  <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token) ds1           <- result_read1$data ds1$telephone  # Manipulate a field in the dataset in a VALID way ds1$telephone <- paste0(\"(405) 321-000\", seq_len(nrow(ds1)))  ds1 <- ds1[1:3, ] ds1$age       <- NULL; ds1$bmi <- NULL # Drop the calculated fields before writing. result_write  <- REDCapR::redcap_write(ds1, redcap_uri=uri, token=token)  # Read the dataset for the second time. result_read2  <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token) ds2           <- result_read2$data ds2$telephone  # Manipulate a field in the dataset in an INVALID way.  A US exchange can't be '111'. ds1$telephone <- paste0(\"(405) 321-000\", seq_len(nrow(ds1)))  # This next line will throw an error. result_write <- REDCapR::redcap_write(ds1, redcap_uri=uri, token=token) result_write$raw_text }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":null,"dir":"Reference","previous_headings":"","what":"Write/Import records to a REDCap project — redcap_write_oneshot","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"function uses REDCap's API select return data.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"","code":"redcap_write_oneshot(   ds,   redcap_uri,   token,   overwrite_with_blanks = TRUE,   convert_logical_to_integer = FALSE,   verbose = TRUE,   config_options = NULL,   handle_httr = NULL )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"ds base::data.frame() tibble::tibble() imported REDCap project. Required. redcap_uri uri/url REDCap server typically formatted \"https://server.org/apps/redcap/api/\". Required. token user-specific string serves password project.  Required. overwrite_with_blanks boolean value indicating blank/NA values R data frame overwrite data server. default behavior REDCapR, essentially deletes cell's value FALSE, blank/NA values data frame ignored.  Optional. convert_logical_to_integer TRUE, base::logical columns ds cast integer uploading REDCap. Boolean values typically represented 0/1 REDCap radio buttons. Optional. verbose boolean value indicating messages printed R console operation.  verbose output might contain sensitive information (e.g. PHI), turn output might visible somewhere public. Optional. config_options list options passed httr::POST(). See details httr::httr_options(). Optional. handle_httr value passed handle parameter httr::POST(). useful unconventional authentication approaches.  NULL institutions.  Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"Currently, list returned following elements: success: boolean value indicating operation apparently successful. status_code: http status code operation. outcome_message: human readable string indicating operation's outcome. records_affected_count: number records inserted updated. affected_ids: subject IDs inserted updated records. elapsed_seconds: duration function. raw_text: operation successful, text returned REDCap.  operation successful, raw_text returned empty string save RAM.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"Currently, function modify variable types conform REDCap's supported variables.  See validate_for_write() helper function checks common important conflicts.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/redcap_write_oneshot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Write/Import records to a REDCap project — redcap_write_oneshot","text":"","code":"if (FALSE) { # Define some constants uri            <- \"https://bbmc.ouhsc.edu/redcap/api/\" token          <- \"D70F9ACD1EDD6F151C6EA78683944E98\"  # Read the dataset for the first time. result_read1   <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token) ds1            <- result_read1$data ds1$telephone  # Manipulate a field in the dataset in a VALID way ds1$telephone  <- paste0(\"(405) 321-000\", seq_len(nrow(ds1)))  ds1 <- ds1[1:3, ] ds1$age        <- NULL; ds1$bmi <- NULL # Drop the calculated fields before writing. result_write   <- REDCapR::redcap_write_oneshot(ds=ds1, redcap_uri=uri, token=token)  # Read the dataset for the second time. result_read2   <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token) ds2            <- result_read2$data ds2$telephone  # Manipulate a field in the dataset in an INVALID way.  A US exchange can't be '111'. ds1$telephone  <- paste0(\"(405) 321-000\", seq_len(nrow(ds1)))  # This next line will throw an error. result_write   <- REDCapR::redcap_write_oneshot(ds=ds1, redcap_uri=uri, token=token) result_write$raw_text }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":null,"dir":"Reference","previous_headings":"","what":"Create explicit factor level for missing values — replace_nas_with_explicit","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"Missing values converted factor level. explicit assignment can reduce chances missing values inadvertently ignored. also allows presence missing become predictor models.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"","code":"replace_nas_with_explicit(   scores,   new_na_label = \"Unknown\",   create_factor = FALSE,   add_unknown_level = FALSE )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"scores array values, ideally either factor character. Required new_na_label factor label assigned missing value. Defaults Unknown. create_factor Converts scores factor, one already. Defaults FALSE. add_unknown_level new factor level created? (Specify TRUE already exists.)   Defaults FALSE.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"array values, NA values now factor level, label specified new_na_label value.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"create_factor parameter respected scores already factor. Otherwise, levels without values lost. stop error thrown operation fails convert NA values.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/replace_nas_with_explicit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create explicit factor level for missing values — replace_nas_with_explicit","text":"","code":"library(REDCapR) # Load the package into the current R session."},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":null,"dir":"Reference","previous_headings":"","what":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"functions essential calling REDCap API, instead functions help manage tokens securely.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"","code":"retrieve_credential_local(   path_credential,   project_id,   check_url            = TRUE,   check_username       = FALSE,   check_token_pattern  = TRUE,   username             = NA_character_ )  retrieve_credential_mssql(   project_id,   instance,   dsn,   channel    = NULL )  create_credential_local(   path_credential )"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"path_credential file path CSV containing credentials. Required. project_id ID assigned project withing REDCap.  allows user store tokens multiple REDCap projects one file. Required check_url logical value indicates url credential file checked approximately correct form.  Defaults TRUE. retrieve_credential_local(). check_username logical value indicates username credential file checked username returned R. Defaults FALSE. check_token_pattern logical value indicates token credential file 32-character hexadecimal string.  Defaults FALSE. username character value used retrieve credential. See Notes . Optional. instance casual name associated REDCap instance campus.  allows one credential system accommodate multiple instances campus.  Required dsn DSN local machine points desired MSSQL database. Required. channel optional connection handle returned DBI::dbConnect().  See Details . Optional.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"list following elements returned retrieve_credential_local() retrieve_credential_mssql(): redcap_uri: URI REDCap Server. username: Username. project_id: ID assigned project within REDCap. token: token pass REDCap server comment: optional string ignored REDCapR can helpful humans.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"database elements created script provided package's 'Security Database' vignette, default values work. create_credential_local() function copies static file location specified path_credential argument. record represents one accessible project per user. Follow steps adapt desired REDCap project(s): Modify credential file REDCap API text editor like Notepad++, Visual Studio Code, nano. Replace existing records information projects. Delete remaining example records. Make sure file (sensitive password-like) tokens stored securely! Contact REDCap admin request URI & token discuss institutional policies. Ask institution's security team recommendation info, see https://ouhscbbmc.github.io/REDCapR/articles/workflow-read.html https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html Double-check file secured accessible users.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"Storing credentials server preferred Although strongly encourage storing tokens central server (e.g., see retrieve_credential_mssql() function \"SecurityDatabase\" vignette), times approach feasible token must stored locally.  Please contact us institution using something SQL Server, like help adapting approach infrastructure. Storing credentials locally storing credentials locally, typically credential file dedicated just one user. Occasionally makes sense store tokens multiple users –usually purpose testing. username field connected local credential file. need official username REDCap.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/retrieve_credential.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read a token and other credentials from a (non-REDCap) database or file — retrieve_credential","text":"","code":"# ---- Local File Example ---------------------------- path <- system.file(\"misc/example.credentials\", package = \"REDCapR\") (p1  <- REDCapR::retrieve_credential_local(path, 153L)) #> $redcap_uri #> [1] \"https://bbmc.ouhsc.edu/redcap/api/\" #>  #> $username #> [1] \"myusername\" #>  #> $project_id #> [1] 153 #>  #> $token #> [1] \"9A81268476645C4E5F03428B8AC3AA7B\" #>  #> $comment #> [1] \"simple static (read-only) test project\" #>  (p2  <- REDCapR::retrieve_credential_local(path, 212L)) #> $redcap_uri #> [1] \"https://bbmc.ouhsc.edu/redcap/api/\" #>  #> $username #> [1] \"myusername\" #>  #> $project_id #> [1] 212 #>  #> $token #> [1] \"0434F0E9CF53ED0587847AB6E51DE762\" #>  #> $comment #> [1] \"longitudinal (read-only) ARM test project\" #>    # \\dontrun{ # Create a skeleton of the local credential file to modify path_demo <- base::tempfile(pattern = \"temp\", fileext = \".credentials\")  create_credential_local(path_demo) #> [1] TRUE  base::unlink(path_demo) # This is just a demo; don't delete the real file! # }"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate and sanitize the user's REDCap token — sanitize_token","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"Verifies token nonmissing conforms legal pattern 32-character hexadecimal value. character must () digit 0-9, (b) uppercase letter -F, (c) lowercase letter -f. Trailing line endings removed. typical user call function directly.  However functions like redcap_read() call provide informative error message user. institutions create tokens –standard 32-character hexadecimal value.  pattern validates tokens can specified system environmental variable REDCAP_TOKEN_PATTERN using base::Sys.setenv. example, following regex pattern captures base64 encoded value 40 characters (opposed hexadecimal/base16 value 32 characters): ^([-Za-z\\\\d+/\\\\+=]{40})$. See https://rgxdb.com/r/1NUN74O6 https://regex101.com/library/lXFWqM alternative approaches validate base64 values. pattern specified, default 32-character hex token: ^([0-9A-Fa-f]{32})(?:\\\\n)?$.  important segment contained first () capturing group (.e., [0-9A-Fa-f]{32}). trailing newline character removed.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"","code":"sanitize_token(token)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"token REDCap token. Required.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"token, without terminal newline character.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"Although function accept parameter, influenced REDCAP_TOKEN_PATTERN environmental variable.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"Contact institution's REDCap administrator information project-specific token.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"Hao Zhu, Benjamin Nutter, Beasley, Jordan Mark Barbone","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/sanitize_token.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate and sanitize the user's REDCap token — sanitize_token","text":"","code":"secret_token_1 <- \"12345678901234567890123456ABCDEF\" secret_token_2 <- \"12345678901234567890123456ABCDEF\\n\" secret_token_3 <- \"12345678901234567890123456abcdef\" REDCapR::sanitize_token(secret_token_1) #> [1] \"12345678901234567890123456ABCDEF\" REDCapR::sanitize_token(secret_token_2) #> [1] \"12345678901234567890123456ABCDEF\" REDCapR::sanitize_token(secret_token_3) #> [1] \"12345678901234567890123456abcdef\"  # Some institutions use a token system that follows a different pattern Sys.setenv(\"REDCAP_TOKEN_PATTERN\" = \"^([A-Za-z\\\\d+/\\\\+=]{10})$\")  secret_token_4 <- \"abcde1234=\" REDCapR::sanitize_token(secret_token_4) #> [1] \"abcde1234=\" Sys.getenv(\"REDCAP_TOKEN_PATTERN\") #> [1] \"^([A-Za-z\\\\d+/\\\\+=]{10})$\" Sys.unsetenv(\"REDCAP_TOKEN_PATTERN\")"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/to_api_array.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a vector to the array format expected by the REDCap API — to_api_array","title":"Convert a vector to the array format expected by the REDCap API — to_api_array","text":"Utility function convert vector array format expected REDCap API calls.  called internally REDCapR functions, intended called directly.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/to_api_array.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a vector to the array format expected by the REDCap API — to_api_array","text":"","code":"to_api_array(x, element_names)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/to_api_array.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a vector to the array format expected by the REDCap API — to_api_array","text":"x vector convert array format.  Can NULL. element_names string containing name API request parameter array.  Must either \"fields\" \"forms\".","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/to_api_array.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert a vector to the array format expected by the REDCap API — to_api_array","text":"x NULL list returned one element element x format: list(`element_names[0]` = x[1], `element_names[1]` = x[2], ...). x NULL NULL returned.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":null,"dir":"Reference","previous_headings":"","what":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"set functions inspect data frame anticipate problems writing REDCap's API.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"","code":"validate_for_write( d, convert_logical_to_integer, record_id_name )  validate_data_frame_inherits( d )  validate_no_logical( d, stop_on_error = FALSE )  validate_field_names( d, stop_on_error = FALSE )  validate_record_id_name( d, record_id_name = \"record_id\", stop_on_error = FALSE )  validate_repeat_instance( d, stop_on_error = FALSE )  validate_uniqueness( d, record_id_name, stop_on_error = FALSE)"},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"d base::data.frame() tibble::tibble() containing dataset used update REDCap project. record_id_name name field represents one record. default name REDCap \"record_id\". stop_on_error TRUE, error thrown violations. Otherwise, dataset summarizing problems returned. convert_logical_to_integer mimics convert_logical_to_integer parameter  redcap_write() checking potential importing problems. Defaults FALSE.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"tibble::tibble(), potential violation row. two columns : field_name: name field/column/variable might cause problems upload. field_index: position field.  (example, value '1' indicates first column, '3' indicates third column.) concern: description problem potentially caused field. suggestion: potential solution concern.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"functions listed Usage section inspect specific aspect dataset.  validate_for_write() function executes individual validation checks.  allows client check everything one call. Currently, individual checks include: validate_data_frame_inherits(d): d inherits base::data.frame() validate_field_names(d): columns d start lowercase letter, subsequent optional characters sequence () lowercase letters, (b) digits 0-9, /(c) underscores. (exact regex ^[-z][0-9a-z_]*$.) validate_record_id_name(d): d contains field called \"record_id\", whatever value passed record_id_name. validate_no_logical(d) (unless convert_logical_to_integer TRUE): d contain logical values (REDCap typically wants 0/1 values instead FALSE/TRUE). validate_repeat_instance(d): d integer redcap_repeat_instance, column present. validate_uniqueness(d, record_id_name = record_id_name): d contain multiple rows duplicate values record_id, redcap_event_name, redcap_repeat_instrument, redcap_repeat_instance (depending longitudinal & repeating structure project). Technically duplicate rows errors, feel almost always unintentional, lead irrecoverable corruption data. encounter additional types problems attempting write REDCap, please tell us creating new issue, incorporate new validation check function.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"official documentation can found 'API Help Page' 'API Examples' pages REDCap wiki (.e., https://community.projectredcap.org/articles/456/api-documentation.html https://community.projectredcap.org/articles/462/api-examples.html). account wiki, please ask campus REDCap administrator send static material.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"Beasley","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/reference/validate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inspect a dataset to anticipate problems before writing to a REDCap project — validate","text":"","code":"d1 <- data.frame(   record_id      = 1:4,   flag_logical   = c(TRUE, TRUE, FALSE, TRUE),   flag_Uppercase = c(4, 6, 8, 2) ) REDCapR::validate_for_write(d = d1) #> # A tibble: 2 × 4 #>   field_name     field_index concern                                  suggestion #>   <chr>          <chr>       <chr>                                    <chr>      #> 1 flag_Uppercase 3           A REDCap project does not allow field n… Change th… #> 2 flag_logical   2           The REDCap API does not automatically c… Convert t…  REDCapR::validate_for_write(d = d1, convert_logical_to_integer = TRUE) #> # A tibble: 1 × 4 #>   field_name     field_index concern                                  suggestion #>   <chr>          <chr>       <chr>                                    <chr>      #> 1 flag_Uppercase 3           A REDCap project does not allow field n… Change th…  # If `d1` is not a data.frame, the remaining validation checks are skipped: # REDCapR::validate_for_write(as.matrix(mtcars)) # REDCapR::validate_for_write(c(mtcars, iris))  d2 <- tibble::tribble(   ~record_id, ~redcap_event_name, ~redcap_repeat_instrument, ~redcap_repeat_instance,   1L, \"e1\", \"i1\", 1L,   1L, \"e1\", \"i1\", 2L,   1L, \"e1\", \"i1\", 3L,   1L, \"e1\", \"i1\", 4L,   1L, \"e1\", \"i2\", 1L,   1L, \"e1\", \"i2\", 2L,   1L, \"e1\", \"i2\", 3L,   1L, \"e1\", \"i2\", 4L,   2L, \"e1\", \"i1\", 1L,   2L, \"e1\", \"i1\", 2L,   2L, \"e1\", \"i1\", 3L,   2L, \"e1\", \"i1\", 4L, ) validate_uniqueness(d2) #> # A tibble: 0 × 4 #> # ℹ 4 variables: field_name <chr>, field_index <chr>, concern <chr>, #> #   suggestion <chr> validate_for_write(d2) #> # A tibble: 0 × 4 #> # ℹ 4 variables: field_name <chr>, field_index <chr>, concern <chr>, #> #   suggestion <chr>  d3 <- tibble::tribble(   ~record_id, ~redcap_event_name, ~redcap_repeat_instrument, ~redcap_repeat_instance,   1L, \"e1\", \"i1\", 1L,   1L, \"e1\", \"i1\", 3L,   1L, \"e1\", \"i1\", 3L, # Notice this duplicates the row above ) # validate_uniqueness(d3) # Throws error: # validate_uniqueness(d3, stop_on_error = TRUE)"},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"upcoming-changes-in-v120","dir":"Changelog","previous_headings":"","what":"Upcoming Changes in v1.2.0","title":"Upcoming Changes in v1.2.0","text":"features yet CRAN. Install remotes::install_github(\"OuhscBbmc/REDCapR\")","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"possibly-breaking-change-1-2-0","dir":"Changelog","previous_headings":"","what":"Possibly Breaking Change","title":"Upcoming Changes in v1.2.0","text":"changes possibly break existing code –’s unlikely. feel (directly indirectly) improve package considerably. redcap_read(), redcap_read_oneshot(), redcap_dag_read(), redcap_log_read(), redcap_report() return tibble instead data.frame. (#415) affect client code expect call like ds[, 3] return vector instead single-column data.frame/tibble. One solution upcast tibble data.frame (something like .data.frame()). recommend using approach works data.frames tibbles, ds[[3]] dplyr::pull(ds, \"gender\"). information, read short chapter R Data Science. *_collapsed parameters deprecated. want limit records/fields/forms/events, pass vector characters, scalar character separated commas (think everyone already). words use c(\"demographics\", \"blood_pressure\") instead \"demographics,blood_pressure\". relationships four pairs variables: someone using *_collapsed parameter, can programmatically convert vector like: redcap_read() automatically include “plumbing” variables, even ’re included list requested fields & forms. (#442). Specifically: record_id (’s customized name) always returned redcap_event_name returned longitudinal projects redcap_repeat_instrument redcap_repeat_instance returned projects repeating instruments help extract forms longitudinal & repeating projects. redcap_read() redcap_read_oneshot() now return empty dataset records retrieved (records meet filter criteria). Currently 0x0 tibble returned, may change future. now error deliberately thrown. (#452) redcap_event_instruments() now default returns mappings arms. previous default return mappings first arm. recreate previous behavior use call like REDCapR::redcap_event_instruments(uri, token_2, arms = \"1\"). (Suggested @januz, #482) redcap_users_export() used return boolean user_rights, now can 0, 1, 2. (#523)","code":"records_collapsed   <- collapse_vector(records  , records_collapsed) fields_collapsed    <- collapse_vector(fields   , fields_collapsed) forms_collapsed     <- collapse_vector(forms    , forms_collapsed) events_collapsed    <- collapse_vector(events   , events_collapsed) field_names <- trimws(unlist(strsplit(field_names_collapsed, \",\")))"},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-1-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"Upcoming Changes in v1.2.0","text":"New redcap_metadata_coltypes() function. Inspects fields types validation text field generate suggested readr::col_types object reflects project’s current data dictionary. object can passed col_types parameter redcap_read() redcap_read_oneshot(). (Suggested discussed @pbchase, @nutterb, @skadauke, & others, #405 & #294) New redcap_log_read() function. Exports project’s log. (Thanks @joundso, #383, #320) New redcap_project_info_read() function. Exports project’s information, language production status. (Suggested @skadauke, @timothytsai, @pbchase, #236, #410) New parameter blank_for_gray_form_status functions redcap_read(), redcap_read_oneshot(), redcap_read_oneshot_eav(). (@greg-botwin, #386, #389) httr::handle value accepted functions contact server. accommodate institutions unconventional environments. (Suggested @brandonpotvin, #429) sanitized_token() now accepts alternative regex pattern. (Suggested @maeon & @michalkouril, #370) redcap_read_eav_oneshot() UNexported function returns data EAV format (#437) redcap_metadata_read() now correctly subsets forms (identified & corrected @ezraporter, #431 & #445) New redcap_event_read() function. Exports metadata associated project’s longitudinal events (@ezraporter, #457 & #460)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-enhancements-1-2-0","dir":"Changelog","previous_headings":"","what":"Minor Enhancements","title":"Upcoming Changes in v1.2.0","text":"Better documentation server url (suggested @sutzig #395) read_read_oneshot()’s parameter guess_max now allows floating point values support readr::read_csv() ability accept Inf value. (Suggested @eveyp, #392) pkgdown pages run & display examples, CRAN still doesn’t run . ’s illegal call external resources/APIs CRAN computers –mostly occasionally unavailable, code breaks. (#419) redcap_download_file_oneshot() redcap_file_download_oneshot() redcap_file_upload_oneshot() redcap_file_upload_oneshot() redcap_download_instrument() redcap_instrument_download() redcap_dag_read() new data_access_group_id field (introduced maybe 13.1.0) (#459) redcap_users_export() new mycap_participants field (introduced maybe 13.0.0) (#459) Accommodate older versions REDCap don’t return project-level variable, like has_repeating_instruments_or_events, missing_data_codes, external_modules, bypass_branching_erase_field_prompt (@-mad-statter, #465, #466) redcap_meta_coltypes() correctly determines data type autonumber record_id fields. suggests character project DAGs, integer . (@pwildenhain, #472) redcap_log_read() now returns new column reflecting affected record id value (ref #478) redcap_read() redcap_read_oneshot() now remove “pseudofields” (e.g., redcap_event_name, redcap_repeat_instrument, & redcap_repeat_instance) fields parameter. Starting REDCap v13.4.10, error thrown server. REDCap return message common pseudofield requested explicitly user. (#477) redcap_event_instruments() now can return mappings arms, instead one arm per call.(Suggested @januz, #482) validate_data_frame_inherits() validate_field_names() validate_record_id_name() validate_uniqueness() validate_repeat_instance() validate_no_logical() redcap_read() checks event parameter throws error value recognized, project longitudinal (#493) regex regex_named_captures() forgiving ’s unnecessary leading space (@BlairCooper, #495, #501) redcap_log_read() assumes columns character, except timestamp (#525) redcap_file_download_oneshot() longer asks unnecessary parameter repeating_instrument (REDCap server ignores). (@BlairCooper, #506, #530) redcap_read() redcap_read_oneshot() accommodate readr::read_csv()’s parameter na. (Suggested @rmtrane #529)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-110-released-2022-08-10","dir":"Changelog","previous_headings":"","what":"Version 1.1.0 (released 2022-08-10)","title":"Version 1.1.0 (released 2022-08-10)","text":"CRAN release: 2022-08-10","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-1-1-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 1.1.0 (released 2022-08-10)","text":"New redcap_delete() function. deletes vector records. (Thanks @joundso, #372, #373) New redcap_arm_export() function. retrieves list REDCap project arms. (#375) redcap_read() redcap_read_oneshot() accept new locale parameter specifies date, time, number formats, like using comma decimal separator. readr::locale object. (#377, suggested @joundso) New redcap_instruments() function exports list data collection instruments project. (#381, @vcastro) New redcap_event_instruments() function exports instrument-event mappings project (.e., data collection instruments designated certain events longitudinal project). (#381, @vcastro) New redcap_dag_read() function returns Data Access Groups project (#382, @joundso) New detection REDCap trouble large request drops records. (#400 w/ @TimMonahan)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-enhancements-1-1-0","dir":"Changelog","previous_headings":"","what":"Minor Enhancements","title":"Version 1.1.0 (released 2022-08-10)","text":"sanitize_token() now allows lowercase characters –addition uppercase characters & digits. (#347, @jmbarbone) redcap_metadata_read() now uses json (instead csv) transfer dictionary server & client. accommodates super-wide dictionaries 35k+ variables. user shouldn’t notice difference, still receive data.frame. (#335, @januz & @datalorax) Include testthat::skip_on_cran() calls comply CRAN’s “fail gracefully” policy. Similarly, skip remaining examples depend external resources. (#352) retrieve_credential_local() can now user username identify desired credential row (#364) redcap_read() redcap_read_oneshot() gain http_response_encoding parameter ’s passed httr::content(). default value remains “UTF-8”. (#354, @lrasmus) Accommodate single-character REDCap variable names (#367 & #368, @daynefiler) Modify redcap_users_export() (calls REDCap’s user export). API dropped data_export variable added forms_export variable. (#396) redcap_read_oneshot_eav(): project isn’t longitudinal, dummy value event_id used internally (#396) testing server & projects, http errors little different, testing code adjusted (#396) Set httr::user_agent, following advice httr’s vignette (#397)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"test-suite-1-1-0","dir":"Changelog","previous_headings":"","what":"Test Suite","title":"Version 1.1.0 (released 2022-08-10)","text":"Added two dictionaries super wide -5k & 35k variables (#335 & #360, @januz & @datalorax) Read, modify, & read projects DAGs (#353, daniela.wolkersdorfer, #353)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-100-released-2021-07-21","dir":"Changelog","previous_headings":"","what":"Version 1.0.0 (released 2021-07-21)","title":"Version 1.0.0 (released 2021-07-21)","text":"CRAN release: 2021-07-22 package stable years reflected major version number.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-enhancements-1-0-0","dir":"Changelog","previous_headings":"","what":"Minor Enhancements","title":"Version 1.0.0 (released 2021-07-21)","text":"writing records server, functions redcap_write() redcap_write_oneshot() new parameter converts R’s logical/boolean columns integers. meshes well T/F Y/N items coded 1/0 underneath. default FALSE (ie, integers converted default), doesn’t break existing code. (#305) writing records server, functions redcap_write() redcap_write_oneshot() can toggle ability overwrite blank/NA cells (suggested @auricap, #315) functions redcap_read_oneshot(), redcap_read(), & redcap_read_oneshot_eav() now support parameters datetime_range_begin datetime_range_end. passed REDCap parameters dateRangeBegin dateRangeEnd, restricts records returned, based last modified date server. (Thanks @pbchase, #321 & #323.) Better documentation export_survey_fields parameter functions redcap_read() & redcap_read_oneshot(). (Thanks @isaactpetersen, #333) New function redcap_report() export records populate REDCap report. (#326.) New vignette Typical REDCap Workflow Data Analyst developed support workshop 2021 R/Medicine Conference (#332, @higgi13425, @kamclean, & Amanda Miller) New function create_credential_local() starts well-formed csv file can contain tokens. (#340, conversations @higgi13425 & @kamclean.)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"stability-features-1-0-0","dir":"Changelog","previous_headings":"","what":"Stability Features","title":"Version 1.0.0 (released 2021-07-21)","text":"update newer version testthat -v3.0.0 (#312) update newer version readr 2.0.0 (#343) update newer version readr 1.4.0 (#313) update newer version REDCap test server (#310) save expected datasets files -instead included actual test code (#308)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"corrections--bug-fixes-1-0-0","dir":"Changelog","previous_headings":"","what":"Corrections & Bug Fixes","title":"Version 1.0.0 (released 2021-07-21)","text":"Accepts one config_option element. (Proposed @BastienRance, #307) Fixed calculation success value returned redcap_read() redcap_write() parameter continue_on_error true. (Bug found @llrs, #317) redcap_survey_link_export_oneshot() documentation corrected & improved (@jrob95, #526)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-0110-released-2020-04-20","dir":"Changelog","previous_headings":"","what":"Version 0.11.0 (Released 2020-04-20)","title":"Version 0.11.0 (Released 2020-04-20)","text":"CRAN release: 2020-04-21","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"breaking-changes-possible-but-unlikely-0-11-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes (possible, but unlikely)","title":"Version 0.11.0 (Released 2020-04-20)","text":"kernel_api() defaults “text/csv” UTF-8 encoding. Formerly, function decide content-type encoding. details ‘Stability Features’ subsection. constant() longer accepts simplify options. integer vector always returned. (#280)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-11-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.11.0 (Released 2020-04-20)","text":"’s now possible specify exact col_types (readr::cols object) passed readr::read_csv() inside redcap_read_oneshot(). (#258) reader::type_convert() used batches stacked top . way, batches incompatible data types ’re combined. (#257; thanks @isaactpetersen #245) Consequently, guess_max parameter redcap_read() longer serves purpose, soft-deprecated. (#267) redcap_metadata_write() writes project’s metadata. (#274, @felixetorres) redcap_survey_link_export_oneshot() retrieves URL specific record’s survey (e.g., “https://bbmc.ouhsc.edu/redcap/surveys/?s=8KuzSLMHf6”) (#293) convert_logical_to_integer new parameter redcap_write() redcap_write_oneshot(). TRUE, [base::logical] columns ds cast integer uploading REDCap. Boolean values typically represented 0/1 REDCap radio buttons. Defaults FALSE maintain backwards compatibility. (#305)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"stability-features-0-11-0","dir":"Changelog","previous_headings":"","what":"Stability Features","title":"Version 0.11.0 (Released 2020-04-20)","text":"httr::content() (inside kernel_api()) now processes returned value “text/csv”, default. prevent strange characters tricking process internal variable raw_text formed. See [httr::content()](https://httr.r-lib.org/reference/content.html) documentation list possible values thecontent_type` parameter. (Thanks great debugging @vortexing #269, @sybandrew #272, & @begavett, #290) Similarly, kernel_api() now encoding parameter, defaults “UTF-8”. (#270)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-enhancements-0-11-0","dir":"Changelog","previous_headings":"","what":"Minor Enhancements","title":"Version 0.11.0 (Released 2020-04-20)","text":"check bad field names passed read records functions (#288)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"corrections-0-11-0","dir":"Changelog","previous_headings":"","what":"Corrections","title":"Version 0.11.0 (Released 2020-04-20)","text":"‘checkmate’ package now imported, suggested (Thanks @dtenenba, #255). Allow one httr::config() parameter passed (Thanks @BastienRance, #307).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-0102-released-2019-09-22","dir":"Changelog","previous_headings":"","what":"Version 0.10.2 (Released 2019-09-22)","title":"Version 0.10.2 (Released 2019-09-22)","text":"CRAN release: 2019-09-23","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-new-features-0-10-2","dir":"Changelog","previous_headings":"","what":"Minor New Features","title":"Version 0.10.2 (Released 2019-09-22)","text":"export survey time-stamps optionally (Issue #159) redcap_next_free_record_name(): API call ‘Generate Next Record Name’, returns next available record ID (Issue #237) redcap_read() redcap_read_oneshot() allow user specify variables returned character data type. default allow readr::read_csv() guess data type. (#194) redcap_read_oneshot() allows use specify many rows considered readr::read_csv() guesses data type. (#194) redcap_read(), redcap_read_oneshot(), redcap_read_oneshot_eav() always return Linux-style line endings (ie \\n) instead Windows style line endings (ie, \\r\\n) OSes. (#198) read_metadata() always returns character vectors variables. readr 1.2.0, column returned differently . (#193) ‘raw_or_label_headers’ now supported (Thanks Hatem Hosny - hatemhosny, #183 & #203) ‘export_checkbox_labels’ now supported (#186) redcap_users_export() now included (#163) ‘forms’ now supported redcap_read(), redcap_read_oneshot(), & redcap_read_oneshot_eav()(#206). already implemented redcap_metadata_read(). records affected, zero-length character vector returned (instead sometimes zero-length numeric vector) (#212) New function (called constants()) easily exposes REDCap-specific constants. (#217) id_position allows user specify record_id isn’t first position (#207). However, recommend REDCap projects keep important variable first data dictionary. Link new secure Zenodo DOI resolver (@katrinleinweber #191) parameters redcap_read() redcap_read_oneshot() consistent order raw REDCap API. (#204) verbose parameter NULL, value getOption(“verbose”) used. (#215) guess_max parameter provided redcap_read() (longer just redcap_read_oneshot()). Suggested @isaactpetersen #245. Documentation website constructed pkgdown (#224). redcap_variables() now throws error passed bad URI (commit e542155639bbb7).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"modified-internals-0-10-2","dir":"Changelog","previous_headings":"","what":"Modified Internals","title":"Version 0.10.2 (Released 2019-09-22)","text":"interaction REDCap server goes new kernal_api() function, uses ‘httr’ ‘curl’ packages underneath. now, function called packages directly. (#213) converting REDCap’s CSV R’s data.frame, readr::read_csv() used instead utils::read.csv() (Issue #127). updated readr 1.2.0 (#200). changed data variables assigned data types. uses odbc package retrieve credentials token server. Remove RODBC RODBCext (#188). Thanks @krlmlr error checking advice https://stackoverflow.com//50419403/1082435. data.table::rbindlist() replaced dplyr::bind_rows() checkmate package inspects function parameters now (instead testit::assert() base:stop() ) (#190 & #208). collapse_vector() refactored tested (#209) remove dependency pkgload package (#218) Update Markdown syntax new formatting problems (#253)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"deprecated-features-0-10-2","dir":"Changelog","previous_headings":"","what":"Deprecated Features","title":"Version 0.10.2 (Released 2019-09-22)","text":"retrieve_token_mssql(), retrieve_credential_mssql() general useful.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-098-released-2017-05-18","dir":"Changelog","previous_headings":"","what":"Version 0.9.8 (Released 2017-05-18)","title":"Version 0.9.8 (Released 2017-05-18)","text":"CRAN release: 2017-05-18","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-9-8","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.9.8 (Released 2017-05-18)","text":"Enumerate exported variables. redcap_variables(). Experimental EAV export redcap_read_oneshot_eav(), can accessed triple colon (ie, REDCapR::redcap_read_oneshot_eav()).","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"bug-fixes-0-9-8","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"Version 0.9.8 (Released 2017-05-18)","text":"Adapted new 2.4 version curl (see #154)","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-07-1-released-2014-12-17","dir":"Changelog","previous_headings":"","what":"Version 0.7-1 (Released 2014-12-17)","title":"Version 0.7-1 (Released 2014-12-17)","text":"CRAN release: 2014-12-18","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-7-1","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.7-1 (Released 2014-12-17)","text":"Updated Version 6.0.x REDCap (introduced lot improvements API behavior).","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-6","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.6 (Released 2014-11-03)","text":"config_options httr package exposed REDCapR user. See issues #55 & #58; thanks @rparrish @nutterb contributions (https://github.com/OuhscBbmc/REDCapR/issues/55 & https://github.com/OuhscBbmc/REDCapR/issues/58).","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-5","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.5 (Released 2014-10-19)","text":"redcap_metadata_read() tested public.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"minor-updates-0-5","dir":"Changelog","previous_headings":"","what":"Minor Updates","title":"Version 0.5 (Released 2014-10-19)","text":"Test suite now uses testthat::skip_on_cran() call involving OUHSC’s REDCap server. Vignette example subsetting, conditioned second variable’s value.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"version-04-28-released-2014-09-20","dir":"Changelog","previous_headings":"","what":"Version 0.4-28 (Released 2014-09-20)","title":"Version 0.4-28 (Released 2014-09-20)","text":"CRAN release: 2014-09-20","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-4-28","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.4-28 (Released 2014-09-20)","text":"redcap_write() redcap_write_oneshot() now tested public. redcap_write() redcap_write_oneshot() now tested public. redcap_download_file_oneshot() function contributed John Aponte (@johnaponte; Pull request #35) redcap_upload_file_oneshot() function contributed @johnaponte (Pull request #34) Users can specify operation continue error occurs batch read write. Regardless choice, debugging output written console verbose==TRUE. Follows advice @johnaponte, Benjamin Nutter (@nutterb), Rollie Parrish (@rparrish). Closes #43.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"breaking-changes-0-4-28","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"Version 0.4-28 (Released 2014-09-20)","text":"records_collapsed default empty value now empty string (.e., \"\") instead NULL. applies records_collapsed either parameter, returned value.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"updates-0-4-28","dir":"Changelog","previous_headings":"","what":"Updates","title":"Version 0.4-28 (Released 2014-09-20)","text":"default, SSL certs come httr package. However, REDCapR continue maintain copy case httr’s version CRAN gets date. tests split two collections: one ’s run CRAN checks, run manually. Thanks, Gabor Csardi. test dependency outside package code (especially REDCap test projects) run manually changes test databases won’t affect success building previous version CRAN. Corrected typo redcap_download_file_oneshot() documentation, thanks Andrew Peters (@ARPeters #45).","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-3","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.3 (Released 2014-09-01)","text":"Relies httr package, provides benefits like status code message can captured (eg, 200-OK, 403-Forbidden, 404-NotFound). See https://cran.r-project.org/package=httr.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"updates-0-3","dir":"Changelog","previous_headings":"","what":"Updates","title":"Version 0.3 (Released 2014-09-01)","text":"Renamed former status_message outcome_message. message associated http code returned conventionally called ‘status messages’ (eg, OK, Forbidden, Found). operation successful, raw_text value (formerly called raw_csv) returned empty string save RAM. ’s really necessary httr’s status message exposed.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"bug-fixes-0-3","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"Version 0.3 (Released 2014-09-01)","text":"Correct batch reads longitudinal schema #27","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-2","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.2 (Released 2014-07-02)","text":"Added redcap_column_sanitize() function address non-ASCII characters Added redcap_write() (internal function). redcap_project() object reduces repeatedly passing parameters like server URL, user token, SSL cert location.","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"updates-0-2","dir":"Changelog","previous_headings":"","what":"Updates","title":"Version 0.2 (Released 2014-07-02)","text":"New Mozilla SSL Certification Bundles released cURL (released 2013-12-05) Renamed redcap_read_batch() redcap_read(). changes reflect suggestion reads typically batched. Renamed redcap_read() redcap_read_oneshot() Renamed redcap_write() redcap_write_oneshot() (internal function). Small renames parameters","code":""},{"path":[]},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"new-features-0-1","dir":"Changelog","previous_headings":"","what":"New Features","title":"Version 0.1 (Released 2014-01-14)","text":"Introduces redcap_read() redcap_read_batch() documentation SSL verify peer default, using cert file included package Initial submission GitHub","code":""},{"path":"https://ouhscbbmc.github.io/REDCapR/news/index.html","id":"enhancements-0-1","dir":"Changelog","previous_headings":"","what":"Enhancements","title":"Version 0.1 (Released 2014-01-14)","text":"redcap_read() takes parameter raw_or_label (Thanks Rollie Parrish #3) redcap_read() takes parameter export_data_access_groups thanks Rollie Parrish (@rparrish #4) GitHub Commits Releases detailed change log, please see https://github.com/OuhscBbmc/REDCapR/commits/main. list major releases, please see https://github.com/OuhscBbmc/REDCapR/releases.","code":""}]