Communication with DaVinci modules
communication.RmdThe Clinical Timelines module is capable of communicating with other DaVinci modules like the Patient Profile module from {dv.papo} package. Communication in this sense means that the Clinical Timelines module sends out a subject ID which can be received and further processed by other modules. At the same moment, the tab of a DaVinci app switches to the receiver module.
The communication feature is optional and can be activated on the Clinical Timelines module side as follows. Note that there might be also activation needed on the counter module side (e.g. Patient Profile module side).
Activate communication on Clinical Timelines module side
As a default the receiver_id parameter in the
mod_clinical_timelines() call of your module list
definition is set to NULL which means that the
communication functionality is disabled. To enable switching to another
DaVinci module, set receiver_id to the module ID of your
counterpart module.
Example
Example code of a module list definition to turn the communication feature on between a Clinical Timelines and a Patient Profile module:
module_list <- list(
"Clinical Timelines" = mod_clinical_timelines(
module_id = "mod1",
basic_info = set_basic_info(
subjet_level_dataset_name = "adsl",
trt_start_var = "TRTSDT",
trt_end_var = "TRTEDT",
icf_date_var = "RFICDT"
),
mapping = list(
adsl = list("Treatment Start" = set_event(start_dt_var = "TRTSDT"))
),
drug_admin = set_drug_admin(
dataset_name = "adex",
trt_var = "EXTRT",
start_var = "EXSTDTC",
end_var = "EXENDTC",
detail_var = "EXTRT",
label = "Drug Administration",
dose_var = "EXDOSE",
dose_unit_var = "EXDOSU"
),
receiver_id = "mod2"
),
# Note that the focus here lies on the sender_ids parameter, not on the set up of mod_patient_profile()
"Patient Profiles" = dv.papo::mod_patient_profile(
module_id = "mod2",
subjid_var = "USUBJID",
sender_ids = "mod1"
)
)