How to determine whether a drug is brand or generics?

Here is one potential way
http://athena.ohdsi.org/search-terms/terms?domain=Drug&standardConcept=Standard&vocabulary=RxNorm&conceptClass=Branded+Drug&conceptClass=Branded+Drug+Comp&conceptClass=Branded+Drug+Form&conceptClass=Branded+Pack&conceptClass=Quant+Branded+Drug&page=1&pageSize=15&query=