A chaotic, rocky upbringing in Western Canada may have been exactly what Kirsten Johnson needed. It taught her to problem-solve and to be resilient — instincts that would carry her into some of the most unpredictable places on earth. She’s now known as a doctor who leads missions in war zones and disaster areas, but in this excerpt from her memoir “Humanitarienne: A Doctor’s Stories from the Conflict Zone,” she’s still a student, doing an elective at Lima’s Cayetano Heredia Hospital — coming face to face with stark inequities in care, and, suddenly, a strange version of glamour.

During the six weeks I was in Peru, I saw pathologies that were shocking, strange, and wonderful. One of them was caused by the parasite Dibothriocephalus pacificus, which lives in the intestines of Peru’s coastal sea lions and can migrate to humans. It does so without having fully adapted its scolex — the small headlike part with hooks and suckers that normally latches onto the intestine and lets the worm feed. In a massive sea lion, this structure works perfectly, and the worm can grow to enormous lengths. But in the smaller human intestine, the scolex doesn’t grip properly, so the worm eventually slips out, either because of its size or its poorly fitted “anchor.” Sometimes I saw worms up to 25 feet slip out of people’s backsides; other times, I had to help evacuate them by pulling them free. The patient usually felt only a dull abdominal pressure; I felt awe and disbelief as the worm emerged. Pale, flat, and ribbonlike, its segmented body would coil and glisten under the light.