Look up HCPCS definitions and quarterly changes in Python
Attach quarter-specific code descriptions and dates, then distinguish calculated changes from CMS maintenance flags.
Attach code definitions to a research list
You have HCPCS billing codes from a drug-data analysis and want the definitions for the fourth quarter of 2026, plus a record of what changed since Q3. The reference supplies full descriptions, separate code dates and a calculated quarterly comparison.
The optional input.csv selects three real codes: J0178, A9574 and J0014. The same choices appear in the selections list in the Python code below. They are research selections; no code descriptions or dates are invented.
Download both files into your working folder. codes.csv is a genuine subset of the paid reference, with all seven available quarterly records for those codes and all 22 fields. quarterly_changes.csv contains their six adjacent-quarter comparisons. The full $29 purchase covers 34,803 code/quarter records, 8,770 distinct codes and seven CSV tables. See the complete coverage and fields.
Code example
This standard-library example runs in a notebook cell, IPython or a script. It looks up each code using the quarter, then attaches the matching Q3→Q4 comparison.
Paths are relative to your working folder; use from pathlib import Path; print(Path.cwd()) to check it, or supply full paths.
import csv
import json
from pathlib import Path
folder = Path('.') # Folder containing the extracted CSV files.
quarter = '2026-Q4'
previous_quarter = '2026-Q3'
# Three real code selections; the same list is supplied in input.csv.
selections = [
{'hcpcs_code': 'J0178'},
{'hcpcs_code': 'A9574'},
{'hcpcs_code': 'J0014'},
]
# For your own CSV: selections = list(csv.DictReader(open('my_codes.csv', newline='')))
with (folder / 'codes.csv').open(newline='', encoding='utf-8') as source:
code_rows = list(csv.DictReader(source))
with (folder / 'quarterly_changes.csv').open(newline='', encoding='utf-8') as source:
change_rows = list(csv.DictReader(source))
reference = {(r['quarter'], r['hcpcs_code']): r for r in code_rows}
changes = {(r['previous_quarter'], r['current_quarter'], r['hcpcs_code']): r for r in change_rows}
if len(reference) != len(code_rows) or len(changes) != len(change_rows):
raise ValueError('Duplicate reference key; check that you loaded one edition.')
results = []
for selection in selections:
code = selection['hcpcs_code'].strip().upper()
row = reference.get((quarter, code))
comparison = changes.get((previous_quarter, quarter, code))
result = {'hcpcs_code': code, 'quarter': quarter,
'description': row['long_description'] if row else '',
'added_date': row['code_added_date'] if row else '',
'quarterly_change': comparison['comparison_status'] if comparison else 'not_in_comparison',
'cms_action': row['action_label'] if row else '',
'review_status': 'source_disagreement' if row and row['source_agreement'] == 'source_disagreement'
else 'reference_found' if row else 'outside_reference'}
results.append(result)
print(f"{code} | {quarter} | {result['description'] or 'Code absent from this reference'}")
print(f" Added: {result['added_date'] or 'not supplied'}; {previous_quarter} to {quarter}: "
f"{result['quarterly_change']}; CMS action: {result['cms_action'] or 'not available'}")
if row and row['termination_date']:
print(f" CMS termination date: {row['termination_date']}; review before use.")
if result['review_status'] == 'source_disagreement':
print(' Review the alternative source values in source_discrepancies.csv.')
if comparison and comparison['comparison_status'] == 'changed':
print(' Changed fields:', ', '.join(json.loads(comparison['changed_fields_json'])))
Replace selections with your codes or load that column from your own CSV. Change quarter and previous_quarter to select another adjacent pair. The sample includes every available quarter for these three codes; other codes need the complete files.
Analysis of the output
J0178 | 2026-Q4 | Injection, aflibercept, 1 mg
Added: 2013-01-01; 2026-Q3 to 2026-Q4: unchanged; CMS action: No maintenance
A9574 | 2026-Q4 | Injection, ferumoxytol, 1 mg
Added: 2026-07-01; 2026-Q3 to 2026-Q4: unchanged; CMS action: No maintenance
J0014 | 2026-Q4 | Cocaine hydrochloride nasal solution (goprelto), 1 mg
Added: 2026-10-01; 2026-Q3 to 2026-Q4: added; CMS action: Add
J0178 adds the definition “Injection, aflibercept, 1 mg” and its January 2013 addition date. That description gives the unit context behind a drug-code join. Its exported attributes are unchanged between Q3 and Q4.
A9574 was added in July 2026. Its CMS maintenance flag changes from Add in Q3 to No maintenance in Q4, while our comparison reports unchanged. A maintenance flag resetting does not mean the definition changed.
J0014 first appears in the Q4 file and carries an October 1 addition date. Here, the calculated addition and the CMS flag agree. The comparison identifies a source-file change; it does not establish a drug approval or market launch.
The reference also retains previously terminated codes. For those records the example prints the termination date. An unmatched input is retained with outside_reference, which can mean a different quarter, an excluded code system or a code outside this edition. Presence alone does not establish valid billing, coverage or payment.
Connect definitions to package codes and payment benchmarks
If your input is an NDC, start with the NDC–HCPCS crosswalk and preserve each matching relationship. Join its quarter and hcpcs_code to this reference using both keys. The quarterly Part B payment history uses those same keys, with a separate billing unit and source notes. A code definition, package relationship and payment benchmark answer different parts of the task; none establishes a payable claim.
Choose the right starting file for drug identifiers and billing codes →
Using the full dataset
Extract the purchased ZIP and replace both samples with the complete codes.csv and quarterly_changes.csv. The example runs unchanged. Keep identifiers as text and join on code plus quarter to avoid multiplying each input by the number of quarterly snapshots.
The remaining tables are source_discrepancies.csv, code_values.csv, coverage.csv, source_row_status.csv and source_files.csv. Dictionaries explain every field. Coverage is five-character non-dental Level II codes; modifiers, numeric CPT/Level I and D-series dental content are excluded.
Sources and versions
Source: CMS quarterly alpha-numeric HCPCS files for January, April, July and October 2026, captured October 25. Landing-page revision dates are January 12, March 18, June 17 and September 23. These are revised files available at capture, not original-as-published historical vintages.
The workbook is the delivered authority for every quarter. Reconstructing the fixed-width source reveals 476 substantive field differences and 68 whitespace differences, all retained in a separate table. Most concern blank workbook action dates; C9248 and October C9812 also have conflicting attributes. The example flags disputed source rows for review. We do not substitute alternate values or infer the publisher's intent.
The change sheet distinguishes source differences from our preparation. This is a fixed edition with included same-source processing improvements and no automatic refresh. Original CMS files remain free; ACD sells preparation, documentation, validation and delivery.
Example checked October 25, 2026 against both these samples and the complete purchased files. Source and processing records, sample checksums · Expected result CSV. Independent preparation; no agency endorsement.