Starting from a list of ingredients, I wanted to identify all of the products which contain them. I then wanted to add a variable for whether the product is OTC or Rx.
I believe that I am capturing the standard (RxNorm) concepts for the products. (Please correct me if I am wrong.)
create table ingredient_c as
select
c.concept_name,
c.concept_ID
from
ingredients as i left join
v5.concept as c
on
compress(upcase(i.ingredient))=compress(upcase(c.concept_name))
where
c.standard_concept = ‘S’ &
c.concept_class_ID = ‘Ingredient’ &
c.invalid_reason = ’ ’
order by ingredient;
create table drugs as
select distinct
a.concept_name as drug_name_RxNorm,
a.concept_ID as drug_ID_RxNorm,
b.concept_name as ingredient_name
from
ingredient_c as b ,
v5.concept as a ,
v5.concept_relationship as r
where
r.relationship_ID = ‘RxNorm has ing’ &
r.concept_ID_1 = a.concept_ID &
r.concept_ID_2 = b.concept_ID &
R.invalid_reason = ’ ’ &
A.invalid_reason = ’ ’
;
I found in the Concept_class table:
concept_class_id=‘OTC Drug’,concept_class_name=‘Human drug class Human OTC Drug’,concept_class_concept_id=45754858.
However, concept_class_id=‘OTC Drug’ is not in the Concept table.
A search of the Relationship table suggested 'Has legal category (SNOMED)’.
As my list is standardized on RxNorm, I tried to translate it from RxNorm to SNOMED.
CREATE TABLE SNOMED AS
select distinct
D.* ,
a.concept_name as drug_name_SNOMED ,
a.concept_ID as drug_ID_SNOMED
from
drugs as d ,
v5.concept as a ,
v5.concept_relationship as r
where
r.relationship_ID = ’ RxNorm - SNOMED eq’ &
r.concept_ID_1 = d.DRUG_ID_RxNorm &
r.concept_ID_2 = a.concept_ID &
r.invalid_reason = ’ ’ &
a.invalid_reason = ’ ’
;
Here I got stuck, as only 216 of 7593 rows were returned.
So I did a frequency count on Concept_Relationship for relationship_ID ’ RxNorm - SNOMED eq’ and found that, in total, there are only 18,849 rows with this relationship.
So two questions:
1. Am I approaching this in a reasonable way?
2. Is there a way for me to know what relationships can be depended on and which require further development before use?
Thanks,
Gerry