OHDSI Home | Forums | Wiki | Github

Duplicate concepts in codesets - Atlas

estimationmethods
vocabularies
atlas
patientprediction
cdm

(Akshay Kumar) #1

Hello Everyone,

I was selecting concepts to be included in concept set under Atlas.

Let’s say I have a concept called “ABC” which has 2 children “DEF” and “GHI”. I add the concept “ABC” and select “include descendants”. So in to total I see now 3 included concepts in my concept set.

But let’s say that without realizing the “GHI” is a child of “ABC”, I add the concept “GHI” again to the concept set separately.

When I executed the generated SQL for codeset, I see that there are duplicate concepts in codesets based on what I defined.

Q1) Doesn’t Atlas ignore the duplicates?

Q2) Only problem with having duplicates will be that the query will take long time to run. Is there any other problem to having duplicate concept ids?

Q3) Let’s say I have two concept sets C1 and C2. Is there anyway to check the overlapping concepts between these two concepts in Atlas? I know we can do in SQL but is it possible in Atlas?

Q4) I guess the “cart” button is of no use for children concepts. Whether we enable or disable it, concept is going to be part of the concept set. Am I right? Because under the included concepts tab, irrespective whether an item is added into cart or not, I see them in the final list of concepts under codesets. So I guess it’s expected. But wondering whether it’s possible to ignore certain children concepts?

Q5) I see that the cart is enabled or disabled by default (automatically) for few concepts. May I know on what basis it is done?


(Chris Knoll) #2

I don’t think that’s true. This is the generated sql:

INSERT INTO #Codesets (codeset_id, concept_id)
SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
( 
  select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in ({concept_id_list})
UNION  select c.concept_id
  from @vocabulary_database_schema.CONCEPT c
  join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
  and ca.ancestor_concept_id in ({concept_id_list)
  and c.invalid_reason is null

) I
) C;

The select distinct at the top ensures that the concept ID is only put into the concept set once.

It does.

Not a problem. There are no dupes.

You can do this with 2 concept sets saved in the concept set repository. In atlas, go to ‘Concept Sets’, open a concept set, and then flip to the Compare tab. You can pick a second concept set and run the report which will tell you which concepts are in one or the other (or both).

The cart button just adds/removes a single concept from the concept set expression. It doesn’t know anything about children. What if the concept was used as an ‘exclude’? So, think of the cart being ‘lit’ as ‘you added this concept to your concept set for include/exclude/descendant choice.’. If you want to remove ‘redundant’ cocnepts from a concept set expression (ie, you included a parent and a child, but the parent’s ‘include descendants’ is already including the child that you manually entered, you can use the ‘optimize’ function in the conceptset editor. This will remove children from a concpet set if they were added via a parent.

It’s based on if you have a concept set open in Atlas. If you have a concept set open, then when you do a vocabulary search, the carts will lite up for any concept you’ve added to the ‘active’ concept set you have open.


t