surveyMethods: Export Survey Participant Information

View source: R/docsSurveyMethods.R

surveyMethodsR Documentation

Export Survey Participant Information

Description

These methods enable the user to export information relating to survey participants.

Usage

exportSurveyParticipants(rcon, instrument, event, ...)

exportSurveyLink(rcon, record, instrument, event, repeat_instance = 1, ...)

exportSurveyQueueLink(rcon, record, ...)

exportSurveyReturnCode(
  rcon,
  record,
  instrument,
  event,
  repeat_instance = 1,
  ...
)

## S3 method for class 'redcapApiConnection'
exportSurveyParticipants(
  rcon,
  instrument = NULL,
  event = NULL,
  ...,
  error_handling = getOption("redcap_error_handling"),
  config = list(),
  api_param = list()
)

## S3 method for class 'redcapApiConnection'
exportSurveyLink(
  rcon,
  record,
  instrument,
  event = NULL,
  repeat_instance = 1,
  ...,
  error_handling = getOption("redcap_error_handling"),
  config = list(),
  api_param = list()
)

## S3 method for class 'redcapApiConnection'
exportSurveyQueueLink(
  rcon,
  record,
  ...,
  error_handling = getOption("redcap_error_handling"),
  config = list(),
  api_param = list()
)

## S3 method for class 'redcapApiConnection'
exportSurveyReturnCode(
  rcon,
  record,
  instrument,
  event = NULL,
  repeat_instance = 1,
  ...,
  error_handling = getOption("redcap_error_handling"),
  config = list(),
  api_param = list()
)

Arguments

rcon

A redcapConnection object.

record

character(1) or integerish(1). The record ID of a survey participant.

instrument

character(1). The name of a survey instrument.

event

character(1) The event name of the event for which participant information should be exported.

repeat_instance

integerish(1). The repeat instance if the instrument is designated as a repeating instrument. Default value is 1.

...

Arguments to pass to other methods

error_handling

character(1). One of c("error", "null"). An option for how to handle errors returned by the API. see redcapError().

config

A named list. Additional configuration parameters to pass to httr::POST(). These are appended to any parameters in rcon$config.

api_param

A named list. Additional API parameters to pass into the body of the API call. This provides users to execute calls with options that may not otherwise be supported by redcapAPI.

Value

exportSurveyParticipants returns a data frame with the columns:

email The e-mail address of the participant.
email_occurrence The number of times the invitation has been sent (after the next invite).
identifier Participant identifier (if it exists) to match the survey response to a participant.
record Record ID of the participant.
invitation_sent_status Boolean value indicating if a survey invitation has been sent.
invitation_send_time Date/time the survey invitation was sent.
response_status Boolean value indicating if the participant has responded.
survey_access_code The participant's survey access code.
survey_link The participant's survey link.
survey_queue_link The participants' survey queue link.

exportSurveyLink returns a character(1) giving the link for the user to access the survey form.

exportSurveyQueueLink returns a character(1) giving the survey queue link for the user.

exportSurveyReturnCode returns a character(1) giving the survey return code for the user.

Functions

  • exportSurveyParticipants(): Export survey participants for a survey instrument.

  • exportSurveyLink(): Export a survey participant's survey instrument link.

  • exportSurveyQueueLink(): Export a survey participant's survey queue link.

  • exportSurveyReturnCode(): Export a survey participant's instrument return code.

Examples

## Not run: 
unlockREDCap(connections = c(rcon = "project_alias"), 
             url = "your_redcap_url", 
             keyring = "API_KEYs", 
             envir = globalenv())
             
# Export survey participants
exportSurveyParticipants(rcon, 
                         instrument = "survey_form")
                         
# Export survey participants for an event
exportSurveyParticipants(rcon, 
                         instrument = "survey_form", 
                         event = "event_1_arm_1")
                         
# Export survey link
exportSurveyLink(rcon, 
                 record = 1, 
                 instrument = "survey_form")
                 
# Export survey queue link
exportSurveyQueueLink(rcon, 
                      record = 1)
                      
# Export survey return code
exportSurveyReturnCode(rcon, 
                       user = 1, 
                       instrument = "survey_form")

## End(Not run)


redcapAPI documentation built on Sept. 13, 2023, 1:07 a.m.