hccinfhir 0.2.2__py3-none-any.whl → 0.2.3__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 +121 -6
- hccinfhir/extractor_834.py +552 -359
- hccinfhir/sample_files/sample_834_02.txt +1 -0
- hccinfhir/sample_files/sample_834_03.txt +1 -0
- hccinfhir/sample_files/sample_834_04.txt +1 -0
- hccinfhir/sample_files/sample_834_05.txt +1 -0
- hccinfhir/sample_files/sample_834_06.txt +1 -0
- {hccinfhir-0.2.2.dist-info → hccinfhir-0.2.3.dist-info}/METADATA +5 -5
- {hccinfhir-0.2.2.dist-info → hccinfhir-0.2.3.dist-info}/RECORD +11 -6
- {hccinfhir-0.2.2.dist-info → hccinfhir-0.2.3.dist-info}/WHEEL +0 -0
- {hccinfhir-0.2.2.dist-info → hccinfhir-0.2.3.dist-info}/licenses/LICENSE +0 -0
hccinfhir/datamodels.py
CHANGED
|
@@ -195,22 +195,64 @@ class RAFResult(BaseModel):
|
|
|
195
195
|
|
|
196
196
|
model_config = {"extra": "forbid", "validate_assignment": True}
|
|
197
197
|
|
|
198
|
+
class HCPCoveragePeriod(BaseModel):
|
|
199
|
+
"""A single HCP (Health Care Plan) coverage period from HD loop"""
|
|
200
|
+
start_date: Optional[str] = None
|
|
201
|
+
end_date: Optional[str] = None
|
|
202
|
+
hcp_code: Optional[str] = None
|
|
203
|
+
hcp_status: Optional[str] = None
|
|
204
|
+
aid_codes: Optional[str] = None # REF*CE composite
|
|
205
|
+
|
|
206
|
+
|
|
198
207
|
class EnrollmentData(BaseModel):
|
|
199
208
|
"""
|
|
200
209
|
Enrollment and demographic data extracted from 834 transactions.
|
|
201
210
|
|
|
202
211
|
Focus: Extract data needed for risk adjustment and Medicaid coverage tracking.
|
|
212
|
+
Supports California DHCS Medi-Cal 834 format with FAME fields.
|
|
203
213
|
|
|
204
214
|
Attributes:
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
215
|
+
# Header Info
|
|
216
|
+
source: Interchange sender ID (ISA06)
|
|
217
|
+
report_date: Transaction date (GS04)
|
|
218
|
+
|
|
219
|
+
# Identifiers
|
|
220
|
+
member_id: Unique identifier for the member (REF*0F)
|
|
221
|
+
mbi: Medicare Beneficiary Identifier (REF*6P)
|
|
222
|
+
medicaid_id: Medicaid/Medi-Cal ID number (REF*23)
|
|
223
|
+
hic: Medicare HICN (REF*F6)
|
|
224
|
+
cin: Client Index Number from REF*3H
|
|
225
|
+
cin_check_digit: CIN check digit from REF*3H
|
|
226
|
+
|
|
227
|
+
# Name
|
|
228
|
+
first_name: Member first name (NM104)
|
|
229
|
+
last_name: Member last name (NM103)
|
|
230
|
+
middle_name: Member middle name (NM105)
|
|
231
|
+
|
|
232
|
+
# Demographics
|
|
208
233
|
dob: Date of birth (YYYY-MM-DD)
|
|
209
234
|
age: Calculated age
|
|
210
235
|
sex: Member sex (M/F)
|
|
211
|
-
|
|
236
|
+
race: Race/ethnicity code (DMG05)
|
|
237
|
+
language: Preferred language (LUI02)
|
|
238
|
+
death_date: Date of death if applicable
|
|
239
|
+
|
|
240
|
+
# Address
|
|
241
|
+
address_1: Street address line 1 (N301)
|
|
242
|
+
address_2: Street address line 2 (N302)
|
|
243
|
+
city: City (N401)
|
|
244
|
+
state: State code (N402)
|
|
245
|
+
zip: Postal code (N403)
|
|
246
|
+
phone: Phone number (PER04)
|
|
247
|
+
|
|
248
|
+
# Coverage tracking
|
|
249
|
+
maintenance_type: 001=Change, 021=Add, 024=Cancel, 025=Reinstate (INS03)
|
|
250
|
+
maintenance_reason_code: Maintenance reason (INS04)
|
|
251
|
+
benefit_status_code: A=Active, C=COBRA, etc. (INS05)
|
|
212
252
|
coverage_start_date: Coverage effective date
|
|
213
|
-
coverage_end_date: Coverage termination date
|
|
253
|
+
coverage_end_date: Coverage termination date
|
|
254
|
+
|
|
255
|
+
# Medicaid/Medicare Status
|
|
214
256
|
has_medicare: Member has Medicare coverage
|
|
215
257
|
has_medicaid: Member has Medicaid coverage
|
|
216
258
|
dual_elgbl_cd: Dual eligibility status code ('00','01'-'08')
|
|
@@ -218,25 +260,75 @@ class EnrollmentData(BaseModel):
|
|
|
218
260
|
is_partial_benefit_dual: Partial Benefit Dual (uses CPA_/CPD_ prefix)
|
|
219
261
|
medicare_status_code: QMB, SLMB, QI, QDWI, etc.
|
|
220
262
|
medi_cal_aid_code: California Medi-Cal aid code
|
|
263
|
+
medi_cal_eligibility_status: Medi-Cal eligibility status from REF*6O
|
|
264
|
+
|
|
265
|
+
# CA DHCS / FAME Specific
|
|
266
|
+
fame_county_id: FAME county ID (REF*ZX or N4*CY)
|
|
267
|
+
case_number: Case number (REF*1L)
|
|
268
|
+
fame_card_issue_date: FAME card issue date
|
|
269
|
+
fame_redetermination_date: FAME redetermination date (REF*17)
|
|
270
|
+
fame_death_date: FAME death date
|
|
271
|
+
primary_aid_code: Primary AID code (REF*RB)
|
|
272
|
+
carrier_code: Carrier code
|
|
273
|
+
fed_contract_number: Federal contract number
|
|
274
|
+
client_reporting_cat: Client reporting category
|
|
275
|
+
res_addr_flag: Residential address flag from REF*6O
|
|
276
|
+
reas_add_ind: Reason address indicator from REF*6O
|
|
277
|
+
res_zip_deliv_code: Residential zip delivery code
|
|
278
|
+
|
|
279
|
+
# Risk Adjustment Fields
|
|
221
280
|
orec: Original Reason for Entitlement Code
|
|
222
281
|
crec: Current Reason for Entitlement Code
|
|
223
282
|
snp: Special Needs Plan enrollment
|
|
224
283
|
low_income: Low Income Subsidy (Part D)
|
|
225
284
|
lti: Long-Term Institutionalized
|
|
226
285
|
new_enrollee: New enrollee status (<= 3 months)
|
|
286
|
+
|
|
287
|
+
# HCP (Health Care Plan) Info
|
|
288
|
+
hcp_code: Current HCP code (HD04 first part)
|
|
289
|
+
hcp_status: Current HCP status (HD04 second part)
|
|
290
|
+
amount: Premium or cost share amount
|
|
291
|
+
|
|
292
|
+
# HCP History (multiple coverage periods)
|
|
293
|
+
hcp_history: List of historical HCP coverage periods
|
|
227
294
|
"""
|
|
295
|
+
# Header Info
|
|
296
|
+
source: Optional[str] = None
|
|
297
|
+
report_date: Optional[str] = None
|
|
298
|
+
|
|
228
299
|
# Identifiers
|
|
229
300
|
member_id: Optional[str] = None
|
|
230
301
|
mbi: Optional[str] = None
|
|
231
302
|
medicaid_id: Optional[str] = None
|
|
303
|
+
hic: Optional[str] = None
|
|
304
|
+
cin: Optional[str] = None
|
|
305
|
+
cin_check_digit: Optional[str] = None
|
|
306
|
+
|
|
307
|
+
# Name
|
|
308
|
+
first_name: Optional[str] = None
|
|
309
|
+
last_name: Optional[str] = None
|
|
310
|
+
middle_name: Optional[str] = None
|
|
232
311
|
|
|
233
312
|
# Demographics
|
|
234
313
|
dob: Optional[str] = None
|
|
235
314
|
age: Optional[int] = None
|
|
236
315
|
sex: Optional[str] = None
|
|
316
|
+
race: Optional[str] = None
|
|
317
|
+
language: Optional[str] = None
|
|
318
|
+
death_date: Optional[str] = None
|
|
319
|
+
|
|
320
|
+
# Address
|
|
321
|
+
address_1: Optional[str] = None
|
|
322
|
+
address_2: Optional[str] = None
|
|
323
|
+
city: Optional[str] = None
|
|
324
|
+
state: Optional[str] = None
|
|
325
|
+
zip: Optional[str] = None
|
|
326
|
+
phone: Optional[str] = None
|
|
237
327
|
|
|
238
328
|
# Coverage tracking
|
|
239
329
|
maintenance_type: Optional[str] = None
|
|
330
|
+
maintenance_reason_code: Optional[str] = None
|
|
331
|
+
benefit_status_code: Optional[str] = None
|
|
240
332
|
coverage_start_date: Optional[str] = None
|
|
241
333
|
coverage_end_date: Optional[str] = None
|
|
242
334
|
|
|
@@ -248,6 +340,21 @@ class EnrollmentData(BaseModel):
|
|
|
248
340
|
is_partial_benefit_dual: bool = False
|
|
249
341
|
medicare_status_code: Optional[str] = None
|
|
250
342
|
medi_cal_aid_code: Optional[str] = None
|
|
343
|
+
medi_cal_eligibility_status: Optional[str] = None
|
|
344
|
+
|
|
345
|
+
# CA DHCS / FAME Specific
|
|
346
|
+
fame_county_id: Optional[str] = None
|
|
347
|
+
case_number: Optional[str] = None
|
|
348
|
+
fame_card_issue_date: Optional[str] = None
|
|
349
|
+
fame_redetermination_date: Optional[str] = None
|
|
350
|
+
fame_death_date: Optional[str] = None
|
|
351
|
+
primary_aid_code: Optional[str] = None
|
|
352
|
+
carrier_code: Optional[str] = None
|
|
353
|
+
fed_contract_number: Optional[str] = None
|
|
354
|
+
client_reporting_cat: Optional[str] = None
|
|
355
|
+
res_addr_flag: Optional[str] = None
|
|
356
|
+
reas_add_ind: Optional[str] = None
|
|
357
|
+
res_zip_deliv_code: Optional[str] = None
|
|
251
358
|
|
|
252
359
|
# Risk Adjustment Fields
|
|
253
360
|
orec: Optional[str] = None
|
|
@@ -255,4 +362,12 @@ class EnrollmentData(BaseModel):
|
|
|
255
362
|
snp: bool = False
|
|
256
363
|
low_income: bool = False
|
|
257
364
|
lti: bool = False
|
|
258
|
-
new_enrollee: bool = False
|
|
365
|
+
new_enrollee: bool = False
|
|
366
|
+
|
|
367
|
+
# HCP Info
|
|
368
|
+
hcp_code: Optional[str] = None
|
|
369
|
+
hcp_status: Optional[str] = None
|
|
370
|
+
amount: Optional[str] = None
|
|
371
|
+
|
|
372
|
+
# HCP History
|
|
373
|
+
hcp_history: List[HCPCoveragePeriod] = []
|