Usually a way to tackle this problem is to try different context window sizes and use the one that gives the highest validation performance.
this method cannot be easily applied to our task, because different medical events like medication, diagnosis or adverse drug reaction require different context window sizes.