Skip to contents

A shiny module. Navigates to the subject and form that are mentioned in a selected table row. Designed to be used with DT::datatable(), since these tables can provide a reactive value with the tablerow highlighted on click.

Usage

mod_go_to_form_server(
  id,
  r,
  navinfo,
  navtable,
  tablerow,
  all_forms,
  form_name = "Form",
  subject_id = "subject_id"
)

Arguments

id

Character string, used to connect the module UI with the module Server.

r

Common reactive values. Used to send back information about the selected subject id (r$subject_id) to the main server. In addition, r$filtered_subjects is needed to verify whether an ID selected in the tablerow is in the active, filtered selection.

navinfo

Common reactive values. Used to send back the request for the change in form/subject id back to the server. Contains the character strings active_form, active_tab, and trigger_page_change. The module will create these variables if they are not yet available in navinfo.

navtable

A reactive value. Table to look up the form and subject id to navigate to.

tablerow

A reactive value. Table row associated with navtable to look up the form and subject id in. For example, if navtable is converted to a DT::datatable() object in output$DTnavtable, tablerow should be input$DTnavtable_table_rows_selected. See also the DT::datatable() documentation.

all_forms

A data frame containing two columns: a column named "form" with all the form to navigate through in the correct order, and a column named "main_tab", showing the name of the main_tab in which the form can be found.

form_name

Character vector. Name of the column containing forms. If defined, this column needs to be in the navtable. If this variable is NULL, it will default to the first variable in vars$all_forms.

subject_id

Character vector. Name of the column containing the subject identifiers. This column needs to be defined in the navtable.

See also

mod_go_to_form_server()