How can a doctor tell the difference between a coma and a fugue state?

Consciousness. Coma implies absence of response to pain and usually other noxious externally administered stimuli. Fugue state (which is different than catatonia) involves an amnestic conscious state similar to an alcoholic blackout in which behavior may appear purposeful but not be remembered subsequently.