Thyroid problems and abnormal levels of FSH, LH, prolactin, androgen hormones or male hormones
and estrogen hormones can be the cause
and hence get this tested. If there is pain on right side, then possibility of gut disorders like colitis, IBS, kidney stones etc should be looked into. The pain can also be due to adhesions formed post surgery.
I think you should discuss these possibilities with your doctor. It is difficult to comment beyond this without examining.