Define "safely". If you write code for a hospital that handles this case poorly, when a premature infant is found abandoned in a toilet, you might end up debugging from the ER.
Define "poorly". Hospitals I've worked with just tend to put in codes for unnamed babies (such as "NBM", "NBF", surname if known, etc.) for the name fields of legacy programs. If you over-heavily relied on the names in the first case, you'd have a big problem with multiple baby John Smiths in the maternity ward.
John/Jane Doe
No, they call them Baby Boy, and Baby Girl - it even goes on the birth certificate.