In January, I went through arthroscopic surgery on my left hip to fix The Injury. The Apple Health app on my iPhone captured a bunch of data that I was able to chart out to visualize the surgery and subsequent recovery.

The Injury

The Injury happened 8 years ago, while playing Ultimate in Winnipeg. There was no drama or exciting story like falling out of a tree or fighting off a bear. I took a single, normal walking step, and a horrid stabbing knife of pain shot through my leg, and I couldn’t move. I had to be carried vertically off the field.

My physio thought it was a groin strain. I did some rehab and was on the field again a couple weeks later.

But over the next several years, The Injury kept coming back. There was no warning. I’d take a step, or push off for a sprint, or do a lateral move, and 99% of the time it would be fine—but 1% of the time, it triggered The Injury.

I saw other physios and medical specialists. There was no clear diagnosis. Groin strain. Hip flexor strain. Abdominal strain. When it wasn’t actively triggered, it was like it was never there. I’d have an appointment, and The Injury wouldn’t be there. I couldn’t even point to anything in particular as the thing that hurt. It was just a vague “somewhere inside this general area, it’s very bad when it’s triggered, but it feels perfectly fine right now.”

When I moved to Germany in 2018, I joined a touring Ultimate club in Berlin. It was an amazing experience. But The Injury kept coming back again, and again, and finally, during the German national championships in 2019, I realized that I just couldn’t do it any more. Our last game of the nationals was my last time on the field. After more than 20 years of playing and touring around the world, I was done.

The diagnosis

Frustrated with the lack of an actual diagnosis, I kept doing research on my own to try and figure out what The Injury could be. I suspected it was a sports hernia, and scheduled a private consultation with a surgeon in Berlin who specializes in hernias.

His diagnosis was quick and efficient, and backed up by subsequent xrays and an MRI: I had cam-type femoroacetabular impingement, where the ball joint of my hip was overgrown and colliding with the edges of the socket. This explained all of the symptoms: the vague locality, the intermittent symptoms, the intensity of the pain, and even the way I wouldn’t be able to walk properly right after it triggered. Since it was a mechanical issue, surgery was the only option.

Then the pandemic hit. Surgery was out of the question.

The surgery

Five years later and with second opinions to confirm that yes, this was the source of The Injury, and that yes, surgery was recommended, and that yes, if I don’t get this done it would probably lead to arthritis in the hip, I was scheduled for hip arthroscopy with Dr. Gregor Möckel in Berlin.

I spent a good long time psyching myself up and psyching myself out.

Dr. Möckel is a leading specialist in this particular surgery, and had surprisingly detailed papers and videos available online. If you aren’t too squeamish, there’s an actual video on YouTube of this surgery being carried out in real time.

The surgery was carried out on January 17. It went perfectly. My ball joint was shaved down to remove the obstruction and the cartilege smoothed and repaired. I didn’t even need much in the way of painkillers: some ibuprofen did the trick. Compared to The Injury, the surgery was nothing.

I spent three weeks on crutches, slowly putting more weight on the operated leg while starting rehab. As of May, I was cleared to do what I want—including a return to the Ultimate field.

Was all of that captured by the Apple Health app?

I realized the Apple Health app on my iPhone was recording a whole bunch of data about my movements over the past year: steps, step length, stability, and more. I was curious if the surgery and recovery would be visible in the data.

The Apple Health app on an iPhone is a bit frustrating for looking at data over time, because it dynamically scales charts to fit whatever’s currently in the view, so long-term trends and comparisons weren’t really visible.

But the data from Apple Health can be exported. I decided to try taking this data and charting it myself.

The result is fascinating: not only is the surgery visible, but the steady process of recovery over time is made clear.

Step Count

Steps per day. I usually try to do at least 10,000. Higher is better.
Date range from May 1, 2023 – April 30, 2024

Step Length

Median length of a step, in centimetres. I don’t think higher is inherently better but my usual gait would normalize.
Date range from May 1, 2023 – April 30, 2024

Walking Asymmetry

Percentage of time that asymmetric steps are counted while walking. Lower is better.
Date range from May 1, 2023 – April 30, 2024

Walking Steadiness

A mix of balance, stability, and coordination while walking. This data is provided on weekly cadence. Apple classifies these values as “OK, Low, or Very Low,” but here, higher is better.
Date range from May 1, 2023 – April 30, 2024

Walking Speed

Median walking speed per day in km/h. These values are influenced by how quickly I’m walking Pepper, but they even out over time.
Date range from May 1, 2023 – April 30, 2024

Double Support Percentage

Percentage of gait cycle spent on two feet. Lower is better.
Date range from May 1, 2023 – April 30, 2024

Some things I found particularly interesting:

  • It took about three months to return to “normal” after the surgery.
  • I don’t really see a moment “before” and “after” crutches. This backs up my feeling that I gradually transitioned off of them even while still using them.
  • I had a big drop in walking steadiness in September ahead of the January surgery. I’m not sure why this was. It could be that I triggered The Injury around then, but I can’t recall.
  • The data alone suggests that in the last few weeks, I had a bit of setback in terms of walking steadiness and symmetry. However, I also walked a heck of a lot more than usual due to some travel, so I suspect this is correlated.
  • There are so many influencing factors for all of this data—walking my dog, the weather, the way the ground is wherever I happen to be—that I wouldn’t take any of this as truly accurate over time. But, the trends themselves seem consistent and are interesting on their own.

Some technical details about how I went about this:

  1. Export health data from the Apple Health app. This results in a export.xml file with all the raw data. I followed these step by step instructions.
  2. Convert the export.xml into CSVs. I used Eric Wolter’s phenomenal tool to do this.
  3. Process the resulting .csv based on what I actually cared about. In my case, I wanted to focus only on data recorded by my iPhone for a given date range. Here’s a gist with some python I used to do this.
  4. Process each individual filtered .csv to consolidate it further as needed. Sometimes the data would have multiple values for a single day that I wanted to sum (gist), and other times there would be multiple values I needed to average out (gist).
  5. Visualize the data on this post with Tremor.