Usually they will do a full anatomy scan about 20 weeks which will be able to tell the doctors how things are going. That is also the time you can find out the sex of the baby if you'd like.
During pregnancy they can usually tell if something is wrong during an ultrasound. After birth they can do testing.