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.
Files changed (43) hide show
  1. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/PKG-INFO +6 -11
  2. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/README.md +5 -10
  3. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/datamodels.py +18 -18
  4. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/hccinfhir.py +1 -4
  5. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/pyproject.toml +1 -1
  6. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/.gitignore +0 -0
  7. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/LICENSE +0 -0
  8. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/__init__.py +0 -0
  9. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/__init__.py +0 -0
  10. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_coefficients_2025.csv +0 -0
  11. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_dx_to_cc_2025.csv +0 -0
  12. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_eligible_cpt_hcpcs_2023.csv +0 -0
  13. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_eligible_cpt_hcpcs_2024.csv +0 -0
  14. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_eligible_cpt_hcpcs_2025.csv +0 -0
  15. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/data/ra_hierarchies_2025.csv +0 -0
  16. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/extractor.py +0 -0
  17. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/extractor_837.py +0 -0
  18. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/extractor_fhir.py +0 -0
  19. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/filter.py +0 -0
  20. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_calculate.py +0 -0
  21. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_coefficients.py +0 -0
  22. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_demographics.py +0 -0
  23. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_dx_to_cc.py +0 -0
  24. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_hierarchies.py +0 -0
  25. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/model_interactions.py +0 -0
  26. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/__init__.py +0 -0
  27. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_0.txt +0 -0
  28. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_1.txt +0 -0
  29. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_10.txt +0 -0
  30. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_11.txt +0 -0
  31. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_2.txt +0 -0
  32. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_3.txt +0 -0
  33. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_4.txt +0 -0
  34. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_5.txt +0 -0
  35. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_6.txt +0 -0
  36. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_7.txt +0 -0
  37. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_8.txt +0 -0
  38. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_837_9.txt +0 -0
  39. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_eob_1.json +0 -0
  40. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_eob_2.json +0 -0
  41. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_eob_200.ndjson +0 -0
  42. {hccinfhir-0.0.5 → hccinfhir-0.0.7}/hccinfhir/samples/sample_eob_3.json +0 -0
  43. {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.5
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 = Demographics(
131
+ demographics = {
132
132
  age=67,
133
- sex='F',
134
- dual_elgbl_cd='00', # Not dual eligible
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 = Demographics(
117
+ demographics = {
118
118
  age=67,
119
- sex='F',
120
- dual_elgbl_cd='00', # Not dual eligible
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(..., description="[derived] Age-sex category code")
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):
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hccinfhir"
7
- version = "0.0.5"
7
+ version = "0.0.7"
8
8
  authors = [
9
9
  { name="Yubin Park", email="yubin.park@mimilabs.ai" },
10
10
  ]
File without changes
File without changes
File without changes
File without changes