Let's answer your question as you pose it. Unique occurrences occur once only; that's what the word means. So, each unique value occurs once, and you don't need a program to calculate 1 as an answer. You might want to know which results histories occur just once, and those are identifiable by an indicator variable
bysort resultshistory : gen unique = _N == 1
Now let's suppose that you didn't mean what you said. I advised in an earlier answer reading
On distinct observations (and why the word "unique" is misleading): http://www.stata-journal.com/sjpdf.html?articlenum=dm0042
As that's a review of the entire question, with details on various commands to be used, I'll stop there.
Your various questions are good at showing what code you have before you have a question, but you don't always show code that is an attempt to answer your question. Nor do you show explicitly that you are looking at documentation, including StataCorp FAQs and accessible material in the Stata Journal, so although I am trying to help you, I am also going to downvote you as not showing attempted code solutions and not showing research effort.