# Temporary Basals (`temp`) ## Delivery Type (`deliveryType`) The string `temp`. 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. ## Duration (`duration`) An integer value representing a duration of time in milliseconds. 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. 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. ## Expected Duration (`expectedDuration`) 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. 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. ## Percent (`percent`) Different insulin pump manufacturers have different interfaces for setting temporary basal rates by percentage. Some express this as a positive or negative percentage from the currently active scheduled basal rate. Other pumps express this change as an absolute percentage of the current active rate. Examples: 1. The current active rate is 0.5 units per hour, so the user programs a -50% temp basal to implement a rate of 0.25 2. The user inputs 50% to yield 0.25 units per hour and 150% to yield a 0.75 temporary rate 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. ## Basal Rate (`rate`) A floating point number >= 0 representing the amount of insulin delivered in units per hour. 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. ## Suppressed (`suppressed`) An object representing another `basal` event - namely, the event that is currently [suppressed](/docs/device-data/data-types/basal/suppressed) (inactive) because this temp basal is in effect. ## Quick Summary ## Examples ```json Example (client) { "type": "basal", "deliveryType": "temp", "duration": 28800000, "expectedDuration": 34560000, "percent": 0.75, "rate": 0.1875, "suppressed": { "type": "basal", "deliveryType": "scheduled", "scheduleName": "Weekend", "rate": 0.25 }, "clockDriftOffset": 0, "conversionOffset": 0, "deviceId": "DevId0987654321", "deviceTime": "2018-05-14T18:00:00", "guid": "a58d9efb-3f0d-41d3-a711-edf890a3062e", "id": "e52976685fc94f7a9d0272fdd5c63fa0", "time": "2018-05-14T08:00:00.000Z", "timezoneOffset": 600, "uploadId": "SampleUploadId" } ``` ```json Example (ingestion) { "type": "basal", "deliveryType": "temp", "duration": 50400000, "expectedDuration": 60480000, "percent": 0.65, "rate": 1.2025, "suppressed": { "type": "basal", "deliveryType": "scheduled", "scheduleName": "Stress", "rate": 1.85 }, "clockDriftOffset": 0, "conversionOffset": 0, "deviceId": "DevId0987654321", "deviceTime": "2018-05-14T18:00:00", "time": "2018-05-14T08:00:00.000Z", "timezoneOffset": 600, "uploadId": "SampleUploadId" } ``` ```json Example (storage) { "type": "basal", "deliveryType": "temp", "duration": 82800000, "expectedDuration": 99360000, "percent": 0.75, "rate": 0.075, "suppressed": { "type": "basal", "deliveryType": "scheduled", "scheduleName": "Very Active", "rate": 0.1 }, "_active": true, "_groupId": "abcdef", "_schemaVersion": 0, "_version": 0, "clockDriftOffset": 0, "conversionOffset": 0, "createdTime": "2018-05-14T08:00:05.000Z", "deviceId": "DevId0987654321", "deviceTime": "2018-05-14T18:00:00", "guid": "7a504ee3-17a5-4ec8-b157-c1a985731192", "id": "e3b4654d90664fca9a30c20ff19c93fd", "time": "2018-05-14T08:00:00.000Z", "timezoneOffset": 600, "uploadId": "SampleUploadId" } ``` ## Keep Reading * [Basal](/docs/device-data/data-types/basal) * [Common Fields](/docs/device-data/common-fields) * [Pump Settings](/docs/device-data/data-types/pump-settings) * [Automated Basals](/docs/device-data/data-types/basal/automated) * [Scheduled Basals](/docs/device-data/data-types/basal/scheduled) * [Suppressed Basals](/docs/device-data/data-types/basal/suppressed) * [Suspend Basals](/docs/device-data/data-types/basal/suspend) * [Units](/docs/device-data/units)