chmsflow 0.1.0
Basic features
- Added variables.csv that contains list of CHMS variables in chmsflow.
- Added variable-details.csv that maps variables across CHMS cycles 1-6
- Added Vignettes to describe the process of using rec_with_table() (part of recodeflow) to combine the data
Medication features
-
recode_meds_cycles1to2()andrecode_meds_cycles3to6()recode medication data and merge medication columns into the main cycle data frame in one call. Both share the same call signature, so the workflow is identical regardless of cycle:cycle1 <- recode_meds_cycles1to2(cycle1, cycle1_meds, c("any_htn_med", "diab_med")) cycle3 <- recode_meds_cycles3to6(cycle3, cycle3_meds, c("any_htn_med", "diab_med")) aggregate_meds_by_person()collapses long-format medication data to one row per respondent, preservingtagged_na("a")(valid skip) andtagged_na("b")(missing) distinctions across the aggregation.recode_after_meds()recodes derived variables (e.g.htn_status,diab_status) whose inputs include pre-computed medication variables, automatically excluding meds-database rows fromvariable_detailsso medication columns are passed through rather than re-derived from raw ATC/MHR columns.16 ATC-classification functions (
is_ace_inhibitor(),is_beta_blocker(),is_calcium_channel_blocker(),is_diuretic(),is_diabetes_med(),is_nsaid(),is_any_antihtn_med(),is_other_antihtn_med(), plus theiris_*_cycles1to2()variants) are exported for custom workflows.New vignette
recoding_medications.qmddocuments the medication-recoding workflow for both cycle groupings, with a section on calling the underlyingis_*classifiers directly.
Breaking changes (medications)
- The
any_htn_med2argument ofderive_hypertension(),derive_hypertension_adj(),derive_hypertension_control(), andderive_hypertension_control_adj()has been renamed toany_htn_med. Thediab_med2argument ofderive_diabetes_status()has been renamed todiab_med. Calls that pass the old argument by name will fail with an “unused argument” error. - The self-referential
any_htn_med2anddiab_med2entries ininst/extdata/variable-details.csvhave been removed. Newany_htn_medanddiab_medentries cover all six cycles via three database tiers:DerivedVarrows for cycles 1-2 (atc_*/mhr_*columns),DerivedVarrows for cycles 3-6 (meucatc,npi_25b), andcopypassthrough rows for the main cycle databases once medications have been merged in.