
Study-design features: add your own person-level features to an OMOP study
Source:R/study_features.R
study_features.RdA study design feature is anything a protocol needs that the OMOP CDM does not define itself: an area-level index of the
residence ZIP (RUCA, SDI, census income), a risk score, a site-specific exposure definition. This framework keeps the package
small by shipping the mechanism and a few worked examples, not the data. It mirrors the Python module
omop_etl.study_features, and fitted state and manifests are interchangeable between the two languages.
Details
study_feature()describes one feature;ruca_feature(),sdi_feature(),area_feature(),sql_feature()andcustom_feature()build common ones.feature_set()collects features, extended iteratively withadd_feature().compute_features()returns one row per index stay (the address in effect at admission is resolved once and shared).write_feature_set()stores the values asmeasurementrows under site-defined concepts, andfeature_set_covariate_settings()returns the matching OHDSIFeatureExtractioncovariate settings, so FeatureExtraction, PatientLevelPrediction and DeepPatientLevelPrediction read them like any other covariate.feature_set_manifest()/load_feature_state()ship the parameters and fitted state (SDI cut points, a training percentile grid, mean and sd) with a model so a replicating site reproduces the features exactly.
Transforms that learn from data refuse to run at a new site unless the training state is supplied; pass fit = TRUE
to compute_features() only when building the training reference. Nothing here reads events after the index date.