Went to the ER about a stabbing pain in my left rib and shoulder as well as flank pain. My stomach aparently isnt emptying at all! What causes this?

Gastroparesis. Gastroparesis is commonly caused by diabetes, but can have a multitude of other causes. I would recommend going to see a gastroenterologist. .