Restore behavior of tm_t_abnormality_by_wrong as it was before migration#1539
Merged
averissimo merged 4 commits intoJun 26, 2026
Conversation
Contributor
Contributor
Unit Test Performance Difference
Additional test case details
Results for commit dc73eb3 ♻️ This comment has been updated with latest results. |
Contributor
|
Writing down here what we discussed this morning, the 2 modules in this PR have implementations that need some standardizing, so despite the PR looking good they will suffer some changes. Let's either integrate those changes on the modules or apply this PR after. Keeping PR open until then. |
averissimo
approved these changes
Jun 9, 2026
averissimo
left a comment
Contributor
There was a problem hiding this comment.
Good fix, ok to merge.
I've noticed something about the modules, but I'm creating a new PR
# Pull Request
### Changes description
- Uses `teal`'s validation input framework
- Fixes problem with module stalling when selected worst flag does not
exist
- It can be tested using the following app and selecting "N"
### Example app (inherited from other PR)
```r
devtools::load_all()
data <- teal_data()
data <- within(data, {
ADSL <- teal.modules.clinical::tmc_ex_adsl
ADLB <- teal.modules.clinical::tmc_ex_adlb %>%
dplyr::filter(!AVISIT %in% c("SCREENING", "BASELINE"))
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
ADSL <- data[["ADSL"]]
ADLB <- data[["ADLB"]]
app <- init(
data = data,
modules = modules(
tm_t_abnormality_by_worst_grade(
label = "Laboratory Test Results with Highest Grade Post-Baseline",
dataname = "ADLB",
arm_var = choices_selected(
choices = variable_choices(ADSL, subset = c("ARM", "ARMCD")),
selected = "ARM"
),
paramcd = choices_selected(
choices = value_choices(ADLB, "PARAMCD", "PARAM"),
selected = c("ALT", "CRP", "IGA")
),
worst_flag_indicator = teal.transform::choices_selected(c("Y", "N")),
add_total = FALSE
)
),
filter = teal_slices(
teal_slice("ADSL", "SAFFL", selected = "Y"),
teal_slice("ADLB", "ONTRTFL", selected = "Y")
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
```
---------
Signed-off-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Oriol Senan <35930244+osenan@users.noreply.github.com>
averissimo
merged commit Jun 26, 2026
b681610
into
279-interactive_variables@main
24 of 37 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
It fixes this comment here. We had slightly changed the behavior of the module after the migration. This PR keeps the use of
teal.picks::valuesbut allowing to use multiple worst flag indicators.Test it with the example on the module:
You should see the module working and two options available.
Note: If you select "N" as worst flag indicator it will fail to compute the table. (It says it is computing and it never finishes). But it also happens in the example module before migration, that allowed multiple values and the "N" just does not work. It needs the right data that can allow multiple correct worst flag indicator. But the example proves that the multiple values are in the UI and used by the module.