Network Study Paint By Numbers

Caution: work in progress. This tool is under construction and has not been peer reviewed. Treat the stages, the worked example, the generated SQL, and the exported JSON as a draft, and check anything you plan to rely on against the source protocol, the OHDSI documentation, and your own data. Corrections are welcome.

Free research tool

Network Study Paint By Numbers

Plan an OHDSI network study end to end: the research question, every concept set behind it, the ATHENA lookups that fill them, the cohort logic and its time-at-risk, the feasibility assessment and cohort diagnostics that decide whether the study can run across the network, and the path from site readiness to publication. One track walks through a published study, decision by decision. The other collects the same decisions for your own study and exports them as a protocol-ready plan. Work through the example first, then work backwards into your own design.

See how the stages fit together

Every participating site runs the same study code against its own OMOP CDM database, so patient-level data stay at the site and only approved aggregate results are shared. The numbered stages run in order, but the protocol and the study package are drafted alongside the definitions and finalized after cohort diagnostics are reviewed. Time-at-risk is designed inside the cohort logic stage, because every window is anchored to the cohort's start or end date. Click any stage to jump to it; the same stages appear on both tracks.

The feasibility assessment and vocabulary work sit off the path on purpose. The loop from the feasibility assessment is the one people skip: it is answered from what you already know, before anything is built, and if it comes back weak the fix may be the question, the design, or the data sources. Treat it as provisional until cohort diagnostics report counts from real data. When diagnostics show problems, such as missing concepts or a rule that drops the wrong people, the loop goes back to the definitions, concept sets and cohort logic together. Much of the manuscript's methods section can be adapted from the finalized protocol.

The study behind this walkthrough

The worked example is Estimating the risk of non-arteritic ischemic optic neuropathy (NAION) and diabetic retinopathy progression associated with semaglutide exposure, an OHDSI network study led by Cindy X. Cai (Wilmer Eye Institute, Johns Hopkins) with the OHDSI Eye Care and Vision Research Workgroup. It began as a safety question in the news, semaglutide and a rare blinding condition, and became a network study run across administrative claims and electronic health record databases, with results published in JAMA Ophthalmology in 2025.

Every artifact is public:

Design details on this track are reproduced from version 1 of that protocol as posted at ohdsi-studies.github.io/SemaglutideNaion, accessed August 2026. Concept IDs and thresholds may be revised over time, so verify anything you reuse against the live protocol and ATHENA.

The research question

The clinical concern was a single question: does semaglutide cause NAION? The protocol split it into separate questions, each with a stated population, exposure, comparator, and outcome:

  1. Among patients with type 2 diabetes mellitus, is the risk for NAION higher among patients who use semaglutide as compared with a non-GLP-1 RA anti-diabetic medication?
  2. Among patients with type 2 diabetes mellitus, is the risk for diabetic retinopathy progression higher among patients who use semaglutide as compared with a non-GLP-1 RA anti-diabetic medication?
  3. Among patients with type 2 diabetes mellitus, is the risk for NAION higher among patients who use semaglutide as compared with other GLP-1 RA anti-diabetic medications?

Each is a population-level effect estimation question in the standard OHDSI form: a defined population, a defined exposure, a defined comparator, a defined outcome. The study also characterized NAION incidence in each exposure cohort before estimating anything, so a clinical characterization question sits underneath the estimation questions, and a self-controlled case series reuses the same cohorts as a second design.

The same study, run through the use case generator

If you had typed this study into the Analytic Use Case Generator before writing the protocol, it would have produced a use case per question. Here is what goes in each slot, taken from the protocol:

Use case typeSlotsAssembled question
Outcome incidence
Clinical characterization
drug: semaglutide
outcome: NAION
time horizon: while on treatment
Amongst people who are new users of semaglutide, how many experienced NAION within the on-treatment period of initiating treatment?
Comparative effectiveness
Population-level effect estimation
drug: semaglutide
outcome: NAION
time horizon: while on treatment
comparator: empagliflozin
Does exposure to semaglutide have a different risk of NAION within the on-treatment period, relative to empagliflozin?
Comparative effectiveness
Repeated per comparator and per outcome
drug: semaglutide
outcome: diabetic retinopathy progression
time horizon: while on treatment
comparator: dulaglutide
Does exposure to semaglutide have a different risk of diabetic retinopathy progression within the on-treatment period, relative to dulaglutide?

Filling the slots this way shows something the protocol text alone does not. The comparative effectiveness template gets instantiated once per comparator and outcome pair, which is how a short list of protocol questions becomes the much larger set of comparisons the study ran. The self-controlled case series has no template in the generator, because it contrasts exposed and unexposed time within the same people rather than comparing two cohorts.

What to reuse in your own study: one clinical concern usually decomposes into several analytic questions of different types. Write each one in the standard form before touching data; the question type determines which design, which cohorts, and which feasibility checks follow.

Feasibility assessment

Before any concept set is built, the use case generator's feasibility questions can be answered from what is already known about the question and the data. Answered from the protocol, they come out like this for the semaglutide study:

DimensionAnswer for this studyWhy
Computable phenotypesNeeds a custom, uncertain definitionNAION had no validated phenotype, so the team wrote two definitions and measured them with PheValuator.
Population prevalenceCommon (>1%)Adults with type 2 diabetes on second-line treatment.
Recorded in coded fieldsMostly coded, with some misclassificationDiagnosis codes for ischemic optic neuropathy exist, but they are imprecise, which is what drove the two-definition approach.
Data domainsAlso procedures / devicesConditions, drugs, and visits, plus procedures for the retinopathy treatment outcomes.
Continuous follow-upUp to 1 yearOn-treatment time-at-risk, with 365 days of prior observation required.
Governance and linkageStandard population, no linkageAdults, no record linkage needed.
ComparatorEstablished active comparator (equipoise)Second-line diabetes drugs that clinicians genuinely choose between, reused from LEGEND-T2DM.
ConfoundingRich covariates; large-scale PS feasibleThe study used large-scale propensity scores with a curated negative control set.

That mix sits in the upper feasibility bands: strong on population, comparator, and confounding control, with the outcome phenotype as the one real risk. The study addressed exactly that risk by defining NAION twice and measuring both definitions, which is what the assessment would have told you to do.

The assessment is provisional. Prevalence, coded capture, and follow-up are estimates until the cohorts exist and cohort diagnostics report counts from each participating database. When an assessment comes back weak, the response is not always a new question: a different design, such as a self-controlled case series in place of a cohort comparison, or a different set of data sources can make the same question feasible.

What to reuse in your own study: run the feasibility assessment as soon as the question is written, answer it from what the team knows and a few quick counts, and revisit the answers once cohort diagnostics report real numbers.

Design and study population

The primary design is an active comparator, new-user cohort design. The population is adults 18 or older with type 2 diabetes mellitus; an indication cohort defines that population and excludes type 1 and secondary diabetes. The target is new users of semaglutide as second-line treatment after metformin. Comparators come in two flavors: within class (dulaglutide, exenatide) and across class (empagliflozin, sitagliptin, glipizide), and the protocol states these were chosen as the most commonly occurring medication within each class in the LEGEND-T2DM study. A self-controlled case series compares NAION incidence during exposed and unexposed time in the same people, which trades confounding-by-indication concerns for within-person assumptions.

The study period runs from December 1, 2017 to December 31, 2023. Analysis uses large-scale propensity scores with 1:1 matching and Cox models for the cohort comparisons, and Poisson regression for the self-controlled case series, executed through the Strategus pipeline calling HADES packages.

What to reuse in your own study: the team did not invent its exposure cohorts, comparator choices, or negative controls; it reused them from LEGEND-T2DM. Before designing from scratch, look for a prior network study in your therapeutic area whose validated pieces you can reuse.

Concept sets

A concept set is the bridge between a clinical idea ("type 2 diabetes", "semaglutide") and the rows in an OMOP database. Each entry names a standard concept and two decisions: whether to include its descendants in the vocabulary hierarchy, and whether the entry is an exclusion that subtracts concepts from the set. The protocol appendix publishes every concept set as a table with exactly those columns, which is what an ATLAS export looks like.

The semaglutide exposure concept set
Concept IDConcept nameCodeVocabularyExcludedDescendants
793143semaglutide1991302RxNormNOYES

One row covers the exposure. The RxNorm ingredient with descendants includes every clinical drug, branded product, and dose form of semaglutide, which is why drug concept sets anchor at the ingredient level.

The type 2 diabetes concept set, including its exclusions
Concept IDConcept nameCodeVocabularyExcludedDescendants
201820Diabetes mellitus73211009SNOMEDNOYES
443238Diabetic - poor control268519009SNOMEDNOYES
442793Complication due to diabetes mellitus74627003SNOMEDNOYES
4016045Diabetic - good control170763003SNOMEDNOYES
201254Type 1 diabetes mellitus46635009SNOMEDYESYES
435216Disorder due to type 1 diabetes mellitus420868002SNOMEDYESYES
40484648Type 1 diabetes mellitus uncontrolled444073006SNOMEDYESYES
40484649Type 1 diabetes mellitus well controlled444074000SNOMEDYESYES
195771Secondary diabetes mellitus8801005SNOMEDYESYES
761051Complication due to secondary diabetes mellitus138811000119100SNOMEDYESYES
43531009Pregnancy and type 1 diabetes mellitus609566000SNOMEDYESYES
4024659Gestational diabetes mellitus11687002SNOMEDYESYES

The set anchors on the broad SNOMED parent, Diabetes mellitus, and then carves type 1, secondary, and gestational diabetes out of it with exclusions (shown in red). Starting broad and subtracting is often safer than starting narrow, because source data frequently code the generic parent.

The GLP-1 receptor agonist class set that enforces the new-user rule
Concept IDConcept nameCodeVocabularyExcludedDescendants
45774435dulaglutide1551291RxNormNOYES
1583722exenatide60548RxNormNOYES
40170911liraglutide475968RxNormNOYES
44506754lixisenatide1440051RxNormNOYES
44816332albiglutide1534763RxNormNOYES
793143semaglutide1991302RxNormYESYES

This set exists to express "no prior GLP-1 RA exposure other than the target drug". The target itself is listed and excluded, so the same class definition can be reused for every exposure cohort by swapping which ingredient is excluded.

The protocol appendix holds the same style of table for every other set the cohorts need: metformin, insulin, each comparator ingredient, and each competing drug class. Every clinical phrase in a cohort definition ("prior metformin", "no prior sulfonylurea", "no type 1 diabetes") is backed by its own named concept set.

Building the T2DM set in ATLAS

  1. Open Search, type diabetes mellitus, and filter to Standard Concept: Standard, Vocabulary: SNOMED.
  2. Tick Diabetes mellitus (201820) and the other three included concepts, then Add to Concept Set and give the set a name.
  3. Search again for the type 1, secondary, and gestational diabetes concepts and add those to the same set.
  4. On the Concept Set Expression tab, tick Descendants on every row, then tick Exclude on the carve-out rows.
  5. Open Included Concepts and read the resolved list. If a concept you expected is missing, or one you did not expect appears, fix the expression now.

Rather than doing that by hand, you can paste the finished set straight in. ATLAS offers two import routes, both on the Import tab of a concept set.

RouteWhere to pasteWhat comes across
Concept Set Expression JSONImport tab → Concept Set sub-tabConcepts plus the Descendants and Exclude flags already set.
Concept identifiersImport tab → Concept Identifiers sub-tabJust the concepts. ATLAS looks up each one itself, so nothing can be stale, but you set the flags by hand afterward.

If a pasted JSON ever throws a DataTables warning about an unknown parameter, the JSON is missing a field that ATLAS's table expects. The concept identifier route avoids that class of problem, because ATLAS builds the concept records from the vocabulary rather than trusting the file.

What to reuse in your own study: inventory every clinical idea your question mentions, including the ones hiding inside exclusion rules, and give each its own concept set before writing any cohort logic. Search the OHDSI Phenotype Library first; an evaluated definition beats a new one.

ATHENA and the vocabulary, online and offline

ATHENA is the OHDSI vocabulary browser, and it is where the concept IDs above come from. The working pattern for filling a concept set:

  1. Search the clinical term and filter to Standard Concepts = Standard; only standard concepts populate the *_concept_id fields your cohorts query.
  2. Pick the right level: for drugs, the RxNorm Ingredient (semaglutide, 793143); for conditions, the SNOMED clinical finding (Diabetes mellitus, 201820). Descendants then do the fan-out to dose forms or subtypes.
  3. Open the concept page and review its hierarchy and related concepts to decide what descendants will pull in and what needs excluding.
  4. Record the concept ID, the source code, and the vocabulary in your concept set table, with the Excluded and Descendants flags decided deliberately.

ATHENA also distributes the vocabulary tables for download (an account is required, and some vocabularies such as CPT4 need a UMLS API key during the download step). Once loaded into a database, three tables answer almost everything: CONCEPT, CONCEPT_ANCESTOR, and CONCEPT_RELATIONSHIP. The tasks below use the study's real concept IDs, so you can run them against any OMOP vocabulary and compare. Each one is shown twice: the point-and-click path in ATLAS, and the SQL for a downloaded vocabulary. Use whichever fits how you work; they answer the same question.

Look up a concept from its source code

In ATLAS

  1. Open Search in the left menu.
  2. Type the drug or condition name, or paste the source code, and press Search.
  3. In the results, set the Standard Concept filter to Standard and filter Vocabulary to RxNorm for drugs or SNOMED for conditions.
  4. Click the concept name to open it. The concept ID, code, domain, and class are listed at the top.

Same lookup in SQL

SELECT concept_id, concept_name, domain_id, vocabulary_id,
       concept_class_id, standard_concept, concept_code
FROM concept
WHERE vocabulary_id = 'RxNorm'
  AND concept_code = '1991302';   -- semaglutide; expect concept_id 793143
Resolve a concept set: descendants in, exclusions out

In ATLAS

  1. Open Concept Sets and click New Concept Set, or open an existing one.
  2. From a vocabulary search, tick the concepts you want and click Add to Concept Set.
  3. On the Concept Set Expression tab, tick Descendants for the concepts that should fan out, and Exclude for the branches you are carving away.
  4. Click the Included Concepts tab. This is the resolved list, the same output the SQL returns. Read it before trusting the set.
  5. The Included Source Codes tab shows which source codes map in.

Same resolution in SQL

-- Type 2 diabetes as defined in the protocol:
-- Diabetes mellitus and descendants, minus T1DM, secondary, and gestational branches
SELECT DISTINCT c.concept_id, c.concept_name, c.vocabulary_id
FROM concept_ancestor ca
JOIN concept c ON c.concept_id = ca.descendant_concept_id
WHERE ca.ancestor_concept_id IN (201820, 443238, 442793, 4016045)
  AND c.invalid_reason IS NULL
  AND c.concept_id NOT IN (
        SELECT descendant_concept_id
        FROM concept_ancestor
        WHERE ancestor_concept_id IN
          (201254, 435216, 40484648, 40484649,
           195771, 761051, 43531009, 4024659)
      )
ORDER BY c.concept_name;
Find which source codes map to your standard concepts

In ATLAS

  1. Open the concept set and click the Included Source Codes tab.
  2. Filter by vocabulary to see only the coding systems your sites use, such as ICD-10-CM or ICD-9-CM.
  3. Click Export on that tab to download the list as a file you can share with a data holder.

Same mapping in SQL

-- Which ICD-10-CM (or other source) codes map to these standard concepts?
SELECT src.vocabulary_id, src.concept_code, src.concept_name,
       std.concept_id AS standard_concept_id, std.concept_name AS standard_name
FROM concept_relationship cr
JOIN concept src ON src.concept_id = cr.concept_id_1
JOIN concept std ON std.concept_id = cr.concept_id_2
WHERE cr.relationship_id = 'Maps to'
  AND cr.invalid_reason IS NULL
  AND std.concept_id IN (793143)   -- swap in any resolved standard IDs
ORDER BY src.vocabulary_id, src.concept_code;
What to reuse in your own study: resolve every concept set with the descendant query and read the resulting list before trusting it. Unexpected concepts come in through the hierarchy, and it costs less to find them in the vocabulary than in your results.

Cohort logic and time-at-risk

Here is the semaglutide exposure cohort from the protocol, laid out as the anatomy every ATLAS cohort definition shares. Read it top to bottom as a machine would.

Entry event
First-ever drug exposure of semaglutide, limited to the earliest event per person, with 365 days of continuous observation before the event.
Entry restrictions
Age 18 or older at entry; at least one type 2 diabetes condition occurrence on or before entry; no type 1 diabetes; no secondary diabetes (events outside the observation period are allowed for these lookbacks).
Inclusion rules
  • Prior metformin: a metformin drug era of 90 days or more starting anytime up to 90 days before entry, or at least 3 metformin exposures on or before entry.
  • New to the class and its rivals: no prior exposure to GLP-1 RAs other than semaglutide, DPP4 inhibitors, SGLT2 inhibitors, sulfonylureas, or other anti-diabetics.
  • Essentially insulin-naive: no insulin era longer than 30 days before entry, and no insulin era starting in the 30 days around entry. The protocol labels this rule a proxy for under 30 days of insulin use with no combination initiation, which records that the rule approximates the clinical idea rather than capturing it exactly.
Cohort exit
End of continuous exposure to semaglutide, allowing a 30-day gap between exposures, adding 0 days after the final exposure, using days supply and exposure end dates for duration.
Eras
Remaining events combine into cohort eras if they are within 0 days of each other.

The same structure repeats for each comparator with the drug names swapped. The logic is identical; only the concept sets change.

Building this cohort in ATLAS

  1. Open Cohort Definitions and click New Cohort Definition.
  2. Under Cohort Entry Events, click Add Initial Event and choose Drug Exposure. Set the concept set to your semaglutide set, and tick First exposure.
  3. Set with continuous observation of 365 days before the event, and limit initial events to earliest event per person.
  4. Under Inclusion Criteria, click New inclusion criteria once per rule and name it, for instance "Prior metformin". Build the logic with the criteria and attribute pickers on the right, which is where the day windows are entered.
  5. Under Cohort Exit, choose End of continuous exposure, set the persistence window gap to 30 days, and leave the surveillance offset at 0.
  6. Save, then run Generate against a data source to see counts.
The import path is not where you would expect. To load a cohort definition JSON into ATLAS, open a cohort definition, go to the Export tab, choose the JSON sub-tab, paste the JSON over what is there, and click Reload. There is no Import button for cohorts, unlike concept sets, which do have one. This trips up nearly everyone the first time.
These cohorts are already on the public ATLAS demo

The study's own definitions were built on atlas-demo.ohdsi.org, so you can open the real thing rather than rebuilding it. Search the cohort definition list for semaNAION and you will find the set, including:

  • Persons with type 2 diabetes mellitus and no prior T1DM or secondary diabetes, the indication cohort
  • New user of semaglutide as 2nd-line treatment with prior T2DM and prior metformin, and the same for each comparator
  • Nonarteritic anterior ischemic optic neuropathy with index date correction, in its specific and sensitive forms
  • Treatment-requiring diabetic retinopathy or macular edema, with and without vitrectomy

Open one, go to Export → JSON, and copy what you see. On the other track you can load that JSON straight into your own plan and edit from there.

Anyone can save to the public demo and it is periodically reset, so treat what you find there as a teaching copy rather than the authoritative version. The protocol and the study repository are the record.

The outcome side gets the same rigor. NAION has two definitions, a specific one (two ischemic optic neuropathy diagnoses on separate days within 90 days, with the outcome date pulled earlier if preceded within 60 days by a visual field defect, optic disc disorder, optic neuritis, or optic disc edema) and a sensitive one (a single diagnosis with the same adjustments); both exclude giant cell arteritis and traumatic optic neuropathy. Rather than assuming these definitions work, the study measured their performance with PheValuator.

Windows and time-at-risk

Every window in this study is anchored to the cohort's start or end date, which is why they are designed here with the cohort logic rather than afterward. They are stored in two different places, though. The washout and the lookbacks are part of the cohort definition in ATLAS. The time-at-risk is not part of a cohort definition; it is entered in the analysis specification as the risk window start and end settings of the HADES modules, with each one anchored to cohort start or cohort end. Because the on-treatment time-at-risk ends at cohort end, the exit rule above is what defines it.

  • The washout window is the 365 days of continuous observation required before entry, set on the entry event. It gives every subject enough visible history to establish "new user" and to build covariates.
  • The lookback windows inside the inclusion rules (metformin up to 90 days before entry; class exclusions anytime before entry; the insulin rule's 30-day spans) each encode a specific clinical requirement.
  • The time-at-risk is when outcomes count. The primary analysis is on-treatment: from cohort entry until a gap in exposure of more than 30 days, the end of continuous observation, or the end of the study period, whichever comes first. An intent-to-treat analysis is run as well, and a sensitivity analysis splits the study period into calendar windows (December 2017 to January 2020, February 2020 to June 2021, July 2021 to December 2023) because semaglutide uptake changed so much across those years.
What to reuse in your own study: write your entry event, restrictions, inclusion rules, and exit as separate, named pieces, and when a rule is a proxy for something the data cannot observe directly, document it as a proxy in the rule name itself, the way this protocol does with insulin. Write down the washout, each lookback, and the time-at-risk start and end anchors as explicit numbers at the same time, before anyone touches ATLAS. Ambiguity in windows is the most common reason two sites implement "the same" cohort differently.

Cohort diagnostics

Once the cohorts exist, the next check is whether the definitions behave as intended in real data. The protocol runs CohortDiagnostics on every target, comparator, indication, and outcome cohort before any estimation. It reports cohort counts, inclusion rule attrition, incidence over time, the index event breakdown, visit context, cohort overlap, and orphan concepts, which are concepts found in the data that appear related to a concept set but are not included in it. It gives evidence for review rather than a pass or fail verdict.

For the outcome, the study went a step further: PheValuator estimated sensitivity, specificity, and predictive values for both NAION definitions, replacing "we assume the codes are right" with measured performance.

Where the fixes go

Problems found here send you back to the definitions, and the fix can sit in either one. Orphan concepts and unexpected source codes point to the concept sets. Heavy attrition on one inclusion rule, or an index event breakdown dominated by something unexpected, points to the cohort logic.

Diagnostics at every site

A definition that behaves well in one database can behave differently in another, so diagnostics are reviewed for each participating data source, not only the coordinating site's. At your own site, the CohortDiagnostics R package can run before the study package is complete. At other sites, it runs from the package's diagnostics-only specification, which is why the protocol and package are drafted alongside the definitions and finalized afterward.

What to reuse in your own study: run cohort diagnostics on your own data before any other site sees the package, read the orphan concepts and the index event breakdown before trusting the counts, and ask every site to review its own diagnostics before running the full study.

Finalizing the protocol

Drafting the protocol starts at the design stage and grows as each stage is settled. This stage finalizes it, and in OHDSI the finished protocol is posted publicly before any results exist. The SemaglutideNaion protocol is posted as a versioned HTML document, and its structure is the community's working template, so copy it:

  • Front matter: abbreviations, responsible parties with institutional affiliations, and a disclosure that the study runs within OHDSI.
  • Abstract: background, purpose, design, subjects, methods, and expected conclusions, written in the same shape a journal will later ask for.
  • Amendments and milestones: empty sections held open, so later changes are recorded as amendments rather than quiet edits.
  • Rationale and background: the trial and observational evidence that motivated the question, with citations.
  • Study objectives: the questions restated as numbered objectives.
  • Research methods: design, population, exposures, outcomes, covariates, and negative controls, each pointing at the cohort definitions.
  • Data analysis plan: which HADES packages run, in what order, with the time-at-risk definition written out.
  • Study diagnostics: the pass or fail thresholds applied after execution, stated before any result is seen.
  • Strengths and limitations, human subjects protection, dissemination plan: including that each site seeks its own institutional review board (IRB) determination.
  • Appendix: every cohort definition in full, printed as entry events, inclusion rules, exits, and concept set tables.

That appendix is what makes the protocol reproducible. A reader can rebuild every cohort from the document alone, without access to the authors' ATLAS instance.

What to reuse in your own study: write the protocol before running anything, publish it where collaborators can cite it, and print the full cohort definitions into an appendix. Leave the amendments section in place from version 1 onward.

Finalizing and testing the study package

The protocol describes the study; the study package executes it. Like the protocol, the package starts early, since a preliminary version already runs cohort diagnostics at other sites, and this stage finalizes and tests it. For this study that package is an R project in a public repository, generated from the OHDSI EmptyStudyRepository template, so its shape matches other network studies:

Analysis specification
createStrategusAnalysisSpecification.R builds the specification; the result is saved as inst/fullStudyAnalysisSpecification.json. The JSON, not the R script, is what each site executes.
A diagnostics-only specification
inst/cohortDiagnosticsAnalysisSpecification.json is a separate, lighter specification. Sites can run diagnostics alone before committing to the full study.
Execution script
StrategusCodeToRun.R holds a clearly marked block of inputs: CDM schema, work schema, output location, database name, cohort table prefix, minimum cell count, and connection details.
Locked dependencies
renv.lock pins every R package version. Sites run renv::restore() once, so all sites execute the same code against different data.
Results sharing
ShareResults.R uploads results using a key file and user name issued by the study coordinator.
Status badge
The README shows a study status badge, currently Results Available, so a visitor knows the stage without reading further.

How a site tests before running

  1. Set up R, RTools, RStudio, and Java following the HADES R Setup instructions.
  2. Confirm that R can reach the OMOP CDM through DatabaseConnector, before touching the study code.
  3. Download the package, open the project, and restore the environment with renv::restore(). The README warns this step is slow and asks you to reopen the project afterward.
  4. Run the diagnostics specification first, by swapping which JSON the script loads. This generates the cohorts and their diagnostics without running the estimation.
  5. Set minCellCount to your site's own censoring requirement before any results leave.
  6. Run the full specification only once diagnostics look right.
What to reuse in your own study: ship a diagnostics-only specification alongside the full one, pin your dependencies, and put every site-specific value in a single labeled input block. A site that has to edit code in several places will edit it differently from the next site.

Site readiness

A site can run the package only once the following are in place. Most are conditions of joining any network study rather than steps specific to this one:

  • An OMOP CDM conversion of the site's data, on a CDM version the package supports.
  • A data quality assessment, such as the OHDSI Data Quality Dashboard and the Achilles characterization reports, so the coordinator can judge whether the database suits the question.
  • Approvals: the site's own IRB determination and any data governance sign-off its institution requires. The SemaglutideNaion protocol states that each site seeks its own IRB determination.
  • A working R environment with the HADES packages, and a confirmed connection to the CDM through DatabaseConnector.
  • The package and upload credentials, with the key file and user name issued by the study coordinator.

Approvals often take the longest, so sites start them while the package is still being finalized.

What to reuse in your own study: send candidate sites a short readiness checklist when you invite them, ask for their data quality results up front, and track each site's approval status separately from its technical setup.

Running it across the network

This stage is what makes it a network study. Every site runs the same specification against its own OMOP CDM database, and patient-level data never leave the site. Each site writes results into a per-database folder as CSV files, reviews them locally, and uploads only approved aggregate results to the coordinator, with small counts censored below the minimum cell count at the source.

Study diagnostics and their thresholds

For the estimation analyses, the protocol set a second layer of diagnostics with numeric thresholds, written in advance and applied to the executed results while blinded to the estimates. These are computed from the study's own output, so they can only be checked after execution. A database contributes to the meta-analysis only if it passes.

DiagnosticThreshold
Covariate balance (standardized mean difference)< 0.1
Empirical equipoise (preference scores between 0.3 and 0.7)> 10% of both arms
Residual bias (expected absolute systematic error, EASE)< 0.25
Meta-analysis heterogeneity< 0.4
Minimum detectable relative risk (meta-analytic)< 10

The self-controlled case series has its own gates: a pre-exposure check and a time-trend check, each requiring p above 0.05, plus the same EASE bound. Residual bias is estimated from negative controls, exposure-outcome pairs with no expected causal effect, adapted from LEGEND-T2DM through a data-driven algorithm plus expert review and used to calibrate the estimates.

Synthesis

Once results arrive, the coordinator applies these gates and runs the evidence synthesis (evidenceSynthesis.R in this package) across the databases that pass. Meta-analysis fits this study because it estimates effects. A characterization study usually reports its results database by database instead, so synthesis is a design choice rather than a required step.

What to reuse in your own study: plan the results path before recruiting sites. Decide who coordinates, how results are transferred, what the minimum cell count is, and who applies the diagnostics gates, and write those answers into the protocol rather than settling them over email later.

Interpreting and publishing the results

Results are published through the OHDSI results explorer, discussed with the workgroup and on the community calls, presented at conferences, and written up as a manuscript. Much of the manuscript's methods section can be adapted from the finalized protocol, which already describes the design, cohorts, and analysis in the shape a journal asks for, and the manuscript can cite the protocol's posted version.

This study reached the last of those stages: the findings appeared in JAMA Ophthalmology, and the repository badge moved to Results Available. A companion study on diabetic retinopathy followed from the same package.

What to reuse in your own study: agree on the manuscript target and on how site contributors will be credited before results exist, and update the repository status badge at each stage so anyone who finds the study knows where it stands.

Your research question

Choose the analytic use case that matches what you want to learn, then fill in the blanks. The question assembles below in the standard OHDSI form.

The worked example pairs an estimation question with a characterization question and a self-controlled design on the same cohorts. If your concern decomposes the same way, note the companion questions here.

Your feasibility assessment

Set your best estimate on each question from what you know now, before building anything. The questions change with the use case type you chose, and the read updates as you go.

Not set yet

    Treat this read as provisional until cohort diagnostics report counts from real data. If it comes back weak, the fix may be the question, the design, or the data sources.

    Design and study population

    Start the protocol draft at this stage. What you enter here and in the stages that follow comes across into it, and the protocol stage finalizes it.

    Name where each comparator comes from. The worked example reused its comparators from LEGEND-T2DM rather than inventing them.

    Your concept sets

    List every clinical idea your question and cohort rules mention, including the ones inside exclusions, and build a concept set for each. For every row, record the standard concept ID from ATHENA and decide the Descendants and Excluded flags deliberately.

    Start from an existing ATLAS definition

    If the concept set or cohort you want already exists, load it instead of retyping it. This reads the JSON that ATLAS shows on a concept set's Export tab, or a cohort definition's Export → JSON tab, and fills in the stages below from it.

    A cohort definition brings its concept sets, entry event, observation window, age restriction, inclusion rule names, and exit strategy. A concept set brings itself. Importing adds to what you have; it does not erase your existing entries.

    Building these in ATLAS

    1. Open Search, find each concept, and filter to Standard Concept: Standard.
    2. Tick the concepts and click Add to Concept Set.
    3. On Concept Set Expression, set the Descendants and Exclude flags to match what you entered above.
    4. Read the Included Concepts tab before using the set anywhere.

    Or skip the clicking: export what you entered above in ATLAS's own JSON format and paste it in.

    Both routes live on the Import tab of a concept set. The JSON sub-tab brings your Descendants and Exclude flags across; the Concept Identifiers sub-tab takes a plain comma-separated list and has ATLAS look up each concept itself, which is the more forgiving route if a paste ever errors.

    Vocabulary verification

    Work through this for each concept set above, in ATHENA or against a downloaded vocabulary:

    The generator below writes the resolve query for each of your concept sets, using the included and excluded IDs you entered above. Run it against CONCEPT and CONCEPT_ANCESTOR from the ATHENA download (an account is required, and CPT4 needs a UMLS API key during download).

    Your cohort logic and time-at-risk

    Define the target cohort's anatomy the way the worked example does: entry, restrictions, inclusion rules, exit, and then the time-at-risk anchored to it. Repeat mentally for each comparator; if only the concept sets rotate, you have designed it well.

    Inclusion rules

    Name each rule and state its logic with its window, e.g., "Prior metformin: era of 90+ days starting up to 90 days before entry, or 3+ exposures ever". If a rule is a proxy, name it as a proxy.

    Cohort exit

    Time-at-risk and windows

    The washout is the continuous observation field above, and the lookbacks sit inside your inclusion rules. The time-at-risk is entered in the analysis specification rather than the cohort definition, so the ATLAS export below does not include it. Record it here so the protocol states it, and check that an on-treatment end matches the exit you chose above.

    Building this cohort in ATLAS

    1. Cohort Definitions → New Cohort Definition.
    2. Add Initial Event, choose the domain you picked above, and point it at your entry concept set.
    3. Set the prior continuous observation days and the earliest-event limit to match your entries.
    4. Add one inclusion criteria per rule you named, then build each rule's logic with the criteria and attribute pickers.
    5. Set Cohort Exit to match your choice above, then save and Generate.

    The export below writes your entries as an ATLAS cohort definition you can load directly.

    Before you load it. The import path for cohorts is the Export tab's JSON sub-tab: paste there and click Reload, since cohorts have no Import button. Note also that this export is a scaffold, not a finished definition. Your entry event, observation window, age restriction, and exit strategy are translated in full, but inclusion rules come across as named, empty rules, because this form holds them as prose rather than as structured criteria. Open each one in ATLAS and build its logic there.
    If you imported a definition, do not send this export back over the original. Importing keeps each inclusion rule's name but not its underlying criteria, so exporting again would give you a cohort whose rules look right and do nothing. Treat an imported cohort as a starting point for a new definition, and keep editing the original in ATLAS.

    Your cohort diagnostics

    Once your cohorts exist, check that the definitions behave as intended before anything is finalized. CohortDiagnostics gives evidence for review rather than a pass or fail verdict, so read it and record what you changed.

    Problems in concept sets and problems in cohort logic both show up here. Go back to whichever stage the fix belongs in, then run diagnostics again.

    Finalize your protocol

    Your protocol draft started at the design stage. Fill in the sections that the stages above do not already cover; everything you entered comes across into the export.

    Protocol checklist

    Export your work in either shape. The plan export brings every stage exactly as entered. The protocol draft arranges the same entries into the standard OHDSI protocol sections and inserts template methods language matched to the designs you ticked at the design stage, such as large-scale propensity score and negative control language for a comparative cohort; the template paragraphs are shaded, so review and edit them before sharing. The Word download can go straight into an IRB submission or an email, and the print option produces a PDF through your browser's Save as PDF.

    Finalize and test your study package

    The package is what other sites run. A preliminary version already runs cohort diagnostics at other sites; this stage finalizes and tests it. Start from the OHDSI EmptyStudyRepository template so your repository matches what people expect.

    Sites may raise this to meet their own censoring rules.

    Package checklist

    Test it before anyone else runs it

    Site readiness

    List the sites you expect to join, then track what each needs before it can run the package. Most of these are conditions of joining any network study rather than steps specific to yours.

    Readiness checklist

    Running it across the network

    Every site runs the same package against its own CDM. Patient-level data stay at the site, and only approved aggregate results come back.

    Execution checklist

    Interpreting and publishing your results

    Publication checklist

    The worked example reproduces design elements from Estimating the risk of NAION and diabetic retinopathy progression associated with semaglutide exposure (version 1), the OHDSI network study protocol by Cindy X. Cai, Michelle Hribar, and the OHDSI Eye Care and Vision Research Workgroup, posted at ohdsi-studies.github.io/SemaglutideNaion with results published in JAMA Ophthalmology (2025). Concept IDs, windows, and thresholds are quoted as recorded in that protocol, accessed August 2026; verify anything you reuse against the live protocol and ATHENA. The analytic use case structure is adapted from the OHDSI Save Our Sisyphus Challenge and the Book of OHDSI. This planner is an educational scaffold, not a substitute for protocol review, phenotype validation, or IRB approval.