Friday, April 27, 2007

Readers Challenge: Help me decode the Dexcom data format

I've been using a Dexcom STS continuous glucose monitor system for about a month now.

For day to day use, it's really wonderful. I can see highs before they happen and take the edge off them, and I can also watch much more easily for lows and reduce their impact.

But the software continues to be a major annoyance. Basically all it gives me is two very simplistic graphs of the blood glucose data collected by the Dexcom system.

The Glucose Trend graph shows up to one week of glucose readings from the system.
Dexcom Glucose Trend graph

By choosing a smaller number of days, I can see the readings a little more spread out. For me, this makes it easier to look at the values.
Dexcom Glucose Trend graph for 2 days

However the software shows no summary statistics, and the only way I can actually see that values is by holding my mouse over them.

The other graph is the Modal Day one, which lets me see a number of days worth of data superimposed over a 24-hour period. This makes it a little easier to see patterns.
Dexcom Modal Day graph

Again there is no summary data for the selected time period, and I can only look at one time segment at a time. So if I wanted to see what was happening for the last two weekends, I'd need to produce one report for each weekend and then look from one to the other.

OK. Now this is where I ask for your help. I've sent some e-mails to Dexcom asking for more information on how to get the data out of the system. So far, I've heard nothing back. Maybe one of you format hackers can help me in decoding the actual information itself.

Warning, it's fairly technical below this point. And I'm really hoping that someone can help with this problem.

Using some tools such as the wonderful FileMon from SysInternals, I've finally figured out where the receiver data is being stored on my PC. Trust me when I tell you that this is not easy.

For example, on my system, a lot of information is written by the software to various folders in this location:
C:\Documents and Settings\Bernard Farrell\Local Settings\Apps\2.0\TO260ZDW.VE3\JGBRCCZA.X12


But the actual receiver data is written into a number of .R2Download files in this location:
C:\Documents and Settings\All Users\Application Data\DexCom\DexCom DM - Consumer\ReceiverData\

For example one of them is named {2E6B7BE9-DA8F-42FA-8337-29404D84A829}.R2Download.

The files contain XML structured data, part of which is the readings themselves in some compressed form.
Dexcom Receiver data file

The data is contained in the DataBaseRecords object in this XML file. And from looking at the Signature object later in the file, it may be encoded using some sha1 approach.

I've uploaded the contents of one data file to my server. If you'd like to have a look at the file and see if you can figure out the data portion, then download the data file from here.

And if you can give me any suggestions as to how to decode this, I'd be thrilled.

Labels: , ,

10 Comments:

At April 28, 2007 1:42 PM , Anonymous EricJ said...

Bernard,

Thanks for posting this - I've wondered about being able to do the same thing.

Can you post the info later in the file (and perhaps a link to the whole file) that makes you suspect SHA-1 is used? If I understand SHA-type hashes correctly, they can be used to provide a unique signature for a set of data (for checking its integrity) but they aren't themselves a way of encoding the full datastream in a way that can be reversed, even with the proper key. That is, given the SHA-1 hash of a dataset, and access to something that may or may not be the unencoded form of the dataset, you can check to see that your unencoded form is correct. But given only the SHA-1 hash, you can't recover the data itself.
So there must be something else going on.

Am I missing something?

Thanks,

Eric

 
At April 28, 2007 2:03 PM , Blogger Bernard said...

Eric

There is a link to one complete data file on the post itself. I've changed the wording to make it clearer.

I'm really not an expert in encryption or compression techniques and I'm guessing slightly from what's in the file itself.

If you can shed any light on it, that would be great

 
At April 28, 2007 2:27 PM , Anonymous EricJ said...

Ah, got it. When I clicked on that link, my browser ignored all the XML except the data strings themselves, so I was confused. But downloading the file, or just choosing "View document source", now I see that the rest of the XML is there.

Looking at the data, it sure looks like it's base64 encoded, given the characters used. But it doesn't decode to any plain text, so I'm guessing it's encoded binary data. That's not too surprising, but could be a pain to figure out.

Some of my students are very smart computer scientists, and like the idea of figuring out things like this, so I may give them a shot at it. I'll let you know if I find out anything. Thanks for digging up the data files.

Eric

 
At April 29, 2007 5:34 AM , Anonymous JasonJayhawk said...

I responded on diabetesforums.com. No clues, but more questions...

 
At April 29, 2007 11:35 PM , Anonymous EricJ said...

Jason,

Could you post a copy of your comments here, or at least a link - I couldn't find your post on that site.

Thanks!

 
At April 30, 2007 10:47 AM , Blogger d.pi said...

Exciting, Bernard, thanks for doing this! I don't have any decoding experience but I'll grab the file and poke at it a bit myself, the more eyes the better, right? :) You've already done some heavy detective work, no wonder I couldn't find the files with a cursory search...

Meghan

 
At May 09, 2007 3:53 PM , Blogger Anne said...

why can't dexcom just provide the raw data. Minimed does with the Guardian RT. I think they just don't want to bother with the FDA regulators. I hate it when people treat diabetics like they are stupid and might hurt themselves if given too much information!

 
At July 31, 2007 9:49 AM , Blogger Khurt Williams said...

Bernard,

I found this link on MSDN. Also here on the W3C web site. I am not a Windows developer so there is not much I can do with this stuff but I want to help.

It would appear that the data is either signed or encrypted with public key cryptography. If is simply signed then it is possible to decode the DatabaseRecords block. If it is encrypted then we are SOL.

One can only speculate as to why DexCom would do this. In any case, the software is Windows only and I am a Mac user so I am SOL using the DexCom.

 
At October 16, 2007 11:39 AM , Blogger Bill said...

I wish that the CGMS data from these devices could be exported to a csv or xls file. It still might be possible to create an excel model that could mine usable data and statistics out of the xml hash file of raw data.

 
At March 25, 2008 10:15 PM , Anonymous Anonymous said...

wow gold cheap wow gold buy wow gold world of warcraft gold wow world of warcraft wow gold WoW Warrior WoW Hunter WoW Rogue WoW Paladin WoW Shaman WoW Priest WoW Mage WoW Druid WoW Warlock power leveling powerleveling wow power leveling wow powerleveling wow guides wow tips food flower google?? google???? google???? ???? ???? ???? ??? ?? LED? ?? ?? ??? ?? ?? ?? ???? ???? ???? ???? ???? ???? ???? ???? ???? powerlin518 logo design website design web design ????

 

Post a Comment

Links to this post:

Create a Link

<< Home

   Blog Directory - Blogged