Cut one slice off one onion; set aside for topping. Chop remaining onions. On a large skillet, melt butter. Saute ham and chopped onions until onions are tender. Add mushrooms; saute for 2 minutes. Stir in flour until blended; cook 1 minute longer. Remove from the heat.
In a small bowl, beat the egg yolks, cream, salt and pepper. Stir into ham mixture. Pour into pastry shell. Sprinkle with cheese. Separate reserved onion slice into rings; place in center of tart. Bake at 375° for 25-30 minutes or until top begins to brown and a knife inserted in the center comes out clean.