medicaid_utils.adapted_algorithms.py_pmca package¶
Submodules¶
medicaid_utils.adapted_algorithms.py_pmca.pmca module¶
This program implements the Pediatric Medical Complexity Algorithm (Tamara D. Simon, Dorothy Lyons, Peter Woodcox et al 2014) to identify children with complex and non-complex chronic conditions using Medicaid claims data and to distinguish them from children with neither chronic nor chronic complex conditions (healthy children). ‘Complex’ and ‘Non-Complex’ designations are assigned based on whether a child’s condition(s) identified by ICD-9 code(s) can be considered chronic, malignant, or progressive, and whether multiple body systems are involved.
- class medicaid_utils.adapted_algorithms.py_pmca.pmca.PediatricMedicalComplexity[source]¶
Bases:
objectThis class packages functions to create indicator variables for conditions of interest based on their chronic nature identified by Seattle Children’s Research Institute subset from conditions defined by diagnostic codes outlined in the Chronic Illness and Disability Payment System (CDPS) version 5.3
- classmethod create_pmca_condition_counts(df: DataFrame, diag_cd_lst_col: str) DataFrame[source]¶
Create PMCA condition counts from diagnosis codes.
For each PMCA body system condition and progressive conditions, counts how many diagnosis codes in the list match, and creates binary indicator columns (any_{condition}, {condition}_2h).
- Parameters:
df (dask.DataFrame) – Patient-level DataFrame with a diagnosis code list column.
diag_cd_lst_col (str) – Name of the column containing comma-separated diagnosis codes.
- Returns:
DataFrame with condition count and indicator columns appended.
- Return type:
dask.DataFrame
Examples
>>> # Requires a dask DataFrame with diagnosis code list column >>> df = PediatricMedicalComplexity.create_pmca_condition_counts( ... df, 'LST_DIAG_CD_RAW')
- data_folder = '/home/runner/work/medicaid-utils/medicaid-utils/medicaid_utils/adapted_algorithms/py_pmca/data'¶
- filename = 'pmca.py'¶
- classmethod get_pmca_chronic_condition_categories(df: DataFrame) DataFrame[source]¶
Assign PMCA chronic condition categories.
Creates cond_less (less conservative) and cond_more (more conservative) category columns with values 1 (non-chronic), 2 (non-complex chronic), or 3 (complex chronic).
- Parameters:
df (dask.DataFrame) – DataFrame with PMCA condition indicator columns from
create_pmca_condition_counts.- Returns:
DataFrame with cond_less and cond_more columns appended.
- Return type:
dask.DataFrame
Examples
>>> # Requires a dask DataFrame with PMCA condition indicator columns >>> df = PediatricMedicalComplexity.get_pmca_chronic_condition_categories( ... df)
- package_folder = '/home/runner/work/medicaid-utils/medicaid-utils/medicaid_utils/adapted_algorithms/py_pmca'¶
- medicaid_utils.adapted_algorithms.py_pmca.pmca.pmca_chronic_conditions(df: DataFrame, diag_cd_lst_col: str = 'LST_DIAG_CD_RAW') DataFrame[source]¶
This function implements the Pediatric Medical Complexity Algorithm to identify children with complex and non-complex chronic conditions using Medicaid claims data and to distinguish them from children with neither chronic nor chronic complex conditions (healthy children).
‘Complex’ and ‘Non-Complex’ designations are assigned based on whether a child’s condition(s) identified by ICD-9 code(s) can be considered chronic, malignant, or progressive, and whether multiple body systems are involved.
Definitions of the categories assigned by the Algorithm:
- The less conservative version (cond_less) calculates values as
- ‘Complex Chronic’:
more than one body system is involved, or
one or more conditions are progressive, or
one or more conditions are malignant
- ‘Non-complex Chronic’:
only one body system is involved, and
the condition is not progressive or malignant
- ‘Non-Chronic’:
no body system indicators are present, and
the condition is not progressive or malignant
- The more conservative version (cond_more) calculates values as
- ‘Complex Chronic’:
more than one body system is involved, and each must be indicated in more than one claim, or
one or more conditions are progressive, or
one or more conditions are malignant
- ‘Non-complex Chronic’:
only one body system is indicated in more than one claim, and
the condition is not progressive or malignant
- ‘Non-Chronic’:
no body system indicators are present in more than one claim, and
the condition is not progressive or malignant
Body Systems of interest and the variables used to indicate them:
Body system
variable
cardiac
cardiac
craniofacial
cranio
dermatological
derm
endocrinological
endo
gastrointestinal
gastro
genetic
genetic
genitourinary
genito
hematological
hemato
immunological
immuno
malignancy
malign
mental health
mh
metabolic
metab
musculoskeletal
musculo
neurological
neuro
pulmonary-respiratory
pulresp
renal
renal
ophthalmological
opthal
otologic
otol
otolaryngological
otolar
- Parameters:
df (dask.DataFrame) – Patient level dask dataframe
diag_cd_lst_col (str, default=LST_DIAG_CD_RAW) – Column name that has comma separated list of diagnosis codes in the observation period
- Return type:
dask.DataFrame
Examples
>>> # Requires a patient-level dask DataFrame with diagnosis code list >>> df = pmca_chronic_conditions(df, 'LST_DIAG_CD_RAW')