If X is the number of individuals that have the studied property (e.g. positive events) in a n size sample, then X follows a binomial law, B(n,pi).
There are several confidence intervals for pi. The approximation of the binomial law by the normal law can be used to determine one confidence interval. This is all the more valid since n*pi and n(1-pi) are big.
The exact confidence interval with coverage probability 1-alpha, can be determined using the repartition function of the binomial law.
Here, alpha is set to 0.05.
Daudin J-J., Robin S. and Vuillet C., 2001. Statistique inférentielle, idées, démarches, exemples.Société Française de Statistique et Presses Universitaires Rennes. 185p.