I look at Latent Image as the real "birth" of sentience in the EMH. He has a problem that software engineers CAN'T program away. LI was his Koybayashi Maru and he failed.
Remember what Kirk said to Savik...
A no-win situation is a possibility every commander may face. Has that never occurred to you?
No sir. It has not.
How we deal with death is at least as important as how we deal with life, wouldn't you say?
Of course there can be two situations with equal probability of survival/death.
How one chooses and how well one deals with the choice is the stuff of great literature and personal growth.