Maybe accidently but I don't think it was the shooters intent to harm aanyone but himself. Several shots from a shot gun inside a hospital, wouldn't have been difficult to hit someone if he were really trying.
He wanted the cops to come and kill him. Makes me wonder if he had moral qualms about killing himself, which in effect is what he did anyway, he just used a cop as his weapon to do it with.
OPINION: Serious suiciders can and often are homiciders if interfered with.
(Note: This is a separate issue than suicide bombers whom always have a homicidal intent.)