Skip to contents

Writes the result of derive_geography_features() as measurement rows so OHDSI tools see RUCA and SDI as ordinary covariates: one row per stay and value, dated the admission date. SDI score and RUCA code as they are, SDI quintile as 1-5 (from the fixed cut points). Missing values write no row. Re-running replaces the rows of the same concepts for the same persons. unit_concept_id is 0 (the values have no unit): FeatureExtraction joins measurement covariates on the unit and skips rows where it is NULL. FeatureExtraction reads them with createCovariateSettings(useMeasurementValueLongTerm = TRUE, includedCovariateConceptIds = GEOGRAPHY_CONCEPT_IDS).

Usage

write_geography_measurements(
  con,
  geography,
  concept_ids = NULL,
  visit_ids = TRUE,
  register_concepts = TRUE,
  type_concept_id = 45754907
)

Arguments

con

A DBI connection to an OMOP DuckDB.

geography

The result of derive_geography_features().

concept_ids

Named numeric vector overriding GEOGRAPHY_CONCEPT_IDS (sdi_score, sdi_quintile, ruca_code).

visit_ids

Link each row to visit_occurrence_id = stay_id (right when the stays are visit_occurrence rows).

register_concepts

Add the local concepts to concept (Measurement domain) so covariate names resolve.

type_concept_id

Measurement type concept; default 45754907 ("Derived value").

Value

The number of rows written.