medicaid_utils.adapted_algorithms.py_betos package¶
Submodules¶
medicaid_utils.adapted_algorithms.py_betos.betos_proc_codes module¶
Python module to apply Berenson-Eggers Type of Service (BETOS) categorization for claims
- class medicaid_utils.adapted_algorithms.py_betos.betos_proc_codes.BetosProcCodes[source]¶
Bases:
object- data_folder = '/home/runner/work/medicaid-utils/medicaid-utils/medicaid_utils/adapted_algorithms/py_betos/data'¶
- filename = 'betos_proc_codes.py'¶
- classmethod get_betos_cat(df: DataFrame, pdf_crosswalk: DataFrame, claim_type: str = 'medicaid', proc_code_prefix: str = 'PRCDR_CD') DataFrame[source]¶
Get claimwise Betos codes & categories related to CPT procedure codes in claim
- Parameters:
df (dask.DataFrame) – Claim dask dataframe
pdf_crosswalk (pandas.DataFrame) – CPT x Betos code crosswalk, with betos code and betos category information
claim_type ({'medicaid', 'medicare'}) – Medicaid or Medicare claim type
proc_code_prefix (str, default='PRCDR_CD') – Column name prefix for procedure code columns
- Return type:
dask.DataFrame
Examples
>>> # Requires BETOS crosswalk data and claim data >>> BetosProcCodes.get_betos_cat(df, pdf_crosswalk)
- classmethod get_betos_cpt_crosswalk(year: int) DataFrame[source]¶
Get CPT x Betos code crosswalk, with betos code and betos category information. The returned CPT x Betos code crosswalk dataframe has the below columns:
cpt_code - HCPCS codes A0010-V9999 AMA/CPT-4 codes 00100-99999
betos_code - BETOS codes D1A-Z2
betos_code_name - BETOS code description
- betos_cat - BETOS category abbrevation, with the below 7 values:
EVALUATION AND MANAGEMENT - betos_eval
PROCEDURES - betos_proc
IMAGING - betos_img
TESTS - betos_test
DURABLE MEDICAL EQUIPMENT - betos_dme
OTHER - betos_oth
EXCEPTIONS/UNCLASSIFIED - betos_uncla
- Parameters:
year (type) – Public use file year
- Return type:
pandas.DataFrame
Examples
>>> # Requires BETOS public use crosswalk files on disk >>> pdf = BetosProcCodes.get_betos_cpt_crosswalk(2018) >>> 'cpt_code' in pdf.columns True
- package_folder = '/home/runner/work/medicaid-utils/medicaid-utils/medicaid_utils/adapted_algorithms/py_betos'¶
- medicaid_utils.adapted_algorithms.py_betos.betos_proc_codes.assign_betos_cat(df: DataFrame, year: int, claim_type: str = 'medicaid', proc_code_prefix: str = 'PRCDR_CD') DataFrame[source]¶
Get claimwise BETOS codes & categories related to CPT procedure codes in claim. Columns in output dataframe:
- If concat_codes_to_list=True,
lst_betos_code - Comma separated BETOS codes
lst_betos_cat - Comma separated BETOS cat
- Else,
One boolean column each for all BETOS codes & BETOS categories
- Parameters:
- Return type:
dask.DataFrame
Examples
>>> # Requires BETOS public use files and claim data >>> assign_betos_cat(df, 2018)