From 7551430d4a2806e0e0b463b262699a8734faa48f Mon Sep 17 00:00:00 2001 From: "Fukuda, Hiroaki" Date: Mon, 13 Apr 2026 03:41:26 -0400 Subject: [PATCH 1/2] Add messages when variables are not available listings --- R/prepare_ae_forestly.R | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/R/prepare_ae_forestly.R b/R/prepare_ae_forestly.R index 6aac709..22f56b3 100644 --- a/R/prepare_ae_forestly.R +++ b/R/prepare_ae_forestly.R @@ -64,6 +64,23 @@ prepare_ae_forestly <- function( } } + if (population == observation) { + if (any(!meta$population[[population]]$var %in% names(meta$data_observation))) { + stop(paste0( + "When the same term is specified for population and observation, ", + "the variable specified in population should be included in the observation dataset." + )) + } + } + + if (any(!ae_listing_display %in% names(meta$data_observation))) { + warning(paste0( + "The variables specified in ae_listing_display should be included in the observation dataset. ", + "Only the variables included in the observation dataset will be displayed on AE listing table." + )) + ae_listing_display <- ae_listing_display[ae_listing_display %in% names(meta$data_observation)] + } + if (is.null(parameter)) { parameters <- names(meta$parameter) From a064ed0270fc6517a281f35bb7c3909944844826 Mon Sep 17 00:00:00 2001 From: "Fukuda, Hiroaki" Date: Tue, 14 Apr 2026 22:16:47 -0400 Subject: [PATCH 2/2] Change the error message to the temporary processing --- R/prepare_ae_forestly.R | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/R/prepare_ae_forestly.R b/R/prepare_ae_forestly.R index 22f56b3..7edde75 100644 --- a/R/prepare_ae_forestly.R +++ b/R/prepare_ae_forestly.R @@ -64,19 +64,20 @@ prepare_ae_forestly <- function( } } - if (population == observation) { - if (any(!meta$population[[population]]$var %in% names(meta$data_observation))) { - stop(paste0( - "When the same term is specified for population and observation, ", - "the variable specified in population should be included in the observation dataset." - )) - } - } + # Temporary Processing + data_observation <- meta$data_observation |> + merge( + meta$data_population, + by = "USUBJID", + all.x = TRUE, + suffixes = c("", ".pop") + ) + meta$data_observation <- data_observation[, !grepl("\\.pop$", names(data_observation))] if (any(!ae_listing_display %in% names(meta$data_observation))) { warning(paste0( - "The variables specified in ae_listing_display should be included in the observation dataset. ", - "Only the variables included in the observation dataset will be displayed on AE listing table." + "The variables specified in ae_listing_display should be included in the input dataset. ", + "Only the variables included in the input dataset will be displayed on AE listing table." )) ae_listing_display <- ae_listing_display[ae_listing_display %in% names(meta$data_observation)] }