Movie that tricks your brain the whole time

I’m trying to remember a movie about a father who accidentally killed his wife and daughter, but he was hallucinating the whole time and didn’t know he killed them. Most of the movie takes place in a hospital and they only reveal at the end that he killed his family. I’m pretty sure i watched it on Netflix. Thanks for any help!