Skip to contents

A shiny module. Used to display figures and tables of a study-specific form and will be accessible in through the study form tab on the main page.

Usage

mod_study_forms_server(
  id,
  r,
  form,
  form_items,
  id_item = c("subject_id", "event_name", "item_group", "form_repeat", "item_name"),
  table_names = NULL,
  item_info
)

Arguments

id

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

r

Common reactive values. Used to access the data frames review_data, filtered_data, and the active subject_id. The latter is used to show data in the tables of the active subject id, and to highlight data in the figures. The data frame filtered data should contain a column "item_type". If all values in "item_type" are "continuous", time-series figures will be shown.

form

A character string with the name of the form to display.

form_items

A named character vector with the names of the expected variables defined in the applicable form. Used in the UI to create a filter with drop-down menu, to select the desired variables in a figure. Used in the module Server to make sure that all expected columns are always created, even if some variables are implicitly missing (which might occur if there are not yet any values available for a specific variable). Also, implicitly missing variables might give errors if part of the script relies on the variables' presence. See also the parameter expected_columns in create_table.default().

id_item

Character vector containing the column names of the columns that can uniquely identify one item/row.

table_names

An optional character vector. If provided, will be used within datatable_custom(), to improve the column names in the final interactive tables.

item_info

A data frame containing the names of the study forms (in the column item_group), and the columns item_scale use_unscaled_limits, which are used to customize the way the figures are shown in the page.

Details

The module displays tables and figures, and shows data of the currently active subject. In the figures, the data can easily be compared with data of other study participants. Data that is new or updated will have large points, so that the reviewer can focus on new data. By default, all items of a form will be shown, but the reviewer can select single or multiple variables to focus on in the figure. There is also an option to switch from graphical view to table view. In a table view, the same data will be shown in wide-table format, with new/updated data shown in bold. If the values contain units, the original units will be shown. The Study forms module is used in the main app_server to create all applicable study form pages.