pycomorb 0.4.1__tar.gz → 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pycomorb-0.4.1/src/pycomorb.egg-info → pycomorb-0.4.2}/PKG-INFO +1 -1
- {pycomorb-0.4.1 → pycomorb-0.4.2}/pyproject.toml +1 -1
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/CustomComorbidityIndex.py +3 -1
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/GagneComorbidityIndex.py +4 -3
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/__init__.py +2 -1
- {pycomorb-0.4.1 → pycomorb-0.4.2/src/pycomorb.egg-info}/PKG-INFO +1 -1
- {pycomorb-0.4.1 → pycomorb-0.4.2}/LICENSE +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/README.md +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/setup.cfg +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/CharlsonComorbidityIndex.py +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/ElixhauserComorbidityIndex.py +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/HospitalFrailtyRiskScore.py +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/CHARLSON_AUSTRALIA.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/CHARLSON_DEYO.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/CHARLSON_DHOORE.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/CHARLSON_QUAN.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/CHARLSON_ROMANO.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/CHARLSON_SWEDEN.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/CHARLSON_UK_SHMI_v1.55.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/ELIXHAUSER.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/ELIXHAUSER_AHRQ_ICD10.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/ELIXHAUSER_AHRQ_ICD9.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/ELIXHAUSER_QUAN.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/ELIXHAUSER_WEIGHTS.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/GAGNE.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb/common/HFRS.csv +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb.egg-info/SOURCES.txt +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb.egg-info/dependency_links.txt +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb.egg-info/requires.txt +0 -0
- {pycomorb-0.4.1 → pycomorb-0.4.2}/src/pycomorb.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pycomorb
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Comorbidity and frailty score calculation utilities (Charlson, Elixhauser, Gagne, HFRS) using polars
|
|
5
5
|
Author-email: Finn Fassbender <finn.fassbender@charite.de>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -170,7 +170,9 @@ def CustomComorbidityIndex(
|
|
|
170
170
|
|
|
171
171
|
# Combine: outer join on id_col, take max for each category
|
|
172
172
|
all_categories = sorted(set(cats9) | set(cats10))
|
|
173
|
-
df_combined = df9.join(
|
|
173
|
+
df_combined = df9.join(
|
|
174
|
+
df10, on=id_col, how="outer", suffix="_right", coalesce=True
|
|
175
|
+
)
|
|
174
176
|
for cat in all_categories:
|
|
175
177
|
left = cat
|
|
176
178
|
right = f"{cat}_right"
|
|
@@ -36,6 +36,7 @@ def GagneComorbidityIndex(
|
|
|
36
36
|
icd_version: str = "icd9",
|
|
37
37
|
icd_version_col: str = None,
|
|
38
38
|
return_categories=False,
|
|
39
|
+
gagne_name: bool = False,
|
|
39
40
|
):
|
|
40
41
|
"""
|
|
41
42
|
Calculate the Gagne Comorbidity Index using ICD codes.
|
|
@@ -49,7 +50,7 @@ def GagneComorbidityIndex(
|
|
|
49
50
|
return_categories (bool): If True, also return presence indicators for each Gagne category.
|
|
50
51
|
|
|
51
52
|
Returns:
|
|
52
|
-
- DataFrame with [id_col, "
|
|
53
|
+
- DataFrame with [id_col, "Combined Comorbidity Score"].
|
|
53
54
|
- DataFrame with category indicators if return_categories is True, else None.
|
|
54
55
|
"""
|
|
55
56
|
|
|
@@ -68,9 +69,9 @@ def GagneComorbidityIndex(
|
|
|
68
69
|
definition_file = "GAGNE.csv"
|
|
69
70
|
definition_file_path = Path(__file__).parent / f"common/{definition_file}"
|
|
70
71
|
weight_col_name = "weights"
|
|
71
|
-
score_col_name = "Gagne Score"
|
|
72
|
+
score_col_name = "Gagne Score" if gagne_name else "Combined Comorbidity Score"
|
|
72
73
|
|
|
73
|
-
# Define mutual exclusion rules for
|
|
74
|
+
# Define mutual exclusion rules for combined score
|
|
74
75
|
mutual_exclusion_rules = [
|
|
75
76
|
("Complicated diabetes", "Uncomplicated diabetes")
|
|
76
77
|
]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
__author__ = """Finn Fassbender"""
|
|
4
4
|
__email__ = "finn.fassbender@charite.de"
|
|
5
|
-
__version__ = "0.4.
|
|
5
|
+
__version__ = "0.4.2"
|
|
6
6
|
|
|
7
7
|
from .CharlsonComorbidityIndex import CharlsonComorbidityIndex
|
|
8
8
|
from .ElixhauserComorbidityIndex import ElixhauserComorbidityIndex
|
|
@@ -94,6 +94,7 @@ def comorbidity(
|
|
|
94
94
|
icd_version=icd_version,
|
|
95
95
|
icd_version_col=icd_version_col,
|
|
96
96
|
return_categories=return_categories,
|
|
97
|
+
gagne_name="gagne" in score,
|
|
97
98
|
)
|
|
98
99
|
elif score in (
|
|
99
100
|
"hfrs",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pycomorb
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Comorbidity and frailty score calculation utilities (Charlson, Elixhauser, Gagne, HFRS) using polars
|
|
5
5
|
Author-email: Finn Fassbender <finn.fassbender@charite.de>
|
|
6
6
|
License-Expression: MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|