OHDSI / Atlas

ATLAS is an open source software tool for researchers to conduct scientific analyses on standardized observational data
http://atlas-demo.ohdsi.org/
Apache License 2.0
266 stars 136 forks source link

How is a cohort generated using a concept set of non-standard codes? #416

Closed leeevans closed 7 years ago

leeevans commented 7 years ago

It's recommended to always use standard codes in cohort definitions (which is portable across data sets) but I thought it should be possible to generate a cohort in ATLAS using a concept set of non-standard codes. e.g. Using Read codes in a CPRD dataset.

Expected behavior

The generated cohort SQL for a concept set with non-standard concept codes checked as 'Mapped' would use the 'Maps from' concept relationship to include the associated standard concept codes or, if not checked as 'Mapped', the generated SQL would use the source_concept_id columns in the CDM tables to match the non-standard concept id.

Actual behavior

The generated SQL looks for 'Maps to' relationship if the non-standard code is checked as 'Mapped' which doesn't find anything for non-standard codes. The generated SQL doesn't appear to use the CDM table source_concept_id columns for non-standard concept codes. Maybe I'm doing something wrong but the result is that no data is found in the generated cohort.

Steps to reproduce behavior

I created the following example cohort definition in demo atlas using a list of Non-standard RA Read codes on synpuf dataset (some with mapped flag set): http://www.ohdsi.org/web/atlas/#/cohortdefinition/152999/conceptset/0/details

Review the generated PostgreSQL code on the export tab.

Note. There are no Read codes in the synpuf dataset so this example cohort is only useful to review the generated SQL- it will never find any matching data.

schuemie commented 7 years ago

I agree with Lee that it should be possible to use the source_concept_id field in a cohort definition. We would strongly like to encourage people to use standard concepts, but it sometimes unavoidable to use source concepts instead (unless you can wait several months and a new ETL for your problem to fixed in the vocab).

gowthamrao commented 7 years ago

Agree. Atlas allows us to specify condition_source_concept_id. For condition_concept_id leave the default "any condition"

chrisknoll commented 7 years ago

@leeevans , I think this is working correctly: the concept set is going to return any concepts that would map to the concepts you specified in the concept set. Also: the concepts you specified are also returned in the concept set expression results, so if you are already using non-standard concepts in your cocnept set, you don't need to specify 'Mapped'.

Your cohort definition example is attempting to find those non-standard concepts in the standard concept field. To make the concept set look at the non-standard field (condition_source_concept, for example), you should set the dropdown to 'Any Condition' and add the filter 'Condition Source Concept' to the criteria. This will give you a different drop down to associate the source concepts to your concept set.

leeevans commented 7 years ago

Great. Thanks for the explanation.