You had an amniocentesis. This is a prenatal test. It helps you learn whether a fetus has certain genetic conditions. It can also help find certain neural tube defects, check for an infection of the amniotic fluid, or check the fetus's lung development. The test is most often done between the 15th and 20th week of pregnancy.