Metadata-Version: 2.1
Name: icd-mappings
Version: 0.3.2
Summary: 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)
Home-page: https://github.com/snovaisg/ICDMappings
License: MIT
Author: Simao Novais
Author-email: snovaisg.97@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: importlib-resources (>=5.12.0,<6.0.0)
Project-URL: Repository, https://github.com/snovaisg/ICDMappings
Description-Content-Type: text/markdown

# ICD-Mappings
This python tool enables a variety of mappings between ICD diagnostic codes (International Classification of Diseases) **with a single line of code**. 

# Supported Mappings

From `ICD-9 CM` diagnostic codes to:
- [ICD-10 CM](https://www.nber.org/research/data/icd-9-cm-and-icd-10-cm-and-icd-10-pcs-crosswalk-or-general-equivalence-mappings): International Classification of Diseases version 10 Clinical Modification.
- [CCS](https://hcup-us.ahrq.gov/toolssoftware/ccs/ccs.jsp): Clinical Classification Software. Has a universe of just 283 diagnostic categories.
- [CCI](https://hcup-us.ahrq.gov/toolssoftware/chronic/chronic.jsp): Chronic Condition Indicator. True or False whether the diagnostic is chronic.
- [ICD-9 Chapters](https://icd.codes/icd9cm): 19 Chapters of ICD-9 CM.

From `ICD-10 CM` diagnostic codes to:
- [ICD-9 CM](https://www.nber.org/research/data/icd-9-cm-and-icd-10-cm-and-icd-10-pcs-crosswalk-or-general-equivalence-mappings): International Classification of Diseases version 9 Clinical Modification

# Installation

`pip install icd-mappings`

# Usage

```python
from icdmappings import Mapper

mapper = Mapper()

# Make sure your codes don't include '.' separators 
icd9code = '29410' 
mapper.map(icd9code, source='icd9', target='ccs')
>>> '653'

# Can map 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']

# classify ICD-9 diagnostics into chronic or not-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']

# You can also check available mappers
mapper.show_mappers()
>>> Here are the available mappers
>>>
>>> From icd9 to:
>>>        - icd10
>>>        - ccs
>>>        - cci
>>>        - chapter
>>> From icd10 to:
>>>        - icd9
```

# Feature requests

Feel free to request a new feature [here](https://github.com/snovaisg/ICD-Mappings/issues).


# Acknowledgments

[Tekaichi](https://github.com/Tekaichi) for building the initial version of the icd9->ccs pipeline

