Pavlos- your diagrams are really helpful. Is this a situation that highlights the difference between confounding “in expectation” and confounding “in measure” Counfounding and effect modification “in expectation” versus “in measure” (?) Since there is no human involvement in the post-randomization exclusion process described in the original post, we would have no reason to expect that baseline patient covariates would be associated with exposure, yet we might observe/notice, following randomization that certain covariates ended up being associated (statistically) with exposure…
I have never been involved in designing an RCT and have no idea how an EMR system might be involved in randomizing patients in a pragmatic trial. I assume that the EMR could be used initially to identify a pool of potentially eligible patients based on the inclusion criteria (e.g., identify patients with the disease in question). But why couldn’t the EMR then be used to identify exclusion criteria among those in the initial pool, thereby generating a “final” pool of patients who will subsequently be randomized? Wouldn’t this process circumvent the concerns about confounding you are describing?