Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
060314d
feat: add S3 method dispatch for picks or teal transform variables
Mar 12, 2026
975ae0a
tests: add test for tm_g_ae_oview module
Mar 12, 2026
b6fd8f6
chore: fix spelling
Mar 12, 2026
d68f94a
chore: fix sign credentials
osenan Mar 12, 2026
3dd972e
[skip style] [skip vbump] Restyle files
github-actions[bot] Mar 12, 2026
89ecbea
Update DESCRIPTION
osenan Mar 16, 2026
630f5bf
Update R/tm_g_ae_oview_picks.R
osenan Mar 16, 2026
2869ce9
Update R/tm_g_ae_oview_picks.R
osenan Mar 16, 2026
c2f07a3
Update R/tm_g_ae_oview_picks.R
osenan Mar 16, 2026
bf70fff
chore: update docs after fix style
osenan Mar 16, 2026
88fbf7e
chore: fix typo in description
osenan Mar 16, 2026
8bd9bd3
refactor: change defaults on ae_oview generic and use dataname directly
osenan Mar 16, 2026
584c88b
refactor: add only necessary arguments to the UI
osenan Mar 17, 2026
b3f3eb0
fix: update test after refactor on method
osenan Mar 17, 2026
e00faee
[skip style] [skip vbump] Restyle files
github-actions[bot] Mar 17, 2026
440b9fe
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] Mar 17, 2026
5abc2ca
chore: fix linters and examples
osenan Mar 17, 2026
df0f269
[skip style] [skip vbump] Restyle files
github-actions[bot] Mar 17, 2026
b7219f0
chore: fix R CMD check and lintr
osenan Mar 17, 2026
640f80e
[skip style] [skip vbump] Restyle files
github-actions[bot] Mar 17, 2026
6e6e222
chore: fix styler and linter
osenan Mar 17, 2026
73c6f60
chore: revert to magrittr pipe
osenan Mar 17, 2026
8ca1bc1
chore: remove pipe consistency linter as we need magrittr pipes
osenan Mar 17, 2026
0e4d1bc
Update R/tm_g_ae_oview.R
osenan Mar 17, 2026
af68495
refactor: use as.picks to reuse picks srv and ui in choices_selected
osenan Mar 18, 2026
e5e9dad
chore: fix lintr comment to avoid automatic restyling
osenan Mar 18, 2026
5f0cfc2
Update R/tm_g_ae_oview_picks.R
osenan Mar 18, 2026
0c0b079
refactor: simplify and avoid S3 method dispatch
osenan Apr 8, 2026
b91a4f7
chore: remove references to unused methods
osenan Apr 8, 2026
756d9a4
chore: fix lintrs from CI
osenan Apr 8, 2026
ea0558b
refactor: avoid using parent envirionment and simplify conversion
osenan Apr 9, 2026
1678829
Update R/tm_g_ae_oview.R
osenan Apr 10, 2026
af27484
Update R/utils.R
osenan Apr 10, 2026
bce4924
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
github-actions[bot] Apr 10, 2026
4c910e5
Merge branch 'redesign_extraction@main' into oriol_ae_oview_picks@main
osenan Jun 21, 2026
f79e49d
chore: simplify DESCRIPTION and NAMESPACE
osenan Jun 21, 2026
e26de58
refactor: reuse functions from teal.modules.clinical for teal.transfo…
osenan Jun 21, 2026
d539dc1
chore: trigger CI on feature branch
osenan Jun 21, 2026
8f19a12
chore: fix R CMD check
osenan Jun 22, 2026
e8572b5
[skip style] [skip vbump] Restyle files
github-actions[bot] Jun 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Imports:
teal.code (>= 0.7.0),
teal.data (>= 0.8.0),
teal.logger (>= 0.4.0),
teal.picks (>= 0.1.0),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

teal.transform is in the Depends, and teal.picks is a substitute, so should also be in the Depends. the same we did in tmc

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, changed

teal.reporter (>= 0.6.0),
teal.widgets (>= 0.5.0),
tern (>= 0.9.7),
Expand All @@ -50,9 +51,11 @@ Suggests:
withr (>= 3.0.0)
Remotes:
insightsengineering/osprey
insightsengineering/teal.picks@redesign_exptraction@main
Comment thread
osenan marked this conversation as resolved.
Outdated
Config/Needs/verdepcheck: insightsengineering/osprey, rstudio/shiny,
insightsengineering/teal, insightsengineering/teal.slice,
insightsengineering/teal.transform, mllg/checkmate, tidyverse/dplyr,
insightsengineering/teal, insightsengineering/teal.picks,
insightsengineering/teal.slice, insightsengineering/teal.transform,
mllg/checkmate, tidyverse/dplyr,
insightsengineering/formatters, tidyverse/ggplot2, r-lib/lifecycle,
daroczig/logger, rstudio/shinyvalidate, insightsengineering/teal.code,
insightsengineering/teal.logger, insightsengineering/teal.reporter,
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Generated by roxygen2: do not edit by hand

S3method(tm_g_ae_oview,default)
S3method(tm_g_ae_oview,picks)
export(label_aevar)
export(plot_decorate_output)
export(quick_filter)
Expand Down
52 changes: 42 additions & 10 deletions R/tm_g_ae_oview.R
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
#' Teal module for the `AE` overview
#' @title Teal module for the `AE` overview
Comment thread
osenan marked this conversation as resolved.
Outdated
#'
#' @description
#'
#' Display the `AE` overview plot as a shiny module
#'
#' This is an S3 generic that dispatches on the class of `flag_var_anl`:
#' - [choices_selected][teal.transform::choices_selected()] dispatches to the
#' default method.
#' - [picks][teal.picks::picks()] dispatches to the picks method.
#'
#' @inheritParams teal.widgets::standard_layout
#' @inheritParams teal::module
#' @inheritParams argument_convention
#' @param flag_var_anl ([`teal.transform::choices_selected`])
#' `choices_selected` object with variables used to count adverse event
#' @param flag_var_anl Either a ([`teal.transform::choices_selected`])
#' `choices_selected` object or a (`[picks][teal.picks::picks()]`)
#' object with variables used to count adverse event
#' sub-groups (e.g. Serious events, Related events, etc.)
#'
#' @param dataname (`character(1)`) Name of the events dataset. Required when
#' using the default method with [choices_selected][teal.transform::choices_selected()].
#' Ignored by the `.picks` method.
#' @inherit argument_convention return
#' @inheritSection teal::example_module Reporting
#'
#' @export
#'
#' @examples
#' data <- teal_data() %>%
#' within({
Expand Down Expand Up @@ -47,7 +53,7 @@
#' join_keys(data) <- default_cdisc_join_keys[names(data)]
#'
#' ADAE <- data[["ADAE"]]
#'
#' # Using default method (choices selected)
#' app <- init(
#' data = data,
#' modules = modules(
Expand All @@ -73,14 +79,40 @@
#' shinyApp(app$ui, app$server)
#' }
#'
#' @export
tm_g_ae_oview <- function(label,
dataname,
arm_var,
flag_var_anl,
dataname = NULL,
arm_var = teal.picks::picks(
teal.picks::datasets(),
teal.picks::variables(
choices = teal.picks::is_categorical(min.len = 2),
selected = 1L
)
),
flag_var_anl = teal.picks::picks(
Comment thread
averissimo marked this conversation as resolved.
Outdated
teal.picks::datasets(),
teal.picks::variables(
choices = teal.picks::is_categorical(min.len = 2),
selected = 1L
)
),
Comment thread
averissimo marked this conversation as resolved.
Outdated
fontsize = c(5, 3, 7),
plot_height = c(600L, 200L, 2000L),
plot_width = NULL,
transformators = list()) {
UseMethod("tm_g_ae_oview", flag_var_anl)
Comment thread
averissimo marked this conversation as resolved.
Outdated
}

#' @rdname tm_g_ae_oview
#' @export
tm_g_ae_oview.default <- function(label,
dataname,
arm_var,
flag_var_anl,
fontsize = c(5, 3, 7),
plot_height = c(600L, 200L, 2000L),
plot_width = NULL,
transformators = list()) {
message("Initializing tm_g_ae_oview")
Comment thread
averissimo marked this conversation as resolved.
checkmate::assert_class(arm_var, classes = "choices_selected")
checkmate::assert_class(flag_var_anl, classes = "choices_selected")
Expand Down Expand Up @@ -295,13 +327,13 @@
"Treatment or Control not found in Arm Variable. Perhaps they have been filtered out?"
))

q1 <- obj %>%

Check warning on line 330 in R/tm_g_ae_oview.R

View workflow job for this annotation

GitHub Actions / SuperLinter 🦸‍♀️ / Lint R code 🧶

file=R/tm_g_ae_oview.R,line=330,col=19,[pipe_consistency_linter] Use the |> pipe operator instead of the %>% pipe operator.
teal.code::eval_code(
code = as.expression(c(
bquote(anl_labels <- formatters::var_labels(.(as.name(dataname)), fill = FALSE)),
bquote(
flags <- .(as.name(dataname)) %>%

Check warning on line 335 in R/tm_g_ae_oview.R

View workflow job for this annotation

GitHub Actions / SuperLinter 🦸‍♀️ / Lint R code 🧶

file=R/tm_g_ae_oview.R,line=335,col=47,[pipe_consistency_linter] Use the |> pipe operator instead of the %>% pipe operator.
select(all_of(.(input$flag_var_anl))) %>%

Check warning on line 336 in R/tm_g_ae_oview.R

View workflow job for this annotation

GitHub Actions / SuperLinter 🦸‍♀️ / Lint R code 🧶

file=R/tm_g_ae_oview.R,line=336,col=57,[pipe_consistency_linter] Use the |> pipe operator instead of the %>% pipe operator.
rename_at(vars(.(input$flag_var_anl)), function(x) paste0(x, ": ", anl_labels[x]))
)
))
Expand Down
Loading
Loading