Skip to contents

One row per cohort row, in cohort order: prior_encounters_all_count, prior_ip_os_ed_count (inpatient 9201 / 262, ED 9203 and observation 581385 visits; also the custom concept 2000000048), days_since_prior_encounter, days_since_prior_ip_ed (lookback_days when there is none), readmission_count_twelve_months, prior_outpatient_count (outpatient 9202 / 581477 and telehealth 5083 visits, since 0.34.0), n_secondary_dx (secondary diagnoses of the index stay since 0.34.0: distinct diagnosis codes as recorded, dots and case ignored, from admission to discharge, leaving out the principal diagnosis's code; it replaces n_secondary_dx_ccs; since 0.34.2 only diagnoses on the index visit count when the cohort has visit_occurrence_id, and one with no visit id counts by date), elix_pre_index_conditions_count (distinct condition concepts before the admission, all history) and tobacco ("Current user", "Former user", "Never user" or, with no status, "Missing / Unknown" (0.34.1); since 0.34.2 the level of the latest tobacco record on or before discharge, a same-day tie going to the higher level; from tobacco observation concepts, the PCORnet VITAL smoking status (43054909) and ICD F17 / Z72.0 / 305.1 / Z87.891 / V15.82). Visits are counted in [admission - lookback_days, admission); diagnoses and observations up to the discharge date. Same as Python omop_etl.extract_protocol_history_features.

Usage

extract_protocol_history_features(con, cohort, lookback_days = 365)

Arguments

con

DuckDB connection to an OMOP CDM.

cohort

data frame with row_id, subject_id, cohort_start_date, cohort_end_date (as built by extract_benchmark_features()).

lookback_days

visit window in days (default 365).

Value

A data frame with one row per cohort row.