{ "info": { "author": "Yubin Park", "author_email": "yubin.park@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# hccpy \n\nHierachical Condition Categories Python Package.\n\nThis module implements the [Hierachical Condition Categories](https://www.cms.gov/cciio/resources/forms-reports-and-other-resources/downloads/ra-march-31-white-paper-032416.pdf) that are used for adjusting risks for the Medicare population.\nThe original SAS implementation can be found [here](https://www.nber.org/data/cms-risk-adjustment.html).\nCurrently, hccpy supports CMS-HCC V22, V23, and V24 (beta) and HHS-HCC Year 2019.\n\nNOTE: This package does not support for ICD-9.\n\n## Installing\n\nInstalling from the source:\n\n```\n$ git clone git@github.com:yubin-park/hccpy.git\n$ cd hccpy\n$ python setup.py develop\n```\nOr, simply using `pip`:\n\n```\n$ pip install hccpy\n```\n\n## File Structure\n\n- `hccpy/ `: The package source code is located here.\n - `data/`: The raw data files directly downloaded from [the National Burequ of Economics Research](https://www.nber.org/data/cms-risk-adjustment.html)\n - Here, you see the original SAS scripts and data files for the CMS HCC models.\n - `_AGESEXV2.py`: a Python re-write of the `AGESEXV2.TXT` SAS script.\n - `_V2218O1M.py`: a Python re-write of the `V2218O1M.TXT` SAS script.\n - `_V2218O1P.py`: a Python re-write of the `V2219O1P.TXT` SAS script.\n - `_V22I0ED2.py`: a Python re-write of the `V22I0ED2.TXT` SAS script.\n - `_V2318P1M.py`: a Python re-write of the `V2318P1M.TXT` SAS script.\n - `_V2419P1M.py`: a Python re-write of the `V2419P1M.TXT` SAS script.\n - `hcc.py`: the **main** module that combines the various logical components for CMS-HCC\n - `hhshcc.py`: the **main** module for HHS-HCC\n - `utils.py`: utility functions for reading data files\n- `tests/`: test scripts to check the validity of the outputs.\n- `LICENSE.txt`: Apache 2.0.\n- `README.md`: This README file.\n- `setup.py`: a set-up script.\n\n## Code Examples\n\n`hccpy` is really simple to use.\nPlease see some examples below:\n\n### Importing \n\nTo import the `HCCEngine` class from `hccpy`: \n\n```python\n>>> import json\n>>> from hccpy.hcc import HCCEngine\n>>> he = HCCEngine()\n>>> print(he.profile.__doc__)\nReturns the HCC risk profile of a given patient information.\n\n Parameters\n ----------\n dx_lst : list of str\n A list of ICD10 codes for the measurement year.\n age : int or float\n The age of the patient.\n sex : str \n The sex of the patient; {\"M\", \"F\"}\n elig : str\n The eligibility segment of the patient.\n Allowed values are as follows:\n - \"CFA\": Community Full Benefit Dual Aged\n - \"CFD\": Community Full Benefit Dual Disabled\n - \"CNA\": Community NonDual Aged\n - \"CND\": Community NonDual Disabled\n - \"CPA\": Community Partial Benefit Dual Aged\n - \"CPD\": Community Partial Benefit Dual Disabled\n - \"INS\": Long Term Institutional\n - \"NE\": New Enrollee\n - \"SNPNE\": SNP NE\n orec: str\n Original reason for entitlement code.\n - \"0\": Old age and survivor's insurance\n - \"1\": Disability insurance benefits\n - \"2\": End-stage renal disease \n - \"3\": Both DIB and ESRD\n medicaid: bool\n If the patient is in Medicaid or not.\n>>>\n```\n\n### HCC-Profiling a Member with Diagnosis Codes\n\nTo get a HCC profile from a list of diagnosis codes (in ICD-10):\n\n```python\n>>> rp = he.profile([\"E1169\", \"I5030\", \"I509\", \"I211\", \"I209\", \"R05\"])\n>>> print(json.dumps(rp, indent=2))\n{\n \"risk_score\": 1.3139999999999998,\n \"details\": {\n \"CNA_M70_74\": 0.379,\n \"CNA_HCC85\": 0.323,\n \"CNA_HCC88\": 0.14,\n \"CNA_HCC18\": 0.318,\n \"CNA_HCC85_gDiabetesMellit\": 0.154,\n \"CNA_DIABETES_CHF\": 0.0\n },\n \"hcc_lst\": [\n \"HCC85\",\n \"HCC88\",\n \"HCC18\"\n ],\n \"hcc_map\": {\n \"I5030\": \"HCC85\",\n \"I209\": \"HCC88\",\n \"E1169\": \"HCC18\",\n \"I509\": \"HCC85\"\n },\n \"parameters\": {\n \"age\": 70,\n \"sex\": \"M\",\n \"elig\": \"CNA\",\n \"medicaid\": false,\n \"disabled\": 0,\n \"origds\": 0\n }\n}\n>>>\n```\n\n### HCC-Profiling a New Member\n\nIf a member is new, then provide the `elig=\"NE\"` in the input:\n\n```python\n>>> rp = he.profile([], elig=\"NE\", age=65)\n>>> print(json.dumps(rp, indent=2))\n{\n \"risk_score\": 0.514,\n \"details\": {\n \"NE_NMCAID_NORIGDIS_NEM65\": 0.514\n },\n \"hcc_lst\": [],\n \"hcc_map\": {},\n \"parameters\": {\n \"age\": 65,\n \"sex\": \"M\",\n \"elig\": \"NE_NMCAID_NORIGDIS_NE\",\n \"medicaid\": false,\n \"disabled\": 0,\n \"origds\": 0\n }\n}\n>>>\n```\n\n### HCC-Profiling a Intitutionalized Member\n\nIf a member has a different eligibility status, change the eligibility as follows (e.g. institutionalized member):\n\n```python\n>>> rp = he.profile([\"E1169\", \"I5030\", \"I509\", \"I209\"], elig=\"INS\")\n>>> print(json.dumps(rp, indent=2))\n{\n \"risk_score\": 2.6059999999999994,\n \"details\": {\n \"INS_M70_74\": 1.323,\n \"INS_HCC88\": 0.497,\n \"INS_HCC18\": 0.441,\n \"INS_HCC85\": 0.191,\n \"INS_HCC85_gDiabetesMellit\": 0.0,\n \"INS_DIABETES_CHF\": 0.154\n },\n \"hcc_lst\": [\n \"HCC88\",\n \"HCC18\",\n \"HCC85\"\n ],\n \"hcc_map\": {\n \"I209\": \"HCC88\",\n \"E1169\": \"HCC18\",\n \"I509\": \"HCC85\",\n \"I5030\": \"HCC85\"\n },\n \"parameters\": {\n \"age\": 70,\n \"sex\": \"M\",\n \"elig\": \"INS\",\n \"medicaid\": false,\n \"disabled\": 0,\n \"origds\": 0\n }\n}\n```\n\n### HCC-Describing a Hierachical Condition Category\n\nTo get the description, hierarchy parents and children of a HCC:\n\n```python\n>>> hcc_doc = he.describe_hcc(\"HCC19\") # either \"HCC19\", \"hcc19\" or \"19\"\n>>> print(json.dumps(hcc_doc, indent=2))\n{\n \"description\": \"Diabetes without Complication\",\n \"children\": [],\n \"parents\": [\n \"HCC17\",\n \"HCC18\"\n ]\n}\n```\n\n### Eligible Risk Adjustment Codes\n\nNot all claims are eligible for risk adjustment.\nFor professional claims, a certain set of CPT codes is required to be eligible, while for institutional claims, a certain set of bill types is needed.\nThis module provides an easy interface for determining if a certain claim is eligible for risk adjustment or not.\n\nNOTE: This function uses CPT codes, and this requires [AMA CPT license](https://www.ama-assn.org/practice-management/cpt/ama-cpt-licensing-overview).\nOnce you carefully review the license, you need to download [a data file](https://www.cms.gov/Medicare/Health-Plans/MedicareAdvtgSpecRateStats/Downloads/2019-Medicare-CPT-HCPC-List.zip).\n\n```python\n>>> from hccpy.raeligible import RAEligible\n>>> rae = RAEligible()\n>>> rae.load(fn=\"CY2019Q2_CPTHCPCS_CMS_20190425.csv\")\n>>> rae.is_eligible(pr_lst=[\"C5271\"])\nTrue\n>>> rae.is_eligible(pr_lst=[\"C5270\"])\nFalse\n>>>\n```\nNOTE: The data file (`CY2019Q2_CPTHCPCS_CMS_20190425.csv`) should be located in the same folder.\n\n## License\nApache 2.0\n\n## Authors\n- Yubin Park, PhD\n- Thomas Chen\n\n## References\n- https://www.nber.org/data/cms-risk-adjustment.html\n- https://www.cms.gov/medicare/health-plans/medicareadvtgspecratestats/risk-adjustors.html\n- https://github.com/calyxhealth/pyriskadjust\n- https://github.com/AlgorexHealth/hcc-python\n- https://github.com/galtay/hcc_risk_models\n- https://www.cms.gov/cciio/resources/forms-reports-and-other-resources/downloads/ra-march-31-white-paper-032416.pdf\n- https://www.cms.gov/cciio/resources/regulations-and-guidance/index.html\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yubin-park/hccpy", "keywords": "", "license": "Apaceh 2.0", "maintainer": "", "maintainer_email": "", "name": "hccpy", "package_url": "https://pypi.org/project/hccpy/", "platform": "", "project_url": "https://pypi.org/project/hccpy/", "project_urls": { "Homepage": "https://github.com/yubin-park/hccpy" }, "release_url": "https://pypi.org/project/hccpy/0.0.9/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "hccpy is a Python implementation of HCC", "version": "0.0.9" }, "last_serial": 5980914, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "47dd9c0d08470dc8b273f0e9a2a38b7c", "sha256": "dc845fafd52c129d7448ae1767ed3108eb47cc7828feacbe08a412c834565f85" }, "downloads": -1, "filename": "hccpy-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "47dd9c0d08470dc8b273f0e9a2a38b7c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 94946, "upload_time": "2019-04-08T01:08:58", "url": "https://files.pythonhosted.org/packages/76/69/54556d1f8ab37db66ec3df17155bc1335860873df7c0d28adde5ff1ac6ed/hccpy-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7bdf6b4c0b738f61332fa054c3c5d8c4", "sha256": "db5adaa8417195281020a08aca095bdf0f72e9d86f84b52b8dcef72316df7979" }, "downloads": -1, "filename": "hccpy-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7bdf6b4c0b738f61332fa054c3c5d8c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5753, "upload_time": "2019-04-08T01:08:59", "url": "https://files.pythonhosted.org/packages/7f/b5/c4662b4dc9892970a72cdf655b7451bd37e93dab37117c6bd0e66b7f7add/hccpy-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "9b8003afcebfc216c1118b74e9accebe", "sha256": "32b57bd344735887fbabac7602698b42fe3fb42a2b09ea18d40c6aeeb9199f1b" }, "downloads": -1, "filename": "hccpy-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "9b8003afcebfc216c1118b74e9accebe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 151806, "upload_time": "2019-06-25T14:20:56", "url": "https://files.pythonhosted.org/packages/41/a3/ac83c962155535b6ae844475499827c488f515468d7c8989d792b9e5a2a4/hccpy-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2ca22bb99c86bb3ee308a06ffcf99210", "sha256": "336edd0cfc860781a91787e2ec9cf0136277a5c52691637b83b1e4b8287223a0" }, "downloads": -1, "filename": "hccpy-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2ca22bb99c86bb3ee308a06ffcf99210", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10289, "upload_time": "2019-06-25T14:20:58", "url": "https://files.pythonhosted.org/packages/26/f8/c52531c8d382a10c91360698ebbaeee498b9b45060d69eecb834830f8756/hccpy-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "5cec7fab86ddb3819cf0eedb88644b43", "sha256": "cc89433299bef5aefe98179418d7d4b12248f5d8b558bfef5eba6e0f682ae5dc" }, "downloads": -1, "filename": "hccpy-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "5cec7fab86ddb3819cf0eedb88644b43", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 189905, "upload_time": "2019-07-09T15:06:27", "url": "https://files.pythonhosted.org/packages/4f/55/0c74ebac1652ba9dca511aa33724ca01774240c6acdce5d4d3d37b2f8564/hccpy-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ca2c96de4de89e304afec3216a3e8fdb", "sha256": "8736d5a48c74157769405eb0f99f14d8f94f9f2dad9a634c7c5dfce88802953c" }, "downloads": -1, "filename": "hccpy-0.0.4.tar.gz", "has_sig": false, "md5_digest": "ca2c96de4de89e304afec3216a3e8fdb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10797, "upload_time": "2019-07-09T15:06:30", "url": "https://files.pythonhosted.org/packages/f5/92/28d2cc9fb6110bbd30ed9d07b7612f569426714f179b0dcfd32ae0de9f4e/hccpy-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "fbcad6406f3aa959771abd2ea0bd8a24", "sha256": "a687289fb609e41e44858434c85ee5bc9b5fadc9fb1d81cafbada05d6bf26fb4" }, "downloads": -1, "filename": "hccpy-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "fbcad6406f3aa959771abd2ea0bd8a24", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 189949, "upload_time": "2019-07-10T14:23:31", "url": "https://files.pythonhosted.org/packages/61/f4/a78a0901213537201881612815034c752dbab3002ba3387d999573c0dc8b/hccpy-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b3ec9710e489f06af0678bf653bcf99", "sha256": "c51ef7b2554575e1505a2e8faa93090879e4b90161c41fcb7877d340357236a4" }, "downloads": -1, "filename": "hccpy-0.0.5.tar.gz", "has_sig": false, "md5_digest": "7b3ec9710e489f06af0678bf653bcf99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10875, "upload_time": "2019-07-10T14:23:36", "url": "https://files.pythonhosted.org/packages/83/72/085aabeb30ef85bd08938cb477fb05142a241c649edef69e5603b9940b42/hccpy-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "d3402be20f0f25fd212fbddd083bcf00", "sha256": "30e7fa7463dbe48b97eda750730e6200a745ade58c0a60ce865b7db5be5a22f5" }, "downloads": -1, "filename": "hccpy-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "d3402be20f0f25fd212fbddd083bcf00", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 189954, "upload_time": "2019-07-10T14:29:32", "url": "https://files.pythonhosted.org/packages/1a/cc/1c0cd07439946063cac88f0c8c1687f86768c3316824e8810b41457050cc/hccpy-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3b8fadd51b1e4c77c844a372f3167c3d", "sha256": "b743294faa7df35cbe3c7160a6af83179d33ea2733ab5c4ddbe99f546e266898" }, "downloads": -1, "filename": "hccpy-0.0.6.tar.gz", "has_sig": false, "md5_digest": "3b8fadd51b1e4c77c844a372f3167c3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10880, "upload_time": "2019-07-10T14:29:37", "url": "https://files.pythonhosted.org/packages/b5/8e/5a7b691cb4223a8cfd3ac6542bd6bd8507ce2c83e08717a38a18b9cfeda1/hccpy-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "0e9844b6edc32bcc0015979f969110ab", "sha256": "5d095e1ea26ea6fd5cf33990838459fe5ec9b0b524940bd349788c0090741254" }, "downloads": -1, "filename": "hccpy-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "0e9844b6edc32bcc0015979f969110ab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 338993, "upload_time": "2019-07-15T14:13:27", "url": "https://files.pythonhosted.org/packages/08/68/4fe765594a332e7d600c9a30d652b29037ac3598232400f7af2550fdf1df/hccpy-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1f34e128afa77d92c517fc40f6a81087", "sha256": "efaf397f14e03a61289476ec1e544d5fb67d13c351374fd36021857f82817687" }, "downloads": -1, "filename": "hccpy-0.0.7.tar.gz", "has_sig": false, "md5_digest": "1f34e128afa77d92c517fc40f6a81087", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11040, "upload_time": "2019-07-15T14:13:32", "url": "https://files.pythonhosted.org/packages/c5/57/f32ca248f8896b73ab7f104d3ee3dd539cae897eb40e9aac9ff618159fd4/hccpy-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "ff2908e3541660bfef416154af4252f8", "sha256": "c9224b6f702d11aa0ea921e54254cd9678af49f5be6f8faa5114baf59beb3ffa" }, "downloads": -1, "filename": "hccpy-0.0.8-py3-none-any.whl", "has_sig": false, "md5_digest": "ff2908e3541660bfef416154af4252f8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 375332, "upload_time": "2019-10-09T14:22:05", "url": "https://files.pythonhosted.org/packages/af/ca/17504cc7832da30708e2ec0fd1b8ce30d603ac933fbd5b62e61a137fb01f/hccpy-0.0.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a4f04128f3af08a32a904be996a130a1", "sha256": "8afab6fce8f8333d3c9bf08c6b2c62745aef239afa16cdbb2ec1a42a9e5b6497" }, "downloads": -1, "filename": "hccpy-0.0.8.tar.gz", "has_sig": false, "md5_digest": "a4f04128f3af08a32a904be996a130a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15865, "upload_time": "2019-10-09T14:22:13", "url": "https://files.pythonhosted.org/packages/77/4d/c662755edeb9cb3bfef6e3333d0bf4045c34f34e0d90126ac8aac582c9f4/hccpy-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "8a8208a87c68900a14b2a26f103a1fe2", "sha256": "90aba73774647e1db39e8fafbea00b3c5271dab898c4dc09ab040d4bd62ffac6" }, "downloads": -1, "filename": "hccpy-0.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "8a8208a87c68900a14b2a26f103a1fe2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 375339, "upload_time": "2019-10-16T02:54:27", "url": "https://files.pythonhosted.org/packages/64/9e/a44a648387ce828f45c6dd3f3f0fd923072ce65a9dedd22c9bb6d09b093f/hccpy-0.0.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "664fbe9bc35e5e1164d32251d0dc3b93", "sha256": "33b9a65184f993cb5b4fdb86dc91d153e36136138e31e0360bb0ef8169d5d9c6" }, "downloads": -1, "filename": "hccpy-0.0.9.tar.gz", "has_sig": false, "md5_digest": "664fbe9bc35e5e1164d32251d0dc3b93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15889, "upload_time": "2019-10-16T02:54:36", "url": "https://files.pythonhosted.org/packages/b1/3b/04115515ee7ed686fca6cf343d79bd623f78cf9cf0541d0f9b5d56afacfc/hccpy-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8a8208a87c68900a14b2a26f103a1fe2", "sha256": "90aba73774647e1db39e8fafbea00b3c5271dab898c4dc09ab040d4bd62ffac6" }, "downloads": -1, "filename": "hccpy-0.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "8a8208a87c68900a14b2a26f103a1fe2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 375339, "upload_time": "2019-10-16T02:54:27", "url": "https://files.pythonhosted.org/packages/64/9e/a44a648387ce828f45c6dd3f3f0fd923072ce65a9dedd22c9bb6d09b093f/hccpy-0.0.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "664fbe9bc35e5e1164d32251d0dc3b93", "sha256": "33b9a65184f993cb5b4fdb86dc91d153e36136138e31e0360bb0ef8169d5d9c6" }, "downloads": -1, "filename": "hccpy-0.0.9.tar.gz", "has_sig": false, "md5_digest": "664fbe9bc35e5e1164d32251d0dc3b93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15889, "upload_time": "2019-10-16T02:54:36", "url": "https://files.pythonhosted.org/packages/b1/3b/04115515ee7ed686fca6cf343d79bd623f78cf9cf0541d0f9b5d56afacfc/hccpy-0.0.9.tar.gz" } ] }