Skip to content

Commit 37f9b88

Browse files
authored
Merge pull request #161 from tidepool-org/gerrit-improvements
Further updates
2 parents 63e2250 + 7ea9e32 commit 37f9b88

37 files changed

+141
-180
lines changed

_partials/basal_duration.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Duration (`duration`)
2+
3+
An integer value representing a duration of time in milliseconds.
4+
5+
Note that for some insulin pumps, even for a scheduled basal not interrupted by another event like a suspend or temp, the duration may not be the nice round numbers of milliseconds that might be expected given the schedule in the pumpSettings, for example, 3600000 for a basal event lasting an hour. This is because of how some pumps schedule the small pulses of insulin delivery fulfilling the scheduled rate; depending on how the pulses are scheduled, the actual duration of the basal may be a bit over or under the scheduled duration.
6+
7+
This value is expected to be >= 0 and <= 432000000 (the number of milliseconds in five days), as we assume that any single basal interval, even for a user running a flat-rate basal schedule, is broken up by a suspension of delivery in order to change the infusion site and/or insulin reservoir at least every five days.
8+
9+
10+
## Expected Duration (`expectedDuration`)
11+
12+
An integer value representing an original programmed duration of time in milliseconds, copied from the `duration` field on ingestion when a following event has resulted in truncation of the original programmed duration.
13+
14+
Many insulin pumps provide information on the expected duration of basals in addition to the *actual* duration of basals. (These values may differ in the case of a basal being suspended or canceled.) Where this is true, Platform will provide the same information. If you do not know what the expected duration is, do not include this information as it is an optional field.
15+
16+
17+
18+

_partials/basal_rate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Basal Rate (`rate`)
2+
3+
A floating point number >= 0 representing the amount of insulin delivered in units per hour.
4+
5+
Different insulin pump manufacturers offer the ability to program basal rates with different levels of precision in terms of significant digits on the rate. We endeavor to represent each rate as accurately as possible for each insulin pump; occasionally when values are stored to a falsely large number of floating point digits this means rounding the raw rate value found in a record from a pump in order to match the significant digits of precision advertised by the manufacturer. It is the burden of the uploading client to handle this rounding since the number of significant digits for rates varies according to the pump manufacturer.

docs/device-data/data-types/activity-physical.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This type is used to convey information about physical activity.
1313

1414
```json {% title="Example (physical activity)" %}
1515
{
16-
"type": "water",
16+
"type": "physicalActivity",
1717
"clockDriftOffset": 0,
1818
"conversionOffset": 0,
1919
"createdTime": "2018-05-14T08:17:13.453Z",

docs/device-data/data-types/basal.md

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
<!-- omit in toc -->
22
# Basal Insulin (`basal`)
33

4-
<!-- omit in toc -->
5-
## Table of Contents
6-
7-
1. [Overview](#overview)
8-
2. [Duration (`duration`)](#duration-duration)
9-
3. [Expected Duration (`expectedDuration`)](#expected-duration-expectedduration)
10-
4. [Rate (`rate`)](#rate-rate)
11-
5. [Schedule Name (`scheduleName`)](#schedule-name-schedulename)
12-
6. [Keep Reading](#keep-reading)
13-
144
---
155

16-
## Overview
17-
186
This is the Tidepool data type for background insulin dosing — the “constant drip” of insulin programmable in all insulin pumps. Different insulin pump manufacturers use different terminology for this insulin dosing, so we have standardized calling one set of rates covering a 24-hour period a basal “schedule.”
197

208
The data model for basal schedules is part of the Tidepool [pump settings type](./pump-settings.md), however, basal data types represent actual intervals of basal insulin delivery and may or may not match the programmed basal schedule.
@@ -32,41 +20,6 @@ This page documents the fields shared by various basal delivery types. The four
3220

3321
---
3422

35-
## Duration (`duration`)
36-
37-
In Platform, the duration field is required on all basals. We define duration as the period of time that a basal runs or, in the case of suspend basals, the period of time a suspension of insulin occurs.
38-
39-
Depending on how some pumps' insulin pulses are scheduled, the actual duration of the basal may
40-
differ slightly from the scheduled duration. This explains why some pumps' duration results in odd numbers of milliseconds (e.g. 3600001 for a basal event lasting an hour).
41-
42-
Platform expects the duration value of basals to be >= 0 and <= 604800000 milliseconds (seven days).
43-
44-
---
45-
46-
## Expected Duration (`expectedDuration`)
47-
48-
Many insulin pumps provide information on the expected duration of basals in addition to the *actual* duration of basals. (These values may differ in the case of a basal being suspended or canceled.) Where this is true, Platform will provide the same information. If you do not know what the expected duration is, do not include this information as it is an optional field.
49-
50-
---
51-
52-
## Rate (`rate`)
53-
54-
Different insulin pump manufacturers offer the ability to program basal rates with different levels of precision in terms of significant digits on the rate.
55-
56-
Tidepool endeavors to represent each rate accurately, so occasionally when values are stored to a falsely large number, Platform will round the raw rate value to match the significant digits of precision advertised by the manufacturer.
57-
58-
Many insulin pump manufacturers do not allow a basal rate higher than 10.0 or 15.0 units per hour; Platform will reject any value higher than 100.0 units per hour.
59-
60-
---
61-
62-
## Schedule Name (`scheduleName`)
63-
64-
Tidepool would love to surface the basal schedule names for every pump manufacturer. Unfortunately, most manufacturers do not provide this information or record pump setting changes. In some cases, we can find this information ourselves by looking up the active pump settings at the time of a particular basal event.
65-
66-
Schedule name is an optional field and should only be added to basal data when directly available from an insulin pump's raw data, or if it can be inferred with high confidence via lookup against a complete pump settings history.
67-
68-
---
69-
7023
## Keep Reading
7124

7225
* [Annotations](../annotations.md)

docs/device-data/data-types/basal/automated.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<!-- omit in toc -->
22
# Automated Basals (`automated`)
33

4-
<!-- omit in toc -->
5-
## Table of Contents
4+
## Delivery Type (`deliveryType`)
5+
6+
The string `automated`.
7+
8+
This is the sub-type of basal event representing intervals of basal insulin delivery triggered by the pump itself (rather than manual user entry) according to a closed loop algorithm.
9+
10+
{% partial file="/_partials/basal_duration.md" /%}
611

7-
1. [Quick Summary](#quick-summary)
8-
2. [Delivery Type (`deliveryType`)](#delivery-type-deliverytype)
9-
3. [Examples](#examples)
10-
4. [Keep Reading](#keep-reading)
12+
{% partial file="/_partials/basal_rate.md" /%}
1113

1214
---
1315

@@ -21,12 +23,6 @@
2123

2224
---
2325

24-
## Delivery Type (`deliveryType`)
25-
26-
This is the sub-type of basal event representing intervals of basal insulin delivery triggered by the pump itself (rather than manual user entry) according to a closed loop algorithm.
27-
28-
---
29-
3026
## Examples
3127

3228
```json {% title="Example (client)" %}

docs/device-data/data-types/basal/scheduled.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
<!-- omit in toc -->
22
# Scheduled Basals (`scheduled`)
33

4-
<!-- omit in toc -->
5-
## Table of Contents
4+
## Delivery Type (`deliveryType`)
5+
6+
The string `scheduled`.
7+
8+
This is the sub-type of basal event that represents intervals of basal insulin delivery triggered by the pump itself according to the active basal schedule programmed by the user (or clinician).
9+
10+
{% partial file="/_partials/basal_duration.md" /%}
11+
12+
{% partial file="/_partials/basal_rate.md" /%}
13+
14+
## Schedule Name (`scheduleName`)
615

7-
1. [Quick Summary](#quick-summary)
8-
2. [Delivery Type (`deliveryType`)](#delivery-type-deliverytype)
9-
3. [Examples](#examples)
10-
4. [Keep Reading](#keep-reading)
16+
A string: the name of the basal schedule.
17+
18+
Tidepool would love to surface the basal schedule names for every pump manufacturer. Unfortunately, most manufacturers do not provide this information or record pump setting changes. In some cases, we can find this information ourselves by looking up the active pump settings at the time of a particular basal event.
19+
20+
Schedule name is an optional field and should only be added to basal data when directly available from an insulin pump's raw data, or if it can be inferred with high confidence via lookup against a complete pump settings history.
1121

1222
---
1323

@@ -21,12 +31,6 @@
2131

2232
---
2333

24-
## Delivery Type (`deliveryType`)
25-
26-
This is the sub-type of basal event that represents intervals of basal insulin delivery triggered by the pump itself according to the active basal schedule programmed by the user (or clinician).
27-
28-
---
29-
3034
## Examples
3135

3236
```json {% title="Example (client)" %}

docs/device-data/data-types/basal/suppressed.md

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,6 @@
11
<!-- omit in toc -->
22
# Suppressed Basals (`suppressed`)
33

4-
<!-- omit in toc -->
5-
## Table of Contents
6-
7-
1. [Quick Summary: scheduled](#quick-summary-scheduled)
8-
2. [Quick Summary: automated](#quick-summary-automated)
9-
3. [Quick Summary: temporary](#quick-summary-temporary)
10-
4. [Overview](#overview)
11-
5. [Suppressed Across Schedule Boundaries](#suppressed-across-schedule-boundaries)
12-
6. [Suppressed: When A Temp Or Suspend Is Edited](#suppressed-when-a-temp-or-suspend-is-edited)
13-
7. [Nested Suppressed In Suspend Basals](#nested-suppressed-in-suspend-basals)
14-
8. [Suppressed Suspend Basals](#suppressed-suspend-basals)
15-
9. [Keep Reading](#keep-reading)
16-
17-
---
18-
19-
## Quick Summary: scheduled
20-
21-
{% json-schema
22-
schema={
23-
"$ref": "../../../../reference/data/models/basal/suppressed/scheduled.v1.yaml"
24-
}
25-
/%}
26-
27-
---
28-
29-
## Quick Summary: automated
30-
31-
{% json-schema
32-
schema={
33-
"$ref": "../../../../reference/data/models/basal/suppressed/automated.v1.yaml"
34-
}
35-
/%}
36-
37-
---
38-
39-
## Quick Summary: temporary
40-
41-
{% json-schema
42-
schema={
43-
"$ref": "../../../../reference/data/models/basal/suppressed/temporary.v1.yaml"
44-
}
45-
/%}
46-
47-
---
48-
494
## Overview
505

516
A suppressed basal is a way to essentially replace one basal with another basal. For example, if a PwD's blood glucose is falling, they may program a temp basal to try and prevent hypoglycemia. By programming a temp basal, they are suppressing a scheduled basal, which was previously in effect. A suppressed can apply to all basal types except a suspend — [see here](#suppressed-suspend-basals).
@@ -345,6 +300,38 @@ A suspend basal can embed a scheduled, automatic or temporary suppressed basal,
345300

346301
---
347302

303+
--
304+
305+
## Quick Summary: scheduled
306+
307+
{% json-schema
308+
schema={
309+
"$ref": "../../../../reference/data/models/basal/suppressed/scheduled.v1.yaml"
310+
}
311+
/%}
312+
313+
---
314+
315+
## Quick Summary: automated
316+
317+
{% json-schema
318+
schema={
319+
"$ref": "../../../../reference/data/models/basal/suppressed/automated.v1.yaml"
320+
}
321+
/%}
322+
323+
---
324+
325+
## Quick Summary: temporary
326+
327+
{% json-schema
328+
schema={
329+
"$ref": "../../../../reference/data/models/basal/suppressed/temporary.v1.yaml"
330+
}
331+
/%}
332+
333+
---
334+
348335
## Keep Reading
349336

350337
* [Basal](../basal.md)

docs/device-data/data-types/basal/suspend.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
<!-- omit in toc -->
22
# Suspend Basals (`suspend`)
33

4-
<!-- omit in toc -->
5-
## Table of Contents
4+
## Delivery Type (`deliveryType`)
5+
6+
The string `suspend`.
7+
8+
This is the sub-type of basal event representing the total suspension of insulin delivery on a pump within the stream of basal events — which should be without gaps or overlaps. The user's inputs to suspend (and later resume) insulin delivery are part of Tidepool's [device event](../device-event.md) data type. We represent suspend intervals as a suspend basal to maintain a continuous stream of basal data, making the calculation of statistics (e.g. total basal dose per day) easier.
9+
10+
No rate field appears on suspend basal events. The rate is always zero, so this is redundant information.
11+
12+
{% partial file="/_partials/basal_duration.md" /%}
13+
14+
## Suppressed (`suppressed`)
615

7-
1. [Quick Summary](#quick-summary)
8-
2. [Delivery Type (`deliveryType`)](#delivery-type-deliverytype)
9-
3. [Examples](#examples)
10-
4. [Keep Reading](#keep-reading)
16+
An object representing another `basal` event - namely, the event that is currently [suppressed](./suppressed.md) (inactive) because this suspended basal is in effect.
1117

1218
---
1319

@@ -21,14 +27,6 @@
2127

2228
---
2329

24-
## Delivery Type (`deliveryType`)
25-
26-
This is the sub-type of basal event representing the total suspension of insulin delivery on a pump within the stream of basal events — which should be without gaps or overlaps. The user's inputs to suspend (and later resume) insulin delivery are part of Tidepool's [device event](../device-event.md) data type. We represent suspend intervals as a suspend basal to maintain a continuous stream of basal data, making the calculation of statistics (e.g. total basal dose per day) easier.
27-
28-
No rate field appears on suspend basal events. The rate is always zero, so this is redundant information.
29-
30-
---
31-
3230
## Examples
3331

3432
```json {% title="Example (client)" %}

docs/device-data/data-types/basal/temp.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,13 @@
11
<!-- omit in toc -->
22
# Temporary Basals (`temp`)
33

4-
<!-- omit in toc -->
5-
## Table of Contents
6-
7-
1. [Quick Summary](#quick-summary)
8-
2. [Delivery Type (`deliveryType`)](#delivery-type-deliverytype)
9-
3. [Percent (`percent`)](#percent-percent)
10-
4. [Examples](#examples)
11-
5. [Keep Reading](#keep-reading)
12-
13-
---
14-
15-
## Quick Summary
16-
17-
{% json-schema
18-
schema={
19-
"$ref": "../../../../reference/data/models/basal/temporary.v1.yaml"
20-
}
21-
/%}
22-
23-
---
24-
254
## Delivery Type (`deliveryType`)
265

6+
The string `temp`.
7+
278
This is the sub-type of basal event that represents temporary intervals of basal insulin delivery requested by the user. Insulin pumps allow a temporary basal insulin rate for a duration of up to 24 hours. Depending on the pump, the user will be able to program a temp basal rate by percentage, manual specification or both.
289

29-
---
10+
{% partial file="/_partials/basal_duration.md" /%}
3011

3112
## Percent (`percent`)
3213

@@ -39,6 +20,22 @@ Examples:
3920

4021
Tidepool's data model has standardized on a floating point representation of the second strategy. The value 0.0 represents a temp basal at 0% of the current active rate, 0.5 at 50%, 1.0 at 100%, 1.5 at 150%, and so on.
4122

23+
{% partial file="/_partials/basal_rate.md" /%}
24+
25+
## Suppressed (`suppressed`)
26+
27+
An object representing another `basal` event - namely, the event that is currently [suppressed](./suppressed.md) (inactive) because this temp basal is in effect.
28+
29+
---
30+
31+
## Quick Summary
32+
33+
{% json-schema
34+
schema={
35+
"$ref": "../../../../reference/data/models/basal/temporary.v1.yaml"
36+
}
37+
/%}
38+
4239
---
4340

4441
## Examples

reference/data/models/activity/physical/physical.v1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
title: Physical Activity
2-
description: Logging of physical activity
32
allOf:
43
- $ref: '../../base.v1.yaml'
54
- type: object
5+
description: Logging of physical activity
66
properties:
77
type:
88
type: string

0 commit comments

Comments
 (0)