Swedish medical coding used for diagnosis codes
Project description
codeDx
codeDx (pronounced code-dex) is a codex for medical diagnosis codes — a lookup library for Swedish healthcare datasets. Install as pip install codedx, import as import codedx.
Built for regional datasets where ICD-10-SE (specialist care), KSH97-P (primary care), and rehab function codes coexist across many years and releases.
import codedx
# J440 exists in WHO, ICD-10-CM and ICD-10-SE
codedx.get_name("J440") # 'Chronic obstructive pulmonary disease...'
codedx.get_name("J440", lang="sv") # 'Kroniskt obstruktiv lungsjukdom...'
codedx.is_icd10who_code("J440") # True
codedx.is_icd10cm_code("J440") # True
codedx.is_icd10se_code("J440") # True
codedx.get_ancestors("R060") # ('R060', 'R06', 'R00-R09', '18')
# code_systems maps each system to its name in that system
codedx.code_systems("A00")
# {'icd10who': 'Cholera', 'icd10cm': 'Cholera', 'icd10se': 'Kolera'}
codedx.code_systems("UA3290") # {'rehab': 'Kommunicera, att vara mottagare...'}
# KSH97-P sometimes uses colloquial names — G258 is 'Restless legs' in primary care
# but 'Andra specificerade basalgangliesjukdomar och rörelserubbningar' in ICD-10-SE
codedx.code_systems("G258")
# {'icd10se': 'Andra specificerade basalgangliesjukdomar och rörelserubbningar',
# 'ksh97p': 'Restless legs'}
Dots are dropped throughout, matching what is typically found in databases: A011 not A01.1.
Installation
pip install codedx
Downloads data at install time. Raw files are not redistributed due to licence restrictions.
Data sources
Classification files come from two Swedish authorities:
Ehälsomyndigheten maintains ICD-10-SE and KSH97-P. Files are downloaded from their Confluence collaboration platform. KSH97-P (primary care classification) is being phased out in favour of ICD-10-SE.
Socialstyrelsen retains responsibility for the NordDRG system and the associated rehab function codes (UA/UB series). These files are downloaded from Socialstyrelsen's website.
WHO ICD-10 (English) and ICD-10-CM are downloaded from WHO and the US CDC respectively.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file codedx-0.3.3.tar.gz.
File metadata
- Download URL: codedx-0.3.3.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9c5c043725fa62aa15190eab1afd3e6eff29ea001b1b8ddeb9ab7c061098d1a
|
|
| MD5 |
b44403fcc6d63c8934b2ffaf341cc1c3
|
|
| BLAKE2b-256 |
bb553e6b3e8b6fdd4790dd8ee510c50af9d01e85769cd9370de63627369f6399
|