Skip to main content

CodeRx Drug Database

CodeRx documentation

CodeRx connects the drug identifiers found in healthcare data to information about the products they represent. For example, an NDC on a pharmacy claim can be linked to an RxNorm drug concept, its brand or generic name, and its therapeutic class. These relationships let you analyze medications across different package sizes, manufacturers, and source systems.

Tuva Core includes three CodeRx Open tables and uses them to normalize and enrich pharmacy claims and clinical medication records. You can also configure Core to use a purchased CodeRx Enterprise subscription. This page describes the integration in Tuva Core 1.0.

CodeRx Open and Enterprise​

CodeRx Open is an annual release with a limited set of tables and columns. Tuva includes a snapshot in its versioned Data Assets, so you do not need to download CodeRx separately to use the Open integration.

CodeRx Enterprise requires a separate paid subscription from CodeRx. It provides the full database, including historical products, additional columns, and additional tables for drug ingredients, indications, pricing, packaging, and other uses. Enterprise is delivered through CodeRx's Amazon S3 distribution in CSV and Parquet. Use the access instructions and snapshots supplied for your subscription.

Open in Tuva CorePurchased Enterprise
ContentsThree tables: packages, drugs, and classesFull licensed delivery, including expanded versions of those tables
RefreshThe Open snapshot included in the selected Tuva data-asset versionVendor-published updates loaded by your ingestion process
DistributionTuva's versioned public data assetsCodeRx's authorized S3 delivery
Warehouse relations used by Coreterminology.coderx_packages, terminology.coderx_drugs, terminology.coderx_classescoderx.packages, coderx.drugs, coderx.classes
Configurationuse_coderx_enterprise: false (the default)use_coderx_enterprise: true

Enabling Enterprise changes which three relations Core reads. It does not download the subscription or automatically create analytics from every Enterprise table. Additional licensed tables remain available for downstream analysis in your warehouse.

Enterprise tables​

The inventory below describes the 14-table Enterprise S3 delivery verified in November 2026. The basic/ and premium/ names are folders within that licensed delivery. basic/ is not the three-table CodeRx Open subset.

FolderTableWhat it provides
basic/classesDrug classification relationships
basic/drugsDrug concepts and their clinical-product relationships
basic/excipientsInactive ingredient information
basic/ingredientsActive ingredient components and strength information
basic/packagesNDC package records and related product information
basic/synonymsAlternative drug names for search and matching
premium/indicationsDrug-to-condition relationships for possible treatment or prevention
premium/label_imagesProduct label image references
premium/ncpdp__dose_formsDose-form terminology mappings
premium/ncpdp__dose_unitsDose-unit terminology mappings
premium/ncpdp__representative_ndcsRepresentative NDC mappings for drug products
premium/packagingPackaging components and quantities
premium/pricing__cms_asp_hcpcsCMS average sales price information associated with HCPCS codes
premium/pricing__cms_asp_hcpcs_historicalHistorical CMS ASP/HCPCS pricing records

Table availability and columns can change with vendor releases. Different tables can also have different publication dates; retain the date for each loaded table rather than assuming every file is refreshed together. See CodeRx's current offering for subscription scope beyond this inventory.

The three tables Core uses​

TableWhat it describesCommon use
packagesNDC package identifiers and the RxNorm drug concepts they map toConnect a claim's NDC to a drug and its clinical product
drugsDrug concepts, names, brand status, and corresponding clinical drug conceptsGroup branded products with their unbranded clinical product
classesDrug-to-class relationships, including ATC hierarchy levelsSummarize medications by therapeutic class

Core uses shared interfaces for these tables throughout pharmacy normalization, medication enrichment, and Data Quality. Dependent packages can use the same interfaces. The selected terminology contributes NDC, RxNorm, and ATC information to core.medication in the Core Data Model.

A drug can have more than one class membership. Core selects the lexicographically first non-null level 3 ATC code to preserve one row per drug in its shared class interface. Use the underlying classes table when your analysis needs all class relationships.

The active and prescribable fields describe individual drug and package records. Do not assume every row in the bundled Open package table is active; filter these flags when your question is about currently available products.

Use the Open data assets​

These examples assume Tuva Core is already installed in a dbt project with its Input Layer mapped. Set the variables in that root project's dbt_project.yml. Keep your existing domain settings; the example below enables claims.

dbt_project.yml
vars:
claims_enabled: true
use_coderx_enterprise: false
tuva_core_data_asset_version: '1.0.0'

Install the project's dependencies and build:

dbt deps
dbt build

The CodeRx seeds load the selected Tuva snapshot into the terminology schema. If tuva_schema_prefix is set, the output schema is <tuva_schema_prefix>_terminology. You can load just these three assets with:

dbt seed --select terminology__coderx_packages terminology__coderx_drugs terminology__coderx_classes

For the default data-asset version, the files are under tuva-core/1.0.0/terminology/ in Tuva's public data-asset storage. The tuva_core_data_asset_version variable selects the complete Tuva snapshot; it does not request the latest CodeRx release. See seed loading for storage and version configuration.

For example, this query connects an NDC to its drug and clinical product:

select
p.ndc11,
d.drug_id,
d.drug_name,
d.clinical_drug_id,
d.clinical_drug_name
from terminology.coderx_packages p
join terminology.coderx_drugs d
on p.drug_id = d.drug_id;

Use a purchased Enterprise subscription​

Load the licensed data​

Follow CodeRx's access instructions and use the S3 snapshot location supplied for your subscription. Load the vendor's files through your warehouse ingestion process, preserving drug and NDC identifiers as strings so leading zeros are retained. Keep the snapshot date with your load records so you can identify which terminology release an analysis used.

Core expects packages, drugs, and classes in the coderx schema of the dbt target database. The schema is fixed by Core's source definition; tuva_schema_prefix does not rename it. Tuva does not create or refresh these licensed source relations.

You can load the three tables there directly or expose views over your licensed landing tables. For example, in Snowflake, replace the database and landing-schema names below with your own:

create schema if not exists TUVA_DATABASE.coderx;

create view TUVA_DATABASE.coderx.packages as
select
ndc11, ndc, drug_id, drug_name, is_brand,
clinical_drug_id, clinical_drug_name, active, prescribable
from LICENSED_DATABASE.CODERX_RAW.packages;

create view TUVA_DATABASE.coderx.drugs as
select
drug_id, drug_name, is_brand,
clinical_drug_id, clinical_drug_name, active, prescribable
from LICENSED_DATABASE.CODERX_RAW.drugs;

create view TUVA_DATABASE.coderx.classes as
select
drug_id, drug_name,
atc_1_code, atc_1_name, atc_2_code, atc_2_name,
atc_3_code, atc_3_name, atc_4_code, atc_4_name
from LICENSED_DATABASE.CODERX_RAW.classes;

These views expose the columns Core requires while leaving the complete licensed tables available in the landing schema. In Snowflake, the dbt role needs USAGE on the database and schema and SELECT on all three source relations. When using views, their owner must retain access to the underlying tables.

Select Enterprise and rebuild​

Once all three relations are available, update the root project's variables:

dbt_project.yml
vars:
claims_enabled: true
use_coderx_enterprise: true

Use an unquoted YAML boolean: true, not "true". Then rebuild your project so existing outputs use the selected terminology:

dbt build

The switch selects Enterprise for all three shared interfaces. Missing Enterprise relations cause the dependent queries to fail; unmatched drug identifiers do not fall back to Open. This keeps the terminology source consistent across the build.

After loading a newer Enterprise snapshot, rebuild the affected Core and downstream models. Loading new source tables alone does not refresh materialized analytics. Neither tuva_core_data_asset_version nor custom_bucket_name controls your Enterprise subscription's S3 delivery.

Build medication analytics​

Use core.medication to analyze patient medication records enriched with the selected terminology. Keep source_type and data_source in view when working with claims and clinical records together. A drug's class or indication describes a possible use; it does not establish why an individual patient received the drug.

The Drugs data mart adds medication episodes, potential treatment gaps, refill review lists, and brand-to-generic opportunities.

For the full vendor schema and examples, see the CodeRx documentation. For Core's switch and related settings, see Medication Terminology.