A cancer patient opened fire inside a Manhattan hospital on Thursday night before barricading himself in a bathroom for several hours, sources and police said.