A sentenced prisoner who groped the buttocks of a nurse who was trying to administer him medication has avoided extra jail time.