When using the CONCEPT_RELATIONSHIP to get from a SPL to an RxNorm, I see 2 types of RELATIONSHIP_IDs:
Maps to
SPL - RxNorm
What is the difference between these relationship types?
I see cases where there is only a Maps to
(although I couldn’t find this drug in DailyMed):
000b8a5a-7408-458f-a623-17bd6be9a6e6
I see cases where where only the SPL - RxNorm
exists:
00699692-532a-68fd-8a51-3770a81b2208
Then there are a lot that have both:
0003458f-352a-46fa-9d99-230daa76ae29
Here is how I’m thinking about navigating from SPL --> RxNorm, just ignoring those types for now and pulling back distinct concepts.
SELECT DISTINCT c.CONCEPT_CODE AS SPL,
c2.CONCEPT_ID AS TARGET_CONCEPT_ID,
c2.CONCEPT_NAME AS TARGET_CONCEPT_NAME
FROM CONCEPT c
JOIN CONCEPT_RELATIONSHIP cr
ON cr.CONCEPT_ID_1 = c.CONCEPT_ID
AND (cr.INVALID_REASON IS NULL
OR cr.INVALID_REASON = '')
JOIN CONCEPT c2
ON c2.CONCEPT_ID = cr.CONCEPT_ID_2
AND c2.STANDARD_CONCEPT = 'S'
AND c2.DOMAIN_ID = 'Drug'
WHERE c.VOCABULARY_ID = 'SPL'
ORDER BY c.CONCEPT_CODE
Tagging @Christian_Reich.