The top of the tomatoes remaining yellow is a physiological disorder called Yellow Shoulders. This is usually the results of high heat which causing the lycopene not to form.
Sometimes it is cause by the fruit itself being exposed to too much sun.
We see this more if the plants are weak. Keep your plants healthy and well-watered. Use a slow release organic fertilizer that is low in nitrogen and has a good amount of potassium.
The yellow shoulder parts are still fine to eat, but may not be as flavorful.