From 5e1eaa2b7e23c3732ffd59adeb5f895e926bd495 Mon Sep 17 00:00:00 2001 From: Kyrylo Simonov Date: Wed, 26 Apr 2023 11:23:55 -0500 Subject: [PATCH] Workaround for changed column names in DQD 2.1 See issue OHDSI/AresIndexer#30. The fix is borrowed from https://github.com/OHDSI/AresIndexer/pull/35. --- R/AugmentConceptFiles.R | 4 +++- R/BuildNetworkPerformanceIndex.R | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/R/AugmentConceptFiles.R b/R/AugmentConceptFiles.R index ccbd656..2270fe3 100644 --- a/R/AugmentConceptFiles.R +++ b/R/AugmentConceptFiles.R @@ -36,7 +36,9 @@ augmentConceptFiles <- function(releaseFolder) { if (file.exists(dataQualityResultsFile)) { writeLines("updating concept files with data quality results") dataQualityResults <- jsonlite::fromJSON(dataQualityResultsFile) - results <- dataQualityResults$CheckResults + results <- dataQualityResults$CheckResults %>% + dplyr::rename_with(SqlRender::camelCaseToSnakeCase) %>% + dplyr::rename_with(toupper) # augment achilles concept files with data quality failure count for relevant concept checks conceptAggregates <- results %>% filter(!is.na(results$CONCEPT_ID) && results$FAILED==1) %>% count(CONCEPT_ID,tolower(CDM_TABLE_NAME)) diff --git a/R/BuildNetworkPerformanceIndex.R b/R/BuildNetworkPerformanceIndex.R index aefa128..04d0efe 100644 --- a/R/BuildNetworkPerformanceIndex.R +++ b/R/BuildNetworkPerformanceIndex.R @@ -65,8 +65,8 @@ buildNetworkPerformanceIndex <- performanceTable <- merge(x=performanceTable,y=analysisDetails,by="TASK",all.x=TRUE) - dqdTable <- dplyr::select(dqdData, c("CheckResults.checkId", "CheckResults.EXECUTION_TIME", "CheckResults.CATEGORY")) %>% - rename(TASK = CheckResults.checkId, TIMING = CheckResults.EXECUTION_TIME, CATEGORY = CheckResults.CATEGORY) %>% mutate(PACKAGE = "DQD") %>% + dqdTable <- dplyr::select(dqdData, c("CheckResults.checkId", "CheckResults.executionTime", "CheckResults.category")) %>% + rename(TASK = CheckResults.checkId, TIMING = CheckResults.executionTime, CATEGORY = CheckResults.category) %>% mutate(PACKAGE = "DQD") %>% mutate_at("TIMING", str_replace, " secs", "") mergedTable <- rbind(performanceTable, dqdTable)