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.
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/PKG-INFO +71 -22
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/README.md +70 -21
- hccinfhir-0.1.1/hccinfhir/data/ra_coefficients_2026.csv +8414 -0
- hccinfhir-0.1.1/hccinfhir/data/ra_dx_to_cc_2026.csv +58986 -0
- hccinfhir-0.1.1/hccinfhir/data/ra_eligible_cpt_hcpcs_2026.csv +6725 -0
- hccinfhir-0.1.1/hccinfhir/data/ra_hierarchies_2026.csv +713 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/datamodels.py +4 -2
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/hccinfhir.py +4 -4
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_calculate.py +20 -3
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_coefficients.py +3 -1
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_demographics.py +8 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_dx_to_cc.py +1 -1
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_hierarchies.py +26 -22
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/pyproject.toml +1 -1
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/.gitignore +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/LICENSE +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/__init__.py +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/__init__.py +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/hcc_is_chronic.csv +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_coefficients_2025.csv +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_dx_to_cc_2025.csv +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_eligible_cpt_hcpcs_2023.csv +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_eligible_cpt_hcpcs_2024.csv +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_eligible_cpt_hcpcs_2025.csv +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/data/ra_hierarchies_2025.csv +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/extractor.py +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/extractor_837.py +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/extractor_fhir.py +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/filter.py +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/model_interactions.py +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/__init__.py +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_0.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_1.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_10.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_11.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_2.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_3.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_4.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_5.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_6.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_7.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_8.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_837_9.txt +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_eob_1.json +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_eob_2.json +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_eob_200.ndjson +0 -0
- {hccinfhir-0.1.0 → hccinfhir-0.1.1}/hccinfhir/samples/sample_eob_3.json +0 -0
- {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.
|
|
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
|
-
$
|
|
187
|
-
$
|
|
188
|
-
$
|
|
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
|
-
`
|
|
272
|
+
`ra_dx_to_cc_mapping_2026.csv`
|
|
271
273
|
```sql
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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
|
-
`
|
|
295
|
+
`ra_hierarchies_2026.csv`
|
|
278
296
|
```sql
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
`
|
|
321
|
+
`ra_coefficients_2026.csv`
|
|
289
322
|
```sql
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
-
`
|
|
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) =
|
|
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
|
-
$
|
|
173
|
-
$
|
|
174
|
-
$
|
|
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
|
-
`
|
|
258
|
+
`ra_dx_to_cc_mapping_2026.csv`
|
|
257
259
|
```sql
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
`
|
|
281
|
+
`ra_hierarchies_2026.csv`
|
|
264
282
|
```sql
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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
|
-
`
|
|
307
|
+
`ra_coefficients_2026.csv`
|
|
275
308
|
```sql
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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
|
-
`
|
|
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) =
|
|
334
|
+
WHERE is_included = 'yes' AND YEAR(mimi_src_file_date) = 2025;
|
|
286
335
|
```
|
|
287
336
|
|
|
288
337
|
## Contributing
|