POST /statistics

Description

The /statistics endpoint enables retrieval of a user's summary statistics, including averages, quartiles, and measures of variance. Additionally, time in range based on customizable glycemic ranges and the hypoglycemia risk metric available to users through Dexcom CLARITY® are provided.

 

Resource

POST /v2/users/self/statistics

 

Authorization

OAuth 2.0 bearer token; see the Authentication section for details on this workflow.

 

Query Parameters

These query parameters specify the time window for the requested data; both are required. See the discussion of time in the Endpoint Overview section for more details on how they relate to device information.

Name

Type

Description

startDate

DateTime

Beginning of the time window

endDate

DateTime

End of the time window

Request Body Example

In order to calculate the statistics based on target ranges, one or more named time ranges and associated target EGV ranges are required. These are passed in the request body in JSON format. The time ranges must cover the entire 24-hour period and not overlap. If the request body is not included or violates these rules, a 400 (Bad Request) error will be returned.

{
  "targetRanges":[
    {
      "name": "day",
      "startTime": "07:00:00",
      "endTime": "20:00:00",
      "egvRanges": [   
        {
          "name": "urgentLow",
          "bound": 55
        },
        {
          "name": "low",
          "bound": 70
        },
        {
          "name": "high",
          "bound": 180
        }
      ]
    },
    {
      "name": "night",
      "startTime": "20:00:00",
      "endTime": "07:00:00",
      "egvRanges": [   
        {
          "name": "urgentLow",
          "bound": 55
        },
        {
          "name": "low",
          "bound": 80
        },
        {
          "name": "high",
          "bound": 200
        }
      ]
    }
  ]
}

 

Request Body Fields

Name

Type

Description

name

String

Reference name for the time window

startTime

Time

Beginning of the time window

endTime

Time

End of the time window

egvRanges

Array

Array containing the minimum and maximum EGV defining the target range

 

The egvRanges array fields are as follows

 

 

Name

Type

Description

name

String

Name of for the EGV threshold used for calculations; the following must be included:

  • "urgentLow"
  • "low"
  • "high"

bound

Float

The value of the EGV threshold; must follow the rule:

"urgentLow" < "low" < "high"

 

Request Example

 

Response Example

{
  "hypoglycemiaRisk": "minimal",
  "min": 44,
  "max": 261,
  "mean": 133.64806445274132,
  "median": 124,
  "variance": 1447.8893070219756,
  "stdDev": 38.05114067964291,
  "sum": 680135,
  "q1": 103,
  "q2": 124,
  "q3": 158,
  "utilizationPercent": 96.00831928771177,
  "meanDailyCalibrations": 1.9809075622325305,
  "nDays": 19,
  "nValues": 5089,
  "nUrgentLow": 33,
  "nBelowRange": 10,
  "nWithinRange": 4417,
  "nAboveRange": 629,
  "percentUrgentLow": 0.6484574572607585,
  "percentBelowRange": 0.19650225977598745,
  "percentWithinRange": 86.79504814305365,
  "percentAboveRange": 12.35999213990961
}

 

Response Fields

Name

Type

Description

hypoglycemiaRisk

String

Risk for the patient to have future hypoglycemic events; see additional notes below

(nullable)

min

Float

Minimum of all EGV data for given date range

max

Float

Maximum of all EGV data for given date range

mean

Float

Mean of all EGV data for given date range

median

Float

Median of all EGV data for given date range

variance

Float

Statistical variance of glucose level for given date range

stdDev

Float

Standard deviation of all EGV data for given date range

sum

Float

Sum of all EGV data for given date range

q1

Float

First quartile of all EGV data for given date range

q2

Float

Second quartile of all EGV data for given date range

q3

Float

Third quartile of all EGV data for given date range

utilizationPercent

Float

Percent CGM sensor was utilized for given date range

meanDailyCalibrations

Float

Mean number of calibrations per day for given date range

nDays

Integer

Number of calendar days contributing data to the statistics calculations; only days containing EGV data are included in this count

nValues

Integer

Total number of EGV observations for given date range

nUrgentLow

Integer

Number of EGV observations below urgentLow bound (exclusive) specified in egvRanges array

nBelowRange

Integer

Number of EGV observations below low bound (exclusive) and above urgentLow bound (inclusive) specified in egvRanges array

nWithinRange

Integer

Number of EGV observations between high bound (inclusive) and above low bound (inclusive) specified in egvRanges array

nAboveRange

Integer

Number of EGV observations above high bound (exclusive) specified in egvRanges array

percentUrgentLow

Float

Percentage of EGV observations below urgentLow bound (exclusive) specified in egvRanges array

percentBelowRange

Float

Percentage of EGV observations below low bound (exclusive) and above urgentLow bound (inclusive) specified in egvRanges array

percentWithinRange

Float

Percentage of EGV observations between high bound (inclusive) and above low bound (inclusive) specified in egvRanges array

percentAboveRange

Float

Percentage of EGV observations above high bound (exclusive) specified in egvRanges array

 

Notes

Statistics are calculated using the value field from the /egvs endpoints. See the GET /egvs page for more details.

 

Additional notes for hypoglycemiaRisk:

This calculation estimates the risk for severe hypoglycemia. It is based on a combination of the number of times glucose was low, the magnitude of the low glucose and for how long there was low glucose.

Experiencing frequent lower measured glucose values for short durations has more impact than minimal hypoglycemia for longer periods but with less frequency. Having more frequent lows for longer durations and at lower glucose levels carries a high risk for severe hypoglycemia. The hypoglycemia risk complements the patient’s A1C measurements. Patients can have low or high A1C and still be at low, medium or high hypoglycemia risk. The impact of hypoglycemic risk on patients and diabetes management should be reviewed by a healthcare professional.

The hypoglycemia risk estimation is calculated from a minimum amount of days with a minimum duration of CGM wear time as follows:

  • When number of days in date range is less than 20 days, at least 12 days in date range with utilizationPercent greater than or equal to 66%.
  • When number of days in date range is greater than or equal to 20 days, at least 60% of total days in date range with utilizationPercent greater than or equal to 66%.

Clinical References:

Kovatchev, B, et al. Algorithmic Evaluation of Metabolic Control and Risk of Severe Hypoglycemia in Type 1 and Type 2 Diabetes Using Self-Monitoring Blood Glucose Data. Diabetes Technology and Therapeutics, 5(5): 817-828, 2003. PubMed Link

Clarke W, Kovatchev B. Statistical Tools to Analyze Continuous Glucose Monitor Data. Diabetes Technology & Therapeutics. 2009; 11(Suppl 1): S-45-S-54. doi:10.1089/dia.2008.0138. PubMed Link

Hypoglycemia Risk corresponds to the risk categories from these studies:

  • "minimal" corresponds to Minimal Risk in the studies
  • "low" corresponds to Low Risk in the studies
  • "moderate" corresponds to Moderate Risk in the studies
  • "high" corresponds to High Risk in the studies

 

The documentation for an earlier version of this endpoint is available here.