Compiles the recipe into an omop_plan suitable for server-side
execution via ds.omop.plan.execute. The conversion maps
population-level filters to cohort specifications, groups variables by
output and table, selects the appropriate plan builder (person_level,
features, events, survival, intervals, baseline, temporal_covariates, or
person_period) for each output type, and attaches row-level filter trees.
Details
Multiple populations and recipe-level scope are both serialized into the plan for the server to execute:
plan$populationscarries every recipe population. A criteria population serializes aslist(id, label, kind = "criteria", filter_tree, cohort_definition_id); a set-op population aslist(id, label, kind = "setop", setop = list(op, members)). The base population is always included so its cohort drives single-population recipes exactly as before.every
plan$outputs[[name]]carries thepopulation_idit was authored against (default"base"), so the server materializes and gates each output against the right population.plan$scopecarries the recipe-level scope (list(cohort, tables, combine)) the server folds and intersects into every population. It is omitted when no scope was set.
Recipes are the recommended interface for ordinary analysis code. Plans are retained as an explicit lower-level contract so advanced users, tests, and the server can inspect the exact payload before it is executed.
Examples
if (FALSE) { # \dontrun{
recipe <- omop_recipe(
blocks = omop_variable_block(
table = "condition_occurrence",
concept_ids = c(201820), format = "binary"),
outputs = omop_output(type = "wide"))
recipe_execute(recipe)
plan <- recipe_to_plan(recipe) # advanced: inspect the server payload
} # }