OHDSI / WebAPI

OHDSI WebAPI contains all OHDSI services that can be called from OHDSI applications
Apache License 2.0
131 stars 169 forks source link

ACHILLES in ATLAS Data Sources, Drug Exposure Report #1966

Open ericaVoss opened 3 years ago

ericaVoss commented 3 years ago

We keep coming across this issue. For data partners that have drug exposure data on the ingredient level . . . in ACHILLES some how acetaminophen gets associated to the “ingredient” of “ALKA-SELTZER PLUS COLD AND COUGH COOL MENTHOL - dextromethorphan hydrobromide, chlorpheniramine maleate, acetaminophen, phenylephrine hydrochloride capsule, liquid filled”. This Alk-seltzer is a classification concept - 44361362.

image

In my database I see it for another component, dextromethorphan

image

So the weird thing is, why does ACHILLES for this ingredient Drug Exposure – instead of mapping to itself, maps to this classification. Do you know what query is getting run here?

AnthonyMolinaro commented 3 years ago

@ericaVoss Alright, I reached out to @anthonysena and he informed me that the queries come from here: Atlas drug queries and also leverage concept_hierarchy.

So, the issue could actually be in several places. I'll dig around and see what I can find.

ericaVoss commented 3 years ago

@AnthonyMolinaro somewhere in the queries we are forgetting to filter on STANDARD_CONCEPT = 'S'

SELECT *
FROM CDM_OPTUM_EXTENDED_DOD_V1478.CONCEPT c
  JOIN CDM_OPTUM_EXTENDED_DOD_V1478.CONCEPT_ANCESTOR ca
    ON ca.DESCENDANT_CONCEPT_ID = c.CONCEPT_ID
  JOIN CDM_OPTUM_EXTENDED_DOD_V1478.CONCEPT c2
    ON c2.CONCEPT_ID = ca.ANCESTOR_CONCEPT_ID
    AND c2.CONCEPT_NAME LIKE '%ALKA%'
    AND c2.CONCEPT_CLASS_ID = 'Ingredient'
WHERE c.CONCEPT_ID = 1125315

So this Alka-Seltzer is listed as an ingredient but it is also listed as Classification . . . it shouldn't be returning in these DRUG_EXPOSURE graphs in ACHILLES.

ericaVoss commented 3 years ago

@AnthonyMolinaro just wanted to make sure this is still on your radar

AnthonyMolinaro commented 3 years ago

@ericaVoss Thanks for the nudge, will get back to this.

AnthonyMolinaro commented 3 years ago

Hey @ericaVoss , It looks like the issue is in CONCEPT_HIERARCHY and not TREEMAP. The nonstandard mappings are already present in CONCEPT_HEIRARCHY by the time TREEMAP is accessed by the webapi and there's no way to filter them out because only the parent concept id is being returned:

select c.concept_id,  c.standard_concept  std, c.concept_name,
       c2.concept_id, c2.standard_concept std, c2.concept_name
  from cdm_optum_extended_dod_v1478.concept c
  join cdm_optum_extended_dod_v1478.concept_ancestor ca
    on ca.descendant_concept_id = c.concept_id
  join cdm_optum_extended_dod_v1478.concept c2
    on c2.concept_id = ca.ancestor_concept_id
   and lower(c2.concept_name) like '%alka%'
   and lower(c2.concept_class_id) = 'ingredient'
 where c.concept_id = 1125315

concept_id | std | concept_name  | concept_id | std | concept_name                                                                                                                                                              
-----------+-----+---------------+------------+-----+-------------------------------------------------
   1125315 | S   | acetaminophen |   44361362 | C   | ALKA-SELTZER PLUS COLD AND COUGH COOL MENTHOL...

select concept_id, concept_name, level1_concept_name
  from results_optum_extended_dod_v1478.concept_hierarchy
 where concept_id = 1125315
   and treemap = 'Drug'

concept_id | concept_name  | level1_concept_name                                                                                                                                                       
-----------+---------------+-------------------------------------------------
   1125315 | acetaminophen | ALKA-SELTZER PLUS COLD AND COUGH COOL MENTHOL... 
   1125315 | acetaminophen | acetaminophen                                                                                                                                                             

It seems like the fix is to filter on standard concepts in the creation of concept_hierarchy. Looping in @anthonysena and @chrisknoll for some feedback.

AnthonyMolinaro commented 2 years ago

Discussing with @anthonysena and @chrisknoll

I think what Erica initially suggested works. We add: AND c2.standard_concept = 'S' after line 100:

https://github.com/OHDSI/WebAPI/blob/master/src/main/resources/ddl/results/init_concept_hierarchy.sql#L100

Thoughts?

chrisknoll commented 2 years ago

That should be fine. In the past I wondered why we'd need to filter on standard concepts in concept_ancestor because, by definition, everything in concept_ancestor is standard. However, I see now that there are concepts with std_concept = 'C', maybe that's a new development, but now filtering on 'S' makes sense when you're not looking for classification concepts.

AnthonyMolinaro commented 2 years ago

That should be fine. In the past I wondered why we'd need to filter on standard concepts in concept_ancestor because, by definition, everything in concept_ancestor is standard. However, I see now that there are concepts with std_concept = 'C', maybe that's a new development, but now filtering on 'S' makes sense when you're not looking for classification concepts.

Great, thanks Chris. I'll go ahead and test it out to verify. I'd like to at least quantify the difference in rows before/after so we know how different CA looks once we make this change. I'll post my findings in a PR and we can go from there.

chrisknoll commented 2 years ago

BTW: I think it might be an error for the concept you found to be marked 'C'....usually the 'C' concepts (if I recall correctly) were classification type concepts ... so to have a concept that looks like a branded drug , but has a class of 'ingreident', but has a std_concept of 'C'...that record seems wrong in a number of ways.

@cgreich can you tell us if this is a normal concept?