A man accused of attempted murder was shot by police while in custody at a Thousand Oaks hospital, authorities say.