In the process of QCing LAERTES, specifically was looking at drug concepts that did not get mapped to an ingredient.
- Original LAERTES Vocab Version:
OMOP Vocabulary v5.0 17-JUL-15
- Updated LAERTES Vocab Version :
v5.0 11-MAR-16
We use the CONCEPT_ANCESTOR table to get drugs to their INGREDIENT level. There seems to be cases where things used to map to themselves using CONCEPT_ANCESTOR but now do not (see query in APPENDIX A and results below).
Is this a bug or a misunderstanding on my part?
Concepts that No Longer Map To Themselves in CONCEPT_ANCESTOR
19023420 Bile fluid 19080435 FACTOR IX,RECOMBINANT 19086313 h influenzae type b 19112612 Influenza Virus Trivalent-Split 2004 19112614 Influenza Virus Vaccine TV P-SURF 2004 19112615 Influenza Vaccine Trivalent 2004 (Live) 19121608 Influenza virus vaccine 43532251 antithrombin alfa 43533108 Influenza Virus Vaccine, Live Attenuated, A-Texas-50-2012 (H3N2) strain 46233853 oldaterol
APPENDIX A
Finding Ingredients that used to map to themselves in JULY-176-2015 but do not in MARCH-11-2016.
WITH CTE_OLD AS (
SELECT c.*
FROM [VOCABULARY_v5.0_20150717].dbo.CONCEPT c
JOIN [VOCABULARY_v5.0_20150717].dbo.CONCEPT_ANCESTOR cr
ON cr.ANCESTOR_CONCEPT_ID = c.CONCEPT_ID
JOIN [VOCABULARY_v5.0_20150717].dbo.CONCEPT c2
ON c2.CONCEPT_ID = cr.DESCENDANT_CONCEPT_ID
WHERE c2.DOMAIN_ID = 'DRUG'
AND c.DOMAIN_ID = 'DRUG'
AND c.VOCABULARY_ID = 'RxNorm'
AND c2.vocabulary_id = 'RxNorm'
AND c2.CONCEPT_CLASS_ID = 'Ingredient'
AND c.CONCEPT_CLASS_ID = 'Ingredient'
AND c.CONCEPT_ID = c2.CONCEPT_ID
),
CTE_NEW AS (
SELECT c.*
FROM [VOCABULARY_v5.0_20160311].dbo.CONCEPT c
JOIN [VOCABULARY_v5.0_20160311].dbo.CONCEPT_ANCESTOR cr
ON cr.ANCESTOR_CONCEPT_ID = c.CONCEPT_ID
JOIN [VOCABULARY_v5.0_20160311].dbo.CONCEPT c2
ON c2.CONCEPT_ID = cr.DESCENDANT_CONCEPT_ID
WHERE c2.DOMAIN_ID = 'DRUG'
AND c.DOMAIN_ID = 'DRUG'
AND c.VOCABULARY_ID = 'RxNorm'
AND c2.vocabulary_id = 'RxNorm'
AND c2.CONCEPT_CLASS_ID = 'Ingredient'
AND c.CONCEPT_CLASS_ID = 'Ingredient'
AND c.CONCEPT_ID = c2.CONCEPT_ID
)
SELECT 'OLD ONLY' AS TYPE, * FROM ( SELECT * FROM CTE_OLD EXCEPT SELECT * FROM CTE_NEW) z
UNION
SELECT 'NEW ONLY' AS TYPE, * FROM ( SELECT * FROM CTE_NEW EXCEPT SELECT * FROM CTE_OLD) z
ORDER BY 1,2