The multiyear effort comes as Merck prepares to offset revenue losses from the upcoming patent expiration of its blockbuster cancer drug Keytruda.