Skip to content

Commit 1c48fcb

Browse files
Merge pull request #516 from OHDSI/issue-445
Add three new temporal checks: `plausibleAfterBirth`, `plausibleBeforeDeath`, `plausibleStartBeforeEnd`
2 parents 2883027 + cdb6db7 commit 1c48fcb

12 files changed

+1445
-1197
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ inst/results.json
2828
# Other
2929
.DS_Store
3030

31+
# Visual Studio Code
32+
.vscode/
33+
3134
errorReport.txt
3235
output/
3336
results/
3437
thresholds/
3538
hs_err_pid*.log
3639
docs/Gemfile
3740
docs/Gemfile.lock
38-
sql
3941
vignettes/*.log
4042
/doc/
4143
/Meta/

R/executeDqChecks.R

+9
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ executeDqChecks <- function(connectionDetails,
123123
}
124124
}
125125

126+
126127
# temporary patch to work around vroom 1.6.4 bug
127128
readr::local_edition(1)
128129

@@ -258,6 +259,14 @@ executeDqChecks <- function(connectionDetails,
258259
stop("No checks are available based on excluded tables. Please review tablesToExclude.")
259260
}
260261

262+
if ("plausibleDuringLife" %in% checkDescriptionsDf$checkName) {
263+
warning("DEPRECATION WARNING - The plausibleDuringLife check has been reimplemented with the plausibleBeforeDeath check.")
264+
}
265+
266+
if ("plausibleTemporalAfter" %in% checkDescriptionsDf$checkName) {
267+
warning("DEPRECATION WARNING - The plausibleTemporalAfter check has been reimplemented with the plausibleAfterBirth and plausibleStartBeforeEnd checks.")
268+
}
269+
261270
checkDescriptions <- split(checkDescriptionsDf, seq_len(nrow(checkDescriptionsDf)))
262271

263272
connection <- NULL

inst/csv/OMOP_CDMv5.2_Check_Descriptions.csv

+3
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ FIELD,plausibleValueHigh,The number and percent of records with a value in the @
2020
FIELD,plausibleTemporalAfter,The number and percent of records with a value in the @cdmFieldName field of the @cdmTableName that occurs prior to the date in the @plausibleTemporalAfterFieldName field of the @plausibleTemporalAfterTableName table.,Verification,Plausibility,Temporal,field_plausible_temporal_after.sql,plausibleTemporalAfter=='Yes'
2121
FIELD,plausibleDuringLife,"If yes, the number and percent of records with a date value in the @cdmFieldName field of the @cdmTableName table that occurs after death.",Verification,Plausibility,Temporal,field_plausible_during_life.sql,plausibleDuringLife=='Yes'
2222
FIELD,withinVisitDates,The number and percent of records not within one week on either side of the corresponding visit occurrence start and end date,Verification,Conformance,,field_within_visit_dates.sql,withinVisitDates=='Yes'
23+
FIELD,plausibleAfterBirth,"The number and percent of records with a date value in the @cdmFieldName field of the @cdmTableName table that occurs prior to birth.",Verification,Plausibility,Temporal,field_plausible_after_birth.sql,plausibleAfterBirth=='Yes'
24+
FIELD,plausibleBeforeDeath,"The number and percent of records with a date value in the @cdmFieldName field of the @cdmTableName table that occurs after death.",Verification,Plausibility,Temporal,field_plausible_before_death.sql,plausibleBeforeDeath=='Yes'
25+
FIELD,plausibleStartBeforeEnd,"The number and percent of records with a value in the @cdmFieldName field of the @cdmTableName that occurs after the date in the @plausibleStartBeforeEndFieldName.",Verification,Plausibility,Temporal,field_plausible_start_before_end.sql,plausibleStartBeforeEnd=='Yes'
2326
CONCEPT,plausibleGender,"For a CONCEPT_ID @conceptId (@conceptName), the number and percent of records associated with patients with an implausible gender (correct gender = @plausibleGender).",Validation,Plausibility,Atemporal,concept_plausible_gender.sql,plausibleGender!=''
2427
CONCEPT,plausibleUnitConceptIds,"The number and percent of records for a given CONCEPT_ID @conceptId (@conceptName) with implausible units (i.e., UNIT_CONCEPT_ID NOT IN (@plausibleUnitConceptIds)).",Verification,Plausibility,Atemporal,concept_plausible_unit_concept_ids.sql,plausibleUnitConceptIdsThreshold!=''

inst/csv/OMOP_CDMv5.2_Field_Level.csv

+304-304
Large diffs are not rendered by default.

inst/csv/OMOP_CDMv5.3_Check_Descriptions.csv

+3
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ FIELD,plausibleValueHigh,The number and percent of records with a value in the @
2020
FIELD,plausibleTemporalAfter,The number and percent of records with a value in the @cdmFieldName field of the @cdmTableName that occurs prior to the date in the @plausibleTemporalAfterFieldName field of the @plausibleTemporalAfterTableName table.,Verification,Plausibility,Temporal,field_plausible_temporal_after.sql,plausibleTemporalAfter=='Yes'
2121
FIELD,plausibleDuringLife,"If yes, the number and percent of records with a date value in the @cdmFieldName field of the @cdmTableName table that occurs after death.",Verification,Plausibility,Temporal,field_plausible_during_life.sql,plausibleDuringLife=='Yes'
2222
FIELD,withinVisitDates,The number and percent of records not within one week on either side of the corresponding visit occurrence start and end date,Verification,Conformance,,field_within_visit_dates.sql,withinVisitDates=='Yes'
23+
FIELD,plausibleAfterBirth,"The number and percent of records with a date value in the @cdmFieldName field of the @cdmTableName table that occurs prior to birth.",Verification,Plausibility,Temporal,field_plausible_after_birth.sql,plausibleAfterBirth=='Yes'
24+
FIELD,plausibleBeforeDeath,"The number and percent of records with a date value in the @cdmFieldName field of the @cdmTableName table that occurs after death.",Verification,Plausibility,Temporal,field_plausible_before_death.sql,plausibleBeforeDeath=='Yes'
25+
FIELD,plausibleStartBeforeEnd,"The number and percent of records with a value in the @cdmFieldName field of the @cdmTableName that occurs after the date in the @plausibleStartBeforeEndFieldName.",Verification,Plausibility,Temporal,field_plausible_start_before_end.sql,plausibleStartBeforeEnd=='Yes'
2326
CONCEPT,plausibleGender,"For a CONCEPT_ID @conceptId (@conceptName), the number and percent of records associated with patients with an implausible gender (correct gender = @plausibleGender).",Validation,Plausibility,Atemporal,concept_plausible_gender.sql,plausibleGender!=''
2427
CONCEPT,plausibleUnitConceptIds,"The number and percent of records for a given CONCEPT_ID @conceptId (@conceptName) with implausible units (i.e., UNIT_CONCEPT_ID NOT IN (@plausibleUnitConceptIds)).",Verification,Plausibility,Atemporal,concept_plausible_unit_concept_ids.sql,plausibleUnitConceptIdsThreshold!=''

0 commit comments

Comments
 (0)