vvcb / comorbidipy

Python package to calculate comorbidity scores including Charlson Comorbidity Score and Elixhauser Score and their weighted variants.
MIT License
10 stars 5 forks source link

mapping mechanism #5

Open StillLu opened 3 months ago

StillLu commented 3 months ago

Description

Hi, I compared the CCI score computed by r and your version. I just found some codes cannot be matched in your version. Here I provide a test example (you can transform it to r version), could you please help check your mapping mechanism?

all_icd10_codes = [
    "L03.116", "N17.9", "R26.89", "D50.9", "R74.01", "G23.8", "N39.41", "G89.29",
    "M79.685", "M79.605", "G89.29", "N81.4", "S02.402A", "S02.2XXA", "S02.40FA",
    "S02.2XXA", "J06.0X1A", "S01.112A", "I15.9", "F78.73", "E11.9", "N18.4",
    "N17.9", "N18.30", "E11.22", "N18.30", "E11.22", "S02.19X4", "Z79.01",
    "I77.9", "I70.90", "A41.9", "N18.6", "N19", "D64.9", "I50.30", "N39.0",
    "L89.151", "J98", "S40.021D", "R53.1", "N18.6", "Z99.2", "E11.9", "T82.49XA",
    "D63.1", "Z78.9", "I48.91", "Z71.9", "L89.151", "R19.7", "A41.9", "R68.89",
    "E87.2", "J18.9", "R10.9", "R05"
]
np.random.seed(0)  
ids = np.random.randint(1, 21, size=len(all_icd10_codes))
df = pd.DataFrame({'id': ids, 'code': all_icd10_codes})
ccs = comorbidity(df, id = 'id', age = None, icd= 'icd10', score="charlson", variant="quan", weighting="charlson",assign0 = False)