From 2d27b9b0b35b56b724c61d834d20203ed8ca54db Mon Sep 17 00:00:00 2001 From: cristinamullin <46969696+cristinamullin@users.noreply.github.com> Date: Thu, 30 May 2024 10:26:41 -0400 Subject: [PATCH 1/2] Censored and harmonize tab updates - updates original columns referenced for censored tab table - removes reference to columns that are no longer in the harmonization reference table in the TADA package (unit elements were removed) --- R/mod_censored_data.R | 6 +++--- R/mod_harmonize_np.R | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/R/mod_censored_data.R b/R/mod_censored_data.R index 805105fff..5081b6cc3 100644 --- a/R/mod_censored_data.R +++ b/R/mod_censored_data.R @@ -264,16 +264,16 @@ mod_censored_data_server <- function(id, tadat) { dat[, c( "ResultIdentifier", "TADA.CharacteristicName", - "TADA.DetectionQuantitationLimitMeasure.MeasureValue", + "DetectionQuantitationLimitMeasure.MeasureValue", "DetectionQuantitationLimitMeasure.MeasureUnitCode", "TADA.ResultMeasureValue", "TADA.ResultMeasure.MeasureUnitCode" )] dat <- dat %>% dplyr::rename( - "Estimated Detection Limit Value" = TADA.ResultMeasureValue, - "Original Detection Limit Value" = TADA.DetectionQuantitationLimitMeasure.MeasureValue, + "Original Detection Limit Value" = DetectionQuantitationLimitMeasure.MeasureValue, "Original Unit" = DetectionQuantitationLimitMeasure.MeasureUnitCode, + "Estimated Detection Limit Value" = TADA.ResultMeasureValue, "Estimated Unit" = TADA.ResultMeasure.MeasureUnitCode ) censdat$exdat <- diff --git a/R/mod_harmonize_np.R b/R/mod_harmonize_np.R index 91fdbfdf7..86290788c 100644 --- a/R/mod_harmonize_np.R +++ b/R/mod_harmonize_np.R @@ -52,9 +52,9 @@ mod_harmonize_np_server <- function(id, tadat) { "Target.TADA.MethodSpeciationName", "TADA.SpeciationAssumptions", "Target.TADA.SpeciationConversionFactor", - "TADA.ResultMeasure.MeasureUnitCode", - "Target.TADA.ResultMeasure.MeasureUnitCode", - "Target.TADA.UnitConversionFactor", + #"TADA.ResultMeasure.MeasureUnitCode", #no longer in harmonization template + #"Target.TADA.ResultMeasure.MeasureUnitCode", #no longer in harmonization template + #"Target.TADA.UnitConversionFactor", #no longer in harmonization template "HarmonizationGroup" ) @@ -77,9 +77,9 @@ mod_harmonize_np_server <- function(id, tadat) { Target.TADA.MethodSpeciationName = "Target Speciation", TADA.SpeciationAssumptions = "Speciation Assumptions", Target.TADA.SpeciationConversionFactor = "Speciation Conversion Factor (to AS N or AS P)", - TADA.ResultMeasure.MeasureUnitCode = "Unit", - Target.TADA.ResultMeasure.MeasureUnitCode = "Target Unit", - Target.TADA.UnitConversionFactor = "Unit Conversion Factor", + # TADA.ResultMeasure.MeasureUnitCode = "Unit", + # Target.TADA.ResultMeasure.MeasureUnitCode = "Target Unit", + # Target.TADA.UnitConversionFactor = "Unit Conversion Factor", HarmonizationGroup = "Harmonization Group" ) harm$ref <- ref @@ -123,9 +123,9 @@ mod_harmonize_np_server <- function(id, tadat) { Target.TADA.MethodSpeciationName = "Target Speciation", TADA.SpeciationAssumptions = "Speciation Assumptions", Target.TADA.SpeciationConversionFactor = "Speciation Conversion Factor (to AS N or AS P)", - TADA.ResultMeasure.MeasureUnitCode = "Unit", - Target.TADA.ResultMeasure.MeasureUnitCode = "Target Unit", - Target.TADA.UnitConversionFactor = "Unit Conversion Factor", + # TADA.ResultMeasure.MeasureUnitCode = "Unit", + # Target.TADA.ResultMeasure.MeasureUnitCode = "Target Unit", + # Target.TADA.UnitConversionFactor = "Unit Conversion Factor", HarmonizationGroup = "Harmonization Group" ) harm$ref <- ref @@ -157,7 +157,7 @@ mod_harmonize_np_server <- function(id, tadat) { selection = "none", rownames = FALSE ) %>% DT::formatStyle(columns = names(harm$ref), `font-size` = "12px") %>% - DT::formatStyle(columns = c("TADA.CharacteristicName", "TADA.ResultSampleFractionText", "TADA.MethodSpeciationName", "TADA.ResultMeasure.MeasureUnitCode"), backgroundColor = "#2e6da4", color = "white") + DT::formatStyle(columns = c("TADA.CharacteristicName", "TADA.ResultSampleFractionText", "TADA.MethodSpeciationName"), backgroundColor = "#2e6da4", color = "white") }) # apply synonym ref to data when button is pushed From e09c26e36bc25550013a2806a2f724d454e9e4a0 Mon Sep 17 00:00:00 2001 From: cristinamullin <46969696+cristinamullin@users.noreply.github.com> Date: Thu, 30 May 2024 10:47:59 -0400 Subject: [PATCH 2/2] define global variables --- R/utils.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index f18fcf8e1..f04d2a9f1 100644 --- a/R/utils.R +++ b/R/utils.R @@ -22,5 +22,6 @@ utils::globalVariables(c( "nd_method", "nd_mult", "od_method", "org_table", "organization", "original_source", "project", "sampleMedia", "selected_filters", "selected_flags", "siteType", - "siteid", "startDate", "statecode", "od_mult", "field_sel" + "siteid", "startDate", "statecode", "od_mult", "field_sel", + "DetectionQuantitationLimitMeasure.MeasureValue" ))