Skip to content

Commit

Permalink
Update tm_t_binary_outcome.R (#582)
Browse files Browse the repository at this point in the history
* Fix in tm_t_binary_outcome.R

Co-authored-by: Dawid Kałędkowski <dawid.kaledkowski@gmail.com>
  • Loading branch information
Polkas and gogonzo authored Sep 8, 2022
1 parent 910478e commit ff86fe8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

### Bug fixes
* Fixed bug in `tm_g_barchart_simple` which prevented graph from being shown.
* Fixed bug in `tm_g_forest_rsp` when endpoint was deselected.
* Fixed broken example for `tm_t_abnormality_by_worst_grade`.
* Fixed bug in the `tm_t_binary_outcome`, crashed the app when deselecting all `paramcd`.

### Miscellaneous
* Added `nestcolor` dependency and replaced deprecated function `tern::color_palette` with `nestcolor::color_palette`
Expand Down
9 changes: 8 additions & 1 deletion R/tm_g_forest_rsp.R
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,18 @@ srv_g_forest_rsp <- function(id,
),
handlerExpr = {
aval_var <- anl_merged()$columns_source$aval_var
paramcd_level <- unlist(anl_merged()$filter_info$paramcd[[1]]$selected)
if (length(paramcd_level) == 0) {
return(NULL)
}

sel_param <- if (is.list(default_responses)) {
default_responses[[input[[extract_input("paramcd", paramcd$filter[[1]]$dataname, filter = TRUE)]]]]
default_responses[[paramcd_level]]
} else {
default_responses
}


common_rsp <- if (is.list(sel_param)) {
sel_param$rsp
} else {
Expand Down
5 changes: 3 additions & 2 deletions R/tm_t_binary_outcome.R
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,9 @@ srv_t_binary_outcome <- function(id,
),
handlerExpr = {
aval_var <- anl_merged()$columns_source$aval_var
sel_param <- if (is.list(default_responses)) {
default_responses[[input[[extract_input("paramcd", paramcd$filter[[1]]$dataname, filter = TRUE)]]]]
paramcd <- input[[extract_input("paramcd", paramcd$filter[[1]]$dataname, filter = TRUE)]]
sel_param <- if (is.list(default_responses) && (!is.null(paramcd))) {
default_responses[[paramcd]]
} else {
default_responses
}
Expand Down

0 comments on commit ff86fe8

Please sign in to comment.