Stuart T. Weinberg, MD, FAAP, FAMIA

Clinical Informatics Consultant

Code Set Scripts
updated December 23, 2021
 

*** NOTE *** - As of November 14th, 2016, all of the flat files noted below now require 'https' instead of 'http'

This information is being posted as a public service to those using the CDC Immunization Information Systems' Code Sets.

Many of these code sets are available as pipe-delimited flat files, lending themselves to retrieval by automated scripts that can then parse and process the data contained in them. However, there are some idiosyncrasies involved with these files about which developers should be aware. The following is a summary of those idiosyncrasies, organized by each Code Set.


CVX Code Set - evaluated 9/5/2015

Flat file: http://www2a.cdc.gov/vaccines/iis/iisstandards/downloads/cvx.txt

  1. the first two characters of the file are ASCII 255 and ASCII 254

  2. starting with the 4th character, every other character is the null character (ASCII 0)

  3. the CVX codes are followed by 7-8 trailing spaces before the next pipe delimiter, for a fixed length of 10

  4. there is an undescribed boolean value between pipes 5 and 6, resulting in an extra field when parsed

  5. the column order is not consistent with what is displayed on the web site or the PDF format:

    PDF: Short Description, Full Vaccine Name, CVX Code, Vaccine Status, Last Updated Date, Notes
    Flat: CVX Code, Short Description, Full Vaccine Name, Notes, Vaccine Status, (extra boolean value), Last Updated Date


MVX Code Set - evaluated 9/5/2015

Flat file: http://www2a.cdc.gov/vaccines/iis/iisstandards/downloads/mvx.txt

  1. the first two characters of the file are ASCII 255 and ASCII 254

  2. starting with the 4th character, every other character is the null character (ASCII 0)


CVX Mapped to Vaccine Groups - evaluated 9/6/2015

Flat file: http://www2a.cdc.gov/vaccines/iis/iisstandards/downloads/VG.txt

  1. no unusual leading characters in the file; no null characters embedded

  2. the CVX codes in the 2nd column are followed by 7-8 trailing spaces before the next pipe delimiter, for a fixed length of 10


Product Name Mapped to CVX/MVX - evaluated 9/7/2015

Flat file: http://www2a.cdc.gov/vaccines/iis/iisstandards/downloads/TRADENAME.txt

  1. no unusual leading characters in the file; no null characters embedded

  2. the CVX codes are followed by 7-8 trailing spaces before the next pipe delimiter, for a fixed length of 10

  3. the MVX codes are followed by 7-8 trailing spaces before the next pipe delimiter, for a fixed length of 10

  4. there is an extra pipe delimiter at the end of each record


CPT Mapped to CVX - evaluated 9/7/2015

Flat file: http://www2a.cdc.gov/vaccines/iis/iisstandards/downloads/cpt.txt

  1. no unusual leading characters in the file; no null characters embedded

  2. the CPT codes are followed by 5 trailing spaces before the next pipe delimiter, for a fixed length of 10

  3. the CVX codes are followed by 7-8 trailing spaces before the next pipe delimiter, for a fixed length of 10

  4. there is an extra numeric field at the end of each record

  5. there appears to be an extra blank field between pipes 2 and 3

  6. the column order is not consistent with what is displayed on the PDF format:

    PDF: CPT Code, CPT Description, CVX Code, Vaccine Name, CPT Code Status, Comments, Last Updated Date
    Flat: CPT Code, CPT Description, (extra blank field), Vaccine Name, CVX Code, Comments, Last Updated Date, (extra numeric field)


CVX Mapped to VIS - evaluated 9/7/2015

Flat file: http://www2a.cdc.gov/vaccines/iis/iisstandards/downloads/cvx_vis.txt

  1. the first two characters of the file are ASCII 255 and ASCII 254

  2. starting with the 4th character, every other character is the null character (ASCII 0)

  3. the CVX codes are followed by 7-8 trailing spaces before the next pipe delimiter, for a fixed length of 10

  4. the format of the VIS Edition Date is a timestamp (YYYY-MM-DD hh:mm:ss) which differs from the more common date format (YYYY/MM/DD) for dates in other flat files


NDC Unit of Sale - evaluated 11/22/2015

Flat file: http://www2a.cdc.gov/vaccines/iis/iisstandards/downloads/NDC/NDC_Unit_sale.txt

When using the Sale NDC table in the Technical Guidance document to create a database table for use with the flat file:

  1. the table is missing the OuterPackForm field which appears in the flat file and the PDF document after the OuterEndDate field

  2. the table lists a field called CVX code which would be an illegal field name in a mySQL table because of the space

  3. the table lists the OuterGTIN field between the OuterRoute and last_update_date fields, but the field is actually last in the flat file and PDF document

  4. the table states that the NDCouterID field is a unique primary key, but the flat file lists the same ID multiple times (examples: 516, 658, 722, 744)

  5. the CVX codes in the flat file are followed by 7-8 trailing spaces before the next pipe delimiter, for a fixed length of 10

  6. the format of the last_update_date field is a timestamp (YYYY-MM-DD hh:mm:ss) which differs from the more common date format (YYYY/MM/DD) for dates in other flat files and also differs from the format in the PDF document


NDC Unit of Use - evaluated 12/17/2015

Flat file: http://www2a.cdc.gov/vaccines/iis/iisstandards/downloads/NDC/NDC_Unit_use.txt

When using the Use NDC table in the Technical Guidance document to create a database table for use with the flat file:

  1. the table states that the NDCUseUnit_ID field is the primary key, but the flat file lists the same ID multiple times (examples: 327, 328, 329, 330, 331, 332, 333, 339, 341, 377)

  2. the table is missing the NoInner field which appears in the flat file and the PDF document after the vaccine_name field (listed as CVX Short Description in the PDF

  3. the table is missing the GTIN field which appears in the flat file and the PDF document as the last field

  4. the CVX codes in the flat file are followed by 7-8 trailing spaces before the next pipe delimiter, for a fixed length of 10

  5. the format of the last_updated_date field is a timestamp (YYYY-MM-DD hh:mm:ss) which differs from the more common date format (YYYY/MM/DD) for dates in other flat files and also differs from the format in the PDF document

  6. 10/14/2019 - The NDCUseUnit_ID field appears to have been renamed NDCInnerID.

  7. 10/14/2019 - There appears to be a new field UseUnitPackForm which has been added...