Very little recovery is possible unless we separate urine streams at their source. Once mixed with the rest of the wastewater very little N is recoverable as has to go through the process and gets recovered in the sludge stage as struvite, etc. Phosphorus, OTOH, is more recoverable per unit.
Take a look at (PDF on Google): Nitrogen Recovery from Wastewater: Possibilities, Competition with Other Resources, and Adaptation Pathways
Jan Peter van der Hoek 1,2,* , Rogier Duijff 1 and Otto Reinstra 2
The most promising mature technologies that can be incorporated into existing wastewater treatment plants include struvite precipitation, the treatment of digester reject water by air stripping, vacuum membrane filtration, hydrophobic membrane filtration, and treatment of air from thermal sludge drying, resulting respectively in 1.1%, 24%, 75%, 75%, and 2.1% nitrogen recovery for the specific case wastewater treatment plant Amsterdam-West.
The effects on sustainability were limited. Higher nitrogen recovery (60%) could be realized by separate urine collection, but this requires a completely new infrastructure for wastewater
collection and treatment.
I suspect most of the pharmaceuticals in sewage have a pretty short half life in that environment. Maybe the biggest problem would be the antibiotics that could impact beneficial bacteria in the soils. Not sure how long those survive in a composting situation where the temperatures get up to 170F.