I imagine it was one of the hospital staff who was given the title in case something needed to be investigated. Not someone whose sole job was detective.
When I worked for the Geek Squad in a function that was barely more than retail, my title was “Counter Intelligence Agent.” It was kind of a funny pun because I mostly worked at the counter but other than that it seemed a bit … Inflated.