insert_cohort: Insert a cohort from a local data frame.

View source: R/cohort.R

insert_cohortR Documentation

Insert a cohort from a local data frame.

Description

Uploads a data frame to the database via omopgenerics::insertTable and marks it as a cohort table with omopgenerics::newCohortTable. Use this when cohort membership has already been computed locally (e.g. from a CSV or programmatic cohort definition).

Usage

insert_cohort(cdm, cohort_df, name = "cohort")

Arguments

cdm

A CDM reference (from syrona_connect()$cdm).

cohort_df

Data frame with columns: cohort_definition_id, subject_id, cohort_start_date, cohort_end_date.

name

Name for the cohort table in the database (default "cohort").

Details

Requires that the CDM connection was created with a writeSchema.

Value

Updated CDM reference with the cohort table attached.


syrona documentation built on Sept. 5, 2026, 1:06 a.m.