An amniocentesis is performed to obtain amniotic fluid for prenatal genetic studies, testing for fetal infections, or assessing lung maturity. The patient must sign an informed consent form at least 24 hours before the procedure. Ideal gestational age is 16 weeks or later. Ultrasound is used to visualize the fetus and guide insertion of a needle through the abdominal wall and into the amniotic sac to withdraw amniotic fluid samples.