Calculation of comorbidity score based on the structure of the ICD-10 described in Stausberg; Hagn (2015): New Morbidity and Comorbidity Scores based on the Structure of the ICD-10 DOI: 10.1371/journal.pone.0143365.
There are two variants described: ICD-10-groups or ICD-10-chapters. The module currently implements the group variant only.
Function | weight |
Give the comorbidity-score per person. |
Function | _groups |
Return data frame with ICD3 codes corresponding to icd_groups. |
Constant | _ARTIFACT |
Undocumented |
Constant | _GROUP |
Stausberg scores per ICD group. |
Variable | _log |
Logger instance for that module. |
pandas.DataFrame
, index_column: str
, icd_column: str
, weight_name: str
= 'weight', ignored_icds: tuple
= 'UUU', exclude_appendix_artifact: bool
= True) -> pandas.DataFrame
:
(source)
¶
Give the comorbidity-score per person.
The function use the ICD-10-groups variant as Comorbidity Scores based on the Structure of the ICD-10 by Stausberg and Hagn, 2015 DOI: 10.1371/journal.pone.0143365.
One ICD-group can be scored with values between -131 and +6. The range of the score per person can be between -176 and +71. Regarding to the discussion in the original publication the ICD group of appendix diseases (K35-K38 with score value of -131) can (and is by default) excluded from the scores calculation. Because of that by default the lowest possible score per group is -5 and per person -45.
Parameters | |
data:pandas.DataFrame | Input date. |
indexstr | Name of column which is grouped for (e.g. Person ID). |
icdstr | Name of column with specific ICD codes internally converted into ICD-10-groups. |
weightstr | Name of resulting column with weight/score values. |
ignoredtuple | Codes that are ignored in the input data. |
excludebool | ICD codes belonging to the ICD group K35-K38 is excluded from score calculation. |
Returns | |
pandas.DataFrame | A new data frame with two columns. |
Return data frame with ICD3 codes corresponding to icd_groups.
Example
The two groups ['T15-T19', 'T80-T88'] will be converted into ['T15', 'T16', .., 'T19', 'T80', .., 'T88'].
Parameters | |
icdlist | List of ICD groups. e.g. ["A01-A06", "X14-X20"] |
Returns | |
pandas.DataFrame | A data frame with column ICD3 and GROUP. |
Raises | |
ValueError | If the format of the group string is invalid. |