Assuming you just started residency last month, you need to talk to your PD about what your options may be. In general, taking a LOA for a few months is doable depending on the program and situation. Taking a full 1 or 2 years off is more problematic and your PD is not likely to guarantee you a spot in 2 years after a mere month of internship, BUT if you talk to them, you can see if you have options.