
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
This python tool enables a variety of mappings between ICD diagnostic codes (International Classification of Diseases) with a single line of code.
This python tool enables a variety of mappings of ICD codes (International Classification of Diseases) to different medical concepts with a single line of code.
From ICD-9 CM
diagnostic codes to:
From ICD-10 CM
diagnostic codes to:
pip install icd-mappings
Below are some examples on how to use this tool for both the Mapper
and Validator
classes
This class allows you to map between ontologies.
from icdmappings import Mapper
mapper = Mapper()
icd9code = '29410'
mapper.map(icd9code, source='icd9', target='ccs')
>>> '653'
# you can pass any Iterable of codes (list, numpy array, pandas Series, you name it)
icd9codes = ['29410', '5362', 'NOT_A_CODE', '3669']
mapper.map(icd9codes, source='icd9', target='ccs')
>>> ['653', '141', None, '86']
# which of these diagnostics are chronic?
mapper.map(icd9codes, source='icd9', target='cci')
>>> [True, False, None, True]
# icd9 to icd10
mapper.map(icd9codes, source='icd9', target='icd10')
>>> ['F0280', 'R111000', None, 'H269']
# icd10 to chapters and blocks
icd10codes = ['F0280', 'R111000', 'NOT_A_CODE', 'H269', 'H27.8']
mapper.map(icd10codes, source='icd10', target='chapter')
>>> ['5', '18', None, '7', '7']
mapper.map(icd10codes, source='icd10', target='block')
>>> ['F00-F09', 'R10-R19', None, 'H25-H28', 'H25-H28']
# And many more... You can check all available mappers this way
mapper.show_mappers()
>>> From icd9 to:
>>> - cci
>>> - ccs
>>> - chapter
>>> - icd10
>>> From icd10 to:
>>> - icd9
>>> - block
>>> - chapter
>>> - ccsr
>>> - ccir
This class helps you validate codes for a given ontology. Currently supports ICD9 and ICD10 codes.
from icdmappings import Validator
validator = Validator()
icd9code = '3591'
validator.validate(icd9code, expects='icd9_diagnostic')
>>> True
icd9codes = ['3591','NOT_A_CODE', '00321']
validator.validate(icd9codes, expects='icd9_diagnostic')
>>> [True, False, True]
# can also check procedure codes
icd9codes = ['3582', '5731', 'NOT_A_CODE']
validator.validate(icd9codes, expects='icd9_procedure')
>>> [True, True, False]
# likewise for ICD10
icd10code = 'B530'
validator.validate(icd10code, expects='icd10_diagnostic')
>>> True
Feel free to request a new functionality or report a bug by creating a new issue.
Tekaichi for building the initial version of the icd9->ccs pipeline
FAQs
This python tool enables a variety of mappings between ICD diagnostic codes (International Classification of Diseases) with a single line of code.
We found that icd-mappings demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.