MCH·OMOPLive
Under construction This sheet is being revised. Content may change or be incomplete.

Cheat sheet · Sheet 02

Cohort Definition Design

Quick reference for building reproducible cohorts in ATLAS. A cohort is a set of people who satisfy criteria for some duration of time: who enters, who stays, when they leave.

← All cheat sheets Worked example: menopause →

01The five moving parts

Part Answers Examples
Entry event What puts a person in, and on what date (index)? First condition occurrence of essential hypertension; first metformin exposure
Initial event limit If several qualifying events, which count? Earliest per person; all events; latest
Inclusion criteria Which entrants qualify? Evaluated relative to index. Age ≥ 18 at index; ≥ 365d prior observation; second dx within a year
Cohort exit When does membership end? End of continuous exposure; end of observation period; index + 365d
Censoring What cuts membership short or bounds the window? Censoring event (hysterectomy); censor window (2016-01-01 → 2023-12-31)

Don't conflate

  • Censoring event, which ends one person's membership early when further follow-up is uninformative.
  • Censor window, which bounds every person's contribution to a calendar range.
  • Observation gap, which is neither of the above and is handled by OBSERVATION_PERIOD and prior-observation rules.

02Design principles

  • Keep entry simple. Push nuance into inclusion rules, where it is named and countable in attrition.
  • Require prior observation, usually 365d. Without it, "first recorded" means "first we saw," and every incidence estimate inherits the error.
  • Standard concepts + descendants. A flat code list silently misses the specific terms clinicians use.
  • Define exit deliberately. Most under-specified part of a cohort; sets time at risk.
  • Name inclusion rules in plain language. They become the attrition table reviewers read.
  • Inclusion rules combine with AND. For OR, put both branches inside one rule as a criteria group.

03Worked patterns

Entry

  • First-ever recorded diagnosis, earliest event per person
  • First exposure to a drug class, no prior exposure in preceding 365d
  • A procedure, restricted to inpatient visits

Inclusion

  • Age ≥ 40 at index
  • ≥ 365d continuous prior observation
  • Second diagnosis 30–365d after index (confirmation)
  • No competing diagnosis in 365d before index

Exit

  • End of continuous exposure, 30d persistence gap
  • End of observation period (permissive default)
  • Fixed: index + 365d
  • Earliest of the above

04Exporting and running

ATLAS emits parameterized OHDSI SQL: concept set temp tables, entry logic, inclusion rules, exit logic. Translated at runtime by SqlRender, executed via DatabaseConnector.

  • Runs on PostgreSQL, SQL Server, Oracle, Redshift, BigQuery, Snowflake, Databricks/Spark, others.
  • Export the cohort definition JSON, not just the SQL. JSON is the portable, version-controllable artifact; SQL is a build product.

05References

See this sheet in use: Menopause in the OMOP vocabularies builds two cohorts against a real vocabulary search, including one where the entry event has to be an Observation rather than a Condition, and one where the age rule does all the work.

Corrections or suggestions welcome: danielle@boycedatascience.com