You are probably using ‘earliest event per person’, which is setting the cohort entry event to the first visit, and exits at end of observation. So, change your cohort to be ‘all events per person’, and then specify a duration of the entry event (something like ends 0 days after the event end date, the event being visits).
If you are sayign that you want a person to enter the cohort when they have a drug after the visit to the cardiology specialist, then make your entry event the drug, make an inclusion rule saying that there’s a prior visit with the specialist, and then make your cohort exit either at end of continuous observation, or after a fixed duration of time. Without knowing more about what youre cohort represents (remember: cohorts aren’t yes/no for people, cohorts are ‘when yes’).
-Chris