Haha, yeah, I think if they'd go as far to assume all women there (or all women past 30) have kids it would be pretty easy to assume any Doctor is a man.
Also slight nitpick of the title: if(gender == "female" && married && age >= 30) would work just as well. But the use of strings for the gender field is excellent practice! Not only for non-binary gender(s) but also for "unknown" and any other edge cases.