Documentation / Viewer

Cohorts

Patients with a fact (a finding, condition, vaccine, allergy, medicine or encounter) compared with everyone else: who they are and what happens to them next.

A cohort of patients with a high HbA1c compared with everyone else: baseline, outcomes over time and what else follows
A cohort of patients with a high HbA1c compared with everyone else: baseline, outcomes over time and what else follows
  1. Cohort – The group as a sentence: the fact, the period in which it starts, new cases only, age, gender and follow-up.
  2. Outcomes – Up to 8 facts to follow after the start: chips, common outcomes and suggestions from the result.
  3. Baseline – Age and gender of the cohort and the comparison group side by side.
  4. Over time – The share with the outcome by day since the start, cohort against comparison group.

Open Cohorts at the top of the left panel. The group reads as a sentence, Patients with HbA1c high first recorded in 2025, new only, aged … to …, all genders, followed for 1 year; each boxed part can be changed. The fact opens a panel to search results, conditions, medicines, vaccines, allergies and visits, one row per concept (codes that mean the same are merged, as on Correlations). Each patient's start is the first date of the fact in the period. With New only, patients who had the fact before the period are left out. Choose how long to follow them (90 days to 2 years), and optionally an age range and gender.

Comparison group
Everyone else with a record in the period who never had the fact, starting from their first record in the period. It is not matched: the table Who is in the cohort shows how the two groups differ in age and gender.
Outcomes
Up to 8 facts to follow, shown as chips: add them with Add outcome, by clicking one of the common outcomes (visits and frequent conditions), or with + Follow on a suggestion of what happens more often after the start. For each: the share of each group in which it happens within the follow-up, the risk ratio with its 95% confidence interval, and a curve of the share by day since the start (Kaplan-Meier, so patients whose data ends earlier still count until then). Conditions and allergies count only when new; patients who already had them are left out. Encounters, results, vaccines and medicines count at their next occurrence after the start.
What else happens
Facts within the follow-up that occur more often in the cohort than in the comparison group, with the ratio when both groups have at least 5 patients; facts seen almost only in the cohort are listed apart. Add as outcome follows one of them.

Reading it

A higher risk after the start is co-occurrence in time, not an effect of the fact. The cohort is usually older and sicker than the comparison group, and facts that follow from the definition of the cohort (metformin after a high HbA1c, a diagnosis made on the same result) show up at the top. Follow-up stops at the last record in the data, and never after today.

ExampleTry the sample

Load the sample made with python3 tools/sample-data/generate_correlations.py. Choose HbA1c: high in last year's period: diabetes and metformin are found almost only in the cohort, a statin follows a high LDL, and admissions are about twice as frequent as in the comparison group.

NoteNeeds viewer:browse and access to Patient; facts of types your account cannot see are not offered. Counts from 1 to 4 show as <5, and groups under 20 patients get no curve.