Per-participant adverse-event timelines colored by severity, with seriousness highlighting and filters.
The chart below is live — rendered by the safety.viz
aeTimelines module on the package’s example data, with the
full control sidebar.
The same chart ships as a gsm-idiom report workflow. Run it with
gsm.core::RunWorkflow() to produce a standalone HTML
report, or use the matching runner script:
lWorkflow <- yaml::read_yaml(
system.file("workflow", "3_reports", "ae_timelines.yaml", package = "gsm.safety")
)
gsm.core::RunWorkflow(
lWorkflow = lWorkflow,
lData = list(dfResults = ExampleData("adae"))
)
Rscript inst/examples/ae-timelines.R <output-dir>
ae_timelines.yaml workflow
meta:
Type: Report
ID: ae_timelines
Output: html
Name: AE Timelines Report
Description: Interactive safety.viz adverse-event timelines, one row per participant.
lSettings:
color:
value_col: AESEV
label: Severity
highlight:
value_col: AESER
label: Serious Event
value: Y
filters:
- value_col: AESER
label: Serious Event
- value_col: AESEV
label: Severity
- value_col: ARM
label: Treatment Group
- value_col: USUBJID
label: Participant ID
details:
- value_col: AEBODSYS
label: Body System
- value_col: AEDECOD
label: Dictionary-Derived Term
sort_participants: earliest
spec:
dfResults:
USUBJID:
type: character
AETERM:
type: character
ASTDY:
type: numeric
steps:
- output: strOutputDir
name: getwd
- output: lWidget
name: gsm.safety::Widget_AeTimelines
params:
dfResults: dfResults
lSettings: lSettings
- output: strReportPath
name: gsm.safety::SaveWidgetReport
params:
widget: lWidget
strOutputDir: strOutputDir
strOutputFile: ID
library(gsm.safety)
dfResults <- ExampleData("adae")
Widget_AeTimelines(
dfResults,
lSettings = list(
color = list(
value_col = "AESEV",
label = "Severity"
),
highlight = list(
value_col = "AESER",
label = "Serious Event",
value = "Y"
),
filters = list(
list(value_col = "AESER", label = "Serious Event"),
list(value_col = "AESEV", label = "Severity"),
list(value_col = "ARM", label = "Treatment Group"),
list(value_col = "USUBJID", label = "Participant ID")
),
details = list(
list(value_col = "AEBODSYS", label = "Body System"),
list(value_col = "AEDECOD", label = "Dictionary-Derived Term")
),
sort_participants = "earliest"
)
)