Changelog
Source:NEWS.md
peridefs 0.3.2
New features
- Every
get_*_codes()result now has a fifth column,definition, with a text description of each code (NAwhen none is available). Composite results (e.g.get_ascvd_codes()) placeclassafterdefinition. Definitions are looked up at build time and stored in the spec objects, so there are no runtime lookups. Sources: CMS FY2026 files (ICD-10-CM, ICD-10-PCS), CMS v32 files (ICD-9-CM diagnoses and procedures), and the NLM Clinical Tables API (HCPCS Level II). CPT descriptions are paraphrased, not AMA text. -
CodeSpeckeeps an optionaldefinitionsvector parallel tocodes;add_codes()pads it withNAandremove_codes()subsets it. - Direct access to the ASCVD components:
get_chd_v1_codes(),get_stroke_v1_codes(),get_lead_pad_v1_codes(),get_cerebrovasc_disease_v1_codes(), and the matching*_defs()functions. These wrapget_ascvd_codes()/get_ascvd_defs()withcomponentfixed. -
CompositeCodeSpec$new()gainscomponents_by_variable_type, which sets different default components for the condition and outcome definitions.
Behavior changes
-
get_ascvd_codes()andget_ascvd_defs()no longer return every component by default. The condition definition uses CHD + cerebrovascular disease + LEAD/PAD, and the outcome definition uses CHD + stroke + LEAD/PAD. Passcomponentexplicitly to override this. - Obesity (
spec_obesity_v1) now uses a strict BMI >= 30 definition. Excluded ICD-10E66.1,E66.3,R93.9, andZ68.25-Z68.29. Added ICD-9 codes (excluding278.02andV85.21-V85.25). The same code sets apply to both condition and outcome definitions. - CHD: removed
33515(not a valid CPT code) from the HCPCS list; the range is now 33510-33514 and 33516-33519. - Definition-book text now says “outpatient physician” claim/visit instead of “evaluation and management”.
peridefs 0.3.1
Breaking changes
-
Split the unified diabetes spec into separate Type 1 and Type 2 objects (no deprecated aliases kept):
-
spec_diabetes_v1→spec_diabetes_type1_v1,spec_diabetes_type2_v1 -
spec_diabetes→spec_diabetes_type1,spec_diabetes_type2 -
get_diabetes_v1_codes/defs()→get_diabetes_type1/type2_v1_codes/defs() -
get_diabetes_generics/meds_labels()→get_diabetes_type1/type2_generics/meds_labels()
-
spec_glp1_v1condition tags updated from"diabetes"to"diabetes_type2".-
Renamed all condition- and drug-related objects/functions built around hypertension and hyperlipidemia so they use the full condition name everywhere, instead of mixing an abbreviation (
htn) with a drug-mechanism name (lipid_lowering) on one side and full condition names on the other:-
spec_htn_v1->spec_hypertension_v1;get_htn_v1_codes()->get_hypertension_v1_codes();get_htn_v1_defs()->get_hypertension_v1_defs(). TheCodeSpec’s ownconditionidentifier also changed from"htn"to"hypertension". - The five composite
CompositeDrugSpecobjects are now named after the condition they treat rather than the drug mechanism class:spec_antihypertensive->spec_hypertension,spec_antidiabetic->spec_diabetes,spec_antiobesity->spec_obesity,spec_antidepressive->spec_depression,spec_lipid_lowering->spec_hyperlipidemia– along with theirget_*_generics()/get_*_defs()accessor pairs (e.g.get_antihypertensive_generics()->get_hypertension_generics();get_antihypertensive_defs()similarly becameget_hypertension_meds_labels(), see below). Each object’sdrug_classfield (e.g."antihypertensive") is unchanged – it remains a distinct, drug-mechanism-based identifier, separate fromcondition.
-
CompositeDrugSpec$get_defs()was replaced byCompositeDrugSpec$get_meds_labels(), and the five corresponding exported wrapper functions were renamed to match:get_hypertension_defs()->get_hypertension_meds_labels(),get_diabetes_defs()->get_diabetes_meds_labels(),get_obesity_defs()->get_obesity_meds_labels(),get_depression_defs()->get_depression_meds_labels(),get_hyperlipidemia_defs()->get_hyperlipidemia_meds_labels(). These now return a tibble with columnsname(the component key, e.g."acei_v1") andlabel(e.g."ACE Inhibitors") instead of a bare character vector/string, and no longer include version information in the output (already encoded inname). A drug leaf’sdefsfield is typically just an internal sourcing note (e.g."From the Perisphere antihypertensive medication list."), not a clinical definition, and naming the composite accessor after the condition made it too easy to confuse with the condition side’sget_*_v1_defs(), which does return a real diagnostic-algorithm narrative — hence the move away from a_defs()-style name entirely.get_defs()(the general low-level dispatcher) still works on aCompositeDrugSpec, now returning this same tibble.The
classcolumn ofget_*_generics()for the diabetes and hyperlipidemia composites no longer redundantly encodes the condition (e.g."antidiab_biguanide","ll_statin"); it’s now just the unprefixed drug-mechanism class ("biguanide","statin"), matching the convention already used by the hypertension, obesity, and depression composites. The composite’s ownconditioncolumn/field already supplies the condition context, so repeating it inclasswas redundant. This only changes the leafDrugSpec’sdrug_classidentifier (and therefore theclassoutput column) — the underlying R object variable names indata-raw/build_specs.R(e.g.spec_antidiab_biguanide_v1,spec_ll_statin_v1) are unchanged.
ICD code changes
- ICD-9 250.xx codes split by 5th digit (1/3 → Type 1; 0/2 → Type 2). Non-type-specific complication codes (357.2, 362.0x, 366.41) placed in Type 2 per convention.
- ICD-10: E10.xx → Type 1; E11.xx + E08/E09/E13 → Type 2 per convention.
- Ophthalmic codes (E10.3xx, E11.3xx) now dynamically expanded via
children()to capture all FY2020+ laterality-specific retinopathy codes. Fixes a pre-existing omission of E11.37X1/X3/X9, removes 4 non-billable E11 codes, and adds missing neuropathy, angiopathy, and nephropathy subtypes to both specs.
peridefs 0.3.0
Breaking changes
Collapsed the hypertension, coronary heart disease (CHD), depression, and diabetes specs down to a single version each (issue #4). Previously, these specs had multiple versions (e.g.,
spec_htn_v1/spec_htn_v2) that shared identical codes and differed only in the narrativedefstext (e.g., whether a medication criterion was included); the remaining single version of each now carries the most complete (formerly highest-numbered) narrative. As a result, the following exported functions and package data objects have been removed:get_htn_v2_codes(),get_htn_v2_defs(),spec_htn_v2;get_depression_v2_codes(),get_depression_v2_defs(),spec_depression_v2;get_diabetes_v2_codes(),get_diabetes_v2_defs(),get_diabetes_v3_codes(),get_diabetes_v3_defs(),spec_diabetes_v2,spec_diabetes_v3; and thespec_ascvdcomposite no longer has a"chd_v2"component (only"chd_v1", now carrying the merged definition). Useget_htn_v1_codes(),get_depression_v1_codes(), andget_diabetes_v1_codes()(and their_defs()counterparts) going forward — they now return the most current definition.CodeSpec$get_codes()/CompositeCodeSpec$get_codes()output (and thereforeget_ascvd_codes()and similar composite accessors) no longer duplicates the version number inside theclasscolumn.classis now the component’s own unversioned condition identifier (e.g.,"chd"), whileversioncontinues to hold the version tag (e.g.,"v1") separately — previouslyclassheld the full versioned component key (e.g.,"chd_v1"), which duplicated information already present inversion. Any downstream code filtering onclass == "chd_v1"-style values needs to filter onclass == "chd"andversion == "v1"instead.
peridefs 0.2.0
Added
concatenateargument (defaultFALSE) to allget_*_codes()functions. WhenTRUE, all code vectors are collapsed into a single unnamed character vector instead of a named list. Errors informatively if combined withformat = "tibble".get_*_codes(variable_type = "outcome")now falls back to condition codes for specs that have no outcome definition, rather than returning empty code sets.Added depression (history) specs:
spec_depression_v1(diagnosis only) andspec_depression_v2(diagnosis or antidepressive medication), with accessor functionsget_depression_v1_codes(),get_depression_v2_codes(), and corresponding_defs()variants.Exported
spec_antidepressive_v1as a standalone spec with accessor functionsget_antidepressive_v1_generics(),get_antidepressive_v1_codes(), andget_antidepressive_v1_defs().Added
spec_antiobesity, a composite drug spec ([CompositeDrugSpec]) combiningnon_glp1_v1(naltrexone/bupropion, orlistat) andglp1_v1(exenatide, dulaglutide, semaglutide, liraglutide, tirzepatide) components, with accessor functionsget_antiobesity_generics(),get_antiobesity_codes(), andget_antiobesity_defs().Added asthma spec
spec_asthma_v1(ICD-9 493.xx, ICD-10 J45.xx; 20 and 26 codes respectively), with accessor functionsget_asthma_v1_codes()andget_asthma_v1_defs().Added obesity hypoventilation syndrome spec
spec_ohs_v1(ICD-9 278.03, ICD-10 E66.2; also covers Pickwickian syndrome), with accessor functionsget_ohs_v1_codes()andget_ohs_v1_defs().All composite spec getter functions (
get_*_codes(),get_*_generics(),get_*_codes()for drug specs) now accept a vector of component names to retrieve and union multiple components in one call (e.g.,get_ascvd_codes(component = c("chd_v1", "stroke_v1"))). Errors informatively if any component name is invalid.get_*_generics()andget_*_codes()for drug specs now return a named list by default (keyed by component name), consistent with the behaviour ofget_*_codes()for condition specs. Passconcatenate = TRUEto flatten to an unnamed character vector (the previous default behaviour).componentis no longer a visible parameter on getter functions for non-composite specs; it only appears in the signature of getters that actually require it.