Causal estimation of time‐varying treatment effects in observational studies: Application to depressive disorder | Synapse