render_redcap_instrument: Render REDCap Instrument

View source: R/mod_REDCap.R

render_redcap_instrumentR Documentation

Render REDCap Instrument

Description

This function will select the appropriate shiny widget translation function based on the provided parameters. Used to loop over REDCap project information to create an entire data collection instrument which may consist of multiple questions/question types.

Usage

render_redcap_instrument(
  shinyREDCap_type,
  id,
  field_label,
  required,
  choices,
  current_subject_data = NULL,
  ...
)

Arguments

shinyREDCap_type

A string indicating a supported shinyREDCap question type. Valid options include: "shinyREDCap_text", "shinyREDCap_date", "shinyREDCap_dropdown", "shinyREDCap_truefalse", "shinyREDCap_yesno", "shinyREDCap_radio", "shinyREDCap_checkbox", "shinyREDCap_notes", "shinyREDCap_integer"

id

A string, containing a globally unique REDCap question identifier. Used to create a valid Shiny inputID.

field_label

A string containing the question being asked. May contain html formatting.

required

A string, "yes" or "no". Is this a required REDCap question type?

choices

REDCap choices for the question.

current_subject_data

Previously saved REDCap data on the current subject.

...

Any additional parameters to pass to shiny widget inputs.

Value

A shiny input widget for the UI


ReviewR documentation built on Sept. 1, 2023, 5:08 p.m.