We have a similar discussion going in a Janeway thread right now, but I'm all about consistency. So, I'll say here what I basically said there.
The EMH was a simulation designed to learn and then appropriately react. However, everything he did was a result of his programming. In any instance, you could print out his schematics and see the exact computations to show why he did what he did.
He was programmed to seem real, to show emotions, to be as realistic as possible. But, realism, no matter how good the programming, does not a real person make.
Don't get me wrong, I like the Doc. I thought he was an interesting character, but I was never thrilled that a program was given permission to program itself.
Like a storybook character or a simulation on the holodeck, the Doc was as real as the Voyager crew wanted to allow him to be.
What was that line he fed Janeway? Something like, 'Photons and force fields, flesh and blood... what does it matter as long as your feelings are real?'