{"id":27870,"library":"icd-mappings","title":"ICD Mappings","description":"Python tool for mapping ICD diagnostic codes across classifications (e.g., ICD-10 to CCS, CCI, CCC, ICD-9, chapters, blocks). Current version 0.6.2, supports Python 3.8-3.14. Active development with monthly releases.","status":"active","version":"0.6.2","language":"python","source_language":"en","source_url":"https://github.com/snovaisg/ICDMappings","tags":["icd","icd-10","icd-9","mappings","healthcare","medical-codes"],"install":[{"cmd":"pip install icd-mappings","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used for data handling and mapping tables.","package":"pandas","optional":false},{"reason":"Downloading mapping data files.","package":"requests","optional":false}],"imports":[{"note":"Top-level import was removed in v0.3.0; mappers moved to subpackage.","wrong":"from icd_mappings import Icd10Mapper","symbol":"Icd10Mapper","correct":"from icd_mappings.mappers import Icd10Mapper"},{"note":"No common mistake; keep correct pattern.","wrong":"from icd_mappings.mappers import Icd9Mapper","symbol":"Icd9Mapper","correct":"from icd_mappings.mappers import Icd9Mapper"},{"note":"","wrong":null,"symbol":"CcsMapper","correct":"from icd_mappings.mappers import CcsMapper"}],"quickstart":{"code":"from icd_mappings.mappers import Icd10Mapper\n\nmapper = Icd10Mapper()\n# Map single code\nprint(mapper.map('J45.0', target='chapter'))  # '10 - Diseases of the respiratory system'\n# Map multiple codes\ncodes = ['J45.0', 'E11.9']\nresults = {code: mapper.map(code, target='blocks') for code in codes}\nprint(results)","lang":"python","description":"Initialize a mapper and convert ICD-10 codes to chapters or blocks."},"warnings":[{"fix":"Update code to handle None returns instead of catching exceptions.","message":"In v0.3.0, mappers no longer raise errors for unmappable codes; they return None. Code that relied on exceptions will break.","severity":"breaking","affected_versions":"<0.3.0"},{"fix":"Use `from icd_mappings.mappers import Icd10Mapper`.","message":"Top-level imports like `from icd_mappings import Icd10Mapper` were removed in v0.3.0.","severity":"deprecated","affected_versions":"<0.3.0"},{"fix":"No fix needed; rely on consistency.","message":"Input codes work with or without dots (normalized automatically). However, be aware that normalization removes dots before validation, so 'J450' and 'J45.0' are treated identically.","severity":"gotcha","affected_versions":">=0.5.0"},{"fix":"Use `mapper = Icd10Mapper(use_cache=True)` to cache data locally.","message":"Mapper data is downloaded on first use; ensure internet connectivity or preload data.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Import from correct subpackage: `from icd_mappings.mappers import Icd10Mapper`","cause":"Old import path used; module structure changed in v0.3.0.","error":"ModuleNotFoundError: No module named 'icd_mappings.mappers'"},{"fix":"Check if result is None before accessing attributes: `result = mapper.map(code, target); if result: ...`","cause":"Mapper returned None because code is unmappable (v0.3.0+ behavior).","error":"AttributeError: 'NoneType' object has no attribute '...'"},{"fix":"Upgrade to >=0.3.0 and handle None returns, or catch the exception.","cause":"Using version <0.3.0, which raises exceptions for unmappable codes.","error":"icd_mappings.exceptions.CodeNotMappedError"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}