Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add links in compare large scale characteristics #261

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
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
15 changes: 11 additions & 4 deletions inst/shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ server <- function(input, output, session) {
# summarise_large_scale_characteristics -----
## Tidy summarise_large_scale_characteristics -----
getTidyDataSummariseLargeScaleCharacteristics <- shiny::reactive({
browser()

if (is.null(dataFiltered$summarise_large_scale_characteristics)) {
validate("No large scale characteristics in results")
}
Expand Down Expand Up @@ -765,6 +765,7 @@ browser()
})
## Tidy large_scale_characteristics ----
createTidyDataCompareLargeScaleCharacteristics <- shiny::reactive({

lscFiltered <- filterLargeScaleCharacteristics()

if (nrow(lscFiltered) == 0) {
Expand Down Expand Up @@ -825,16 +826,22 @@ browser()
target_cohort,
comparator_cohort)

cols <- list(target_cohort= colDef(name = target_cohort,
sortNALast = TRUE),
cols <- list(target_cohort = colDef(name = target_cohort,
sortNALast = TRUE),
comparator_cohort = colDef(name = comparator_cohort,
sortNALast = TRUE),
"Concept name (concept ID)" = colDef(name = "Concept name (concept ID)",
cell = function(value){
value_concept <- gsub(".*\\(|\\)","",value)
url <- sprintf("https://athena.ohdsi.org/search-terms/terms/%s", value_concept)
htmltools::tags$a(href = url, target = "_blank", as.character(value))
}),
"Standardised mean difference" = colDef(name = "Standardised mean difference",
sortNALast = TRUE)
)
names(cols)[1] <- target_cohort
names(cols)[2] <- comparator_cohort

reactable::reactable(tbl,
defaultSorted = list("Standardised mean difference" = "desc"),
columns = cols,
Expand Down
Loading