hccinfhir 0.1.0__tar.gz → 0.1.1__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 (48) hide show
  1. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/PKG-INFO +71 -22
  2. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/README.md +70 -21
  3. hccinfhir-0.1.1/hccinfhir/data/ra_coefficients_2026.csv +8414 -0
  4. hccinfhir-0.1.1/hccinfhir/data/ra_dx_to_cc_2026.csv +58986 -0
  5. hccinfhir-0.1.1/hccinfhir/data/ra_eligible_cpt_hcpcs_2026.csv +6725 -0
  6. hccinfhir-0.1.1/hccinfhir/data/ra_hierarchies_2026.csv +713 -0
  7. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/datamodels.py +4 -2
  8. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/hccinfhir.py +4 -4
  9. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_calculate.py +20 -3
  10. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_coefficients.py +3 -1
  11. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_demographics.py +8 -0
  12. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_dx_to_cc.py +1 -1
  13. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_hierarchies.py +26 -22
  14. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/pyproject.toml +1 -1
  15. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/.gitignore +0 -0
  16. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/LICENSE +0 -0
  17. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/__init__.py +0 -0
  18. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/__init__.py +0 -0
  19. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/hcc_is_chronic.csv +0 -0
  20. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_coefficients_2025.csv +0 -0
  21. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_dx_to_cc_2025.csv +0 -0
  22. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_eligible_cpt_hcpcs_2023.csv +0 -0
  23. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_eligible_cpt_hcpcs_2024.csv +0 -0
  24. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_eligible_cpt_hcpcs_2025.csv +0 -0
  25. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_hierarchies_2025.csv +0 -0
  26. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/extractor.py +0 -0
  27. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/extractor_837.py +0 -0
  28. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/extractor_fhir.py +0 -0
  29. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/filter.py +0 -0
  30. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_interactions.py +0 -0
  31. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/__init__.py +0 -0
  32. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_0.txt +0 -0
  33. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_1.txt +0 -0
  34. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_10.txt +0 -0
  35. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_11.txt +0 -0
  36. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_2.txt +0 -0
  37. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_3.txt +0 -0
  38. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_4.txt +0 -0
  39. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_5.txt +0 -0
  40. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_6.txt +0 -0
  41. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_7.txt +0 -0
  42. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_8.txt +0 -0
  43. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_9.txt +0 -0
  44. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_eob_1.json +0 -0
  45. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_eob_2.json +0 -0
  46. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_eob_200.ndjson +0 -0
  47. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_eob_3.json +0 -0
  48. {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: hccinfhir
3
- Version: 0.1.0
3
+ Version: 0.1.1
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
@@ -182,10 +182,12 @@ Each method returns a RAFResult containing:
182
182
  - Processed service level data (when applicable)
183
183
 
184
184
  ## Testing
185
+
186
+ After installing `hatch`
185
187
  ```bash
186
- $ python3 -m hatch shell
187
- $ python3 -m pip install -e .
188
- $ python3 -m pytest tests/*
188
+ $ hatch shell
189
+ $ pip install -e .
190
+ $ pytest tests/*
189
191
  ```
190
192
 
191
193
  ## Dependencies
@@ -267,36 +269,83 @@ $ python3 -m pytest tests/*
267
269
 
268
270
  ## Data Files
269
271
 
270
- `ra_dx_to_cc_mapping_2025.csv`
272
+ `ra_dx_to_cc_mapping_2026.csv`
271
273
  ```sql
272
- SELECT diagnosis_code, cc, model_name
273
- FROM ra_dx_to_cc_mapping
274
- WHERE year = 2025 and model_type = 'Initial';
274
+ WITH latest_years AS (
275
+ SELECT
276
+ model_name,
277
+ MAX(year) as latest_year
278
+ FROM mimi_ws_1.cmspayment.ra_dx_to_cc_mapping
279
+ WHERE model_type = 'Initial'
280
+ AND year <= 2026 -- Don't go beyond 2026
281
+ GROUP BY model_name
282
+ )
283
+ SELECT
284
+ r.diagnosis_code,
285
+ r.cc,
286
+ r.model_name
287
+ FROM mimi_ws_1.cmspayment.ra_dx_to_cc_mapping r
288
+ INNER JOIN latest_years l
289
+ ON r.model_name = l.model_name
290
+ AND r.year = l.latest_year
291
+ WHERE r.model_type = 'Initial'
292
+ ORDER BY r.model_name, r.diagnosis_code;
275
293
  ```
276
294
 
277
- `ra_hierarchies_2025.csv`
295
+ `ra_hierarchies_2026.csv`
278
296
  ```sql
279
- SELECT cc_parent,
280
- cc_child,
281
- model_domain,
282
- model_version,
283
- model_fullname
284
- FROM ra_hierarchies
285
- WHERE eff_last_date > '2025-01-01';
297
+ WITH latest_dates AS (
298
+ SELECT
299
+ model_domain,
300
+ model_version,
301
+ model_fullname,
302
+ MAX(eff_last_date) as latest_eff_last_date
303
+ FROM mimi_ws_1.cmspayment.ra_hierarchies
304
+ GROUP BY model_domain, model_version, model_fullname
305
+ )
306
+ SELECT
307
+ r.cc_parent,
308
+ r.cc_child,
309
+ r.model_domain,
310
+ r.model_version,
311
+ r.model_fullname
312
+ FROM mimi_ws_1.cmspayment.ra_hierarchies r
313
+ INNER JOIN latest_dates l
314
+ ON r.model_domain = l.model_domain
315
+ AND r.model_version = l.model_version
316
+ AND r.model_fullname = l.model_fullname
317
+ AND r.eff_last_date = l.latest_eff_last_date
318
+ ORDER BY r.model_domain, r.model_version, r.model_fullname, r.cc_parent, r.cc_child;
286
319
  ```
287
320
 
288
- `ra_coefficients_2025.csv`
321
+ `ra_coefficients_2026.csv`
289
322
  ```sql
290
- SELECT coefficient, value, model_domain, model_version
291
- FROM ra_coefficients
292
- WHERE eff_last_date > '2025-01-01';
323
+ WITH preferred_records AS (
324
+ SELECT
325
+ model_domain,
326
+ model_version,
327
+ MAX(eff_last_date) as latest_eff_last_date
328
+ FROM mimi_ws_1.cmspayment.ra_coefficients
329
+ GROUP BY model_domain, model_version
330
+ )
331
+ SELECT
332
+ r.coefficient,
333
+ r.value,
334
+ r.model_domain,
335
+ r.model_version
336
+ FROM mimi_ws_1.cmspayment.ra_coefficients r
337
+ INNER JOIN preferred_records p
338
+ ON r.model_domain = p.model_domain
339
+ AND r.model_version = p.model_version
340
+ AND r.eff_last_date = p.latest_eff_last_date
341
+ ORDER BY r.model_domain, r.model_version, r.coefficient;
293
342
  ```
294
343
 
295
- `ra_eligible_cpt_hcpcs_2025.csv`
344
+ `ra_eligible_cpt_hcpcs_2026.csv`
296
345
  ```sql
297
346
  SELECT DISTINCT cpt_hcpcs_code
298
347
  FROM mimi_ws_1.cmspayment.ra_eligible_cpt_hcpcs
299
- WHERE is_included = 'yes' AND YEAR(mimi_src_file_date) = 2024;
348
+ WHERE is_included = 'yes' AND YEAR(mimi_src_file_date) = 2025;
300
349
  ```
301
350
 
302
351
  ## Contributing
@@ -168,10 +168,12 @@ Each method returns a RAFResult containing:
168
168
  - Processed service level data (when applicable)
169
169
 
170
170
  ## Testing
171
+
172
+ After installing `hatch`
171
173
  ```bash
172
- $ python3 -m hatch shell
173
- $ python3 -m pip install -e .
174
- $ python3 -m pytest tests/*
174
+ $ hatch shell
175
+ $ pip install -e .
176
+ $ pytest tests/*
175
177
  ```
176
178
 
177
179
  ## Dependencies
@@ -253,36 +255,83 @@ $ python3 -m pytest tests/*
253
255
 
254
256
  ## Data Files
255
257
 
256
- `ra_dx_to_cc_mapping_2025.csv`
258
+ `ra_dx_to_cc_mapping_2026.csv`
257
259
  ```sql
258
- SELECT diagnosis_code, cc, model_name
259
- FROM ra_dx_to_cc_mapping
260
- WHERE year = 2025 and model_type = 'Initial';
260
+ WITH latest_years AS (
261
+ SELECT
262
+ model_name,
263
+ MAX(year) as latest_year
264
+ FROM mimi_ws_1.cmspayment.ra_dx_to_cc_mapping
265
+ WHERE model_type = 'Initial'
266
+ AND year <= 2026 -- Don't go beyond 2026
267
+ GROUP BY model_name
268
+ )
269
+ SELECT
270
+ r.diagnosis_code,
271
+ r.cc,
272
+ r.model_name
273
+ FROM mimi_ws_1.cmspayment.ra_dx_to_cc_mapping r
274
+ INNER JOIN latest_years l
275
+ ON r.model_name = l.model_name
276
+ AND r.year = l.latest_year
277
+ WHERE r.model_type = 'Initial'
278
+ ORDER BY r.model_name, r.diagnosis_code;
261
279
  ```
262
280
 
263
- `ra_hierarchies_2025.csv`
281
+ `ra_hierarchies_2026.csv`
264
282
  ```sql
265
- SELECT cc_parent,
266
- cc_child,
267
- model_domain,
268
- model_version,
269
- model_fullname
270
- FROM ra_hierarchies
271
- WHERE eff_last_date > '2025-01-01';
283
+ WITH latest_dates AS (
284
+ SELECT
285
+ model_domain,
286
+ model_version,
287
+ model_fullname,
288
+ MAX(eff_last_date) as latest_eff_last_date
289
+ FROM mimi_ws_1.cmspayment.ra_hierarchies
290
+ GROUP BY model_domain, model_version, model_fullname
291
+ )
292
+ SELECT
293
+ r.cc_parent,
294
+ r.cc_child,
295
+ r.model_domain,
296
+ r.model_version,
297
+ r.model_fullname
298
+ FROM mimi_ws_1.cmspayment.ra_hierarchies r
299
+ INNER JOIN latest_dates l
300
+ ON r.model_domain = l.model_domain
301
+ AND r.model_version = l.model_version
302
+ AND r.model_fullname = l.model_fullname
303
+ AND r.eff_last_date = l.latest_eff_last_date
304
+ ORDER BY r.model_domain, r.model_version, r.model_fullname, r.cc_parent, r.cc_child;
272
305
  ```
273
306
 
274
- `ra_coefficients_2025.csv`
307
+ `ra_coefficients_2026.csv`
275
308
  ```sql
276
- SELECT coefficient, value, model_domain, model_version
277
- FROM ra_coefficients
278
- WHERE eff_last_date > '2025-01-01';
309
+ WITH preferred_records AS (
310
+ SELECT
311
+ model_domain,
312
+ model_version,
313
+ MAX(eff_last_date) as latest_eff_last_date
314
+ FROM mimi_ws_1.cmspayment.ra_coefficients
315
+ GROUP BY model_domain, model_version
316
+ )
317
+ SELECT
318
+ r.coefficient,
319
+ r.value,
320
+ r.model_domain,
321
+ r.model_version
322
+ FROM mimi_ws_1.cmspayment.ra_coefficients r
323
+ INNER JOIN preferred_records p
324
+ ON r.model_domain = p.model_domain
325
+ AND r.model_version = p.model_version
326
+ AND r.eff_last_date = p.latest_eff_last_date
327
+ ORDER BY r.model_domain, r.model_version, r.coefficient;
279
328
  ```
280
329
 
281
- `ra_eligible_cpt_hcpcs_2025.csv`
330
+ `ra_eligible_cpt_hcpcs_2026.csv`
282
331
  ```sql
283
332
  SELECT DISTINCT cpt_hcpcs_code
284
333
  FROM mimi_ws_1.cmspayment.ra_eligible_cpt_hcpcs
285
- WHERE is_included = 'yes' AND YEAR(mimi_src_file_date) = 2024;
334
+ WHERE is_included = 'yes' AND YEAR(mimi_src_file_date) = 2025;
286
335
  ```
287
336
 
288
337
  ## Contributing