Lower Right Rib Pain

when im sleeping on my right side, i experience severe pain from my shoulder to my right rib and it goes on to the rightest part of my hip bone. it gets severe in the night and even i cant sit for longer pressurising my right hip, when i get up i feel severe pain in my hip bone and unable to walk for properly for a few minutes. through various online searches, i came to know it might be my gallbladder or liver but im not sure of course. im experiencing these night traumas after my last miscarriage, which caused an egg size cyst also, been 3 months by now im taking vitamins and minerals to let the cyst dissolve itself as per my gynaecologist. could any doctor please tell me what it possibly could be? does it could be something serious?

dr-nouman-anjum-internal-medicine-lahore

Get an ultrasound abdomen done minimum 2-4 hours fasting (to rule out gallstones)
Get your vitamin d levels and uric acid done and in meanwhile visit any good medical specialist around you to get yourself examined may be it can be simply a muscular spasm...!

And if ultrasound indicates gallbladder stones visit any general/laproscopic surgeon