A husband who was exposed to the coronavirus hid that he was feeling ill so he could visit his wife in the maternity unit of an upstate New York hospital.

The man told the truth only after his wife also began showing symptoms. UR Medicine said Monday it will begin taking the temperature of visitors to its hospitals' maternity units.

"It was purely an honor system before," spokesman Chip Partner told the Democrat and Chronicle, which first reported the incident. "Now we're adding the temperature check."

The man, who has not been identified, went to Strong Memorial Hospital in Rochester so he could be with his wife when she gave birth. He was questioned by staff at the hospital and told them he was in good health and had not been exposed to the coronavirus.

Partner told the Democrat and Chronicle that shortly after giving birth the woman began showing symptoms.

"That’s when the significant other admitted his potential exposure and that he was feeling symptomatic," he said.

Strong Memorial Hospital in Rochester, N.Y. Google Maps

UR Medicine can't say whether the mother, father or newborn child were infected with the coronavirus because of privacy laws.

Barbara Ficarra, a spokesperson for UR Medicine, told NBC News that a nurse who assisted the family was tested for the virus and the results came back negative. The mother has since returned home, Ficarra said.

Many hospitals in New York are banning most visitors to help in slowing the spread of COVID-19, the disease caused by the virus.

UR Medicine said in a message on its website that the only exceptions are parents of a child in the hospital and a partner, spouse or doula visiting a patient in the maternity unit. Once they arrive to the unit, the guest "will be screened for symptoms, including temperature," the message reads.

"Those with symptoms will be asked to leave the hospital. These screening measures will be completed twice daily throughout the hospitalization," the message states, adding that the guest will not be allowed to leave the patient's room without the patient.

Also on Monday, UR Medicine announced that all doctors, staff and visitors are required to wear masks while in public, clinical areas. The Democrat and Chronicle reported that requiring the use of masks in public areas is not related to the incident at Strong Memorial Hospital.