Skip to content

Commit

Permalink
release prep
Browse files Browse the repository at this point in the history
  • Loading branch information
katy-sadowski committed Nov 4, 2023
1 parent b3a1f5e commit ef4f61f
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 = "[email protected]", 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 ef4f61f

Please sign in to comment.