Bacterial antigen detection can be performed in a number of ways and by using either a sample of urine or even serum. Ideally, the bacterial antigen tests are done on some kind of exudates like pus to find out exactly which types of bacteria are infecting the individual. Bacterial antigen detection in urine is therefore done to identify the type of bacteria present in the urine. Since urine is quite sterile normally, bacteria in the urine indicate a urinary tract infection. Antigens are proteins that are on the surface of any pathogenic entity - except prions, which are proteins themselves. When an antibody latches on to the antibody, the antigen can then be identified as a known antigen. This is the exact same process that goes on in the body as well, where infections are kept at bay when they are detected by antibodies and destroyed before they do any cellular damage.
An antigen test for bacterial content in urine is done to prove the presence of an infection in the uterine organs. This includes confirming a case of cystitis or pyelonephritis. Cystitis is a case of the urinary bladder getting infected - mostly by the E.Coli bacteria that is normally located in the human gut. Pyelonephritis is an infection of the kidneys. This is a dangerous situation that guarantees a stay in the intensive care unit and results from not treating a case of cystitis.
When it comes to testing for cystitis, a urinalysis is the first step to detect the presence of leukocytes or white blood cells in the urine. The test for specific bacteria like E.Coli can then be done by taking a culture sample or using a test like ELISA. This is a test that is usually done to identify viruses by in principle can be used for any antigen test. It is done taking the sample and washing it with antibodies and then using an enzyme to bind the antibodies, which then creates an electrical signal that can be picked up.
There is preparation that is required for this test though it is advisable that you fill your bladder before coming for this test. Ensure that you do not drink too much water just for this test as the concentrations of bacteria in the sample could be low. Try and achieve as natural a sample as possible.