Package index
Spec Data Objects
All exported spec_* data objects. Each version of a condition or drug class is a distinct _vX-named object. Composite specs contain named versioned components accessible via component= (or component = "all" to union everything). Print any spec to see its definitions and component names.
-
spec_objectsspec_depressionspec_hyperlipidemiaspec_diabetes_type1spec_diabetes_type2spec_asthma_v1spec_hypertensionspec_obesityspec_ascvdspec_ckd_v1spec_copd_v1spec_depression_v1spec_diabetes_type1_v1spec_diabetes_type2_v1spec_hf_v1spec_hypertension_v1spec_hyperlipidemia_v1spec_isch_stroke_v1spec_obesity_v1spec_ohs_v1spec_osa_v1 - Condition and Drug Code Specification Objects
Conditions: Cardiovascular
Hypertension, heart failure, and the ASCVD composite. ASCVD’s components (chd_v1, stroke_v1, lead_pad_v1, cerebrovasc_disease_v1) are also directly exported below, as thin wrappers around get_ascvd_codes(component = ...)/get_ascvd_defs(component = ...).
-
get_hypertension_v1_codes() - Retrieve ICD codes for hypertension
-
get_hypertension_v1_defs() - Retrieve the narrative algorithm description for hypertension (v1)
-
get_hf_v1_codes() - Retrieve ICD codes for heart failure
-
get_hf_v1_defs() - Retrieve the narrative algorithm description for heart failure (v1)
-
get_ascvd_codes() - Retrieve codes for a named ASCVD component
-
get_ascvd_defs() - Retrieve the narrative algorithm description for an ASCVD component
-
get_chd_v1_codes() - Retrieve ICD codes for coronary heart disease (CHD)
-
get_chd_v1_defs() - Retrieve the narrative algorithm description for coronary heart disease (CHD)
-
get_stroke_v1_codes() - Retrieve ICD codes for stroke (any)
-
get_stroke_v1_defs() - Retrieve the narrative algorithm description for stroke (any)
-
get_lead_pad_v1_codes() - Retrieve ICD codes for lower extremity artery disease (LEAD) / peripheral artery disease (PAD)
-
get_lead_pad_v1_defs() - Retrieve the narrative algorithm description for LEAD/PAD
-
get_cerebrovasc_disease_v1_codes() - Retrieve ICD codes for cerebrovascular disease
-
get_cerebrovasc_disease_v1_defs() - Retrieve the narrative algorithm description for cerebrovascular disease
-
get_obesity_v1_codes()get_obesity_v1_defs() - Retrieve ICD codes for obesity
-
get_diabetes_type1_v1_codes()get_diabetes_type1_v1_defs() - Retrieve ICD codes for Type 1 diabetes mellitus
-
get_diabetes_type2_v1_codes()get_diabetes_type2_v1_defs() - Retrieve ICD codes for Type 2 diabetes mellitus
-
get_hyperlipidemia_v1_codes()get_hyperlipidemia_v1_defs() - Retrieve ICD codes for hyperlipidemia
-
get_ckd_v1_codes()get_ckd_v1_defs() - Retrieve ICD codes for chronic kidney disease
-
get_copd_v1_codes()get_copd_v1_defs() - Retrieve ICD codes for COPD
-
get_osa_v1_codes()get_osa_v1_defs() - Retrieve ICD codes for sleep apnea
-
get_ohs_v1_codes()get_ohs_v1_defs() - Retrieve ICD codes for obesity hypoventilation syndrome
-
get_asthma_v1_codes()get_asthma_v1_defs() - Retrieve ICD codes for asthma
-
get_depression_v1_codes()get_depression_v1_defs() - Retrieve ICD codes for depression
-
get_osteoarthritis_v1_codes()get_osteoarthritis_v1_defs() - Retrieve ICD codes for osteoarthritis
-
get_hypertension_generics()get_hypertension_meds_labels() - Retrieve generic drug names for hypertension medications
-
get_diabetes_type1_generics()get_diabetes_type1_meds_labels() - Retrieve generic drug names for Type 1 diabetes medications
Drugs: Diabetes (Type 2)
Biguanides, sulfonylureas, meglitinides, TZDs, alpha-glucosidase inhibitors, DPP-4, SGLT-2, GLP-1, insulin, amylin, etc.
-
get_diabetes_type2_generics()get_diabetes_type2_meds_labels() - Retrieve generic drug names for Type 2 diabetes medications
Drugs: Obesity
Non-GLP-1 agents (non_glp1_v1: naltrexone/bupropion, orlistat) and GLP-1 receptor agonists (glp1_v1: exenatide, dulaglutide, semaglutide, liraglutide, tirzepatide).
-
get_obesity_generics()get_obesity_meds_labels() - Retrieve generic drug names for obesity medications
Drugs: Depression
SSRIs (ssri_v1), SNRIs (snri_v1), tricyclics (tca_v1), MAOIs (maoi_v1), and other/atypical agents (other_v1).
-
get_depression_generics()get_depression_meds_labels() - Retrieve generic drug names for depression medications
Drugs: Hyperlipidemia
Statins (statin_v1), ezetimibe (ezetimibe_v1), PCSK9 inhibitors (pcsk9_v1), fibrates (fibrate_v1), bile acid sequestrants (bile_acid_seq_v1), and niacin (niacin_v1).
-
get_hyperlipidemia_generics()get_hyperlipidemia_meds_labels() - Retrieve generic drug names for hyperlipidemia medications
-
get_defs() - Retrieve and display the narrative algorithm description
Custom Spec API
Build your own code or drug specifications from scratch, or non-destructively modify any bundled spec.
-
code_spec() - Create a user-defined condition code specification
-
drug_spec() - Create a user-defined drug class specification
-
add_codes() - Add codes to a condition code specification
-
remove_codes() - Remove codes from a condition code specification
-
modify_code_spec() - Modify a condition code specification
-
modify_drug_spec() - Modify a drug class specification
ICD-10-PCS Utilities
Expand ICD-10-PCS prefix patterns (e.g., "0210xxx") to all matching valid 7-character codes using the FY2026 CMS reference table.
-
expand_pcs() - Expand ICD-10-PCS prefix patterns to all matching valid codes
R6 Spec Classes
Underlying R6 classes used by all spec objects. Useful when building custom specs programmatically.
-
CodeSpec - R6 class for medical condition code specifications
-
DrugSpec - R6 class for drug class specifications
-
CompositeCodeSpec - R6 class for composite condition code specifications
-
CompositeDrugSpec - R6 class for composite drug class specifications