I haven't worked on these designs, but I remember the methodologist that taught me this in grad school giving us a lecture about this.
EDIT: the BMJ article (laudably) provides access to the analyis code, although I won't have time to review it:
github.com/nilskruger/Tirzepatide-and-the-Risk-of-Atherosclerotic-Cardiovascular-Events