There was a study, and the author's name escapes me now, but what they looked at was folks who came into an addiction treatment facility. They used a scale called the "brief severity index" and they looked at different types of psychiatric symptoms such as depression, anxiety, and paranoia, which they called "psychoticism".
They found that of everybody who came into this addiction treatment facility, 39% of them had psychiatric symptoms. However, after one month in sobriety that dropped 13-fold to 3%, and that 3% held steady six months out. This is what's recommended in the DSM, which I mentioned earlier. That is, you should wait a month into sobriety before diagnosing a psychiatric illness.
To answer your question, if someone is currently using substances and they don't have a month of sobriety and you don't have a longitudinal history of clinical records, it's very difficult to make a psychiatric diagnosis before they've had that time in sobriety.