Querying a Medication's NDC (National Drug Code)

2,257 views
Skip to first unread message

Ya`aqov Walker

unread,
May 13, 2011, 2:11:40 PM5/13/11
to SMART App Developers
Hi -
What would the simplest way to pull up the NDC (National Drug Code)
number(s) associated with a given [drugName] (or rxcui) from a
patient's medication list?

I realize that this might venture into RxNorm API's getNDCS web
service function, and could be treated as off-topic, but I just
noticed that the SMART CodedValue node for drugName uses
http://rxnav.nlm.nih.gov/REST/rxcui/{rxcui}, and that the RxNorm API
says that it can return list of NDCs associated with a given rxcui
simply by using the convention: http://rxnav.nlm.nih.gov/REST/rxcui/{rxcui}/ndcs
(see: http://rxnav.nlm.nih.gov/RxNormRestAPI.html#label:r11).

I hope I'm making sense here - I'm trying to quickly get up to speed
on this, and my app is designed to lookup data by NDCs, rather than by
rxcui's, so a quick example of how I could query this would be great.

Thanks in advance,

-Ya`aqov Walker

Josh Mandel

unread,
May 13, 2011, 9:57:07 PM5/13/11
to smart-app-...@googlegroups.com
HI Ya`aqov,

You should be able to use the RxNav REST service to obtain a list of
NDCs given a SMART medication's RxNorm code. It sounds like you have
the right idea with the /ndcs function you mentioned below.

For example, if I run the API Playground app on Alex Lewis, and then
click "GET", I can pull out the first drug's code via:

response.where('?m rdf:type sp:Medication').where('?m sp:drugName
?n').where('?n sp:code ?c')[0].c.value

Yielding: http://rxnav.nlm.nih.gov/REST/rxcui/855334

If I tack on '/ndcs/', I get the URL:
http://rxnav.nlm.nih.gov/REST/rxcui/855334/ndcs

Dereferencing this yields an XML document from the NLM, with a list of
(several!) NDC codes.

Hope this helps,

Josh

Ya`aqov Walker

unread,
May 23, 2011, 8:13:34 PM5/23/11
to SMART App Developers
Thanks for your quick reply.

Now, how could I do the reverse: to search for the RxCUI given an NDC
number?

Additionally (and this might beyond your scope) if I wanted to work
with NDF-RT data, how could I take an RxCUI from the SMART platform,
and match it with an NUI?

In general, I'm running into an issue where I need to know if there's
a single ID that I could use to identify medications across different
platforms - NDC's are common with the FDA, RxCUI is used with RxNav
datasets, SMART uses English abbreviated names, and NDF-RT uses NUI.

Any pointers would be highly appreciated.


Thanks,

Ya`aqov

Josh Mandel

unread,
May 23, 2011, 8:27:50 PM5/23/11
to smart-app-...@googlegroups.com
Hi Ya`aqov,

The SMART team believes that a proliferation of coding systems (for
drugs as well as other entities in the medical record) can make
writing health apps unnecessarily difficult -- and it sounds like
you're experiencing this difficulty! We try to make life easier for
SMART app developers by providing consistent, predictable codes. For
medications, we're using RxNorm SCDs and SBDs (not english names,
though we do provide these as title attributes alongside RxNorm
codes). So when you obtain a SMART medication list, the RxNorm code
for each medication should be clear and unambiguous.

When it comes to mapping drug codes between systems, the RxNorm
database provided by the National Library of Medicine is a very useful
resource. Some of its power is exposed through a public-facing REST
interface at http://rxnav.nlm.nih.gov/RxNormRestAPI.html -- but for
deeper mapping capabilities you may need to download the database and
query it directly (more info at
http://www.nlm.nih.gov/research/umls/rxnorm/docs/rxnormfiles.html).

From the RxNav documentation, you can query for RxNorm identifiers by
NDC or NUI:

* http://rxnav.nlm.nih.gov/REST/rxcui?idtype=NDC&id=54569456800
* http://rxnav.nlm.nih.gov/REST/rxcui?idtype=NUI&id=N0000155159

I hope this helps,

Josh

Ya`aqov Walker

unread,
May 23, 2011, 8:47:18 PM5/23/11
to SMART App Developers
That clarified a lot - thanks for the timely feedback.

On May 23, 8:27 pm, Josh Mandel <jman...@gmail.com> wrote:
> Hi Ya`aqov,
>
> The SMART team believes that a proliferation of coding systems (for
> drugs as well as other entities in the medical record) can make
> writing health apps unnecessarily difficult -- and it sounds like
> you're experiencing this difficulty!  We try to make life easier for
> SMART app developers by providing consistent, predictable codes.  For
> medications, we're using RxNorm SCDs and SBDs (not english names,
> though we do provide these as title attributes alongside RxNorm
> codes).  So when you obtain a SMART medication list, the RxNorm code
> for each medication should be clear and unambiguous.
>
> When it comes to mapping drug codes between systems, the RxNorm
> database provided by the National Library of Medicine is a very useful
> resource. Some of its power is exposed through a public-facing REST
> interface athttp://rxnav.nlm.nih.gov/RxNormRestAPI.html-- but for
> deeper mapping capabilities you may need to download the database and
> query it directly (more info athttp://www.nlm.nih.gov/research/umls/rxnorm/docs/rxnormfiles.html).
>
> From the RxNav documentation, you can query for RxNorm identifiers by
> NDC or NUI:
>
>  *http://rxnav.nlm.nih.gov/REST/rxcui?idtype=NDC&id=54569456800
>  *http://rxnav.nlm.nih.gov/REST/rxcui?idtype=NUI&id=N0000155159
Reply all
Reply to author
Forward
0 new messages