My LiveCompare Diabetes App, Part 1

Regular readers of my blog will know that I am Diabetic. I have an ever expanding Excel workbook containing all my blood sugar records going back to my first diagnosis in February 2009. I also regularly record my weight, blood pressure and resting heart rate. The sheets roll-up into a simple dashboard that I can use to identify trends (especially negative ones). I take a print of the dashboard with me to my Diabetic screenings.

For a while now I've thought about moving to a smartphone app – even building my own for the experience of it.

This morning I was looking for a way to introduce the upcoming LiveCompare 3.1 apps system. And suddenly it hit me: why not build a LiveCompare Diabetes Tracker app?

This is the first in a series of posts that'll cover building the app, the dashboard and migrating all my Excel data.

In this post I'll cover the basic design of the app and look at the data I need to track.

My Excel workbook records three data points:

  • Blood sugar
  • Blood pressure/heart-rate
  • Weight

A blood sugar reading comprises:

  • Date
  • Time slot (see below)
  • Reading (mmo/l)

There are a fixed number of time slots that I record in:

  • Before breakfast
  • 2hrs after breakfast
  • Before lunch
  • 2hrs after lunch
  • Before dinner
  • 2hrs after dinner
  • Before bed

I can enter a simple number to indicate the time slot. That gives a blood record containing:

DATE

SLOT

MMO/L

30/08/2013

0

6.4

 

My blood pressure record looks like:

DATE

LEFT_HIGH

LEFT_LOW

LEFT_HR

RIGHT_HIGH

RIGHT_LOW

RIGHT_HR

30/08/2013

123

76

52

128

72

53

 

Since reading this BBC news article, I've recorded BP and heart-rate from both arms. I'm interested in variance from the norm and variance between arms.

Lastly my weight record looks like:

DATE

WEIGHT_ST

WEIGHT_LBS

29/08/2013

13

1.5

 

Despite being a child of decimalisation, I still measure my body weight in Stones and Pounds. To save you the conversion that works out at 83.41Kgs or 183.50lbs.

All the data will be stored in an XDS that's accessible by the workflows that make up my Diabetes Tracker app. To create the XDS I used a new feature of LiveCompare 3.1 where it will create a SQLITE database for you on the server directly. This saves a lot of mucking about uploading a file.

I have four XDS:

  • Diabetes_Tracker_Bloods (maps to Bloods table)
  • Diabetes_Tracker_BPs (maps to BPs table)
  • Diabetes_Tracker_Weights (maps to Weights table)
  • Diabetes_Tracker_Slots (maps to Slots table)

The 'Diabetes_Tracker_Slots' is a lookup table that I'll to turn the slot number (0, 1, …) into a text description when generating a report.

Here's the workflow to initialise the slots XDS:

Where the Slots param contains:

The DataEntry_Blood workflow looks like:

The workflow reads the current 'bloods' records and adds the new one before writing everything back to the XDS. The other data entry workflows are very similar.

Next time we'll look at setting up the dashboard and then migrating all my Excel sheet data before finally registering everything as an app and running it from a smartphone. At which point we'll be back where I started – wanting a smartphone app to replace my Excel-based Diabetes tracker.