Skip to main content

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 from Ehälsomyndigheten, WHO, and CDC. Raw files are not redistributed due to licence restrictions.

Changelog

0.2.0

  • ICD-10-SE and history file now downloaded from Ehälsomyndigheten (replacing Socialstyrelsen URLs)
  • Retired code lookup now uses the comprehensive history file (historik-icd-10-se-1997-2026.xlsx) covering all codes 1997–2026, instead of the partial inactivation list

0.1.0

  • Initial release

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

codedx-0.2.0.tar.gz (7.8 kB view details)

Uploaded Source

File details

Details for the file codedx-0.2.0.tar.gz.

File metadata

  • Download URL: codedx-0.2.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for codedx-0.2.0.tar.gz
Algorithm Hash digest
SHA256 73c9909733e318e8d4beae87400673feb192a03b49b5f2058f1f68fb6bfaa1ac
MD5 4ca8b26fa9d21c4194de77bd6bd6d6b7
BLAKE2b-256 adc986e7b8e3d2bb1f42b7bb5184bdf23ea83b46708f9700c3683999f27244a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page