The gunman, who received treatment at the hospital earlier, is believed to have had a gripe with some of the health care workers, authorities said.