Skip to content

Commit a599d03

Browse files
chore(mimic-iv): regenerate postgres and duckdb charlson copies
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6aa3306 commit a599d03

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

mimic-iv/concepts_duckdb/comorbidity/charlson.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ WITH diag AS (
275275
OR SUBSTRING(icd10_code, 1, 3) BETWEEN 'C00' AND 'C26'
276276
OR SUBSTRING(icd10_code, 1, 3) BETWEEN 'C30' AND 'C34'
277277
OR SUBSTRING(icd10_code, 1, 3) BETWEEN 'C37' AND 'C41'
278-
OR SUBSTRING(icd10_code, 1, 3) BETWEEN 'C45' AND 'C58'
278+
OR SUBSTRING(icd10_code, 1, 3) BETWEEN 'C45' AND 'C49'
279+
OR SUBSTRING(icd10_code, 1, 3) BETWEEN 'C50' AND 'C58'
279280
OR SUBSTRING(icd10_code, 1, 3) BETWEEN 'C60' AND 'C76'
280281
OR SUBSTRING(icd10_code, 1, 3) BETWEEN 'C81' AND 'C85'
281282
OR SUBSTRING(icd10_code, 1, 3) BETWEEN 'C90' AND 'C97'

mimic-iv/concepts_postgres/comorbidity/charlson.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- THIS SCRIPT IS AUTOMATICALLY GENERATED. DO NOT EDIT IT DIRECTLY.
22
DROP TABLE IF EXISTS mimiciv_derived.charlson; CREATE TABLE mimiciv_derived.charlson AS
3-
/* ------------------------------------------------------------------ */ /* This query extracts Charlson Comorbidity Index (CCI) based on the */ /* recorded ICD-9 and ICD-10 codes. */ /* Reference for CCI: */ /* (1) Charlson ME, Pompei P, Ales KL, MacKenzie CR. (1987) A new method */ /* of classifying prognostic comorbidity in longitudinal studies: */ /* development and validation.J Chronic Dis; 40(5):373-83. */ /* (2) Charlson M, Szatrowski TP, Peterson J, Gold J. (1994) Validation */ /* of a combined comorbidity index. J Clin Epidemiol; 47(11):1245-51. */ /* */ /* Reference for ICD-9-CM and ICD-10 Coding Algorithms for Charlson */ /* Comorbidities: */ /* (3) Quan H, Sundararajan V, Halfon P, et al. Coding algorithms for */ /* defining Comorbidities in ICD-9-CM and ICD-10 administrative data. */ /* Med Care. 2005 Nov; 43(11): 1130-9. */ /* ------------------------------------------------------------------ */
3+
/* ------------------------------------------------------------------ */ /* This query extracts Charlson Comorbidity Index (CCI) based on the */ /* recorded ICD-9 and ICD-10 codes. */ /* Reference for CCI: */ /* (1) Charlson ME, Pompei P, Ales KL, MacKenzie CR. (1987) A new method */ /* of classifying prognostic comorbidity in longitudinal studies: */ /* development and validation.J Chronic Dis; 40(5):373-83. */ /* (2) Charlson M, Szatrowski TP, Peterson J, Gold J. (1994) Validation */ /* of a combined comorbidity index. J Clin Epidemiol; 47(11):1245-51. */ /* */ /* Reference for ICD-9-CM and ICD-10 Coding Algorithms for Charlson */ /* Comorbidities: */ /* (3) Quan H, Sundararajan V, Halfon P, et al. Coding algorithms for */ /* defining Comorbidities in ICD-9-CM and ICD-10 administrative data. */ /* Med Care. 2005 Nov; 43(11): 1130-9. */ /* ICD-10-CM extensions (C4A, C7A, C7B) are not part of WHO ICD-10 and */ /* were not defined in Quan et al. (2005). The malignant_cancer mapping */ /* below follows Quan by excluding skin malignancy (C4A Merkel cell) and */ /* by not mapping C7A/C7B neuroendocrine categories, which fall outside */ /* the WHO ICD-10 code ranges used in the publication. */ /* ------------------------------------------------------------------ */
44
WITH diag AS (
55
SELECT
66
hadm_id,
@@ -276,7 +276,8 @@ WITH diag AS (
276276
OR SUBSTRING(icd10_code FROM 1 FOR 3) BETWEEN 'C00' AND 'C26'
277277
OR SUBSTRING(icd10_code FROM 1 FOR 3) BETWEEN 'C30' AND 'C34'
278278
OR SUBSTRING(icd10_code FROM 1 FOR 3) BETWEEN 'C37' AND 'C41'
279-
OR SUBSTRING(icd10_code FROM 1 FOR 3) BETWEEN 'C45' AND 'C58'
279+
OR SUBSTRING(icd10_code FROM 1 FOR 3) /* Split C45-C58 to exclude C4A (Merkel cell carcinoma), which */ /* lexically falls inside BETWEEN 'C45' AND 'C58' but is skin */ /* malignancy excluded by Quan et al. (2005). */ BETWEEN 'C45' AND 'C49'
280+
OR SUBSTRING(icd10_code FROM 1 FOR 3) BETWEEN 'C50' AND 'C58'
280281
OR SUBSTRING(icd10_code FROM 1 FOR 3) BETWEEN 'C60' AND 'C76'
281282
OR SUBSTRING(icd10_code FROM 1 FOR 3) BETWEEN 'C81' AND 'C85'
282283
OR SUBSTRING(icd10_code FROM 1 FOR 3) BETWEEN 'C90' AND 'C97'

0 commit comments

Comments
 (0)