^ keeping some items private via
draft
status and.gitignore
( No worries, I'm pretty sure my health insurer is getting a pretty good deal anyway )
( Last Metabolic Panel 23/05/18 )
Diet | exercise | sleep | genetics
house | weather | air quality | clothing | shoes
mindset | play | learn | social | meditation | spirit
23/12/17 - I'd just like to keep some notes along the way so I have a reference. I'm just like everyone else about this time of year. I have a pretty holistic sorta mindset on health even though I've found myself with some weaknesses over the years. I smoked cigarettes in college and for a few years following. I'm in pretty good shape right now, but I come from a long line of plump little Welshmen so I'm privy to indulge. My eyes have suffered in recent years from screen time and the only DNA marker risk I have is macular degeneration. My dad and a couple of his brothers have onset diabetes so I'm going to try and avoid it altogether with exercise and diet. In regards to wholistic, I find it odd that folks will wear a device to track the thirty minutes of steps they do a day and ignore the other 1410 minutes. Aside from genetics, I think the most important impact on health is your routine, especially lifestyle, diet, sleep, and exercise so I'll start by logging some of those.
I noticed a project not too long ago on Github that allows for an open-source export of your medical data from MyChart and others. Would like to explore that at some point so I could just sync the blood, lipid panel, and other tests... so I can move that data around at will mainly because I like the control and I think there will end up being decent AI diagnostic tools available in the future.
related
If you’ve ever wanted to analyze your own health data, here’s how.
Within the archive, you’ll find export.xml
. This is where the main metrics are stored.
If you open export.xml
, you'll see most of the interesting data is contained in the attributes of Record
elements.
So let's make a small Python script to convert those attributes to JSON.
Save the following to a file called parse.py
:
import json
import sys
from xml.etree.ElementTree import iterparse
for _, elem in iterparse(sys.argv[1]):
if elem.tag == "Record":
print(json.dumps(elem.attrib))
Then run:
python parse.py export.xml
You should immediately start seeing the data in your terminal.
Using jq, we can convert the JSON to CSV:
python parse.py export.xml | jq -r '[.endDate, .type, .unit, .value] | @csv'
If you prefer TSV (e.g. for processing with cut
), replace @csv
by @tsv
.
Save the data to a file and analyze with your favorite software.