Skip to content

ProgramItUp/icd10_hierarchy

Repository files navigation

ICD-10 Hierarchy Processor

This repository contains a Python script that processes ICD-10 codes and generates a hierarchical description for each code, as well as separate columns for each level of the hierarchy.

Purpose

The main purpose of this code is to:

  1. Read ICD-10 codes from a CSV file
  2. Create a hierarchical description for each code by combining descriptions from all parent codes
  3. Generate separate columns for each level of the hierarchy
  4. Save the resulting data to a new CSV file

How It Works

The code identifies parent-child relationships in ICD-10 codes based on their structure. For example:

  • "A01.03" has parents "A01.0", "A01", and "A"
  • For each code, it creates a description including all parent descriptions, like: "Typhoid pneumonia -> Typhoid fever -> Typhoid and paratyphoid fevers"

Usage

  1. Place your ICD-10 code CSV file in the same directory as the script
  2. Ensure your CSV file has at least the following columns:
    • CodeWithSeparator (e.g., "A01.0")
    • ShortDescription (e.g., "Typhoid fever")
  3. Run the script:
    python icd10_hierarchy_processor.py
    
  4. The script will create a new file called icd_codes_with_hierarchy_description.csv which includes:
    • All original columns
    • A new column icd10_hierarchy_description with the complete hierarchy
    • Multiple columns ShortDescription_n_1, ShortDescription_n_2, etc. with individual hierarchy levels

Requirements

  • Python 3.x
  • pandas library

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages