Loads vital.csv into measurement (height, weight, BMI, systolic and diastolic BP) and observation (smoking).
Mirror of Python load_vital(). Each analyte takes the vocabulary-resolved standard LOINC concept and falls back to
a fixed OMOP concept (3036277 height, 3025315 weight, 3038553 BMI, 3004249 systolic, 3012888 diastolic), never 0.
Usage
load_vital(
con,
source_dir,
site_id = NULL,
disambiguate_patids = FALSE,
derive_bmi = TRUE,
plausible_ranges = NULL
)Arguments
- con
A DuckDB connection with the CDM tables and mapping macros loaded.
- source_dir
Directory holding the PCORnet CSVs.
- site_id, disambiguate_patids
As in
etl_pcornet().- derive_bmi
Add a BMI row (703 x lb / in^2) where height and weight exist but BMI does not.
- plausible_ranges
NULL(default),TRUEfor the package defaults (HT 10-100 in, WT 1-1500 lb, BMI 5-200, SYSTOLIC 40-300, DIASTOLIC 20-200), or a named list such aslist(SYSTOLIC = c(40, 300)). Values outside are dropped. Zero and negative values are always dropped.
