constructLinkToRedcapForm: Construct a Link to a REDCap Form

View source: R/constructLinkToRedcapForm.R

constructLinkToRedcapFormR Documentation

Construct a Link to a REDCap Form

Description

Uses information from the project and a record to link to the form on which a data element is recorded. This is intended to be used within the report of invalid results when exporting or importing records. It should be noted that when importing records, the records may not yet exist and the links may not work.

Usage

constructLinkToRedcapForm(rcon, form_name, record_id, event_id = NULL, ...)

## S3 method for class 'redcapApiConnection'
constructLinkToRedcapForm(rcon, form_name, record_id, event_id = NULL, ...)

## S3 method for class 'redcapOfflineConnection'
constructLinkToRedcapForm(rcon, form_name, record_id, event_id = NULL, ...)

Arguments

rcon

A redcapConnection object.

form_name

character. The name of the form on which the field name exists.

record_id

character. The ID of the record being linked to. If passed as a numeric value, it will be coerced to character. Must have the same length as form_name.

event_id

character or NULL. For classical projects, use either NULL or NA (NA support is permitted to assist with vectorization). For longitudinal projects, the ID of the unique event. If passed as a numeric value, it will be coerced to character.

...

Arguments to pass to other methods

Details

Constructing a link to a REDCap form requires knowledge of the following:

  • The REDCap instance url (usually 'redcap.institution.domain').

  • The REDCap instance version number.

  • The REDCap project ID number

  • The record ID

  • The form name

  • The event ID number (if the project is longitudinal).

If any of these items in unknown, a missing value will be returned. For redcapOfflineConnections, the user will need to provide the version number, the project information, and the events (if the project is longitudinal) as part of the call to offlineConnection. Note that the REDCap User Interface does not include the event ID number with the file download for events.

Value

Returns a character vector the same length of form_name.


redcapAPI documentation built on Oct. 17, 2024, 5:07 p.m.