
Add your own covariates so the OHDSI tools read them
Source:R/custom_covariates.R
write_custom_covariates.RdFeatureExtraction, PatientLevelPrediction and ATLAS know only OMOP tables. A feature that is not in the CDM (an area
deprivation index, a risk score, an alternative definition of a standard feature) becomes visible to them when it is written
as measurement rows with a site-defined concept id (at least 2,000,000,000, the OMOP convention). Studies then extract it
with the standard tool, and an alternative definition of an existing feature sits beside the standard one under its own
concept id, so the two can be compared (see compare_feature_tables()) before one is chosen.
Usage
write_custom_covariates(
con,
values,
concepts,
source = "omop_etl.custom_covariates",
visit_ids = FALSE,
register_concepts = TRUE,
type_concept_id = 45754907
)Arguments
- con
A DBI connection to an OMOP DuckDB.
- values
A long data frame:
person_id,date(the date the value applies to),feature(a name inconcepts),value(numeric), and optionallyvisit_occurrence_id. Missing values write no row.- concepts
Named list; each element is
c(concept_id, concept_name)(concept id as number, at least 2e9).- source
Written to
measurement_source_value.- visit_ids
Link rows to
visit_occurrence_idwhen that column is present invalues.- register_concepts
Add the concepts to
concept(Measurement domain) when that table exists.- type_concept_id
Measurement type concept; default 45754907 ("Derived value").