Skip to content

Commit

Permalink
Merge pull request #95 from elisehinman/remove_medianame
Browse files Browse the repository at this point in the history
Update mod_harmonize_np.R
  • Loading branch information
cristinamullin authored Sep 7, 2023
2 parents 83397eb + 1e1adeb commit a3f08be
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions R/mod_harmonize_np.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a3f08be

Please sign in to comment.