OHDSI Home | Forums | Wiki | Github

Mapping ndc codes to higher level drug classes

(Ibrahim Hasani) #1

Dear all,
I would like to know of any database, paid or unpaid, which would help me map drugs to their higher level classes (antidepressants, antiflammatory etc) through NDC codes.

Also, does the CDM facilitate prescription data as well? Very new to this community but would like to contribute as well.

Thank you

(Fred R.) #2

NDC database has a drug class field. The NDC db is freely available for download.


(Ibrahim Hasani) #3

Hello and thank you for the reply.

I am sorry, but I wasn’t clear with my question. I’m looking for the
therapeutic classes (ATC) corresponding to prescription drug strings, which
all have an NDC code as their only identifier.

(Christian Reich) #4

@Ibrahim_Hasani; @farbodr:

The FDA doesn’t support ATC classes, they have their own classes as Fred pointed out. You can use the OMOP Standardized Vocabularies in this manner. This subject had been discussed before, like here. Look at my comment.

(Vojtech Huser) #5

the query in the comments has 2 columns with identical names (atc_id)
corrected query is below

mistake was in second line - ndc.concept_id as atc_id

  atc.concept_id as atc_id, atc.concept_name as atc_name, atc.concept_code as atc_code, atc.concept_class_id as atc_class,
  ndc.concept_id as ndc_id, ndc.concept_name as ndc_name, ndc.concept_code as ndc_code, ndc.concept_class_id as ndc_class
from concept atc
join concept_ancestor a on a.ancestor_concept_id=atc.concept_id
join concept_relationship r on r.concept_id_1=a.descendant_concept_id and r.invalid_reason is null and r.relationship_id='Mapped from'
join concept ndc on ndc.concept_id=concept_id_2 and ndc.vocabulary_id='NDC'
where atc.vocabulary_id='ATC'

(Christian Reich) #7


This is the right query. But we are in the process of fixing the ancestry relationship between ATC and RxNorm (which is what the first half of the query is banking on). Give us a week. After that, the query will have high quality results, both in recall as well as precision. The whole communication about that is here.

(FabrĂ­cio Kury) #8

Hello, this R script will map NDCs to ATC level 4 classes using RxNorm: https://github.com/fabkury/ndc_map. The repository also contains:

  • a poster with statistics about the mapping process, presented at AMIA 2017
  • a paper comparing drug classification systems
  • the FDA NDC database (as of earlier this year) with ATC-4 classes already joined

If you dig into the R code, you can see that first it queries RxNorm (https://rxnav.nlm.nih.gov/APIsOverview.html) for the RxNorm CUI of each DC, then it queries for the ATC classes (if any) of each CUI. RxNorm also offers other drug classification systems (DCS) besides ATC, which you can get by changing the second step aforementioned; but ATC and Veterans Affairs’ Drug Classes (“VA classes”) are substantially better for large dataset analyses than the other DCSs, as depicted in the paper.

Kind regards,