Skip to main content

hccpy is a Python implementation of HCC

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hccpy-0.0.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

hccpy-0.0.2-py3-none-any.whl (94.9 kB view details)

Uploaded Python 3

File details

Details for the file hccpy-0.0.2.tar.gz.

File metadata

  • Download URL: hccpy-0.0.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for hccpy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 db5adaa8417195281020a08aca095bdf0f72e9d86f84b52b8dcef72316df7979
MD5 7bdf6b4c0b738f61332fa054c3c5d8c4
BLAKE2b-256 7fb5c4662b4dc9892970a72cdf655b7451bd37e93dab37117c6bd0e66b7f7add

See more details on using hashes here.

File details

Details for the file hccpy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: hccpy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 94.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for hccpy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dc845fafd52c129d7448ae1767ed3108eb47cc7828feacbe08a412c834565f85
MD5 47dd9c0d08470dc8b273f0e9a2a38b7c
BLAKE2b-256 766954556d1f8ab37db66ec3df17155bc1335860873df7c0d28adde5ff1ac6ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page