Level: Field check
Context: Verification
Category: Conformance
Subcategory: Computational
Severity: CDM convention ⚠
The number and percent of records that have a value in the cdmFieldName field in the cdmTableName table that do not conform to the fkClass class.
There is the occasional field in the OMOP CDM that expects not only
concepts of a certain domain, but of a certain concept class as well.
The best example is the drug_concept_id
field in the
DRUG_ERA
table. Drug eras represent the span of time a
person was exposed to a particular drug ingredient, so all
concepts in DRUG_ERA.drug_concept_id
must be of the drug
domain and ingredient class.
drug_concept_id
s in these tables must be
ingredients, which are denoted by the concept class ‘ingredient’drug_concept_id
field in the DRUG_ERA and DOSE_ERA
tablesThis check identifies whether records with the correct concepts were written to the correct tables as derived from drug_exposure. If incorrect concepts are allowed to persist, a study package could run on the DRUG_ERA and DOSE_ERA tables but may not produce expected results.
You may inspect the violating rows using the following query:
-- @cdmTableName.@cdmFieldName is either drug_era.drug_concept_id or dose_era.drug_concept_id
SELECT
'@cdmTableName.@cdmFieldName' AS violating_field,
co.concept_class_id AS violating_class,
cdmTable.*
FROM @cdmDatabaseSchema.@cdmTableName cdmTable
LEFT JOIN @vocabDatabaseSchema.concept co ON cdmTable.@cdmFieldName = co.concept_id
WHERE co.concept_id != 0
AND (co.concept_class_id != 'ingredient')
Recommended actions:
Few options are available to correct this error without amending the ETL code that populated your OMOP CDM. If this check is failing it means that there is likely an error in the ETL process that builds the era tables. The DRUG_ERA table is used often in network studies and is meant to identify periods of time where a person is exposed to a specific drug ingredient, allowing for up to 30 days between exposures. If there are records in the DRUG_ERA tables that are not mapped to their ingredient-level ancestor then cohorts and analyses that make use of the DRUG_ERA table will run but they will return unexpected or erroneous results. You may consider dropping the offending rows if you know that they are not needed for analysis, but do so at your own risk.