Matching codes
Decide which code strings count as a hit.starts_with, exactly, contain, end with.
Confirmed condition (≥2 days)
“Seen at least twice on different calendar days.”occurring(at_least=2, count_distinct_on=None).
Gap-separated index
“Two visits far enough apart; index at the first of that pair.”Position filter
“Only primary diagnosis rows.”Cohort with coded washout
“Index patients, age and enrollment filters, drop cancer in the prior year.”Cohort with another EventFrame
Pass EventFrames to.include / .exclude (with optional window=) when the rule is itself an EventFrame.
window=(before, after) is always days relative to the cohort entry index date. Omit window to require membership with no timing filter.