Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: DataQualityDashboard
Type: Package
Title: Execute and View Data Quality Checks on OMOP CDM Database
Version: 2.8.6
Version: 2.8.6.900
Date: 2026-01-22
Authors@R: c(
person("Katy", "Sadowski", email = "sadowski@ohdsi.org", role = c("aut", "cre")),
Expand Down
30 changes: 28 additions & 2 deletions inst/shinyApps/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,35 @@ server <- function(input, output, session) {
observe({
jsonPath <- Sys.getenv("jsonPath")
results <- DataQualityDashboard::convertJsonResultsFileCase(jsonPath, writeToFile = FALSE, targetCase = "camel")
results <- jsonlite::parse_json(jsonlite::toJSON(results))

tryCatch({
# Read checkDescription to get severity status for each check
cdmVersion <- results$Metadata$cdmVersion
checkDescriptionsDf <- readr::read_csv(
file = system.file(
"csv",
sprintf("OMOP_CDMv%s_Check_Descriptions.csv", substr(sub('$v', '', cdmVersion), 1, 3)),
package = "DataQualityDashboard"
),
show_col_types = FALSE
)

results$CheckResults <- results$CheckResults |>
dplyr::left_join(
dplyr::select(checkDescriptionsDf, checkName, severity),
dplyr::join_by('checkName')
)
}, error = function(e) {
results$CheckResults$severity <- NA
})

results$appVersion <- as.character(packageVersion('DataQualityDashboard'))

# Fix json formatting
results <- jsonlite::parse_json(jsonlite::toJSON(results))

session$sendCustomMessage("results", results)
})
})
}

ui <- fluidPage(
Expand Down
2 changes: 2 additions & 0 deletions inst/shinyApps/www/htmlwidgets/lib/dqCheckRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class DqCheckRenderer extends HTMLElement {
{{#each checks}}
<div><b>Check Details</b></div>
<div>{{this.checkName}} - {{this.checkLevel}} - {{this.CDM_TABLE}} - {{this.CDM_FIELD}}</div>
<div><b>Check Severity</b></div>
<div>{{this.severity}}</div>
<div><b>Check Description</b></div>
<div>{{this.checkDescription}}</div>
<div><b>Violated Rows</b></div>
Expand Down
2 changes: 2 additions & 0 deletions inst/shinyApps/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ <h3>References</h3>

<hr class="m-0">
Apache 2.0 Open Source Software - Brought to you by <a href="http://www.ohdsi.org">OHDSI</a>
<br>
App Version: <span id="appVersion"></span>
</div>
</section>

Expand Down
12 changes: 7 additions & 5 deletions inst/shinyApps/www/js/loadResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function loadResults(results) {
var metadata = results.Metadata[0];
$('cdm-source-name').text(metadata.cdmSourceName);
$('dq-metadata').attr('data-results', JSON.stringify(metadata));
$('#appVersion').text(results.appVersion);

function format(d) {
errorMessage = '';
Expand Down Expand Up @@ -152,12 +153,13 @@ function loadResults(results) {
{ data: function (d) { if (d.isError == 1) { return "ERROR" } else if (d.notApplicable == 1) { return "NOT APPLICABLE" } else if (d.failed == 1) { return "FAIL" } else {return "PASS"} }, title: "STATUS", className: 'dt-body-right' },
/*{ data: function (d) { return d.context ? d.context : "None"; }, title: "CONTEXT" },*/
{ data: "cdmTableName", title: "TABLE"},
{ data: function (d) { return d.cdmFieldName ? d.cdmFieldName : "None"; }, title: "FIELD", visible: false },
{ data: "checkName", title: "CHECK", visible: false},
{ data: function (d) { return d.cdmFieldName ? d.cdmFieldName : "None"; }, title: "FIELD", visible: true },
{ data: "checkName", title: "CHECK", visible: true},
{ data: "category", title: "CATEGORY" },
{ data: function (d) { return d.subcategory ? d.subcategory : "None" }, title: "SUBCATEGORY" },
{ data: "checkLevel", title: "LEVEL" },
{ data: function (d) { if (d.notesValue == null) { return "None"; } else { return "Exists"; } }, title: "NOTES" },
{ data: function (d) { return d.subcategory ? d.subcategory : "None" }, title: "SUBCATEGORY", visible: false },
{ data: "checkLevel", title: "LEVEL", visible: false },
{ data: "severity", title: "SEVERITY", visible: true },
{ data: function (d) { if (d.notesValue == null) { return "None"; } else { return "Exists"; } }, title: "NOTES", visible: false },

{
data: function (d) {
Expand Down