Repeated measures to predict binary outcome

#1
I would like to predict outcome of an event based on repeated measures. The problem is the following one:

I have 100 patients with measures of a certain feature at different times, but all the patients do not have the same number of measures.

Le7zT.png

The test data has been taken before knowing the outcome and the aim of this work is to predict outcome based on this measures.
I have tried with MATLAB using fitrm which fits the data to a repeated measures model, but my problem is how to define the within subject-factors for not constant number of measures for each patient.
How can I do this?
 
#2
First, let me tell you about a predictive model that's being used at my hospital. It has 80 factors of which many are lab values, but never does a patient get all 80 variables measured. The work around was turn all 80 variables into binary outcomes based on a threshold, and if the value was not measured it was placed into a default. Example: Glucose, if a patient has a Glucose level over 250 mmol/L then you assign it a value of 1, but if they have not had that test taken in the past 24 hours or it is less than 250 mmol/L then the value is 0.

If you can get some clinical reasoning for setting thresholds on your 4, then you could take this approach. As for setting the default, I would recommend it being what ever the majority of the population falls into. Again for the glucose, an over whelming majority of patients have a glucose under 250 mmol/L, thus the default is being grouped with these people. The idea is saying, "I will assume you have normal values until a measure tells me otherwise". Hope this at least helps you create some ideas