Skip to content
Last updated

Overview

Tidepool Platform automatically calculates several summary statistics for each user as they upload diabetes data into their account. Currently supported data types are CGM and BGM, from Continuous Glucose Monitors and Blood Glucose Meters, respectively. Our plan is to add insulin delivery summaries as well in the future.

The following diagram illustrates how the overall process works using manual Tidepool Uploader upload as an example. The same process applies regardless of how the data arrives in the user's account. Other examples are automatically uploading using Tidepool Mobile, or via cloud-to-cloud import from Dexcom Clarity or Abbott LibreView, or even 3rd party applications such as xDrip.

NOTE: The summary calculation itself is nearly instantaneous. However, it is triggered by the arrival of new data so depending on the path of the upload it may take anywhere from few minutes to several hours for the summary statistics to be recalculated.

AliceTidepool UploaderTidepool PlatformSeastar EndocrinologyIf CGM or BGM dataloop[Every 30 seconds]Connect CGM or BGM device1Upload diabetes data2Mark account summary as out-of-date3OK4OK5Re-calculate summary data6Store summary data7Summary available via patient list8AliceTidepool UploaderTidepool PlatformSeastar Endocrinologyhttps://api.tidepool.org

Calculation

The summary calculation is done in batches of up to 250 most out-of-date user accounts, up to 4 batches in one iteration, where each iteration may begin every 30 seconds. Thus, each calculation iteration may update up to 1,000 accounts. The calculation for each user proceeds as shown in the diagram below:

DeviceSamplesBucketsPeriodsUpload CGM and/or BGM samples1Summarize by type into 1-hour buckets over 60 days2Summarize by type into 1, 7, 14, 30 day periods3DeviceSamplesBucketsPeriods

Each user's data is first summarized into a set of 1-hour buckets separated by type (CGM or BGM) over the last 60 days, for a maximum of 1,440 buckets per type. The 60 day window is backwards from the date of the last uploaded data for each user, not the current date. The window may be shorter than 60 days of data if the user has not uploaded enough data. The window may also contain gaps.

The 1-hour buckets are then further summarized by type (CGM, BGM) into 1, 7, 14, and 30 day periods again backwards from the date of last uploaded data. In each period record, there is a delta record from the previous period of the corresponding duration. This enables period-over-period comparisons to support advanced dashboards such as Stanford Timely Interventions for Diabetes Excellence or TIDE (paper). The following diagram illustrates the relationship of the periods and the corresponding delta record.

Jul 02Jul 09Jul 16Jul 23Jul 30Aug 06Aug 13Aug 20Aug 27previous 30d current 30d previous 14d current 14d previous 7d current 7d previous 1d current 1d last uploaded data Current PeriodsPrevious Periods

Thus, a user who has both CGM and BGM data may have up to the following number of summary calculation artifacts:

[CGMBGM] types ×60 days ×24hours=2,880hourly buckets[CGMBGM] types ×[171430]days=8periods

All of the summary period data is stored within each user account to enable quick sorting and filtering in each clinic's patient list. If a user is a patient of multiple clinics, all clinics share the same summary data.

Threshold Values

The summary calculation uses the glycemic targets established by ADA standards of care and AACE (paper, table) to characterize each CGM or BGM glucose sample. The same target ranges are currently used for all users, and not personalized based on the user's diagnosis type or either the user's or the clinic's preferences. The glycemic target ranges are listed in the table below. In addition to the discrete ranges, we also define two additional composite ranges AnyLow and AnyHigh. Note also that the VeryHigh range is inclusive of the ExtremeHigh range.

Unit

AnyLow

Target

AnyHigh

VeryLow

Low

High

VeryHigh

ExtremeHigh

mmol/L

v < 3.0

3.0 ≤ v < 3.9

3.9 ≤ v ≤ 10.0

10.0 < v ≤ 13.9

v > 13.9

v ≥ 19.4

mg/dL

v < 54

54 ≤ v < 70

70 ≤ v ≤ 180

180 < v ≤ 250

v > 250

v ≥ 350

NOTE: Tidepool normalizes glucose samples to mmol/L units. If the original sample was in mg/dL units, it is converted using a conversion factor of 18.01559 derived from the molecular weight of glucose (C₆H₁₂O₆):

12.01070gmol×6+1.00794gmol×12+15.99940gmol×6=180.1559gmol

Hourly Bucket Data Fields

Each bucket has a set of common fields, as well as a set of fields repeated for each of the 7 named summary ranges: InLow, InTarget, InHigh, InVeryHigh, InExtremeHigh, InAnyLow, and InAnyHigh. For brevity, in the following table the placeholder Xxx corresponds to those names rather than repeating each set of fields.

GlucoseBucket

CGMBGMFieldTypeUnitNotes
TypestringType of data in this bucket: cgm or bgm
DatedateStart time of the bucket
LastRecordTimedateTime of the last sample in the bucket
LastRecordDurationintminDuration of the last sample in the bucket
Total.Glucosefloatmmol/LSum of all samples in the bucket
Total.MinutesintminSum of minutes covered by all samples in the bucket
Total.RecordsintCount of all samples in the bucket
Xxx.Glucosefloatmmol/LSum of all samples within the thresholds of Xxx in the bucket
Xxx.MinutesintminSum of minutes covered by each sample within the thresholds of Xxx in the bucket
Xxx.RecordsintCount of samples within the thresholds of Xxx in the bucket

Summary Period Data Fields

  • GlucosePeriod.GlucoseManagementIndicator is only present if GlucosePeriod.Total.Percent > 70
    • It is calculated using the Jaeb formula to produce a GMI value in mmol/mol units, and then using the NGSP formula to produce a % HbA1c value
    • It is rounded to one decimal point of precision
  • GlucosePeriod.Delta is not recursive: it is only present in the top-level GlucosePeriod
  • GlucosePeriod.Total is always present, but the threshold ranges are present only if:
    • GlucosePeriod.DaysInPeriod ≤ 1 and GlucosePeriod.Total.Percent > 70 or
    • GlucosePeriod.DaysInPeriod > 1 and GlucosePeriod.Total.Minutes > 1,440 (=24 hours)
  • GlucoseRange.Variance is only present in GlucosePeriod.Total

GlucosePeriod

CGMBGMFieldTypeUnitNotes
TypestringType of data in this period: cgm or bgm
DaysInPeriodintNumber of days in this period: 1, 7, 14, or 30
DaysWithDataintNumber of days where Total.Records > 0
HoursWithDataintNumber of hours where Total.Records > 0
TotalGlucoseRangeTotals for all samples regardless of thresholds
InVeryLowGlucoseRange
InLowGlucoseRange
InTargetGlucoseRange
InHighGlucoseRange
InVeryHighGlucoseRange
InExtremeHighGlucoseRange
InAnyLowGlucoseRangeInVeryLow + InLow
InAnyHighGlucoseRangeInHigh + InVeryHigh (this includes InExtremeHigh)
AverageDailyRecordsfloatTotal.RecordsDaysInPeriod
AverageGlucoseMmolfloatmmol/LTotal.GlucoseTotal.Records
GlucoseManagementIndicatorfloat% HbA1c(12.71+4.70587×AverageGlucose)×0.09148+2.152
StandardDeviationfloatmmol/LTotal.VarianceTotal.Minutes
CoefficientOfVariationfloatStandardDeviationAverageGlucoseMmol
DeltaGlucosePeriodDeltas from the previous period of the same duration

GlucoseRange

CGMBGMFieldTypeUnitNotes
Glucosefloatmmol/LSum of all samples in the period
MinutesintminSum of minutes covered by each sample in the period
RecordsintCount of samples in the period
Percentfloat%if Total.Minutes0: Xxx.MinutesTotal.Minutes or if Total.Records0: Xxx.RecordsTotal.Records
Variancefloat(mmolL)2
Calculated using weighted incremental algorithm.

Handling Multiple Data Sources

In the event there are multiple CGM devices uploading data to the user's account, the initial 1-hour bucketing skips any excess data samples within a blackout window defined relative to each data sample that is included in the bucket. Put another way, each data sample included in the bucket masks any following excess data points until the blackout window expires.

In the following example there is a series of data samples in the current 1-hour bucket coming from a Dexcom G6 CGM which measures CGM every 5 minutes, and another hypotethical CGM device that provides data samples at 1 minute intervals.

TimeDeviceAction
xx:00:00Dexcom G6Included in calculation. Sets blackout window to 5 minutes.
xx:00:30Brand XIgnored within blackout window.
xx:01:30Brand XIgnored within blackout window.
xx:02:30Brand XIgnored within blackout window.
xx:03:30Brand XIgnored within blackout window.
xx:04:30Brand XIgnored within blackout window.
xx:05:00Dexcom G6Included in calculation. Resets the blackout window to 5 minutes.
xx:05:30Brand XIgnored within blackout window.
xx:06:30Brand XIgnored within blackout window.
.........

The blackout windows are defined as 15 minutes for Abbott FreeStyle Libre devices, and 5 minutes for all other devices.