Adverse event prevalence by System Organ Class and preferred term, with per-arm rates, between-arm differences, and participant drill-down.

gsm.safety 1.0.0 · safety.viz 1.4.0 · rendered 2026-07-23

The chart below is live — rendered by the safety.viz aeExplorer module on the package’s example data, with the full control sidebar. Expand a System Organ Class to see its preferred terms, or click a row to list the participants behind it.

The bundled adae dataset uses the ADaM ADAE column names the module expects (USUBJID, AEBODSYS, AEDECOD, ARM), so the chart initializes with no settings at all; the settings below only add the filters and drill-down columns.

A note on denominators. ExampleData("adae") carries one placeholder row — a record with a blank System Organ Class — for each of the 37 participants who reported no adverse events. The module counts those participants in the population denominator but never renders them as events, so the prevalence rates below are over all 254 participants rather than only the 217 who had an event.

Render this report from a workflow

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_explorer.yaml", package = "gsm.safety")
)

gsm.core::RunWorkflow(
  lWorkflow = lWorkflow,
  lData = list(dfResults = ExampleData("adae"))
)
Rscript inst/examples/ae-explorer.R <output-dir>
The full ae_explorer.yaml workflow
meta:
  Type: Report
  ID: ae_explorer
  Output: html
  Name: Adverse Event Explorer Report
  Description: Interactive safety.viz adverse event explorer with per-arm prevalence, between-arm differences, and participant drill-down.
  lSettings:
    filters:
      - value_col: AESEV
        label: Severity
      - value_col: AESER
        label: Serious
    details:
      - value_col: AETERM
        label: Reported Term
      - value_col: AESEV
        label: Severity
      - value_col: ASTDY
        label: Start Day
spec:
  dfResults:
    USUBJID:
      type: character
    AEBODSYS:
      type: character
    AEDECOD:
      type: character
    ARM:
      type: character
steps:
  - output: strOutputDir
    name: getwd
  - output: lWidget
    name: gsm.safety::Widget_AeExplorer
    params:
      dfResults: dfResults
      lSettings: lSettings
  - output: strReportPath
    name: gsm.safety::SaveWidgetReport
    params:
      widget: lWidget
      strOutputDir: strOutputDir
      strOutputFile: ID

The live chart

library(gsm.safety)

dfResults <- ExampleData("adae")

Widget_AeExplorer(
  dfResults,
  lSettings = list(
    filters = list(
      list(value_col = "AESEV", label = "Severity"),
      list(value_col = "AESER", label = "Serious")
    ),
    details = list(
      list(value_col = "AETERM", label = "Reported Term"),
      list(value_col = "AESEV", label = "Severity"),
      list(value_col = "ASTDY", label = "Start Day")
    )
  )
)