As far as I know , You can do that , if you go to Tarh office in the health ministry in the sharhrak, pay the rest of you Tarh in full cash... , they deduct the time you worked or have been in the Tarh, then will say to you how much you need to pay for the rest of it
Keep in mind: there is no expression such as " Kharid e Tarh" in the health ministry; so you can ask your request by this mean: I am going to pay " Vadi e" for the rest of my Tarh and continue my study shortly somewhere abroad..
.