A medical office building and surgical center in Bridgewater has changed hands for $7 million, following a transaction arranged by Weichert Commercial Brokerage.