Need advice

Nicole • Carried my baby girl for 38 weeks had a csection and got to meet her on 12/23/2015 happy FTM 💜💚💙🎀
Hi ladies so I'm 36weeks and 1day I went into the doctors today and got a ultrasound I'm caring a lot of fluid and they said at 37 weeks they can do a test where they insert a needle to and draw some fluid from around the baby to see if her lungs are developed enough and it's a 50/50 chance that they are or there not. I have gestational diabetes and they said if her lunches aren't developed they won't induce but I'm extremely uncomfortable and the Braxton hicks I get are so bad. My ankles have been swollen for 3 days now but I can't seem to stay off my feet because I can't get comfortable. Well anyway has anyone had this test where they go in and test the fluid to check there baby's lungs?? How invasive is it?? And does it hurt??