Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 42 new columns ({'WGHTLOSS', 'PARALYSIS', 'HTN_CX', 'AUTOIMMUNE', 'LIVER_MLD', 'icd10cm_description', 'VALVE', 'THYROID_OTH', 'CANCER_NSITU', 'COAG', 'CANCER_METS', 'PULMCIRC', 'NEURO_OTH', 'CANCER_LEUK', 'PERIVASC', 'CANCER_LYMPH', 'ALCOHOL', 'NEURO_MOVT', 'DRUG_ABUSE', 'NEURO_SEIZ', 'LIVER_SEV', 'comorbidity_count', 'DEPRESS', 'THYROID_HYPO', 'HTN_UNCX', 'icd10cm_code', 'ANEMDEF', 'DIAB_UNCX', 'DEMENTIA', 'CBVD_SQLA', 'DIAB_CX', 'BLDLOSS', 'CANCER_SOLID', 'HF', 'OBESE', 'AIDS', 'CBVD_POA', 'RENLFL_SEV', 'LUNG_CHRONIC', 'RENLFL_MOD', 'PSYCHOSES', 'ULCER_PEPTIC'}) and 4 missing columns ({'requires_poa', 'description', 'abbreviation', 'van_walraven_mortality_weight'}).

This happened while the csv dataset builder was generating data using

hf://datasets/EOCS-LTD/elixhauser-icd10-mapping/elixhauser_icd10_mapping.csv (at revision 0f18bd510d1e7ff340b4f0813ff37545b88ae76a), ['hf://datasets/EOCS-LTD/elixhauser-icd10-mapping@0f18bd510d1e7ff340b4f0813ff37545b88ae76a/comorbidity_measures.csv', 'hf://datasets/EOCS-LTD/elixhauser-icd10-mapping@0f18bd510d1e7ff340b4f0813ff37545b88ae76a/elixhauser_icd10_mapping.csv']

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1848, in _prepare_split_single
                  writer.write_table(table)
                  ~~~~~~~~~~~~~~~~~~^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 765, in write_table
                  self._write_table(pa_table, writer_batch_size=writer_batch_size)
                  ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 773, in _write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
                  raise CastError(
                  ...<3 lines>...
                  )
              datasets.table.CastError: Couldn't cast
              icd10cm_code: string
              icd10cm_description: string
              comorbidity_count: double
              AIDS: double
              ALCOHOL: double
              ANEMDEF: double
              AUTOIMMUNE: double
              BLDLOSS: double
              CANCER_LEUK: double
              CANCER_LYMPH: double
              CANCER_METS: double
              CANCER_NSITU: double
              CANCER_SOLID: double
              CBVD_POA: double
              CBVD_SQLA: double
              COAG: double
              DEMENTIA: double
              DEPRESS: double
              DIAB_CX: double
              DIAB_UNCX: double
              DRUG_ABUSE: double
              HF: double
              HTN_CX: double
              HTN_UNCX: double
              LIVER_MLD: double
              LIVER_SEV: double
              LUNG_CHRONIC: double
              NEURO_MOVT: double
              NEURO_OTH: double
              NEURO_SEIZ: double
              OBESE: double
              PARALYSIS: double
              PERIVASC: double
              PSYCHOSES: double
              PULMCIRC: double
              RENLFL_MOD: double
              RENLFL_SEV: double
              THYROID_HYPO: double
              THYROID_OTH: double
              ULCER_PEPTIC: double
              VALVE: double
              WGHTLOSS: double
              -- schema metadata --
              pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 5290
              to
              {'abbreviation': Value('string'), 'description': Value('string'), 'requires_poa': Value('string'), 'van_walraven_mortality_weight': Value('int64')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~^
                      builder, max_dataset_size_bytes=max_dataset_size_bytes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
                      gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  ):
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1850, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
                  ...<4 lines>...
                  )
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 42 new columns ({'WGHTLOSS', 'PARALYSIS', 'HTN_CX', 'AUTOIMMUNE', 'LIVER_MLD', 'icd10cm_description', 'VALVE', 'THYROID_OTH', 'CANCER_NSITU', 'COAG', 'CANCER_METS', 'PULMCIRC', 'NEURO_OTH', 'CANCER_LEUK', 'PERIVASC', 'CANCER_LYMPH', 'ALCOHOL', 'NEURO_MOVT', 'DRUG_ABUSE', 'NEURO_SEIZ', 'LIVER_SEV', 'comorbidity_count', 'DEPRESS', 'THYROID_HYPO', 'HTN_UNCX', 'icd10cm_code', 'ANEMDEF', 'DIAB_UNCX', 'DEMENTIA', 'CBVD_SQLA', 'DIAB_CX', 'BLDLOSS', 'CANCER_SOLID', 'HF', 'OBESE', 'AIDS', 'CBVD_POA', 'RENLFL_SEV', 'LUNG_CHRONIC', 'RENLFL_MOD', 'PSYCHOSES', 'ULCER_PEPTIC'}) and 4 missing columns ({'requires_poa', 'description', 'abbreviation', 'van_walraven_mortality_weight'}).
              
              This happened while the csv dataset builder was generating data using
              
              hf://datasets/EOCS-LTD/elixhauser-icd10-mapping/elixhauser_icd10_mapping.csv (at revision 0f18bd510d1e7ff340b4f0813ff37545b88ae76a), ['hf://datasets/EOCS-LTD/elixhauser-icd10-mapping@0f18bd510d1e7ff340b4f0813ff37545b88ae76a/comorbidity_measures.csv', 'hf://datasets/EOCS-LTD/elixhauser-icd10-mapping@0f18bd510d1e7ff340b4f0813ff37545b88ae76a/elixhauser_icd10_mapping.csv']
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

abbreviation
string
description
string
requires_poa
string
van_walraven_mortality_weight
int64
AIDS
Acquired immune deficiency syndrome
No
0
ALCOHOL
Alcohol abuse
No
0
ANEMDEF
Anemias due to other nutritional deficiencies
Yes
-2
AUTOIMMUNE
Autoimmune conditions
No
0
BLDLOSS
Chronic blood loss (iron deficiency)
Yes
-2
CANCER_LEUK
Leukemia
No
9
CANCER_LYMPH
Lymphoma
No
9
CANCER_METS
Metastatic cancer
No
14
CANCER_NSITU
Solid tumor without metastasis, in situ
No
0
CANCER_SOLID
Solid tumor without metastasis, malignant
No
4
CBVD
Cerebrovascular disease
Yes
0
COAG
Coagulopathy
Yes
3
DEMENTIA
Dementia
No
0
DEPRESS
Depression
No
-3
DIAB_CX
Diabetes with chronic complications
No
0
DIAB_UNCX
Diabetes without chronic complications
No
-1
DRUG_ABUSE
Drug abuse
No
-7
HF
Heart failure
Yes
7
HTN_CX
Hypertension, complicated
No
0
HTN_UNCX
Hypertension, uncomplicated
No
0
LIVER_MLD
Liver disease, mild
Yes
1
LIVER_SEV
Liver disease and failure, moderate to severe
Yes
1
LUNG_CHRONIC
Chronic pulmonary disease
No
3
NEURO_MOVT
Neurological disorders affecting movement
Yes
6
NEURO_OTH
Other neurological disorders
Yes
6
NEURO_SEIZ
Seizures and epilepsy
Yes
6
OBESE
Obesity
No
-4
PARALYSIS
Paralysis
Yes
7
PERIVASC
Peripheral vascular disease
No
2
PSYCHOSES
Psychoses
Yes
0
PULMCIRC
Pulmonary circulation disease
Yes
4
RENLFL_MOD
Renal (kidney) failure and disease, moderate
Yes
5
RENLFL_SEV
Renal (kidney) failure and disease, severe
Yes
5
THYROID_HYPO
Hypothyroidism
No
0
THYROID_OTH
Other thyroid disorders
No
0
ULCER_PEPTIC
Peptic ulcer with bleeding
Yes
0
VALVE
Valvular disease
Yes
-1
WGHTLOSS
Weight loss
Yes
6
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
End of preview.

AHRQ Elixhauser ICD-10-CM to Comorbidity Mapping

4,543 ICD-10-CM diagnosis codes mapped to 38 Elixhauser comorbidity categories with van Walraven mortality weights.

This dataset provides the complete ICD-10-CM to Elixhauser comorbidity crosswalk from the AHRQ Healthcare Cost and Utilization Project (HCUP) Elixhauser Comorbidity Software Refined for ICD-10-CM. It is published as a clean, versioned, machine-readable CSV for integration into clinical analytics, risk adjustment, and AI/ML pipelines.

Files

elixhauser_icd10_mapping.csv

The primary mapping table. Each row is one ICD-10-CM diagnosis code with binary flags (0/1) for each of the 38 Elixhauser comorbidity categories.

Column Description
icd10cm_code ICD-10-CM diagnosis code (no periods)
icd10cm_description Clinical description of the code
comorbidity_count Number of comorbidity categories this code maps to
AIDS through WGHTLOSS 39 binary columns (0/1) for each comorbidity category

Note: Cerebrovascular disease is split into two mapping columns: CBVD_POA (present on admission) and CBVD_SQLA (sequela). These are combined into a single CBVD comorbidity measure in the scoring.

comorbidity_measures.csv

Reference table for the 38 Elixhauser comorbidity categories.

Column Description
abbreviation AHRQ abbreviation (e.g., HF, DIAB_UNCX)
description Full clinical description
requires_poa Whether present-on-admission indicators are used for assignment (Yes/No)
van_walraven_mortality_weight Van Walraven point weight for in-hospital mortality prediction

Quick Start

Load with Pandas

import pandas as pd

# Load the mapping
mapping = pd.read_csv("elixhauser_icd10_mapping.csv")

# Find all comorbidities for a patient's diagnosis codes
patient_dx = ["I509", "E119", "I10", "N183", "E6601"]
patient_flags = mapping[mapping["icd10cm_code"].isin(patient_dx)]

# Aggregate: any code flagging a comorbidity = patient has it
comorbidity_cols = mapping.columns[3:]  # skip code, description, count
patient_comorbidities = patient_flags[comorbidity_cols].max()
flagged = patient_comorbidities[patient_comorbidities == 1].index.tolist()
print(f"Flagged comorbidities: {flagged}")

Load with Hugging Face Datasets

from datasets import load_dataset

dataset = load_dataset("EOCS/elixhauser-icd10-mapping")
df = dataset["train"].to_pandas()

Use with the elixhauser-ahrq Python Package

For production use with van Walraven scoring and risk tier assignment:

pip install elixhauser-ahrq
from elixhauser_ahrq import ElixhauserMapper, ElixhauserScorer

mapper = ElixhauserMapper()
flags = mapper.map_patient_diagnoses(["I509", "E119", "I10"])

scorer = ElixhauserScorer(index_type="mortality")
score = scorer.calculate_score(flags)
print(f"van Walraven Score: {score}")

Use Cases

  • Risk adjustment for episode-based care: Stratify surgical and medical episode populations by comorbidity burden
  • Feature engineering for clinical ML models: Use comorbidity flags as input features for mortality, readmission, or complication prediction models
  • Population health analytics: Identify high-risk subpopulations for care management programs
  • Quality measurement: Calculate risk-adjusted O:E ratios for facility performance comparison
  • EHR integration: Score patients prospectively from problem list ICD-10 codes for care planning

Citation

@software{elixhauser_ahrq_2026,
  author = {Opelka, Frank G.},
  title = {elixhauser-ahrq: Python Implementation of the AHRQ Elixhauser Comorbidity Index},
  version = {2026.1},
  year = {2026},
  organization = {Episodes of Care Solutions (EOCS)},
  url = {https://github.com/fopelka-EOCS/elixhauser-ahrq},
  note = {Based on AHRQ HCUP Elixhauser Comorbidity Software Refined for ICD-10-CM. CDC-reviewed.}
}

References

  • Elixhauser A, Steiner C, Harris DR, Coffey RM. Comorbidity measures for use with administrative data. Medical Care 1998;36(1):8–27.
  • van Walraven C, Austin PC, Jennings A, Quan H, Forster AJ. A modification of the Elixhauser comorbidity measures into a point system for hospital death using administrative data. Medical Care 2009;47(6):626–633.
  • Moore BJ, White S, Washington R, Coenen N, Elixhauser A. Identifying increased risk of readmission and in-hospital mortality using hospital administrative data. Medical Care 2017;55(7):698–705.
  • AHRQ HCUP: https://hcup-us.ahrq.gov/toolssoftware/comorbidityicd10/comorbidity_icd10.jsp
Downloads last month
23

Space using EOCS-LTD/elixhauser-icd10-mapping 1