In short
Once the criteria are set, Run query fills the results panel: the count, the rows, the attrition as bars or a flowchart, the patients and the filtered tables. The SQL tab shows the query — portable or written on the source tables — and can be edited by hand. Report turns it into an HTML, PDF or Word summary, with small counts suppressed.
Running
Run query executes the query on the cohort’s database. While it computes, the button becomes Stop: an over-broad query can be interrupted without waiting.
The header of the results panel then gives the count — the number of rows at the chosen level —, how long it took, and a CSV button that downloads the rows shown.
Displayed results are capped at 10,000 rows
The count stays exact: only the display is limited, and a banner says so. To work with a larger cohort, freeze it, or take its SQL into an SQL collection.
When a run fails, the panel says so and gives the database’s message. The most frequent case — No query could be built from these criteria — points to a Concept criterion with no concept selected, or a database mapping that does not declare the table for the chosen level.
The result tabs
The right-hand panel has up to six tabs.
412
results
- Results — the cohort’s rows: the id at the chosen level, age at admission, start and end dates.
- Attrition — the count after each criterion, detailed below.
- Patients — reviewing the members, chart by chart.
- Tables — every table of the database, filtered on the cohort.
- SQL output — the raw rows of a hand-written query.
- Schema — the database explorer, unfiltered, to find a table or column name while writing SQL.
Patients, Tables and SQL output
The Patients tab opens a board of the cohort’s own: the same tabs and widgets as the Patient data page, listing the patients of the last run — there is no need to materialize the cohort. On first opening the board is empty: Add widget lays it out, and it stays attached to the cohort.
The Tables tab lists every table of the database, filtered on the finest id it carries — the cohort’s unit stays, its hospital stays or its patients —, as a derivation would filter it. Clicking a table counts it and shows its first rows; Count all counts them all. A table without an id, such as a care-unit reference, stays Not filtered. It is the quickest way to see what the cohort brings with it: how many measurements, how many prescriptions.
The SQL output tab shows what a query written in the SQL tab returns, whether or not it lists the cohort’s members — SELECT * FROM measurement LIMIT 10 to glance at a table. When a query does not return the expected id column, Linkr opens this tab directly rather than showing only an error.
Tabs that depend on the schema
The Patients and Tables tabs assume the database’s schema is mapped — with a patient table for the former. Without it, they do not appear.
Reading attrition
The Attrition tab gives what every publication asks for: how many patients remain after each criterion, applied in the tree’s order. Each top-level criterion is a step; a group counts as a single step, under its name — hence the value of naming your groups.
Two presentations, chosen at the top right:
Bars
A horizontal funnel.
One bar per step, then the list of counts with, in brackets, what each step removed. The quickest way to spot an over-selective criterion.
Flowchart
The CONSORT layout.
The steps down the middle, from All records to the final cohort, with their share of the starting count; to the side, how many were excluded at each step. The form a paper expects.
It is the most instructive reading on the page. A criterion that drops the count from 4,000 to 40 is almost always a badly written criterion — a concept absent from this database, an unexpected unit of measure — rather than a genuinely rare population.
The order changes the steps, never the result
Moving a criterion changes the intermediate counts and how many each step excludes, not the final count. Order the criteria as you want to present them: most often, inclusion criteria first, exclusions after.
The cohort’s SQL
The Criteria / SQL toggle in the toolbar shows the query your criteria produce. Its first use is to understand, and to check. It can also be edited.
The query must return a patient_id column — one row per patient.
Written on the source tables of MIMIC-IV: it runs only on databases of this schema.
The line at the top recalls the query’s contract: it must return a patient_id column — one row per patient (visit_id at hospitalization level, visit_detail_id at unit-stay level).
Portable or on the source tables
The format menu offers two writings of the same query:
Source tables
Written on this database’s tables.
The default, named after the schema — MIMIC-IV (source tables). Readable by anyone who knows the database, but it runs only on databases of that schema.
Linkr (portable)
Written on the linkr_* relations.
linkr_patient, linkr_visit… are the same on every database whose schema is mapped: the query re-runs on another database, in another model.
When the criteria cannot be written on the database’s own tables, only the portable format is offered.
Editing, saving, resetting
Typing in the editor creates an unsaved edit, flagged by an orange dot — in the editor’s bar and on the SQL tab. Save (or Cmd+S) keeps it; Cancel goes back to the last saved text. A saved query carries the Modified badge, and an amber dot on the SQL tab recalls it even while you are on the criteria. Reset goes back to the SQL the criteria generate, Copy puts the query on the clipboard.
A saved query is shown as it was written: the format can no longer be switched until you reset it.
Run query always runs what the editor shows, saved or not. A result obtained from an unsaved edit carries the Unsaved SQL badge: saving keeps that definition, cancelling drops the result. Report and Materialize, for their part, read the saved definition — they stay greyed out while an edit is pending, and hovering says why.
Touching the criteria overwrites edited SQL
Criteria and a hand-written query do not coexist. Changing a criterion after editing the SQL opens Overwrite custom SQL?: confirming regenerates the query from the criteria, and your edits are lost.
Custom SQL reduces attrition to one step
Linkr computes attrition by unrolling the criteria one at a time. With a hand-written query there are no criteria to unroll: the attrition goes straight from the total to the query, and the report writes “Selected by the custom SQL query”. That is the price of SQL’s freedom, to weigh against the chart you will need in order to publish.
The cohort report
Report produces a self-contained summary of the cohort, computed fresh from the database: counts, inclusion flowchart, criteria applied, concepts used and their coverage, characteristics — age at index date, sex, month of inclusion —, data available per event table, stays per care unit, methodology and data source. The dialog’s preview is the exported file itself: what you read is what is sent.
Cohort report
A self-contained summary of this cohort: counts, flowchart, criteria, characteristics and methodology, computed fresh from the database.
Cohort report
Adult sepsis — alive at discharge
Generated on 2026-09-28 at 10:42
412
Patients
468
Stays
Patients by sex
Age distribution (at index date)
Methodology
Small-cell rule: any count between 1 and 11 is replaced by <11, and no percentage is given for such counts, so that no small group of patients can be singled out.
-- One row per patient: its patient_idSELECT DISTINCT linkr_patient.patient_idFROM linkr_patient…Three settings, in the left-hand column:
- Format — HTML: a single file that opens in any browser; PDF: goes through the browser’s print dialog, where you choose “Save as PDF”; Word: a
.docxto rework. - Small-cell threshold — any count between 1 and this threshold shows as
<N, with no percentage and no bar, so that no small group of patients can be singled out. 11 is the default, the usual rule for health data. A new threshold re-runs the report’s thirty-odd queries: it applies with Recompute, or Enter. - Include the SQL query in the methodology — the exact query, so a reviewer can re-run it.
Export downloads the file in the chosen format.
What a report needs
The database must be connected and its schema mapped — without a mapping, the report cannot find the patients. An unsaved SQL edit disables the button: the report describes the saved definition.
The threshold does not replace dissemination rules
Suppressing small counts makes a report shareable with colleagues; it is not anonymization in the regulatory sense. Before any release outside the team, check your institution’s rules.
Going further
- Building a cohort — the level, the criteria and how they combine.
- Cohorts — what a cohort is, and what it feeds.
- Patient data — reviewing the members’ charts, and laying out a board.
- Schemas — the mapping the portable SQL relies on.
- Derived sub-databases — drawing a new database from a cohort’s members.