Datasets:
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
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 ({'LUNG_CHRONIC', 'CANCER_SOLID', 'HTN_UNCX', 'RENLFL_SEV', 'AUTOIMMUNE', 'ULCER_PEPTIC', 'CANCER_NSITU', 'PULMCIRC', 'LIVER_SEV', 'PARALYSIS', 'VALVE', 'CANCER_METS', 'THYROID_HYPO', 'DEMENTIA', 'DEPRESS', 'NEURO_SEIZ', 'DIAB_UNCX', 'DIAB_CX', 'icd10cm_description', 'ALCOHOL', 'CANCER_LYMPH', 'CANCER_LEUK', 'DRUG', 'BLDLOSS', 'HTN_CX', 'HF', 'NEURO_MOVT', 'LIVER_MLD', 'PSYCHOSES', 'NEURO_OTH', 'CBVD_SQLA', 'RENLFL_MOD', 'PERIVASC', 'comorbidity_count', 'OBESE', 'AIDS', 'icd10cm_code', 'WGHTLOSS', 'COAG', 'THYROID_OTH', 'ANEMDEF', 'CBVD_POA'}) and 5 missing columns ({'requires_poa', 'description', 'abbreviation', 'ahrq_readmission_index_weight', 'ahrq_mortality_index_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 bee56e8dc292b6c8986ef01f47bb4e13da8698cf), ['hf://datasets/EOCS-LTD/elixhauser-icd10-mapping@bee56e8dc292b6c8986ef01f47bb4e13da8698cf/comorbidity_measures.csv', 'hf://datasets/EOCS-LTD/elixhauser-icd10-mapping@bee56e8dc292b6c8986ef01f47bb4e13da8698cf/elixhauser_icd10_mapping.csv', 'hf://datasets/EOCS-LTD/elixhauser-icd10-mapping@bee56e8dc292b6c8986ef01f47bb4e13da8698cf/poa_exempt_codes.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 1856, in _prepare_split_single
writer.write_table(table)
~~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 811, 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 822, in _write_table
pa_table = table_cast(pa_table, self._schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2381, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2309, in cast_table_to_schema
raise CastError(
...<3 lines>...
)
datasets.table.CastError: Couldn't cast
icd10cm_code: string
icd10cm_description: string
comorbidity_count: int64
AIDS: int64
ALCOHOL: int64
ANEMDEF: int64
AUTOIMMUNE: int64
BLDLOSS: int64
CANCER_LEUK: int64
CANCER_LYMPH: int64
CANCER_METS: int64
CANCER_NSITU: int64
CANCER_SOLID: int64
CBVD_POA: int64
CBVD_SQLA: int64
COAG: int64
DEMENTIA: int64
DEPRESS: int64
DIAB_CX: int64
DIAB_UNCX: int64
DRUG: int64
HF: int64
HTN_CX: int64
HTN_UNCX: int64
LIVER_MLD: int64
LIVER_SEV: int64
LUNG_CHRONIC: int64
NEURO_MOVT: int64
NEURO_OTH: int64
NEURO_SEIZ: int64
OBESE: int64
PARALYSIS: int64
PERIVASC: int64
PSYCHOSES: int64
PULMCIRC: int64
RENLFL_MOD: int64
RENLFL_SEV: int64
THYROID_HYPO: int64
THYROID_OTH: int64
ULCER_PEPTIC: int64
VALVE: int64
WGHTLOSS: int64
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 5118
to
{'abbreviation': Value('string'), 'description': Value('string'), 'requires_poa': Value('string'), 'ahrq_mortality_index_weight': Value('int64'), 'ahrq_readmission_index_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 1379, 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 956, 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 1702, 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 1858, 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 ({'LUNG_CHRONIC', 'CANCER_SOLID', 'HTN_UNCX', 'RENLFL_SEV', 'AUTOIMMUNE', 'ULCER_PEPTIC', 'CANCER_NSITU', 'PULMCIRC', 'LIVER_SEV', 'PARALYSIS', 'VALVE', 'CANCER_METS', 'THYROID_HYPO', 'DEMENTIA', 'DEPRESS', 'NEURO_SEIZ', 'DIAB_UNCX', 'DIAB_CX', 'icd10cm_description', 'ALCOHOL', 'CANCER_LYMPH', 'CANCER_LEUK', 'DRUG', 'BLDLOSS', 'HTN_CX', 'HF', 'NEURO_MOVT', 'LIVER_MLD', 'PSYCHOSES', 'NEURO_OTH', 'CBVD_SQLA', 'RENLFL_MOD', 'PERIVASC', 'comorbidity_count', 'OBESE', 'AIDS', 'icd10cm_code', 'WGHTLOSS', 'COAG', 'THYROID_OTH', 'ANEMDEF', 'CBVD_POA'}) and 5 missing columns ({'requires_poa', 'description', 'abbreviation', 'ahrq_readmission_index_weight', 'ahrq_mortality_index_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 bee56e8dc292b6c8986ef01f47bb4e13da8698cf), ['hf://datasets/EOCS-LTD/elixhauser-icd10-mapping@bee56e8dc292b6c8986ef01f47bb4e13da8698cf/comorbidity_measures.csv', 'hf://datasets/EOCS-LTD/elixhauser-icd10-mapping@bee56e8dc292b6c8986ef01f47bb4e13da8698cf/elixhauser_icd10_mapping.csv', 'hf://datasets/EOCS-LTD/elixhauser-icd10-mapping@bee56e8dc292b6c8986ef01f47bb4e13da8698cf/poa_exempt_codes.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 | ahrq_mortality_index_weight int64 | ahrq_readmission_index_weight int64 |
|---|---|---|---|---|
AIDS | Acquired immune deficiency syndrome | No | -4 | 5 |
ALCOHOL | Alcohol-related disorders | No | -1 | 3 |
ANEMDEF | Anemias due to other nutritional deficiencies | Yes | -3 | 5 |
AUTOIMMUNE | Autoimmune conditions | No | 0 | 2 |
BLDLOSS | Chronic blood loss anemia (iron deficiency) | Yes | -4 | 2 |
CANCER_LEUK | Leukemia | No | 9 | 10 |
CANCER_LYMPH | Lymphoma | No | 5 | 7 |
CANCER_METS | Metastatic cancer | No | 22 | 11 |
CANCER_NSITU | Solid tumor without metastasis, in situ | No | 0 | 0 |
CANCER_SOLID | Solid tumor without metastasis, malignant | No | 10 | 7 |
CBVD | Cerebrovascular disease | Yes | 5 | 0 |
HF | Heart failure | Yes | 14 | 7 |
COAG | Coagulopathy | Yes | 14 | 3 |
DEMENTIA | Dementia | No | 5 | 1 |
DEPRESS | Depression | No | -8 | 2 |
DIAB_CX | Diabetes with chronic complications | No | -2 | 4 |
DIAB_UNCX | Diabetes without chronic complications | No | 0 | 0 |
DRUG | Drug use disorders | No | -7 | 6 |
HTN_CX | Hypertension, complicated | No | 1 | 0 |
HTN_UNCX | Hypertension, uncomplicated | No | 0 | 0 |
LIVER_MLD | Liver disease, mild | Yes | 2 | 3 |
LIVER_SEV | Liver disease, moderate to severe | Yes | 16 | 10 |
LUNG_CHRONIC | Chronic pulmonary disease | No | 2 | 4 |
NEURO_MOVT | Neurological disorders affecting movement | Yes | -1 | 1 |
NEURO_OTH | Other neurological disorders | Yes | 22 | 2 |
NEURO_SEIZ | Seizures and epilepsy | Yes | 2 | 5 |
OBESE | Obesity | No | -7 | -2 |
PARALYSIS | Paralysis | Yes | 4 | 3 |
PERIVASC | Peripheral vascular disease | No | 3 | 1 |
PSYCHOSES | Psychoses | Yes | -9 | 6 |
PULMCIRC | Pulmonary circulation disease | Yes | 4 | 3 |
RENLFL_MOD | Renal failure, moderate | Yes | 3 | 4 |
RENLFL_SEV | Renal failure, severe | Yes | 7 | 8 |
THYROID_HYPO | Hypothyroidism | No | -3 | 0 |
THYROID_OTH | Other thyroid disorders | No | -8 | 0 |
ULCER_PEPTIC | Peptic ulcer disease x bleeding | Yes | 0 | 2 |
VALVE | Valvular disease | Yes | 0 | 0 |
WGHTLOSS | Weight loss | Yes | 13 | 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 | 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 |
AHRQ Elixhauser Comorbidity Software Refined v2027.1: ICD-10-CM mapping
Correction notice. Earlier versions of this dataset were labelled v2025.1. Their
van_walraven_mortality_weightcolumn did not contain AHRQ's index weights and must not be used. They also described the package as "CDC-reviewed", which was inaccurate. This release replaces those files with AHRQ v2027.1 content. If you used the old weight column, re-run with the weights below or with theelixhauser-ahrqpackage 2027.1.0. See Advisory EOCS-ELX-2026-01.
This dataset is a machine-readable copy of AHRQ HCUP's Elixhauser Comorbidity Software Refined for ICD-10-CM, v2027.1 (FY2027; valid for ICD-10-CM codes from October 2015 through September 2027). It contains:
- the mapping from diagnosis codes to comorbidity measures;
- AHRQ's in-hospital mortality and 30-day readmission index weights;
- AHRQ's present-on-admission (POA) exempt-code lists.
It was generated by tools/build_hf_dataset.py in elixhauser-ahrq from AHRQ's reference workbook and SAS programs, and it is checked code by code against them.
Files
| File | Contents |
|---|---|
elixhauser_icd10_mapping.csv |
4,573 codes. Each has its description and a 0/1 flag for 39 mapping columns, exactly as in AHRQ's DX_to_Comorb_Mapping sheet. Cerebrovascular disease appears as two mapping columns, CBVD_POA and CBVD_SQLA, which AHRQ combines into the single measure CBVD. |
comorbidity_measures.csv |
The 38 measures, with AHRQ's description, whether POA is required, and AHRQ's mortality and readmission index weights (from CMR_Index_Program_v2027-1.sas). |
poa_exempt_codes.csv |
AHRQ's POA-exempt codes for each ICD-10-CM version, 33 (FY2016) to 44 (FY2027). |
Important: a code lookup is not the AHRQ algorithm
Taking the maximum of these flags over a patient's codes does not reproduce AHRQ's measures. AHRQ's software:
- maps secondary diagnoses only; the principal diagnosis is excluded;
- counts the 18 POA-dependent measures only when POA is
YorW, or when the code is exempt for the discharge's ICD-10-CM version; - applies the cerebrovascular "not present on admission" rule;
- applies the hierarchy exclusions.
To get AHRQ-faithful results, use AHRQ's SAS software or the elixhauser-ahrq package.
Changes in v2027.1 from v2026.1 (AHRQ change log)
- 8 codes added: C7831, C7832, C7983 (CANCER_METS); D6911, D6919 (COAG); K740A, K7683 (LIVER_MLD); Z6818 (WGHTLOSS).
- 2 codes removed from DEMENTIA: F0670 and F0671.
- Rename:
DRUG_ABUSEbecomesDRUG. - Relabel: ALCOHOL becomes "Alcohol-related disorders".
Attribution
- Source. Agency for Healthcare Research and Quality, Healthcare Cost and Utilization Project: Elixhauser Comorbidity Software Refined for ICD-10-CM, v2027.1. https://hcup-us.ahrq.gov/toolssoftware/comorbidityicd10/comorbidity_icd10.jsp
- Maintainer. Episodes of Care Solutions (EOCS), www.eocs.ltd.
- No endorsement. This dataset is not affiliated with, reviewed or endorsed by AHRQ or any other government agency.
- Downloads last month
- 73