Walks an omop_recipe and returns a tidy report of problems without
contacting any server. The first and most important check is whether the
recipe even compiles: recipe_to_plan is run inside
tryCatch and any compile error becomes the no_compile lint.
Remaining rules inspect outputs, variables, and population filters for
structural and disclosure-safety issues that would otherwise surface only at
execution time on the server.
Details
Severities are "ERROR" (will fail), "WARNING" (likely rejected
or wrong), and "INFO" (advisory). Rules:
- no_compile (ERROR)
recipe_to_plan()throws.- empty_output (ERROR)
an output resolves to zero variables.
- dup_output (ERROR)
duplicate output names.
- concept_zero (ERROR)
a non-derived variable has an unmapped
concept_id(0 or NA).- concept_unnamed (WARNING)
concept_idpresent butconcept_namemissing.- time_since_spec (ERROR)
a
time_sincevariable lacks a valid fixed ISOderived$reference_dateorderived$unit.- age_no_index (WARNING)
format = "age"with index reference but the base population has neither a cohort nor a date filter.- narrow_filter (WARNING)
population
age_rangewidth < 5 years (server rejects). Calendar-window width is server policy and is therefore not hard-coded by this client lint.- highcard_factor (WARNING)
a raw
_concept_idcolumn withfactor_concepts = TRUE, or a categorical format on a high-cardinality domain.- window_inverted (WARNING)
a variable
time_windowwithstart > end.- long_split (INFO)
a
"long"output spanning > 1 table.- no_value_source (INFO)
an aggregate format with no
value_source.
Edge cases: a NULL recipe returns a single empty_recipe info
row; a recipe with no outputs adds a no_output warning.
Examples
if (FALSE) { # \dontrun{
recipe <- omop_recipe(outputs = omop_output(type = "wide"))
recipe_lint(recipe)
} # }