This python tools allows you to map ICD codes between versions (ICD9 <-> ICD10) and also to other coding schemas such as CCS (Clinical Classification Software) and CCI (Chronic Condition Indicator)
Project description
ICDMappings
This tool helps working with ICD codes. It maps between ICD versions (such as between ICD9 and ICD10). Also maps to other codings such as CCS (Computer Software Classification), and classifies ICD9 codes as chronic or not thanks to CCI (Chronic Condition Indicator).
Installation
pip install icd-mappings
Usage
from icdmappings import Mapper
mapper = Mapper()
icd9code = '29410'
mapper.map(icd9code, 'icd9toccs')
>>> '653'
# Can also map any Iterable of codes
icd9codes = ['29410', '5362', 'NOT_A_CODE', '3669']
# icd9 to ccs
mapper.map(icd9codes, mapper='icd9toccs')
>>> ['653', '141', None, '86']
# icd9 to icd10
mapper.map(icd9codes, mapper='icd9toicd10')
>>> ['F0280', 'R111000', None, 'H269']
# You can also check available mappers
mapper.show_mappers()
>>> ['icd9toccs', 'icd9toicd10', 'icd10toicd9', 'icd9tochapter', 'icd9tolevel3', 'icd9tocci', 'icd9level3toccs']
Mappers
List of all mappers:
- ICD9<->ICD10: ICD9-CM and ICD10-CM (in both directions).
- ICD9->CCS: ICD9-CM to CCS (Clinical Classification Software) codes;
- ICD9->ICD9Chapters: ICD9-CM diagnostic codes to the 19 Chapters;
- ICD9->CCI ICD9-CM diagnostics to CCI (Chronic Condition Indicator). True of False depending on whether a diagnostic is chronic or not;
- ICD9->Level3: Gets the 3rd level of an ICD9-CM diagnostic code;
- ICD9Level3->CCS: Maps the 3rd level of an ICD9 code into the corresponding CCS code. Why? Sometimes codes in a database do not have the full length by default (poor quality of recording), so it can be useful to translate directly from the 3rd level to CCS. Some collisions happen (one icd9level3 could map to one of multiple ccs's) and at the moment we simply choose one of the compatible CCS codes.
Supports mapping either a single code
at a time, or an iterable of codes
(range, list, np.array, pd.Series, etc...).
:warning: When ICD9 or ICD10 is mentioned, it always refers to the American version aka ICD9-CM / ICD10-CM.
Feature requests
Feel free to sugest feature requests under Issues
, such as turning this into a script in case your pipeline does not use python.
Acknowledgments
Tekaichi for building the initial version of the icd9->ccs pipeline
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for icd_mappings-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25c1d6aab53940c955e3e37cb266a78060f2e44be2671aed036c764cc25a4a52 |
|
MD5 | 84d3741c123083404cc7222d3179b375 |
|
BLAKE2b-256 | a372bcfbbe61055578d95a72cd5b83f99c36f44032f42998556632ddf72acc0c |