Skip to content

Commit

Permalink
Merge pull request #503 from katy-sadowski/katy__v25
Browse files Browse the repository at this point in the history
Release preparation
  • Loading branch information
katy-sadowski authored Nov 4, 2023
2 parents b3a1f5e + ef4f61f commit 2e601f2
Show file tree
Hide file tree
Showing 48 changed files with 272 additions and 137 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: DataQualityDashboard
Type: Package
Title: Execute and View Data Quality Checks on OMOP CDM Database
Version: 2.4.1
Date: 2023-10-18
Version: 2.5.0
Date: 2023-11-04
Authors@R: c(
person("Katy", "Sadowski", email = "sadowski@ohdsi.org", role = c("aut", "cre")),
person("Clair", "Blacketer", role = c("aut")),
Expand Down
4 changes: 2 additions & 2 deletions R/executeDqChecks.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ executeDqChecks <- function(connectionDetails,
if (!str_detect(cdmVersion, regex(acceptedCdmRegex))) {
stop("cdmVersion must contain a version of the form '5.X' where X is an integer between 2 and 4 inclusive.")
}

if (sqlOnlyIncrementalInsert == TRUE && sqlOnly == FALSE) {
stop("Set `sqlOnly` to TRUE in order to use `sqlOnlyIncrementalInsert` mode.")
}
Expand Down Expand Up @@ -139,7 +139,7 @@ executeDqChecks <- function(connectionDetails,
stop("Please populate the cdm_source table before executing data quality checks.")
}
if (nrow(metadata) > 1) {
metadata <- metadata[1,]
metadata <- metadata[1, ]
warning("The cdm_source table has more than 1 row. A single row from this table has been selected to populate DQD metadata.")
}
metadata$dqdVersion <- as.character(packageVersion("DataQualityDashboard"))
Expand Down
85 changes: 42 additions & 43 deletions R/writeDBResultsTo.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,52 +27,51 @@
#'

writeDBResultsToJson <- function(connection,
resultsDatabaseSchema,
cdmDatabaseSchema,
writeTableName,
outputFolder,
outputFile) {
metadata <- DatabaseConnector::renderTranslateQuerySql(
connection,
sql = "select * from @cdmDatabaseSchema.cdm_source;",
snakeCaseToCamelCase = TRUE,
cdmDatabaseSchema = cdmDatabaseSchema
)
resultsDatabaseSchema,
cdmDatabaseSchema,
writeTableName,
outputFolder,
outputFile) {
metadata <- DatabaseConnector::renderTranslateQuerySql(
connection,
sql = "select * from @cdmDatabaseSchema.cdm_source;",
snakeCaseToCamelCase = TRUE,
cdmDatabaseSchema = cdmDatabaseSchema
)

checkResults <- DatabaseConnector::renderTranslateQuerySql(
connection,
sql = "select * from @resultsDatabaseSchema.@writeTableName;",
snakeCaseToCamelCase = TRUE,
resultsDatabaseSchema = resultsDatabaseSchema,
writeTableName = writeTableName
)
checkResults <- DatabaseConnector::renderTranslateQuerySql(
connection,
sql = "select * from @resultsDatabaseSchema.@writeTableName;",
snakeCaseToCamelCase = TRUE,
resultsDatabaseSchema = resultsDatabaseSchema,
writeTableName = writeTableName
)

# Quick patch for missing value issues related to SQL Only Implementation
checkResults["error"][checkResults["error"] == ''] <- NA
checkResults["warning"][checkResults["warning"] == ''] <- NA
checkResults["executionTime"][checkResults["executionTime"] == ''] <- '0 secs'
checkResults["queryText"][checkResults["queryText"] == ''] <- '[Generated via SQL Only]'
# Quick patch for missing value issues related to SQL Only Implementation
checkResults["error"][checkResults["error"] == ""] <- NA
checkResults["warning"][checkResults["warning"] == ""] <- NA
checkResults["executionTime"][checkResults["executionTime"] == ""] <- "0 secs"
checkResults["queryText"][checkResults["queryText"] == ""] <- "[Generated via SQL Only]"

overview <- .summarizeResults(
checkResults = checkResults
)
overview <- .summarizeResults(
checkResults = checkResults
)

# Quick patch for non-camel-case column name
names(checkResults)[names(checkResults) == "checkid"] <- "checkId"
# Quick patch for non-camel-case column name
names(checkResults)[names(checkResults) == "checkid"] <- "checkId"

allResults <- list(
startTimestamp = Sys.time(),
endTimestamp = Sys.time(),
executionTime = '0 secs',
CheckResults = checkResults,
Metadata = metadata,
Overview = overview
)
allResults <- list(
startTimestamp = Sys.time(),
endTimestamp = Sys.time(),
executionTime = "0 secs",
CheckResults = checkResults,
Metadata = metadata,
Overview = overview
)

.writeResultsToJson(
allResults,
outputFolder,
outputFile
)

}
.writeResultsToJson(
allResults,
outputFolder,
outputFile
)
}
4 changes: 4 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ reference:
desc: >
Function to convert the case of a results JSON file between snakecase and camelcase
contents: convertJsonResultsFileCase
- title: "Write database results to a JSON file"
desc: >
Function to write DQD results from a database table into a JSON file
contents: writeDBResultsToJson
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/AddNewCheck.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/CheckStatusDefinitions.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/CheckTypeDescriptions.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/DataQualityDashboard.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/DqdForCohorts.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 12 additions & 43 deletions docs/articles/SqlOnly.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2e601f2

Please sign in to comment.