Build a medication list normalizer with NDC to RxNorm
How it works
- Look up each NDC (product, package or 11-digit) in the FDA NDC Directory.
- Read the linked RxNorm concept ids.
- Group your rows by RxCUI and label each group with the concept's name.
The code
TypeScript with @healthcare.dev/sdk. Set HDEV_API_KEY to a free key and run it. Every response carries its source, release and license in meta.
import { HealthcareDev } from "@healthcare.dev/sdk"; const hdev = new HealthcareDev(); export async function groupByRxNorm(ndcs: string[]) { const groups = new Map<string, { name: string; ndcs: string[] }>(); for (const ndc of ndcs) { const { data: product } = await hdev.drugs.ndc(ndc); for (const rxcui of product.rxcuis) { if (!groups.has(rxcui)) { const { data: concept } = await hdev.drugs.rxnorm(rxcui); groups.set(rxcui, { name: concept.name, ndcs: [] }); } groups.get(rxcui)!.ndcs.push(ndc); } } return [...groups].map(([rxcui, g]) => ({ rxcui, ...g })); } await groupByRxNorm(["0002-0152-01", "0002-1433-80"]);
Or ask your agent
Connect the MCP server and ask in plain language. It calls map_ndc_to_rxnorm, lookup_drug and cites what it found.
Map NDC 0002-0152-01 to RxNorm and tell me the ingredient and strength.
Take it further
- Cache RxCUI lookups: concepts change far less often than NDC listings.
- Flag NDCs whose
statusis retired or that have areplaced_byrecord. - Add NADAC prices per group to compare packages of the same drug.
Reference data only, not medical advice or a coverage determination. Send codes, NDCs and NPIs, never patient information.
More examples
Claim code checker
Catch non-billable, retired and mistyped ICD-10-CM and HCPCS codes before a claim goes out. One batch call checks up to 100 codes, with the release each answer came from.
Recall and shortage alerts
Watch a list of NDCs for FDA recalls and drug shortages and alert when one appears. Class I recalls first, with the recalling firm, reason and lot codes.
NPI verification
Verify a provider's NPI at sign-up: check digit, whether CMS issued it, active or deactivated, and the name, specialty and license state on record.