@@ -402,40 +402,8 @@ mod_patient_profile <- function(module_id = "",
402402
403403 mod <- list (
404404 # UI function
405- ui = function (module_id ) {
406- app_creator_feedback_ui(module_id ) # NOTE: original UI gated by app_creator_feedback_server
407- },
408- # Server function
405+ ui = mod_patient_profile_UI ,
409406 server = function (afmm ) {
410- fb <- shiny :: reactive({
411- # NOTE: We check the call here and not inside the module server function because:
412- # - app creators interact with the davinci module and not with the ui-server combo, so
413- # errors reported with respect to the module signature will make sense to them.
414- # The module server function might use a different function signature.
415- # - Here we also have access to the unfiltered dataset, which allows us to ensure call
416- # correctness independent of filter state or operation.
417- # Also, as long as the unfiltered dataset does not change (and to date no davinci app
418- # changes it dynamically) this check only runs once at the beginning of the application
419- # and has no further impact on performance.
420- # - "catch errors early"
421-
422- # Overwrite first "argument" (the function call, in fact) with the datasets provided to module manager
423- names(args )[[1 ]] <- " datasets"
424- args [[1 ]] <- afmm [[" unfiltered_dataset" ]]()
425- args [[" afmm_module_names" ]] <- afmm [[" module_names" ]]
426- do.call(check_papo_call , args )
427- })
428-
429- fb_warn <- shiny :: reactive(fb()[[" warnings" ]])
430- fb_err <- shiny :: reactive(fb()[[" errors" ]])
431-
432- app_creator_feedback_server(
433- id = module_id ,
434- warning_messages = fb_warn ,
435- error_messages = fb_err ,
436- ui = dv.papo :: mod_patient_profile_UI(module_id )
437- )
438-
439407 # set palette colours for range_plots
440408 grading_vals <- get_grading_vals(plots [[" range_plots" ]], afmm [[" data" ]])
441409 plots [[" palette" ]] <- fill_palette(grading_vals , plots [[" palette" ]])
@@ -503,7 +471,15 @@ mod_patient_profile <- function(module_id = "",
503471 return (unique(res ))
504472 }),
505473 subject_level = subject_level_dataset_name
506- )
474+ ),
475+ check_mod_fn = function (afmm , dataset_list ) {
476+ res <- check_papo_call(
477+ datasets = dataset_list ,
478+ module_args = args [- 1 ], # exclude function from the result of `match.call`
479+ afmm_module_names = afmm [[" module_names" ]]
480+ )
481+ return (res [[" errors" ]])
482+ }
507483 )
508484 )
509485 return (mod )
0 commit comments