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_subjectsis needed to verify whether an ID selected in thetablerowis in the active, filtered selection.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, andtrigger_page_change. The module will create these variables if they are not yet available innavinfo.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
navtableis converted to aDT::datatable()object inoutput$DTnavtable,tablerowshould beinput$DTnavtable_table_rows_selected. See also theDT::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 isNULL, 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.
