hccinfhir 0.0.6__py3-none-any.whl → 0.0.8__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 -5
- hccinfhir/hccinfhir.py +1 -4
- hccinfhir/model_demographics.py +3 -3
- {hccinfhir-0.0.6.dist-info → hccinfhir-0.0.8.dist-info}/METADATA +1 -1
- {hccinfhir-0.0.6.dist-info → hccinfhir-0.0.8.dist-info}/RECORD +7 -7
- {hccinfhir-0.0.6.dist-info → hccinfhir-0.0.8.dist-info}/WHEEL +0 -0
- {hccinfhir-0.0.6.dist-info → hccinfhir-0.0.8.dist-info}/licenses/LICENSE +0 -0
hccinfhir/datamodels.py
CHANGED
|
@@ -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,11 +67,11 @@ class Demographics(BaseModel):
|
|
|
67
67
|
"""
|
|
68
68
|
Response model for demographic categorization
|
|
69
69
|
"""
|
|
70
|
-
age: int = Field(..., description="[required] Beneficiary age")
|
|
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)")
|
hccinfhir/hccinfhir.py
CHANGED
|
@@ -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):
|
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=inagzG6NH1a6DBSThe0heAi-z3ocfrY39v7_kYi5Lk4,4876
|
|
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
|
-
hccinfhir/hccinfhir.py,sha256=
|
|
7
|
+
hccinfhir/hccinfhir.py,sha256=DxTkqbgVXsOsvX1M_UXemb68UMfC8oVCGus2CYIAiTM,6837
|
|
8
8
|
hccinfhir/model_calculate.py,sha256=6cjWMtayC9fBxhTCnbqSJSlctblYz4Mn9vQYDXx-Iu8,3725
|
|
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.8.dist-info/METADATA,sha256=DIj819iB_TXJHKZxlDqZyMVrruGDwbmdSm4cn2qSkbY,11567
|
|
40
|
+
hccinfhir-0.0.8.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
41
|
+
hccinfhir-0.0.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
42
|
+
hccinfhir-0.0.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|