The gender of a baby is determined by the combination of chromosomes from both parents. The father's health has no direct influence on the baby's gender. The doctor can determine the baby's gender through prenatal testing, such as ultrasound or genetic testing. These tests analyze the baby's DNA and can accurately determine whether it is a boy or girl. However, it is important to note that determining gender through these tests is optional and not necessary for everyone.