Shiny module. Used to display common form data in the dedicated tab.
Usage
mod_common_forms_server(
id,
form,
form_data,
form_review_data,
form_items,
active_subject,
id_item = c("subject_id", "event_name", "item_group", "form_repeat", "item_name"),
table_names = NULL,
timeline_data
)
Arguments
- id
Character string, used to connect the module UI with the module Server.
- form
A character string with the name of the form to display.
- form_data
A reactive value containing the study data of the respective form.
- form_review_data
A reactive value containing the review data of the respective form.
- 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 parameterexpected_columns
increate_table.default()
.- active_subject
A reactive value containing the active subject ID.
- 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.- timeline_data
A reactive with a data frame containing the timeline data. Used to create the timeline figure. Created with
get_timeline_data()
.
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.