Skip to contents

Shiny module. Used to display common form data in the dedicated tab.

Usage

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

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_tables, and the active subject_id. review_data will be used to determine which rows will be displayed in bold and, for the form Adverse events, which timeline data should be highlighted.

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 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.

Details

The module displays tables of common form data in a wide format. Included common forms are currently: Adverse events, Medical History, Medication, and Conc. Procedures. The applicable forms can be flexibly changed in the metadata. The tables shown are overview tables in wide format, similar to the ones in mod_study_forms_server(). When the common form Adverse events is selected, the module will show an additional table with Severe Adverse Events above the table with Adverse Events. In addition, it will show a timeline by calling module mod_timeline_ui()/mod_timeline_server(). The timeline shows study events (such as drug administrations) and study visits together with Adverse Events, so that temporal relationships between these events can be quickly revealed. The common forms module is used in the main server to create all applicable common form pages.