Skip to main content

Hierachical Condition Categories Python Package (hccpy)

This module implements the Hierachical Condition Categories that are used for adjusting risks for the Medicare population.

Installing

Installing from the source:

$ git clone git@github.com:yubin-park/hccpy
$ cd hccpy
$ python setup.py develop

Or, simply using pip:

$ pip install hccpy

Code Examples

hccpy is really simple to use. Please see some examples below:

>>> import json
>>> from hccpy.hcc import HCCEngine
>>> he = HCCEngine()
>>> print(he.profile.__doc__)
Returns the HCC risk profile of a given patient information.

        Parameters
        ----------
        dx_lst : list of str
                 A list of ICD10 codes for the measurement year.
        age : int or float
              The age of the patient.
        sex : str 
              The sex of the patient; {"M", "F"}
        elig : str
               The eligibility segment of the patient.
               Allowed values are as follows:
               - "CFA": Community Full Benefit Dual Aged
               - "CFD": Community Full Benefit Dual Disabled
               - "CNA": Community NonDual Aged
               - "CND": Community NonDual Disabled
               - "CPA": Community Partial Benefit Dual Aged
               - "CPD": Community Partial Benefit Dual Disabled
               - "INS": Long Term Institutional
               - "NE": New Enrollee
               - "SNPNE": SNP NE
        orec: str
              Original reason for entitlement code.
              - "0": Old age and survivor's insurance
              - "1": Disability insurance benefits
              - "2": End-stage renal disease 
              - "3": Both DIB and ESRD
        medicaid: bool
                  If the patient is in Medicaid or not.
>>>
>>> rp = he.profile(["E1169", "I5030", "I509", "I211", "I209", "R05"])
>>> print(json.dumps(rp, indent=2))
{
  "risk_score": 1.314,
  "details": {
    "CNA_M70_74": 0.379,
    "CNA_HCC18": 0.318,
    "CNA_HCC85": 0.323,
    "CNA_HCC88": 0.14,
    "CNA_HCC85_gDiabetesMellit": 0.154
  },
  "parameters": {
    "age": 70,
    "sex": "M",
    "elig": "CNA",
    "medicaid": false,
    "disabled": 0,
    "origds": 0
  }
}
>>>
>>> rp = he.profile([], elig="NE", age=65)
>>> print(json.dumps(rp, indent=2))
{
  "risk_score": 0.514,
  "details": {
    "NE_NMCAID_NORIGDIS_NEM65": 0.514
  },
  "parameters": {
    "age": 65,
    "sex": "M",
    "elig": "NE_NMCAID_NORIGDIS_NE",
    "medicaid": false,
    "disabled": 0,
    "origds": 0
  }
}
>>>
>>> rp = he.profile(["E1169", "I5030", "I509", "I209"], elig="INS")
>>> print(json.dumps(rp, indent=2))
{
  "risk_score": 2.6059999999999994,
  "details": {
    "INS_M70_74": 1.323,
    "INS_HCC88": 0.497,
    "INS_HCC85": 0.191,
    "INS_HCC18": 0.441,
    "INS_DIABETES_CHF": 0.154
  },
  "parameters": {
    "age": 70,
    "sex": "M",
    "elig": "INS",
    "medicaid": false,
    "disabled": 0,
    "origds": 0
  }
}

Authors

  • Yubin Park, PhD

References

Metadata

Release files for hccpy 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hccpy 0.0.2
File Size Uploaded
hccpy-0.0.2.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hccpy 0.0.2
File Interpreter ABI Platform
hccpy-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 100.7 kB

Release files / hccpy-0.0.2.tar.gz

Download URL hccpy-0.0.2.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
db5adaa8417195281020a08aca095bdf0f72e9d86f84b52b8dcef72316df7979
BLAKE2b-256 checksum
How to use checksums
7fb5c4662b4dc9892970a72cdf655b7451bd37e93dab37117c6bd0e66b7f7add
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

Release files / hccpy-0.0.2-py3-none-any.whl

Download URL hccpy-0.0.2-py3-none-any.whl
Size 94.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc845fafd52c129d7448ae1767ed3108eb47cc7828feacbe08a412c834565f85
BLAKE2b-256 checksum
How to use checksums
766954556d1f8ab37db66ec3df17155bc1335860873df7c0d28adde5ff1ac6ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

Release history Release notifications | RSS feed

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page