All Projects → kylebarron → medicare_utils

kylebarron / medicare_utils

Licence: MIT License
Python package to assist working with Medicare data.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

medicare_utils

Documentation Status

Scripts to assist working with Medicare data.

Features

Provides the class MedicareDF. This class contains some canned scripts to make common tasks easier. It currently contains two functions:

  • get_cohort(), which uses the beneficiary summary file to find a set of medicare beneficiaries according to options given to the function.
  • search_for_codes(), which searches for HCPCS, ICD-9 diagnosis, and/or ICD-9 procedure codes in a given type of file.

Installation

Install the package with:

pip install git+https://github.com/kylebarron/medicare_utils --upgrade

You'll also need to manually install the python-snappy package. This is easiest with:

conda install -c conda-forge python-snappy

Otherwise you need to first install the Snappy C library and then run

pip install python-snappy

Usage

The class is initialized with

import medicare_utils as med
mdf = med.MedicareDF('05', range(2010, 2013))
mdf.get_cohort(gender='female', ages=range(65, 75))
mdf.search_for_codes(2010, 'med', icd9_diag='41071')

It has attributes that refer to different levels of the data, when applicable:

  • mdf.pl: patient-level data. Here the index of the data is bene_id for data post-2005, or ehic for data pre-2005.
  • mdf.cl: claim-level data.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].