hccinfhir 0.0.5__tar.gz → 0.0.7__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.
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/PKG-INFO +6 -11
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/README.md +5 -10
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/datamodels.py +18 -18
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/hccinfhir.py +1 -4
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/pyproject.toml +1 -1
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/.gitignore +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/LICENSE +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/__init__.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/__init__.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_coefficients_2025.csv +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_dx_to_cc_2025.csv +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_eligible_cpt_hcpcs_2023.csv +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_eligible_cpt_hcpcs_2024.csv +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_eligible_cpt_hcpcs_2025.csv +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_hierarchies_2025.csv +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/extractor.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/extractor_837.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/extractor_fhir.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/filter.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_calculate.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_coefficients.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_demographics.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_dx_to_cc.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_hierarchies.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_interactions.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/__init__.py +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_0.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_1.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_10.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_11.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_2.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_3.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_4.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_5.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_6.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_7.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_8.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_9.txt +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_eob_1.json +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_eob_2.json +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_eob_200.ndjson +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_eob_3.json +0 -0
- {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: hccinfhir
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.7
|
|
4
4
|
Summary: HCC Algorithm for FHIR Resources
|
|
5
5
|
Project-URL: Homepage, https://github.com/mimilabs/hccinfhir
|
|
6
6
|
Project-URL: Issues, https://github.com/mimilabs/hccinfhir/issues
|
|
@@ -128,15 +128,10 @@ hcc_processor = HCCInFHIR(
|
|
|
128
128
|
)
|
|
129
129
|
|
|
130
130
|
# Define beneficiary demographics
|
|
131
|
-
demographics =
|
|
131
|
+
demographics = {
|
|
132
132
|
age=67,
|
|
133
|
-
sex='F'
|
|
134
|
-
|
|
135
|
-
orec='0', # Old age
|
|
136
|
-
crec='0', # Current old age
|
|
137
|
-
new_enrollee=False,
|
|
138
|
-
snp=False
|
|
139
|
-
)
|
|
133
|
+
sex='F'
|
|
134
|
+
}
|
|
140
135
|
|
|
141
136
|
# Method 1: Process FHIR EOB resources
|
|
142
137
|
raf_result = hcc_processor.run(eob_list, demographics)
|
|
@@ -309,8 +304,8 @@ Join us at [mimilabs](https://mimilabs.ai/signup). Reference data available in M
|
|
|
309
304
|
|
|
310
305
|
## Publishing (only for those maintainers...)
|
|
311
306
|
```bash
|
|
312
|
-
$ hatch build
|
|
313
|
-
$ hatch publish
|
|
307
|
+
$ python3 -m hatch build
|
|
308
|
+
$ python3 -m hatch publish
|
|
314
309
|
```
|
|
315
310
|
|
|
316
311
|
## License
|
|
@@ -114,15 +114,10 @@ hcc_processor = HCCInFHIR(
|
|
|
114
114
|
)
|
|
115
115
|
|
|
116
116
|
# Define beneficiary demographics
|
|
117
|
-
demographics =
|
|
117
|
+
demographics = {
|
|
118
118
|
age=67,
|
|
119
|
-
sex='F'
|
|
120
|
-
|
|
121
|
-
orec='0', # Old age
|
|
122
|
-
crec='0', # Current old age
|
|
123
|
-
new_enrollee=False,
|
|
124
|
-
snp=False
|
|
125
|
-
)
|
|
119
|
+
sex='F'
|
|
120
|
+
}
|
|
126
121
|
|
|
127
122
|
# Method 1: Process FHIR EOB resources
|
|
128
123
|
raf_result = hcc_processor.run(eob_list, demographics)
|
|
@@ -295,8 +290,8 @@ Join us at [mimilabs](https://mimilabs.ai/signup). Reference data available in M
|
|
|
295
290
|
|
|
296
291
|
## Publishing (only for those maintainers...)
|
|
297
292
|
```bash
|
|
298
|
-
$ hatch build
|
|
299
|
-
$ hatch publish
|
|
293
|
+
$ python3 -m hatch build
|
|
294
|
+
$ python3 -m hatch publish
|
|
300
295
|
```
|
|
301
296
|
|
|
302
297
|
## License
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import List, Optional, Literal, Dict, Set, TypedDict
|
|
2
|
+
from typing import List, Optional, Literal, Dict, Set, TypedDict, Union
|
|
3
3
|
|
|
4
4
|
# Define Model Name literal type
|
|
5
5
|
ModelName = Literal[
|
|
@@ -67,24 +67,24 @@ class Demographics(BaseModel):
|
|
|
67
67
|
"""
|
|
68
68
|
Response model for demographic categorization
|
|
69
69
|
"""
|
|
70
|
-
age: int = Field(..., description="Beneficiary age")
|
|
71
|
-
sex: Literal['M', 'F', '1', '2'] = Field(..., description="Beneficiary sex")
|
|
72
|
-
dual_elgbl_cd: Literal[None, 'NA', '99', '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10'] = Field('NA', description="Dual status code")
|
|
73
|
-
orec: Literal[None, '0', '1', '2', '3'] = Field('0', description="Original reason for entitlement")
|
|
74
|
-
crec: Literal[None, '0', '1', '2', '3'] = Field('0', description="Current reason for entitlement")
|
|
75
|
-
new_enrollee: bool = Field(False, description="True if beneficiary is a new enrollee")
|
|
76
|
-
snp: bool = Field(False, description="True if beneficiary is in SNP")
|
|
77
|
-
version: str = Field("V2", description="Version of categorization used (V2, V4, V6)")
|
|
78
|
-
low_income: bool = Field(False, description="True if beneficiary is in low income; RxHCC only")
|
|
70
|
+
age: Union[int, float] = Field(..., description="[required] Beneficiary age")
|
|
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('0', description="Original reason for entitlement")
|
|
74
|
+
crec: Optional[Literal[None, '0', '1', '2', '3']] = Field('0', description="Current reason for entitlement")
|
|
75
|
+
new_enrollee: Optional[bool] = Field(False, description="True if beneficiary is a new enrollee")
|
|
76
|
+
snp: Optional[bool] = Field(False, description="True if beneficiary is in SNP")
|
|
77
|
+
version: Optional[str] = Field("V2", description="Version of categorization used (V2, V4, V6)")
|
|
78
|
+
low_income: Optional[bool] = Field(False, description="True if beneficiary is in low income; RxHCC only")
|
|
79
79
|
graft_months: Optional[int] = Field(None, description="Number of months since transplant; ESRD Model only")
|
|
80
|
-
category: str = Field(
|
|
81
|
-
non_aged: bool = Field(False, description="[derived] True if age <= 64")
|
|
82
|
-
orig_disabled: bool = Field(False, description="[derived] True if originally disabled (OREC='1' and not currently disabled)")
|
|
83
|
-
disabled: bool = Field(False, description="[derived] True if currently disabled (age < 65 and OREC != '0')")
|
|
84
|
-
esrd: bool = Field(False, description="[derived] True if ESRD (ESRD Model)")
|
|
85
|
-
lti: bool = Field(False, description="[derived] True if LTI (LTI Model)")
|
|
86
|
-
fbd: bool = Field(False, description="[derived] True if FBD (FBD Model)")
|
|
87
|
-
pbd: bool = Field(False, description="[derived] True if PBD (PBD Model)")
|
|
80
|
+
category: Optional[str] = Field(None, description="[derived] Age-sex category code")
|
|
81
|
+
non_aged: Optional[bool] = Field(False, description="[derived] True if age <= 64")
|
|
82
|
+
orig_disabled: Optional[bool] = Field(False, description="[derived] True if originally disabled (OREC='1' and not currently disabled)")
|
|
83
|
+
disabled: Optional[bool] = Field(False, description="[derived] True if currently disabled (age < 65 and OREC != '0')")
|
|
84
|
+
esrd: Optional[bool] = Field(False, description="[derived] True if ESRD (ESRD Model)")
|
|
85
|
+
lti: Optional[bool] = Field(False, description="[derived] True if LTI (LTI Model)")
|
|
86
|
+
fbd: Optional[bool] = Field(False, description="[derived] True if FBD (FBD Model)")
|
|
87
|
+
pbd: Optional[bool] = Field(False, description="[derived] True if PBD (PBD Model)")
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
class RAFResult(TypedDict):
|
|
@@ -96,10 +96,7 @@ class HCCInFHIR:
|
|
|
96
96
|
|
|
97
97
|
if not isinstance(service_data, list):
|
|
98
98
|
raise ValueError("Service data must be a list of service records")
|
|
99
|
-
|
|
100
|
-
if not service_data:
|
|
101
|
-
raise ValueError("Service data list cannot be empty")
|
|
102
|
-
|
|
99
|
+
|
|
103
100
|
# Standardize service data with better error handling
|
|
104
101
|
standardized_data = []
|
|
105
102
|
for idx, item in enumerate(service_data):
|
|
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
|
|
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
|