Pre-heat the oven to 200 degrees. Roll out the pastry on a lightly floured surface to 1cm thick and cut a large round of pastry slightly larger than the fluted flan tin. Line the flan case using the pastry, pressing in well and prick the base. Trim any overhanging pastry and chill for 10 minutes.
Line the pastry case with baking parchment and fill with baking beans. Bake in the oven on a baking sheet for 15 minutes until golden at the edges. Remove the parchment and beans at this point, brush the base with the beaten egg and return to the oven to allow the base to cook and brown for 5 minutes. Remove from the oven and cool on a wire rack.
Reduce the oven to 170 degrees. Prepare the filling by whisking together the milk and crème fraîche. Whisk in the 3 beaten eggs and season well with salt and pepper. Add the smoked paprika and whisk well to incorporate. Arrange the ham (reserving a few strips for the garnish) and cherry tomatoes in the base of the pastry and pour the filling over the top.
Sprinkle the Gruyere on top and bake in the oven on a baking sheet for 25 minutes until set and golden. Remove and serve immediately in wedges with the reserved ham on top.
For top tips on protecting you and your family when preparing raw meat and poultry, visit Food safety in the home and view the full Food safety at home video.