Take them out onto a plate. To the same oil, add the chopped ham and the mushrooms, drained of their liquid.
Fry briefly and mix with the potatoes. Stir, pour into an oven dish, sprinkle with grated cheese on top and bake until it melts.
Serve warm with vegetables.