For primary Dx Pelvic mass, you can go with 789.39, but do consider 789.33 / 789.34 based on the documentation and female pelvic Sx provided. I would think of 789.33 as the salpingo-oophorectomy Px was performed on right side to remove the pelvic mass. That would be more specific diagnosis code. The secondary Dx could be 614.6 for female pelvic adhesions.
As far as the CPT code is concerned, I second Alex Wills. Only 58720 can be coded, because of the CCI edits. The reason is, laparotomy and pelvic adhesion lysis are part of the open salpingo-oophorectomy procedure. You can add modifier 22 to 58720, but in that case you need to submit the OP notes or a written explanation along with the claim to emphasize why the physician took unusually more time or why the Sx was difficult to perform.