On July 10, my wife gave birth to a seemingly healthy baby boy with slate-blue eyes and peach-fuzz hair. The pregnancy was without complications. The delivery itself lasted all of 12 minutes. After a couple of days at Greenwich Hospital in Connecticut, we were packing up when a pediatric cardiologist came into the room.

We would not be going home, she told us. Our son had a narrowing of the aorta and would have to be transferred to the neonatal intensive care unit at NewYork-Presbyterian Hospital at Columbia, where he would need heart surgery.

It turned out that our son was among the first in Connecticut whose lives may have been saved by a new state law that requires all newborns to be screened for congenital heart defects.

It was just by chance that we were in Connecticut to begin with. We live in New York, where such tests will not be required until next year. But our doctors were affiliated with a hospital just over the border, where the law took effect Jan. 1.

More Resources: Which States Require This Screening? American Academy of Pediatrics legislation tracker Newborn Foundation screening progress map

As we later learned, congenital heart problems are the most common type of birth defect in the United States. The Centers for Disease Control and Prevention estimate that about one in 555 newborns have a critical congenital heart defect that usually requires surgery in the first year of life.

Many cases are caught in prenatal ultrasounds or routine newborn exams. But as many as 1,500 babies leave American hospitals each year with undetected critical congenital heart defects, the C.D.C. has estimated.

Typically, these babies turn blue and struggle to breathe within the first few weeks of life. They are taken to hospitals, often in poor condition, making it harder to operate on them. By then, they may have suffered significant damage to the heart or brain. Researchers estimate that dozens of babies die each year because of undiagnosed heart problems.

The new screening is recommended by the United States Department of Health and Human Services, the American Heart Association and the American Academy of Pediatrics. Yet more than a dozen states — including populous ones like Massachusetts, Pennsylvania, Florida, Georgia, Wisconsin and Washington — do not yet require it.

The patchy adoption of the heart screening, known as the pulse oximetry test, highlights larger questions about public health and why good ideas in medicine take so long to spread and when we should legislate clinical practice.

Newborns are already screened for hearing loss and dozens of disorders using blood drawn from the heel. The heart test is even less invasive: light sensors attached to the hand and foot measure oxygen levels in the baby’s blood. This can cost as little as 52 cents per child.

Our son’s heart defect was a coarctation of the aorta, a narrowing of the body’s largest artery. This made it difficult for blood to reach the lower part of his body, which meant that the left side of his heart had to pump harder.

In the hospital, though, he appeared completely healthy and normal because of an extra vessel that newborns have to help blood flow in utero. But that vessel closes shortly after birth, sometimes revealing hidden heart problems only after parents bring their babies home.

Depending on the heart defect, the onset of symptoms can be sudden.

This is what happened to Samantha Lyn Stone, who was born in Suffern, N.Y., in 2002. A photograph taken the day before she died shows a wide-eyed baby girl lying next to a stuffed giraffe. The next morning, her mother, Patti, told me, she was wiping Samantha’s face when she heard a gurgle from the baby’s chest.

Before her eyes, Samantha was turning blue. Blood began to spill from her mouth. Ms. Stone dialed 911, and minutes later, a doctor who heard the call over a radio was there performing CPR. Samantha went to one hospital and was flown to another.

But the damage was irreparable. Samantha had gone 45 minutes without oxygen: She lapsed into a coma and died six days later.

It wasn’t until several years later that Ms. Stone learned about the pulse oximetry test. “This could have saved my daughter,” she told me. “There is no parent that should ever have to go through what I went through.”

Pulse oximetry is not a costly, exotic procedure. Most hospitals already have oximeters and use them to monitor infants who suffer complications. You can buy one at Walmart for $29.88.

A recent study in New Jersey, the first state to implement the screening, estimated that the test cost $13.50 in equipment costs and nursing time. If hospitals use reusable sensors similar to those found on blood-pressure cuffs, the test could cost roughly fifty cents.

As medical technology advances, few screenings will be so cheap or simple. Recent years have seen controversy over prostate cancer and mammography screenings. Medical ethicists have to weigh the costs of each program and the agony caused by a false positive against the lives saved.

But with pulse oximetry, the false positive rate is less than 0.2 percent — lower than is seen for screenings newborns already get. The follow-up test is usually a noninvasive echocardiogram, or an ultrasound of the heart. A federal advisory committee came down in favor — three years ago.

“There’s really no question, scientifically, this is a good idea,” said Darshak Sanghavi, a pediatric cardiologist and a fellow at the Brookings Institution. “The issue is, how do we change culture?”

Opposition has taken two forms. One is from doctors who believe policy makers shouldn’t interfere with how medical professionals do their jobs. The other is from smaller hospitals, which worry about access to echocardiograms and the costs of unnecessary transfers.

These concerns can be addressed fairly easily. Nurses in New Jersey and elsewhere have been able to work the test into their normal routines. A rural hospital should already have a protocol to transfer a newborn in serious condition. If Alaska can do it, less remote states can, too.

But this is not simply a rural health care problem. Cardiologists and neonatologists I’ve spoken with said they knew of hospitals in New York City, Boston and metropolitan Atlanta that weren’t screening newborns for heart defects.

“It’s completely the luck of the draw of where you deliver,” said Annamarie Saarinen, who has pushed for the screening since her daughter narrowly avoided leaving the hospital with an undetected heart defect.

Fortunately, our son’s condition was also caught and corrected. The only lasting effects are a three-inch scar on his side and checkups with a cardiologist. He will live a normal life. He will be able to play sports and climb things he’s not supposed to.

Shouldn’t every baby have that chance?