hccinfhir 0.0.7__py3-none-any.whl → 0.0.9__py3-none-any.whl
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.
- hccinfhir/datamodels.py +5 -3
- hccinfhir/model_calculate.py +6 -0
- hccinfhir/model_demographics.py +3 -3
- {hccinfhir-0.0.7.dist-info → hccinfhir-0.0.9.dist-info}/METADATA +1 -1
- {hccinfhir-0.0.7.dist-info → hccinfhir-0.0.9.dist-info}/RECORD +7 -7
- {hccinfhir-0.0.7.dist-info → hccinfhir-0.0.9.dist-info}/WHEEL +0 -0
- {hccinfhir-0.0.7.dist-info → hccinfhir-0.0.9.dist-info}/licenses/LICENSE +0 -0
hccinfhir/datamodels.py
CHANGED
|
@@ -69,9 +69,9 @@ class Demographics(BaseModel):
|
|
|
69
69
|
"""
|
|
70
70
|
age: Union[int, float] = Field(..., description="[required] Beneficiary age")
|
|
71
71
|
sex: Literal['M', 'F', '1', '2'] = Field(..., description="[required] Beneficiary sex")
|
|
72
|
-
dual_elgbl_cd: Optional[Literal[None, 'NA', '99', '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10']] = Field('NA', description="Dual status code")
|
|
73
|
-
orec: Optional[Literal[None, '0', '1', '2', '3']] = Field('
|
|
74
|
-
crec: Optional[Literal[None, '0', '1', '2', '3']] = Field('
|
|
72
|
+
dual_elgbl_cd: Optional[Literal[None, '', 'NA', '99', '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10']] = Field('NA', description="Dual status code")
|
|
73
|
+
orec: Optional[Literal[None, '', '0', '1', '2', '3']] = Field('', description="Original reason for entitlement")
|
|
74
|
+
crec: Optional[Literal[None, '', '0', '1', '2', '3']] = Field('', description="Current reason for entitlement")
|
|
75
75
|
new_enrollee: Optional[bool] = Field(False, description="True if beneficiary is a new enrollee")
|
|
76
76
|
snp: Optional[bool] = Field(False, description="True if beneficiary is in SNP")
|
|
77
77
|
version: Optional[str] = Field("V2", description="Version of categorization used (V2, V4, V6)")
|
|
@@ -90,6 +90,8 @@ class Demographics(BaseModel):
|
|
|
90
90
|
class RAFResult(TypedDict):
|
|
91
91
|
"""Type definition for RAF calculation results"""
|
|
92
92
|
risk_score: float
|
|
93
|
+
risk_score_demographics: float
|
|
94
|
+
risk_score_hcc: float
|
|
93
95
|
hcc_list: List[str]
|
|
94
96
|
cc_to_dx: Dict[str, Set[str]]
|
|
95
97
|
coefficients: Dict[str, float]
|
hccinfhir/model_calculate.py
CHANGED
|
@@ -76,11 +76,17 @@ def calculate_raf(diagnosis_codes: List[str],
|
|
|
76
76
|
hcc_set = apply_hierarchies(hcc_set, model_name)
|
|
77
77
|
interactions = apply_interactions(demographics, hcc_set, model_name)
|
|
78
78
|
coefficients = apply_coefficients(demographics, hcc_set, interactions, model_name)
|
|
79
|
+
|
|
80
|
+
coefficients_demographics = apply_coefficients(demographics, set(), {}, model_name)
|
|
79
81
|
|
|
80
82
|
risk_score = sum(coefficients.values())
|
|
83
|
+
risk_score_demographics = sum(coefficients_demographics.values())
|
|
84
|
+
risk_score_hcc = risk_score - risk_score_demographics
|
|
81
85
|
|
|
82
86
|
return {
|
|
83
87
|
'risk_score': risk_score,
|
|
88
|
+
'risk_score_demographics': risk_score_demographics,
|
|
89
|
+
'risk_score_hcc': risk_score_hcc,
|
|
84
90
|
'hcc_list': list(hcc_set),
|
|
85
91
|
'cc_to_dx': cc_to_dx,
|
|
86
92
|
'coefficients': coefficients,
|
hccinfhir/model_demographics.py
CHANGED
|
@@ -120,9 +120,9 @@ def categorize_demographics(age: Union[int, float],
|
|
|
120
120
|
|
|
121
121
|
# V2/V4 Logic (Medicare Population)
|
|
122
122
|
elif version in ('V2', 'V4'):
|
|
123
|
-
if orec is None:
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
if orec is None or orec == '':
|
|
124
|
+
orec = '0' # Default to 0 if OREC is None
|
|
125
|
+
|
|
126
126
|
# New enrollee logic
|
|
127
127
|
if new_enrollee:
|
|
128
128
|
prefix = 'NEF' if std_sex == '2' else 'NEM'
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
hccinfhir/__init__.py,sha256=OCyYCv4jTOlYHZbTw2DTks3e6_YT1N2JXAOuyR03KNE,43
|
|
2
|
-
hccinfhir/datamodels.py,sha256=
|
|
2
|
+
hccinfhir/datamodels.py,sha256=_eJ2HVRECVJdA_lX11iRDCkyoWUICbTYAZ711Ra9-Wg,4937
|
|
3
3
|
hccinfhir/extractor.py,sha256=-jHVCIJqFAqvrI9GxkkXZVDQjKDa-7vF7v3PGMGAMnA,1801
|
|
4
4
|
hccinfhir/extractor_837.py,sha256=vkTBCd0WBaJoTrUd-Z-zCIaoLk7KV2n4AGqIORhONIk,7147
|
|
5
5
|
hccinfhir/extractor_fhir.py,sha256=Rg_L0Vg5tz_L2VJ_jvZwWz6RMlPAkHwj4LiK-OWQvrQ,8458
|
|
6
6
|
hccinfhir/filter.py,sha256=8uYThN0-AqwVAKyti29WGiFwQKDiremMhYd_m6QcXhM,2193
|
|
7
7
|
hccinfhir/hccinfhir.py,sha256=DxTkqbgVXsOsvX1M_UXemb68UMfC8oVCGus2CYIAiTM,6837
|
|
8
|
-
hccinfhir/model_calculate.py,sha256=
|
|
8
|
+
hccinfhir/model_calculate.py,sha256=aCm6_jjyftGoit-P7tCQ5FYotDPlMxVNHwFhO5if3KE,4044
|
|
9
9
|
hccinfhir/model_coefficients.py,sha256=UrDAEWBoqooSC8hy9YSUsLMmmfgIO0YGtVkui6ruOkE,5528
|
|
10
|
-
hccinfhir/model_demographics.py,sha256=
|
|
10
|
+
hccinfhir/model_demographics.py,sha256=CMnD2-Au9Q6HNZrJUZqVVJRDEmSuK8ZpF39I22JkX8M,6564
|
|
11
11
|
hccinfhir/model_dx_to_cc.py,sha256=jCFlnAOBkfI9FrCX6tZIh-Sp_DW0HwpY7QrPXGtwInI,1765
|
|
12
12
|
hccinfhir/model_hierarchies.py,sha256=e8QtSayTrfPv2wh149FjK7ToiEmU1ISYMA1Pi38iVk0,2700
|
|
13
13
|
hccinfhir/model_interactions.py,sha256=ZLiKJepPjPkYceKDf7dLXoYE0p44I7t9y2sTOlrxojo,20264
|
|
@@ -36,7 +36,7 @@ hccinfhir/samples/sample_eob_1.json,sha256=_NGSVR2ysFpx-DcTvyga6dFCzhQ8Vi9fNzQEM
|
|
|
36
36
|
hccinfhir/samples/sample_eob_2.json,sha256=FcnJcx0ApOczxjJ_uxVLzCep9THfNf4xs9Yf7hxk8e4,1769
|
|
37
37
|
hccinfhir/samples/sample_eob_200.ndjson,sha256=CxpjeQ1DCMUzZILaM68UEhfxO0p45YGhDDoCZeq8PxU,1917986
|
|
38
38
|
hccinfhir/samples/sample_eob_3.json,sha256=4BW4wOMBEEU9RDfJR15rBEvk0KNHyuMEh3e055y87Hc,2306
|
|
39
|
-
hccinfhir-0.0.
|
|
40
|
-
hccinfhir-0.0.
|
|
41
|
-
hccinfhir-0.0.
|
|
42
|
-
hccinfhir-0.0.
|
|
39
|
+
hccinfhir-0.0.9.dist-info/METADATA,sha256=DafI1RTHC6NfyAW7DcV26um2dXkxCmyrZDDjHaH4Pdw,11567
|
|
40
|
+
hccinfhir-0.0.9.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
41
|
+
hccinfhir-0.0.9.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
42
|
+
hccinfhir-0.0.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|