Skip to content

Commit

Permalink
Merge pull request #156 from openpharma/jt-101-make_query_optional
Browse files Browse the repository at this point in the history
Make query handling optional
  • Loading branch information
LDSamson authored Jan 9, 2025
2 parents 6823955 + e408130 commit 2b241c3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: clinsight
Title: ClinSight
Version: 0.1.1.9013
Version: 0.1.1.9014
Authors@R: c(
person("Leonard Daniël", "Samson", , "[email protected]", role = c("cre", "aut"),
comment = c(ORCID = "0000-0002-6252-7639")),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
- Add a logging table to the DB for reviews.
- Simplify pulling data from DB for reviews.
- Review data by records IDs instead of subject & form
- Changed the legend to display 'significance pending' instead of 'significance pending'.
- Make query handling a configurable option
- Changed the legend to display 'significance pending' instead of 'significance unknown'.

## Bug fixes

Expand Down
24 changes: 15 additions & 9 deletions R/mod_main_sidebar.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ mod_main_sidebar_ui <- function(id){
bslib::card_header(mod_navigate_forms_ui(ns("navigate_forms_1"))),
htmltools::HTML("<br><br>"),
mod_review_forms_ui(ns("review_forms_1")),
htmltools::HTML("<hr><br>"),
mod_query_add_ui(ns("write_query"))
if (isTRUE(get_golem_config("allow_query_inputs"))) {
tagList(
htmltools::HTML("<hr><br>"),
mod_query_add_ui(ns("write_query"))
)
}
)
)
),
Expand Down Expand Up @@ -101,13 +105,15 @@ mod_main_sidebar_server <- function(
)
})

mod_query_add_server(
id = "write_query",
r = r,
active_form = reactive(navinfo$active_form),
db_path = db_path,
available_data = available_data
)
if (isTRUE(get_golem_config("allow_query_inputs"))) {
mod_query_add_server(
id = "write_query",
r = r,
active_form = reactive(navinfo$active_form),
db_path = db_path,
available_data = available_data
)
}

mod_review_forms_server(
id = "review_forms_1",
Expand Down
11 changes: 8 additions & 3 deletions R/mod_queries.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ mod_queries_ui <- function(id){
),
full_screen = TRUE
),
mod_query_follow_up_ui(ns("query_follow_up_1"))
if (isTRUE(get_golem_config("allow_query_inputs"))) {
mod_query_follow_up_ui(ns("query_follow_up_1"))
}
)
)
)
Expand Down Expand Up @@ -98,8 +100,11 @@ mod_queries_server <- function(id, r, navinfo, all_forms, db_path, table_names){
dplyr::mutate(reviewer = paste0(reviewer, " ", timestamp))
})

mod_query_follow_up_server("query_follow_up_1", r = r,
selected_query = selected_query, db_path = db_path)
if (isTRUE(get_golem_config("allow_query_inputs"))) {
mod_query_follow_up_server("query_follow_up_1", r = r,
selected_query = selected_query,
db_path = db_path)
}

initial_queries <- reactive({
df <- with(r$query_data, r$query_data[n == 1, ] )
Expand Down
3 changes: 2 additions & 1 deletion inst/golem-config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
default:
golem_name: clinsight
golem_version: 0.1.1.9013
golem_version: 0.1.1.9014
app_prod: no
user_identification: test_user
study_data: !expr clinsight::clinsightful_data
Expand All @@ -11,6 +11,7 @@ default:
Medical Monitor: medical_monitor
Data Manager: data_manager
allow_to_review: [admin, medical_monitor]
allow_query_inputs: TRUE
dev:
golem_wd: !expr golem::pkg_path()
test:
Expand Down

0 comments on commit 2b241c3

Please sign in to comment.