diff --git a/docs/articles/checks/plausibleValueHigh.html b/docs/articles/checks/plausibleValueHigh.html
index fe3f399b..d63d09d0 100644
--- a/docs/articles/checks/plausibleValueHigh.html
+++ b/docs/articles/checks/plausibleValueHigh.html
@@ -151,6 +151,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
@@ -184,7 +190,7 @@ plausibleValueHigh
Dymytry
Dymshyts
- 2024-07-12
+ 2024-10-24
Source: vignettes/checks/plausibleValueHigh.Rmd
plausibleValueHigh.Rmd
diff --git a/docs/articles/checks/plausibleValueLow.html b/docs/articles/checks/plausibleValueLow.html
index 522ff118..1e708978 100644
--- a/docs/articles/checks/plausibleValueLow.html
+++ b/docs/articles/checks/plausibleValueLow.html
@@ -151,6 +151,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
@@ -184,7 +190,7 @@ plausibleValueLow
Dymytry
Dymshyts
- 2024-07-12
+ 2024-10-24
Source: vignettes/checks/plausibleValueLow.Rmd
plausibleValueLow.Rmd
diff --git a/docs/articles/checks/sourceConceptRecordCompleteness.html b/docs/articles/checks/sourceConceptRecordCompleteness.html
index d152f815..1f217e6d 100644
--- a/docs/articles/checks/sourceConceptRecordCompleteness.html
+++ b/docs/articles/checks/sourceConceptRecordCompleteness.html
@@ -151,6 +151,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
@@ -184,7 +190,7 @@ sourceConceptRecordCompleteness
Katy
Sadowski
- 2024-07-12
+ 2024-10-24
Source: vignettes/checks/sourceConceptRecordCompleteness.Rmd
sourceConceptRecordCompleteness.Rmd
diff --git a/docs/articles/checks/sourceValueCompleteness.html b/docs/articles/checks/sourceValueCompleteness.html
index dd3789cc..2e2e4329 100644
--- a/docs/articles/checks/sourceValueCompleteness.html
+++ b/docs/articles/checks/sourceValueCompleteness.html
@@ -151,6 +151,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
@@ -184,7 +190,7 @@ sourceValueCompleteness
Jared
Houghtaling, Clair Blacketer
- 2024-07-12
+ 2024-10-24
Source: vignettes/checks/sourceValueCompleteness.Rmd
sourceValueCompleteness.Rmd
diff --git a/docs/articles/checks/standardConceptRecordCompleteness.html b/docs/articles/checks/standardConceptRecordCompleteness.html
index 5f2d923c..67182b8b 100644
--- a/docs/articles/checks/standardConceptRecordCompleteness.html
+++ b/docs/articles/checks/standardConceptRecordCompleteness.html
@@ -151,6 +151,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
@@ -184,7 +190,7 @@ standardConceptRecordCompleteness
Katy
Sadowski
- 2024-07-12
+ 2024-10-24
Source: vignettes/checks/standardConceptRecordCompleteness.Rmd
standardConceptRecordCompleteness.Rmd
diff --git a/docs/articles/checks/withinVisitDates.html b/docs/articles/checks/withinVisitDates.html
index f3fd930e..dff31edf 100644
--- a/docs/articles/checks/withinVisitDates.html
+++ b/docs/articles/checks/withinVisitDates.html
@@ -151,6 +151,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
@@ -184,7 +190,7 @@ withinVisitDates
Clair
Blacketer
- 2024-07-12
+ 2024-10-24
Source: vignettes/checks/withinVisitDates.Rmd
withinVisitDates.Rmd
diff --git a/docs/articles/index.html b/docs/articles/index.html
index 0d30de15..5958ef1d 100644
--- a/docs/articles/index.html
+++ b/docs/articles/index.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/authors.html b/docs/authors.html
index 413f7d41..5e4321bb 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/index.html b/docs/index.html
index bb851914..806e0a34 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -151,6 +151,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
diff --git a/docs/news/index.html b/docs/news/index.html
index a5068eb0..05e0397b 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index db534a4c..2aa6f2b6 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -34,7 +34,7 @@ articles:
standardConceptRecordCompleteness: checks/standardConceptRecordCompleteness.html
Thresholds: Thresholds.html
withinVisitDates: checks/withinVisitDates.html
-last_built: 2024-07-13T02:25Z
+last_built: 2024-10-24T13:49Z
urls:
reference: https://ohdsi.github.io/DataQualityDashboard/reference
article: https://ohdsi.github.io/DataQualityDashboard/articles
diff --git a/docs/reference/convertJsonResultsFileCase.html b/docs/reference/convertJsonResultsFileCase.html
index 5e74cad2..d506a628 100644
--- a/docs/reference/convertJsonResultsFileCase.html
+++ b/docs/reference/convertJsonResultsFileCase.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/dot-applyNotApplicable.html b/docs/reference/dot-applyNotApplicable.html
index 09ee42b8..3f3c00cd 100644
--- a/docs/reference/dot-applyNotApplicable.html
+++ b/docs/reference/dot-applyNotApplicable.html
@@ -131,12 +131,18 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
Changelog
Changelog
Changelog
diff --git a/docs/reference/dot-getCheckId.html b/docs/reference/dot-getCheckId.html
index a179bf0b..2a02897f 100644
--- a/docs/reference/dot-getCheckId.html
+++ b/docs/reference/dot-getCheckId.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/dot-hasNAchecks.html b/docs/reference/dot-hasNAchecks.html
index bd38b694..0d87f5fa 100644
--- a/docs/reference/dot-hasNAchecks.html
+++ b/docs/reference/dot-hasNAchecks.html
@@ -131,12 +131,18 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
Changelog
diff --git a/docs/reference/dot-recordResult.html b/docs/reference/dot-recordResult.html
index 65335d97..f144c0aa 100644
--- a/docs/reference/dot-recordResult.html
+++ b/docs/reference/dot-recordResult.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/dot-runCheck.html b/docs/reference/dot-runCheck.html
index 9a3af5e0..c6da7ca1 100644
--- a/docs/reference/dot-runCheck.html
+++ b/docs/reference/dot-runCheck.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/dot-summarizeResults.html b/docs/reference/dot-summarizeResults.html
index 4e6d8991..de59904b 100644
--- a/docs/reference/dot-summarizeResults.html
+++ b/docs/reference/dot-summarizeResults.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/dot-writeResultsToCsv.html b/docs/reference/dot-writeResultsToCsv.html
index 967f461d..bc2d9d71 100644
--- a/docs/reference/dot-writeResultsToCsv.html
+++ b/docs/reference/dot-writeResultsToCsv.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/dot-writeResultsToJson.html b/docs/reference/dot-writeResultsToJson.html
index 40b95795..a7a8a163 100644
--- a/docs/reference/dot-writeResultsToJson.html
+++ b/docs/reference/dot-writeResultsToJson.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/dot-writeResultsToTable.html b/docs/reference/dot-writeResultsToTable.html
index 56cb5037..bae7e51a 100644
--- a/docs/reference/dot-writeResultsToTable.html
+++ b/docs/reference/dot-writeResultsToTable.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/executeDqChecks.html b/docs/reference/executeDqChecks.html
index 99b2efd4..6d3cb41d 100644
--- a/docs/reference/executeDqChecks.html
+++ b/docs/reference/executeDqChecks.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/index.html b/docs/reference/index.html
index 216521ad..907618f8 100644
--- a/docs/reference/index.html
+++ b/docs/reference/index.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/listDqChecks.html b/docs/reference/listDqChecks.html
index 0ccd3dc8..26ef4d0b 100644
--- a/docs/reference/listDqChecks.html
+++ b/docs/reference/listDqChecks.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/reEvaluateThresholds.html b/docs/reference/reEvaluateThresholds.html
index 23ab56c7..9c93e902 100644
--- a/docs/reference/reEvaluateThresholds.html
+++ b/docs/reference/reEvaluateThresholds.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/viewDqDashboard.html b/docs/reference/viewDqDashboard.html
index 82ed8c28..21c0397a 100644
--- a/docs/reference/viewDqDashboard.html
+++ b/docs/reference/viewDqDashboard.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/writeDBResultsToJson.html b/docs/reference/writeDBResultsToJson.html
index 509a9594..b721a73a 100644
--- a/docs/reference/writeDBResultsToJson.html
+++ b/docs/reference/writeDBResultsToJson.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/writeJsonResultsToCsv.html b/docs/reference/writeJsonResultsToCsv.html
index 28959148..1e6fa17d 100644
--- a/docs/reference/writeJsonResultsToCsv.html
+++ b/docs/reference/writeJsonResultsToCsv.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/docs/reference/writeJsonResultsToTable.html b/docs/reference/writeJsonResultsToTable.html
index 3c6f82cd..cf3649fc 100644
--- a/docs/reference/writeJsonResultsToTable.html
+++ b/docs/reference/writeJsonResultsToTable.html
@@ -131,6 +131,12 @@
measureConditionEraCompleteness
+
+ plausibleUnitConceptIds
+
+
+ plausibleGenderUseDescendants
+
Changelog
diff --git a/vignettes/checkIndex.Rmd b/vignettes/checkIndex.Rmd
index af436761..d46bf2ec 100644
--- a/vignettes/checkIndex.Rmd
+++ b/vignettes/checkIndex.Rmd
@@ -47,5 +47,5 @@ above to navigate to the check's documentation page.\
- [plausibleAfterBirth](checks/plausibleAfterBirth.html)
- [plausibleBeforeDeath](checks/plausibleBeforeDeath.html)
- [plausibleStartBeforeEnd](checks/plausibleStartBeforeEnd.html)
-- plausibleGenderUseDescendants (PAGE UNDER CONSTRUCTION)
-- plausibleUnitConceptIds (PAGE UNDER CONSTRUCTION)
+- [plausibleGenderUseDescendants](checks/plausibleGenderUseDescendants.html)
+- [plausibleUnitConceptIds](checks/plausibleUnitConceptIds.html)
diff --git a/vignettes/checks/plausibleGenderUseDescendants.Rmd b/vignettes/checks/plausibleGenderUseDescendants.Rmd
index 7fb6ca8b..d9d79400 100644
--- a/vignettes/checks/plausibleGenderUseDescendants.Rmd
+++ b/vignettes/checks/plausibleGenderUseDescendants.Rmd
@@ -1,6 +1,6 @@
---
title: "plausibleGender"
-author: ""
+author: "Katy Sadowski and Dmytry Dymshyts"
date: "`r Sys.Date()`"
output:
html_document:
@@ -14,33 +14,54 @@ output:
**Context**: Validation\
**Category**: Plausibility\
**Subcategory**: Atemporal\
-**Severity**:
+**Severity**: Characterization ✔
## Description
-For a CONCEPT_ID @conceptId (@conceptName), the number and percent of records associated with patients with an implausible gender (correct gender = @plausibleGender).
+For descendants of CONCEPT_ID conceptId (conceptName), the number and percent of records associated with patients with an implausible gender (correct gender = plausibleGenderUseDescendants).
## Definition
+This check will count the number of records for which the person's gender is implausible given the concept for the record. For a given gender-specific concept (e.g., prostate cancer) and its descendants, the check will identify records for which the associated person has an implausible gender (e.g., a female with prostate cancer). There are currently 4 instances of this check - female condition concepts; male condition concepts; female procedure concepts; and male procedure concepts.
-- *Numerator*:
-- *Denominator*:
-- *Related CDM Convention(s)*:
-- *CDM Fields/Tables*:
-- *Default Threshold Value*:
+- *Numerator*: The number of rows with a gender-specific concept whose associated person has an implausible gender.
+- *Denominator*: The number of rows with a gender-specific concept.
+- *Related CDM Convention(s)*: https://ohdsi.github.io/Themis/populate_gender_concept_id.html
+- *CDM Fields/Tables*: `CONDITION_OCURRENCE`, `PROCEDURE_OCCURRENCE`
+- *Default Threshold Value*: 5%
## User Guidance
+A failure of this check indicates one of the following scenarios:
+- The person's gender is wrong
+- The gender-specific concept is wrong
+- The person changed genders and the concept was plausible at the time it was recorded
### Violated rows query
```sql
-
+SELECT
+ cdmTable.@cdmFieldName,
+ cdmTable.@sourceConceptIdField, -- x_source_concept_id for the table of interest (condition_occurrence or procedure_occurrence)
+ cdmTable.@sourceValueField, -- x_source_value for the table of interest
+ COUNT(*)
+FROM @cdmDatabaseSchema.@cdmTableName cdmTable
+ JOIN @cdmDatabaseSchema.person p ON cdmTable.person_id = p.person_id
+ JOIN @vocabDatabaseSchema.concept_ancestor ca ON ca.descendant_concept_id = cdmTable.@cdmFieldName
+WHERE ca.ancestor_concept_id IN (@conceptId)
+ AND p.gender_concept_id <> {@plausibleGenderUseDescendants == 'Male'} ? {8507} : {8532}
+GROUP BY 1,2,3
```
+The above query should help to identify if a mapping issue is the cause of the failure. If the source value and source concept ID are correctly mapped to a standard concept, then the issue may be that the person has the incorrect gender, or that the finding is a true data anomaly. Examples of true anomalies include:
+- Occasional stray code (e.g., due to typo in EHR). This gives an idea how noisy the data is.
+- Newborn codes recorded in the mother’s record (e.g., circumcision).
+- Gender reassignment procedures (e.g., penectomy and prostatectomy in patients with acquired (female) gender). **NOTE** that this is technically a violation of the OMOP CDM specification, since the CDM actually requires that the `gender_concept_id` represents the person's sex at birth. For more information on this convention, see https://ohdsi.github.io/Themis/populate_gender_concept_id.html
### ETL Developers
+Concept mapping issues must be fixed. Ensure as well that source codes are being correctly extracted from the source data. If the CDM accurately represents the source data, then remaining failures should be documented for users of the CDM.
### Data Users
+Persons with implausible gender should not be included in analysis *unless* it can be confirmed with the data provider that these represent cases of gender reassignment, and your analysis does not assume that the `gender_concept_id` represents sex at birth.
diff --git a/vignettes/checks/plausibleUnitConceptIds.Rmd b/vignettes/checks/plausibleUnitConceptIds.Rmd
index 67f1a2bf..df4ba14a 100644
--- a/vignettes/checks/plausibleUnitConceptIds.Rmd
+++ b/vignettes/checks/plausibleUnitConceptIds.Rmd
@@ -1,6 +1,6 @@
---
title: "plausibleUnitConceptIds"
-author: ""
+author: "Katy Sadowski"
date: "`r Sys.Date()`"
output:
html_document:
@@ -14,7 +14,7 @@ output:
**Context**: Verification\
**Category**: Plausibility\
**Subcategory**: Atemporal\
-**Severity**:
+**Severity**: Characterization ✔
## Description
@@ -23,24 +23,43 @@ The number and percent of records for a given CONCEPT_ID @conceptId (@conceptNam
## Definition
-- *Numerator*:
-- *Denominator*:
-- *Related CDM Convention(s)*:
-- *CDM Fields/Tables*:
-- *Default Threshold Value*:
+- *Numerator*: The number of rows in the measurement table with a non-null `value_as_number` and a `unit_concept_id` that is not in the list of plausible unit concept ids. If the list of plausible unit concept ids includes -1, then a NULL `unit_concept_id` is accepted as a plausible unit.
+- *Denominator*: The total number of rows in the measurement table with a non-null `value_as_number`.
+- *Related CDM Convention(s)*: N/A
+- *CDM Fields/Tables*: `MEASUREMENT`
+- *Default Threshold Value*: 5%
## User Guidance
+A failure of this check indicates one of the following:
+- A measurement record has the incorrect unit
+- A measurement record has no unit when it should have one
+- A measurement record has a unit when it should not have one
+- The list of plausible unit concept IDs in the threshold file is incomplete (please report this as a DataQualityDashboard bug!)
+
+The above issues could either be due to incorrect data in the source system or incorrect mapping of the unit concept IDs in the ETL process.
### Violated rows query
```sql
-
+SELECT
+ m.unit_concept_id,
+ m.unit_source_concept_id,
+ m.unit_source_value,
+ COUNT(*)
+FROM @cdmDatabaseSchema.@cdmTableName m
+WHERE m.@cdmFieldName = @conceptId
+ AND COALESCE (m.unit_concept_id, -1) NOT IN (@plausibleUnitConceptIds) -- '-1' stands for the cases when unit_concept_id is null
+ AND m.value_as_number IS NOT NULL
+GROUP BY 1,2,3
```
+Inspect the output of the violated rows query to identify the root cause of the issue. If the `unit_source_value` and/or `unit_source_concept_id` are populated, check them against the list of plausible unit concept IDs to understand if they should have been mapped to one of the plausible standard concepts. If the `unit_source_value` is NULL but the list of plausible unit concept IDs includes -1, then you may need to check your source data to undersand whether or not a unit is available in the source.
### ETL Developers
+Ensure that all units available in the source data are being pulled into the CDM and mapped correctly to a standard concept ID. If a unit is available in the source and is being correctly populated & mapped in your ETL but is *not* present on the list of plausible unit concept IDs, you should verify whether or not the unit is actually plausible - you may need to consult a clinician to do so. If the unit is plausible for the given measurement, please report this as a DataQualityDashboard bug here: https://github.com/OHDSI/DataQualityDashboard/issues. If the unit is not plausible, do not change it! Instead, you should document the issue for users of the CDM and discuss with your data provider how to handle the data.
### Data Users
+It is generally recommended not to use measurements with implausible units in analyses as it is impossible to determine whether the unit is wrong; the value is wrong; and/or the measurement code is wrong in the source data. If a measurement is missing a `unit_concept_id` due to an ETL issue, and the `unit_source_value` or `unit_source_concept_id` is available, you can utilize these values to perform your analysis. If `unit_source_value` and `unit_source_concept_id` are missing, you may consider consulting with your data provider as to if and when you may be able to infer what the missing unit should be.
\ No newline at end of file