% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/REDCapSyncProject.R
\name{project}
\alias{project}
\alias{REDCapSyncProject}
\title{REDCapSync Project Object}
\value{
An R6 \code{REDCapSyncProject} class generator for internal use. Users interact
with instances created by \link{setup_project} or \link{load_project}.
}
\description{
\link[R6:R6Class]{R6} project object for managing REDCap data access and
synchronization. The project object is your main interface to REDCap data
through the \link{REDCapSync} package. It stores your REDCap configuration, data,
metadata, and provides methods to sync, transform, and export your data.
}
\details{
\subsection{Workflow}{

\strong{Initialize} a project with \code{\link[=setup_project]{setup_project()}}:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{project <- setup_project(
  project_name = "FIRST_PROJECT",
  redcap_uri = "https://redcap.yourinstitution.edu/api/",
  dir_path = "~/redcap_projects"
)
}\if{html}{\out{</div>}}

\strong{Synchronize} REDCap data into your project object using the REDCap API
and log-based change detection:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{project$sync()
}\if{html}{\out{</div>}}

\strong{Load} previously saved REDCap project object using cache:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{project <- load_project("FIRST_PROJECT)
projects$names() # should see "FIRST_PROJECT"
}\if{html}{\out{</div>}}

\strong{Access} REDCap data, metadata, and users via read-only fields:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{project$data           # Named list of REDCap forms/instruments
project$metadata       # REDCap field definitions, forms, and choices
project$redcap$users   # REDCap user information
project$redcap$log     # REDCap log information

# you can bypass read-only if needed
users <- project$redcap$users
}\if{html}{\out{</div>}}

\strong{Transform and export} your data into clean, analysis-ready datasets to be
used in R and/or Excel:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{project$add_dataset("analysis_data", ...) # adds to project for re-use
project$save_datasets() # can save to Excel but is also part of future syncs
}\if{html}{\out{</div>}}

\strong{Upload} corrected or new data back to REDCap:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{project$upload(updated_data)
}\if{html}{\out{</div>}}
}

\subsection{Design Features}{

The project object uses \strong{log-based sync}: Since REDCap maintains a detailed
change log, \code{project$sync()} only retrieves and updates records that have
changed since the last sync. This dramatically reduces API calls and improves
performance for large projects.

All methods use \strong{method chaining}: Methods invisibly return the project
object (self), allowing fluent code:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{dataset <- load_project("TEST_CLASSIC")$sync()$load_dataset("REDCapSync")
}\if{html}{\out{</div>}}
}

\subsection{Read-Only Fields}{
\itemize{
\item \code{project$project_name}: Project identifier (set with \link{setup_project})
\item \code{project$dir_path}: Persistent storage directory (set with \link{setup_project})
\item \code{project$data}: Named list of synchronized REDCap forms
\item \code{project$metadata}: REDCap field metadata (forms, fields, choices)
\item \code{project$redcap}: REDCap project info, users, and activity log
\item \code{project$.internal}: Internal project object (for advanced use)
}
}

\subsection{TEST Projects}{

All TEST projects start with "TEST_" and by default the average user cannot
create a project that starts with "TEST_". They are produced from actual
server REDCap projects but never contained real data and were scrubbed of
any "real" user/log data. They are subject to change in future versions as
the package matures. Keep in mind there are many combinations of REDCap
structures to account for.

TEST projects are meant to be used for demonstration and testing
purposes. In general, try to use actual REDCap project(s) to explore the
package.

This is how to load a project with or without specifying a directory.

\if{html}{\out{<div class="sourceCode r">}}\preformatted{# return the list of available test projects
REDCapSync::projects$test_names()

project <- load_project("TEST_CLASSIC")

YOUR_DIRECTORY <- getwd()
project <- setup_project("TEST_CLASSIC", dir_path = YOUR_DIRECTORY)
# now can test object functions (does not use API)
project$sync() # will also save datasets
}\if{html}{\out{</div>}}

The currently available TEST projects are as follows:
\itemize{
\item \code{TEST_CLASSIC}: Classic project (nothing repeats). Has every data type.
Contains data for survival analysis testing. Contains comments.
\item \code{TEST_REPEATING}: Non-longitudinal project with repeating instruments.
\item \code{TEST_LONGITUDINAL}: Longitudinal project (with events).
\item \code{TEST_MULTIARM}: Multi-arm and longitudinal project.
\item \code{TEST_EDGE}: Edge-case project. Meant to test things that may be uncommon
but should be accounted for as package matures.
\item \code{TEST_DATA}: Placeholder project meant to contain more rich test dataset.
\item \code{TEST_CANCER}: Placeholder project meant to contain more rich test dataset.
\item \code{TEST_REDCAPR_SIMPLE}: Borrowed with permission from \link[REDCapR:REDCapR]{REDCapR}.
\item \code{TEST_REDCAPR_LONGITUDINAL}: Borrowed with permission from \link[REDCapR:REDCapR]{REDCapR}.
\item \code{TEST_REDCAPR_CLIN_TRIAL}: Borrowed with permission from \link[REDCapR:REDCapR]{REDCapR}.
}
}
}
\examples{
# Load a test project
projects$test_names() # available test projects
project <- setup_project("TEST_CLASSIC", dir_path = tempdir())

# Sync data from REDCap
project$sync()

# Access data and metadata
head(project$data$text)
project$metadata$fields[1:5, ]

forms <- project$metadata$forms # unchanged metadata
fields <- project$metadata$fields # unchanged metadata
choices <- project$metadata$choices # unchanged metadata

users <- project$redcap$users # unchanged users
log <- project$redcap$log # unchanged log

project$test_token()

dataset <- project$load_dataset("REDCapSync")

}
\seealso{
\code{vignette("REDCapSync", package = "REDCapSync")}
\link{projects} for shortcuts of cached setup projects
\code{vignette("Tokens", package = "REDCapSync")}
\link{setup_project} for initializing projects
\link{dataset} for using the dataset objects
\code{vignette("Datasets", package = "REDCapSync")}
\code{vignette("Uploads", package = "REDCapSync")}
}
\section{Active bindings}{
  \if{html}{\out{<div class="r6-active-bindings">}}
  \describe{
    \item{\code{project_name}}{Read-only character string of project_name as
assigned with \link{setup_project}.}

    \item{\code{dir_path}}{Read-only directory path assigned with \link{setup_project}.}

    \item{\code{data}}{Read-only named list where each name is an instrument name.
See public methods for \link{REDCapSyncProject}.}

    \item{\code{metadata}}{Read-only named list with REDCap metadata. See
public methods for \link{REDCapSyncProject}.}

    \item{\code{redcap}}{Read-only named list with REDCap information including
users and log.}

    \item{\code{.internal}}{Read-only internal project object for custom workflows}
  }
  \if{html}{\out{</div>}}
}
\section{Methods}{
\subsection{Public methods}{
  \itemize{
    \item \href{#method-REDCapSyncProject-initialize}{\code{REDCapSyncProject$new()}}
    \item \href{#method-REDCapSyncProject-print}{\code{REDCapSyncProject$print()}}
    \item \href{#method-REDCapSyncProject-sync}{\code{REDCapSyncProject$sync()}}
    \item \href{#method-REDCapSyncProject-add_dataset}{\code{REDCapSyncProject$add_dataset()}}
    \item \href{#method-REDCapSyncProject-load_dataset}{\code{REDCapSyncProject$load_dataset()}}
    \item \href{#method-REDCapSyncProject-remove_datasets}{\code{REDCapSyncProject$remove_datasets()}}
    \item \href{#method-REDCapSyncProject-generate_dataset}{\code{REDCapSyncProject$generate_dataset()}}
    \item \href{#method-REDCapSyncProject-save_datasets}{\code{REDCapSyncProject$save_datasets()}}
    \item \href{#method-REDCapSyncProject-save_dataset}{\code{REDCapSyncProject$save_dataset()}}
    \item \href{#method-REDCapSyncProject-save}{\code{REDCapSyncProject$save()}}
    \item \href{#method-REDCapSyncProject-set_keyring_token}{\code{REDCapSyncProject$set_keyring_token()}}
    \item \href{#method-REDCapSyncProject-test_token}{\code{REDCapSyncProject$test_token()}}
    \item \href{#method-REDCapSyncProject-url_launch}{\code{REDCapSyncProject$url_launch()}}
    \item \href{#method-REDCapSyncProject-url_record_launch}{\code{REDCapSyncProject$url_record_launch()}}
    \item \href{#method-REDCapSyncProject-upload}{\code{REDCapSyncProject$upload()}}
  }
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-initialize"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-initialize}{}}}
\subsection{\code{REDCapSyncProject$new()}}{
  Active binding are read-only


  The end user will not see \code{project$new()}. This is handled internally.
Users should construct objects using \code{\link[=setup_project]{setup_project()}}. The remain
methods will be accessible to any user.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$new(project)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{project}}{a list object meant to be stored internally within R6}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-print"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-print}{}}}
\subsection{\code{REDCapSyncProject$print()}}{
  Print some key project information
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$print()}
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-sync"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-sync}{}}}
\subsection{\code{REDCapSyncProject$sync()}}{
  Updates the REDCap data for (\code{project} object) by checking REDCap log for
changes. Sync is performed according to the \code{sync_frequency} set in
\code{\link[=setup_project]{setup_project()}} by default. Use \code{hard_check} to force a check, or \code{ hard_reset} to force a complete refresh. As a default, this object will
be saved to your directory when necessary.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$sync(
  save_datasets = TRUE,
  save_to_dir = TRUE,
  hard_check = FALSE,
  hard_reset = FALSE
)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{save_datasets}}{Logical. Save dataset outputs during sync. Default is
\code{TRUE}.}
      \item{\code{save_to_dir}}{Logical. Save updated project object to directory. Default
is \code{TRUE}.}
      \item{\code{hard_check}}{Logical. Force REDCap API check regardless of
\code{sync_frequency}. Default is \code{FALSE}.}
      \item{\code{hard_reset}}{Logical. Overwrite existing dataset files. Default is
\code{FALSE}.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-add_dataset"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-add_dataset}{}}}
\subsection{\code{REDCapSyncProject$add_dataset()}}{
  Add a new dataset entry
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$add_dataset(
  dataset_name,
  transformation_type = "default",
  merge_form_name = "merged",
  filter_field = NULL,
  filter_choices = NULL,
  filter_list = NULL,
  filter_strict = TRUE,
  field_names = NULL,
  form_names = NULL,
  exclude_identifiers = FALSE,
  exclude_free_text = FALSE,
  date_handling = "none",
  labelled = TRUE,
  clean = TRUE,
  drop_blanks = FALSE,
  drop_missing_codes = FALSE,
  drop_others = NULL,
  include_metadata = TRUE,
  include_records = TRUE,
  include_users = TRUE,
  include_log = FALSE,
  annotate_from_log = TRUE,
  include_comments = TRUE,
  with_links = TRUE,
  separate = FALSE,
  use_csv = FALSE,
  dir_other = NULL,
  file_name = NULL,
  hard_reset = FALSE
)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{dataset_name}}{Character. Name of the dataset configuration to create,
load, or reference.}
      \item{\code{transformation_type}}{Character. How to transform data: "default"
(merge non-repeating then add to repeating), "none" (no transformation), or
"merge_non_repeating" (merge non-repeating only). Default is "default".}
      \item{\code{merge_form_name}}{Character. Name for the merged non-repeating form.
Default is "merged".}
      \item{\code{filter_field}}{Character. Field name to filter dataset on.}
      \item{\code{filter_choices}}{Vector. Allowed values for \code{filter_field}.}
      \item{\code{filter_list}}{List. Named list where names are field names and values
are allowed value sets. Alternative to \code{filter_field}/\code{filter_choices}.}
      \item{\code{filter_strict}}{Logical. If \code{TRUE}, filter all forms. If \code{FALSE}, apply
filter only to records (ID column). Default is \code{TRUE}.}
      \item{\code{field_names}}{Character vector. Fields to include. Default \code{NULL}
includes all fields.}
      \item{\code{form_names}}{Character vector. Forms to include. Default \code{NULL} includes
all forms.}
      \item{\code{exclude_identifiers}}{Logical. Exclude identifier fields. Default is
\code{TRUE}.}
      \item{\code{exclude_free_text}}{Logical. Exclude free-text fields (for
deidentification). Default is \code{FALSE}.}
      \item{\code{date_handling}}{Character. Date handling strategy: "none",
"exclude_dates", "random_shift_by_record", "random_shift_by_project",
"zero_by_record", or "zero_by_project". Default is "none".}
      \item{\code{labelled}}{Logical. Convert to labelled data if \code{TRUE}. Default is
\code{TRUE}.}
      \item{\code{clean}}{Logical. Clean data (standardize missing values). Default is
\code{TRUE}.}
      \item{\code{drop_blanks}}{Logical. Drop records with blank fields. Default is
\code{TRUE}.}
      \item{\code{drop_missing_codes}}{Logical. Convert REDCap missing codes to \code{NA}.
Default is \code{FALSE}.}
      \item{\code{drop_others}}{Character vector of additional values to drop.}
      \item{\code{include_metadata}}{Logical. Include field metadata in dataset. Default
is \code{TRUE}.}
      \item{\code{include_records}}{Logical. Include record-level information. Default is
\code{TRUE}.}
      \item{\code{include_users}}{Logical. Include user information. Default is \code{TRUE}.}
      \item{\code{include_log}}{Logical. Include REDCap activity log. Default is \code{FALSE}.}
      \item{\code{annotate_from_log}}{Logical. Annotate data using the REDCap log. Default
is \code{TRUE}.}
      \item{\code{include_comments}}{Logical. Include field comments. Default is \code{TRUE}.}
      \item{\code{with_links}}{Logical. Include hyperlinks in Excel exports. Default is
\code{FALSE}.}
      \item{\code{separate}}{Logical. Separate each form into distinct files (vs.
multi-tab Excel). Default is \code{FALSE}.}
      \item{\code{use_csv}}{Logical. Use CSV format instead of Excel. Default is \code{FALSE}.}
      \item{\code{dir_other}}{Character. Output directory (default is project's \code{output}
folder).}
      \item{\code{file_name}}{Character. Dataset file name (default is
\verb{<project_name>_<dataset_name>}).}
      \item{\code{hard_reset}}{Logical. Overwrite existing dataset files. Default is
\code{FALSE}.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-load_dataset"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-load_dataset}{}}}
\subsection{\code{REDCapSyncProject$load_dataset()}}{
  Load dataset if previously defined with \code{add_dataset}.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$load_dataset(dataset_name, envir = NULL)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{dataset_name}}{Character. Name of the dataset configuration to create,
load, or reference.}
      \item{\code{envir}}{Environment to assign dataset objects. Default is \code{NULL}.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-remove_datasets"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-remove_datasets}{}}}
\subsection{\code{REDCapSyncProject$remove_datasets()}}{
  Clear all or specified datasets from the \code{project} object.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$remove_datasets(dataset_names = NULL)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{dataset_names}}{Character vector. Dataset names to remove/operate on.
Default is \code{NULL}.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-generate_dataset"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-generate_dataset}{}}}
\subsection{\code{REDCapSyncProject$generate_dataset()}}{
  Generate \link{dataset} object. This is usually handled
internally for some default behavior but is provided here for ad-hoc
custom datasets.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$generate_dataset(
  dataset_name,
  envir = NULL,
  transformation_type = "default",
  merge_form_name = "merged",
  filter_field = NULL,
  filter_choices = NULL,
  filter_list = NULL,
  filter_strict = TRUE,
  field_names = NULL,
  form_names = NULL,
  exclude_identifiers = FALSE,
  exclude_free_text = FALSE,
  date_handling = "none",
  labelled = TRUE,
  clean = TRUE,
  drop_blanks = FALSE,
  drop_missing_codes = FALSE,
  drop_others = NULL,
  include_metadata = TRUE,
  include_records = TRUE,
  include_users = TRUE,
  include_log = FALSE,
  annotate_from_log = TRUE,
  include_comments = FALSE
)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{dataset_name}}{Character. Name of the dataset configuration to create,
load, or reference.}
      \item{\code{envir}}{Environment to assign dataset objects. Default is \code{NULL}.}
      \item{\code{transformation_type}}{Character. How to transform data: "default"
(merge non-repeating then add to repeating), "none" (no transformation), or
"merge_non_repeating" (merge non-repeating only). Default is "default".}
      \item{\code{merge_form_name}}{Character. Name for the merged non-repeating form.
Default is "merged".}
      \item{\code{filter_field}}{Character. Field name to filter dataset on.}
      \item{\code{filter_choices}}{Vector. Allowed values for \code{filter_field}.}
      \item{\code{filter_list}}{List. Named list where names are field names and values
are allowed value sets. Alternative to \code{filter_field}/\code{filter_choices}.}
      \item{\code{filter_strict}}{Logical. If \code{TRUE}, filter all forms. If \code{FALSE}, apply
filter only to records (ID column). Default is \code{TRUE}.}
      \item{\code{field_names}}{Character vector. Fields to include. Default \code{NULL}
includes all fields.}
      \item{\code{form_names}}{Character vector. Forms to include. Default \code{NULL} includes
all forms.}
      \item{\code{exclude_identifiers}}{Logical. Exclude identifier fields. Default is
\code{TRUE}.}
      \item{\code{exclude_free_text}}{Logical. Exclude free-text fields (for
deidentification). Default is \code{FALSE}.}
      \item{\code{date_handling}}{Character. Date handling strategy: "none",
"exclude_dates", "random_shift_by_record", "random_shift_by_project",
"zero_by_record", or "zero_by_project". Default is "none".}
      \item{\code{labelled}}{Logical. Convert to labelled data if \code{TRUE}. Default is
\code{TRUE}.}
      \item{\code{clean}}{Logical. Clean data (standardize missing values). Default is
\code{TRUE}.}
      \item{\code{drop_blanks}}{Logical. Drop records with blank fields. Default is
\code{TRUE}.}
      \item{\code{drop_missing_codes}}{Logical. Convert REDCap missing codes to \code{NA}.
Default is \code{FALSE}.}
      \item{\code{drop_others}}{Character vector of additional values to drop.}
      \item{\code{include_metadata}}{Logical. Include field metadata in dataset. Default
is \code{TRUE}.}
      \item{\code{include_records}}{Logical. Include record-level information. Default is
\code{TRUE}.}
      \item{\code{include_users}}{Logical. Include user information. Default is \code{TRUE}.}
      \item{\code{include_log}}{Logical. Include REDCap activity log. Default is \code{FALSE}.}
      \item{\code{annotate_from_log}}{Logical. Annotate data using the REDCap log. Default
is \code{TRUE}.}
      \item{\code{include_comments}}{Logical. Include field comments. Default is \code{TRUE}.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-save_datasets"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-save_datasets}{}}}
\subsection{\code{REDCapSyncProject$save_datasets()}}{
  saves datasets to Excel via setting provided to
\code{add_dataset}.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$save_datasets(hard_reset = FALSE)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{hard_reset}}{Logical. Overwrite existing dataset files. Default is
\code{FALSE}.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-save_dataset"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-save_dataset}{}}}
\subsection{\code{REDCapSyncProject$save_dataset()}}{
  saves dataset to Excel via setting provided to
\code{add_dataset}.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$save_dataset(dataset_name)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{dataset_name}}{Character. Name of the dataset configuration to create,
load, or reference.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-save"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-save}{}}}
\subsection{\code{REDCapSyncProject$save()}}{
  Save project object to directory chosen with
\link{setup_project}.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$save()}
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-set_keyring_token"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-set_keyring_token}{}}}
\subsection{\code{REDCapSyncProject$set_keyring_token()}}{
  Set keyring token. See vignette and config for detail.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$set_keyring_token()}
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-test_token"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-test_token}{}}}
\subsection{\code{REDCapSyncProject$test_token()}}{
  test connection via communication with API.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$test_token(keyring_if_error = TRUE)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{keyring_if_error}}{Logical. Launch pop-up for keyring if token is not
valid or fails to call REDCap. Max 3 attempts. Default is \code{TRUE}.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-url_launch"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-url_launch}{}}}
\subsection{\code{REDCapSyncProject$url_launch()}}{
  opens links in browser.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$url_launch(link_type = "home", open_browser = TRUE)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{link_type}}{Character. REDCap link type: "base", "home", "record_home",
"records_dashboard", "api", "api_playground", "codebook", "user_rights",
"setup", "logging", "designer", "dictionary", "data_quality", or
"identifiers".}
      \item{\code{open_browser}}{Logical. Open link in browser. Default is \code{TRUE}.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-url_record_launch"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-url_record_launch}{}}}
\subsection{\code{REDCapSyncProject$url_record_launch()}}{
  opens record links in browser.
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$url_record_launch(
  record = NULL,
  page = NULL,
  instance = NULL,
  open_browser = TRUE
)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{record}}{Character. Record ID.}
      \item{\code{page}}{Character. REDCap form/instrument name.}
      \item{\code{instance}}{Character. Repeating instance number.}
      \item{\code{open_browser}}{Logical. Open link in browser. Default is \code{TRUE}.}
    }
    \if{html}{\out{</div>}}
  }
}

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-REDCapSyncProject-upload"></a>}}
\if{latex}{\out{\hypertarget{method-REDCapSyncProject-upload}{}}}
\subsection{\code{REDCapSyncProject$upload()}}{
  This will only overwrite and new data. It will not directly delete any
data. Because this is a function that can mess up your data, use it
very carefully. Remember all changes are saved in the REDCap log if
there's an issue. Missing rows and columns are allowed!
  \subsection{Usage}{
    \if{html}{\out{<div class="r">}}
    \preformatted{REDCapSyncProject$upload(to_be_uploaded)}
    \if{html}{\out{</div>}}
  }
  \subsection{Arguments}{
    \if{html}{\out{<div class="arguments">}}
    \describe{
      \item{\code{to_be_uploaded}}{Data frame in raw coded format ready to upload to
REDCap.}
    }
    \if{html}{\out{</div>}}
  }
}

}
