Skip to main content

drgpy is a Python library for assigning a combination of diagnosis and procedure codes to Diagnosis Related Groups (MS-DRG) that is used in Medicare inpatient reimbursement today.

Project description

drgpy

drgpy is a Python library for assigning a combination of diagnosis and procedure codes to Diagnosis Related Groups (MS-DRG) that is used in Medicare inpatient reimbursement today.

Installing

Installing from the source:

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

Or, simply using pip:

$ pip install drgpy

File Structure

  • drgpy/: The package source code is located here.
    • data/: The raw data files downloaded from the CMS website.
    • msdrg.py: The main file for the MS-DRG logic.
    • _mdcsrdr.py: A script that reads/parses mdcs_xx_xx.txt data files.
    • _appndxrdr.py: A script that reads/parses appendix_xx.txt data files.
    • _mdcs0007.py: logics for MDC00 - MDC07
    • _mdcs0811.py: logics for MDC08 - MDC11
    • _mdcs1221.py: logics for MDC12 - MDC21
    • _mdcs2225.py: logics for MDC22 - MDC25
  • tests/: test scripts to check the validity of the outputs.
  • LICENSE.txt: Apache 2.0.
  • README.md: This README file.
  • setup.py: a set-up script.

Code Examples

drgpy is really simple to use. Please see some examples below. NOTE that all functions used below have docstrings. If you want to see the input parameter specifications, please type print(<instance>.<function>.__doc__).

>>> from drgpy.msdrg import DRGEngine
>>> de = DRGEngine()
>>> print(de.get_drg.__doc__)

        Return the corresponding DRG code for the diagnoses and procedures

        Parameters
        ----------
        dx_lst : list
                A list of ICD-10 diagnosis codes
        pr_lst : list
                A list of ICD-10 procedure codes
>>>
>>> de.get_drg(["B20"],[])
'977'
>>> de.get_drg([], ["02HA0RS"])
'983'
>>> de.get_drg([], ["02HA0RS", "02PA0RZ"])
'002'
>>>

Please refer to the test scripts under the tests/ folder if you want to see other example use cases.

License

Apache 2.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

drgpy-0.0.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drgpy-0.0.1-py3-none-any.whl (4.3 MB view details)

Uploaded Python 3

File details

Details for the file drgpy-0.0.1.tar.gz.

File metadata

  • Download URL: drgpy-0.0.1.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for drgpy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 02c52720c7f2100932f05413e8caf45adc155c29fc45171bcf80838d7ccc6118
MD5 89c8f48b57640c8d89b9bbd6b6aea43a
BLAKE2b-256 a69c027034bc04d4abea536b59e6b194f6f21711461f378e3c8554bb9a7ea8fc

See more details on using hashes here.

File details

Details for the file drgpy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: drgpy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for drgpy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c4949b22ae064ea36a5b19380b1f53f7f64d653f09b0e69bc10e33734f5f724
MD5 c8a80cecc3a3f9f24b8c34046e261404
BLAKE2b-256 a9e9700bad75a86a8c71a1f06ce243680069577686eeb2236d00551c5a8c1623

See more details on using hashes here.

Supported by

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