Parsing Dates in CMS' Medicare NCCI Add-on Code Edits
The Centers for Medicare & Medicaid Services (CMS) publishes Add-on Code (AOC) Edits (opens in a new tab) as part of the National Correct Coding Initiative (NCCI).
AOCs identify services that should be performed in association with another service. In order to reduce improper payments, Medicare publishes the list to help claim submitters effectively scrub their claims to ensure that the codes submitted are correct. The codes listed in the Add-on Code Edit files are not frequently eligible for payment if the code is billed independently, so the data file can be used to find common errors. While these edits are intended for Medicare Part B claims, many commercial plans also utilize some of the edits listed by CMS as Add-on codes, so they are generally a good starting place for anyone implementing claim scrubbing into their system or process. Data are published separately for Medicare and Medicaid.
CMS posts updates to the Add-on Code Edits annually on their website. Occasionally, CMS may also provide quarterly updates if necessary. Any time CMS posts an update, the update includes all of the public Add-on Code Edits in a spreadsheet format (both .txt
and .xlsx
are provided).
Interestingly, the Medicare NCCI Edits processes contains several differences between each major category. For example, MUEs are provided in both .csv
and .xlsx
formats, while both PTP and AOC Edits are provided in .txt
and .xlsx
. Both MUEs and PTPs are published quarterly, while AOCs are published annually with the quarterly option (mentioned above) if changes are required.
The AOC Edit data set includes 8 columns that allow users to determine the effective date range of the edit, the type of the edit, the code each edit applies to, and the code it should (typically) be billed in conjunction with.
Interestingly, every date provided in the AOC Edit files uses a format that is not used for dates in the NCCI PTP files (the MUE files don't contain dates). I don't believe that the format is fully described anywhere in CMS' Medicare NCCI documentation, but it is an Ordinal Date (opens in a new tab). Medicaid uses this date format often for its published data sets (including NCCI PTP files), while Medicare typically does not use this format in other published datasets.
It is incorrectly listed in the Medicaid Technical Guidance Manual (example from 2022) (opens in a new tab) as a Julian Date. At first, I also thought it might be a Julian Day (opens in a new tab), but closer inspection shows that they are simply providing a day-of-year number on top of the Gregorian calendar, not a reference to the Julian period. This is a common misnomer for this specific date format, but luckily the data examples clearly indicate an Ordinal Date.
This format is used in 4 columns in the Add-on Code Edits dataset: AOC_DelDT
, Primary_Code_DelDT
, AOC_Edit_EffDT
, AOC_Edit_DelDT
.
The python code below can be used to convert from the YYYYDDD
format (Ordinal Date) to YYYY-MM-DD
format:
from datetime import datetime, timedelta
def convert_ordinal_date_to_standard(ordinal_date_str):
"""
Convert a date from 'YYYYDDD' format to 'YYYY-MM-DD' format.
:param ordinal_date_str: String representing the date in 'YYYYDDD' format.
:return: String representing the date in 'YYYY-MM-DD' format.
"""
if not ordinal_date_str:
return 'NULL'
try:
# Extract the year and the day of the year from the string
year = int(ordinal_date_str[:4])
day_of_year = int(ordinal_date_str[4:])
# Create a date object representing January 1st of the year
date = datetime(year, 1, 1)
# Add the days to reach the desired date (subtracting 1 because January 1st is day 1)
converted_date = date + timedelta(days=day_of_year - 1)
# Return the date in 'YYYY-MM-DD' format
return converted_date.strftime('%Y-%m-%d')
except ValueError as e:
return f"Invalid input: {e}"
While not terribly difficult or time-consuming to convert, I find the use of the Ordinal Date in CMS' NCCI Add-on Code datasets confusing. The NCCI PTP files use the YYYYMMDD
format, so it is not internally consistent, and the Ordinal Format is uncommon enough that I believe it deserves explanation in their documentation or FAQs. I hope this helps save the next interested party 15 minutes of researching date formats.