Is the Cox Model correct in this case?

#1
Dear all, thanks for the help in advance, this is my issue:

I am studying whether skipping a scheduled medical examination (which is every 4 weeks for everybody in the cohort) increases the risk myocardial infarction (MI) and whether time when you skip it (earlier during the follow up or later) has an impact on when the MI occurs.
Without taking in consideration all the covariates (i.e. gender age etc) that do not change within time in attachment there is a file excel with an example of what my data look like.

My question is: is this the way to correctly manipulate my dataset? and does cox address for this specific case of time varying covariate?

Thanks in adavance


p.s. in case the patients did not experience either a medical examination skipped or a MI I used the date of the last medical examination for them
 
#2
My question is: is this the way to correctly manipulate my dataset? and does cox address for this specific case of time varying covariate?
This is a tough question for me. I think the answer depends on the software you use. SAS is what I am most familiar with and I know it can handle time-dependent variables when analyzing time-to-event data via a Cox model. If I were to do it in SAS, I believe I would need it set up so that there was 1 line per patient. And I would be looking at a time-dependent variable that was initially set to no, not missing, at time 0 and changes to yes, missing examination, at the first 4-week examination missing, if ever. To do that in SAS, I would need to compare the event time with the missing examination time-point and so would need to have all the data on one line. Note that this method only considers what happens when people miss any examination and uses their first time missing as the time-point in which to change the time-dependent variable, i.e. it does not change back to no=not missing in the event that the patient does show up for his/her next 4-week exam after missing the previous 1 (or 2 or 3 etc...). That would be much more complicated.