I’m recently starting to work with OMOP CDM. I’m wondering if there’s any way to find the concepts I need in the Vocabularies, or the only way is by querying the database?
My problem comes because I need Concepts to represent family relationships like “Mother”, “Grandfather” and so on. If I try to query the Concept table with something like
SELECT * FROM concept WHERE concept_name LIKE "%mother%";
All the results I got have invalid_reason = U (Updated). So… how can I find the right concepts? Is any other way? Or at least, how can I find the updated concept for this one?
Hi,@josholsan.
If concept is updated ,there is a relationship between it and standard one in “concept_relationship” table.
So for your example try
SELECT c.* FROM concept a JOIN concept_relationship b ON a.concept_id=concept_id_1
JOIN concept c on concept_id_2=c.concept_id
WHERE a.invalid_reason = 'U' AND relationship_id='Maps to'
AND lower(a.concept_name) LIKE '%mother %';
(I added space after ‘mother’ to exclude concepts like cheMOTHERapy etc.)
Thanks you so much Eldar, I didnt knew how the relationship between concepts works. I think that the code you sent me works fine, but I’m having a memory limit exceeded error, I think this is because of my cluster’s performance.