Session 6: Recap + GiBleed Example in Eunomia
Last session’s core model:
execute(): runs module pipeline in orderWe will mirror the “Creating Analysis Specification” workflow:
It keeps design and execution separate:
For the class example, we use Strategus test assets built around the GI bleed question.
Cohorts.csv + SQL cohort definitions (JSON optional)These become sharedResources in the specification.
Example framing in the guidance:
This gives us concrete IDs and module-ready assets.
Strategus modules use R6, R’s object-oriented class system. If you haven’t seen this before, a few things to know:
$new() instead of calling a plain function$ (like a named list)This is different from most R code but the pattern is always the same.
You never need to define your own R6 classes. Just use the ones Strategus provides.
For each module:
$new()$createModuleSpecifications(...) to build settingsEvery createModuleSpecifications() call has defaults. Inspect them before accepting:
For your assignment, you must list all parameters explicitly and annotate which are defaults vs overrides.
See the Strategus reference docs and underlying HADES package docs (CohortDiagnostics, CohortIncidence, Characterization).
This aligns directly with Part 1 assignment scope.
We include:
We also add:
Composition order in code:
ParallelLogger::saveSettingsToJson()For this course workflow, negative controls are optional and not required.
Main design output:
inst/settings/studyAnalysisSpecification.jsonThis is the primary object you submit for design readiness.
After the analysis specification is built:
execute()For assignment work, execution is optional; specification quality is required.
modules/06_strategus-gibleed-demo/strategus-gibleed-demo.R
Run in sections and inspect each object as it is created.
Please note that I created a project file in this directory, so you should open the project to run this code to ensure relative paths are correct.
Open directly with:
strategus-gibleed-demo.Rproj (RStudio) orstrategus-gibleed-demo.code-workspace (VS Code/Positron)Use this translation:
Before submission, verify:
Do not use GiBleed for your assignment submission. Choose a different Eunomia dataset (i.e., MIMIC or Synthea) or your own study cohort definitions.