Interest on a loan used to purchase a property is an allowable expense and would be offset against rental income whether you are still a partner or not. This applies to any individual owning a second property which they rent out (to the practice in this case) and on which they pay interest.
What you will lose by continuing to hold an investment in the surgery premises after retirement is entrepreneur's relief from capital gains tax.
If you were selling your share when you retired you would qualify for entrepreneur's relief, which would reduce the capital gains tax from 18 to 10 per cent.
This is only available for business assets, and as your share of the property will become a non-business asset once you retire, you will not be able to claim this.