Visualizing Medical Code Hierarchy 0 ▲ John D. Cook 1 hour ago · Tech · hide · 0 comments Quick follow up to the previous two posts on ICD-10 codes and HCPCS codes. This post uses Python’s squarify library to create treemaps visualizing how many codes begin with each letter. Here’s the treemap for HCPCS codes. And here’s the treemap for ICD-10 codes. The sizes of the squares are proportional to the number of codes beginning with that letter. Note that they are not necessarily proportional to how often codes are used. The HCPCS map omits R and U because these are tiny relative to the rest. The ICD-10 map omits U for the same reason. Here’s the code that was used to create the HCPCS map. import matplotlib.pyplot as plt import squarify # HCPCS data = { "G": 2010, "J": 1232, "L": 940, "A": 862, "E": 671, "Q": 639, "C": 619, "S": 533, "M": 506, "V": 212, "K": 175, "T": 114, "H": 94, "P": 59, "B": 51, # "U": 5, # "R": 3, } labels = list(data.keys()) sizes = list(data.values()) # Labels are just the letters (no counts) display_labels = labels # Color map — one distinct color per… No comments yet. Log in to reply on the Fediverse. Comments will appear here.