From 1e1adeb09f1aa206b475b00d735e34ef47c7414b Mon Sep 17 00:00:00 2001 From: elisehinman <124372390+elisehinman@users.noreply.github.com> Date: Wed, 6 Sep 2023 19:15:14 -0400 Subject: [PATCH] Update mod_harmonize_np.R remove media name from harmonization table -- was breaking table because no longer in reference table --- R/mod_harmonize_np.R | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/R/mod_harmonize_np.R b/R/mod_harmonize_np.R index 6c105bfa1..ca4ea4757 100644 --- a/R/mod_harmonize_np.R +++ b/R/mod_harmonize_np.R @@ -38,8 +38,7 @@ mod_harmonize_np_server <- function(id, tadat){ moduleServer( id, function(input, output, session){ ns <- session$ns # columns needed for harmonization table - cols = c("TADA.ActivityMediaName", - "TADA.CharacteristicName", + cols = c("TADA.CharacteristicName", "Target.TADA.CharacteristicName", "TADA.CharacteristicNameAssumptions", "TADA.ResultSampleFractionText", @@ -62,8 +61,7 @@ mod_harmonize_np_server <- function(id, tadat){ ref = TADA::TADA_GetSynonymRef(tadat$raw[tadat$raw$TADA.Remove==FALSE,]) ref = ref %>% dplyr::arrange(Target.TADA.CharacteristicName, Target.TADA.ResultSampleFractionText, Target.TADA.MethodSpecificationName) colns = names(ref) - harm$colns = colns %>% dplyr::recode(TADA.ActivityMediaName = "Media", - TADA.CharacteristicName = "Characteristic", + harm$colns = colns %>% dplyr::recode(TADA.CharacteristicName = "Characteristic", Target.TADA.CharacteristicName = "Target Characteristic", TADA.CharacteristicNameAssumptions = "Characteristic Assumptions", TADA.ResultSampleFractionText = "Fraction", @@ -108,8 +106,7 @@ mod_harmonize_np_server <- function(id, tadat){ if(all(cols%in%names(ref))&dim(ref)[1]>0){ ref = ref %>% dplyr::arrange(Target.TADA.CharacteristicName, Target.TADA.ResultSampleFractionText, Target.TADA.MethodSpecificationName) colns = names(ref) - harm$colns = colns %>% dplyr::recode(TADA.ActivityMediaName = "Media", - TADA.CharacteristicName = "Characteristic", + harm$colns = colns %>% dplyr::recode(TADA.CharacteristicName = "Characteristic", Target.TADA.CharacteristicName = "Target Characteristic", TADA.CharacteristicNameAssumptions = "Characteristic Assumptions", TADA.ResultSampleFractionText = "Fraction", @@ -150,7 +147,7 @@ mod_harmonize_np_server <- function(id, tadat){ pageLength=5), selection = 'none', rownames=FALSE) %>% DT::formatStyle(columns = names(harm$ref), `font-size` = "12px") %>% - DT::formatStyle(columns = c("TADA.ActivityMediaName","TADA.CharacteristicName","TADA.ResultSampleFractionText","TADA.MethodSpecificationName","TADA.ResultMeasure.MeasureUnitCode"), backgroundColor = "#2e6da4", color = "white") + DT::formatStyle(columns = c("TADA.CharacteristicName","TADA.ResultSampleFractionText","TADA.MethodSpecificationName","TADA.ResultMeasure.MeasureUnitCode"), backgroundColor = "#2e6da4", color = "white") }) # apply synonym ref to data when button is pushed