Medicine was once the realm of the dying. War and disease ravaged human bodies, and many medical procedures came with the risk of death.

Thanks to countless physicians, nurses, scientists and their patients, though, medical progress marched on.

And photographers documented that history in fascinating detail.

For surgeon and historian Stanley B. Burns, collecting images of medical history became almost of an obsession. Now, over 15,000 of the images in his enormous collection will be housed at Yale University’s Harvey Cushing/John Hay Whitney Medical Library.

The photographs, which date from 1839 to the 1970s, document the sloppy, uplifting and gruesome history of medicine and how it intersects with human lives.

In the 1830s and 1840s, American medicine was a kind of free-for-all. Science hadn’t yet equipped physicians with the tools they needed to effectively treat most patients, and doctors were widely seen as incompetent. “Irregulars” — practitioners of alternative practices such as homeopathy and herbalism — gained in popularity, and most states abolished their medical licensing requirements.

By the 1970s, medicine, long since professionalized, was on the march thanks to emerging technologies such as the CT scan, and more Americans than ever had access to medical care thanks to insurance programs such as Medicare and Medicaid.

Burns’s collection, which encompasses a wide range of medical subjects and formats, shows that progression. As one of the nation’s foremost medical history experts, he amassed over a million photographs depicting what he calls “the darker side of life”: disaster, disease and death, all through a medical lens.

“The collection both celebrates the evolution of medicine and bears witness to untold human pain and loss,” Yale wrote in a news release.

The university’s archival staff is processing Burns’s collection and will digitize some of the photographs. Burns also endowed a library fellowship to support scholars who do research using the collection.