# Dosing Decision (`dosingDecision`)

## Quick Summary


```json
{
  "$ref": "#/components/schemas/dosingdecision.v1",
  "components": {
    "schemas": {
      "code.v1": {
        "title": "Annotation Code",
        "description": "Annotation codes that appear in Tidepool diabetes data records.\nThe annotation codes are primarily intended for machine processing, but they are usually readable enough to make sense.\nThese are by convention structured as series of strings separated by slashes (`/`), in order from more general to more specific.\nFor example:\n\n  * `wrong-device-time` or `time-change`, generic annotations.\n  * `basal/unknown-duration` or `bg/out-of-range`, generic annotations around a particular theme.\n  * `medtronic/basal/flat-rate`, a manufacturer-specific annotation.\n  * `medtronic600/smbg/user-rejected-remote-bg`, a device-specific annotation.",
        "type": "string",
        "minLength": 1,
        "pattern": "^[0-9a-z\\-_]+(/[0-9a-z\\-_]+(/[0-9a-z\\-_]+)?)?$",
        "enum": [
          "animas/basal/flat-rate",
          "animas/basal/marked-suspended-from-alarm",
          "animas/bolus/extended-equal-split",
          "animas/bolus/unknown-duration",
          "animas/out-of-sequence",
          "animas/status/fabricated-from-alarm",
          "basal/auto",
          "basal/intersects-incomplete-suspend",
          "basal/mismatched-series",
          "basal/unknown-duration",
          "bg/out-of-range",
          "carelink/basal/fabricated-from-schedule",
          "carelink/basal/fabricated-from-suppressed",
          "carelink/basal/off-schedule-rate",
          "carelink/bolus/missing-square-component",
          "carelink/wizard/long-search",
          "final-basal/fabricated-from-schedule",
          "insulet/basal/fabricated-from-schedule",
          "insulet/bolus/split-extended",
          "medtronic/basal/fabricated-from-schedule",
          "medtronic/basal/flat-rate",
          "medtronic/basal/one-second-gap",
          "medtronic/basal/time-change",
          "medtronic/status/fabricated-from-device-event",
          "medtronic/wizard/carb-to-exchange-ratio-deconverted",
          "medtronic600/smbg/bg-reading-received",
          "medtronic600/smbg/bg-sent-for-calib",
          "medtronic600/smbg/bg-si-fail-result-recd-frm-gst",
          "medtronic600/smbg/bg-si-pass-result-recd-frm-gst",
          "medtronic600/smbg/entered-as-bg-marker",
          "medtronic600/smbg/entered-in-bg-entry",
          "medtronic600/smbg/entered-in-bolus-wizard",
          "medtronic600/smbg/entered-in-meal-wizard",
          "medtronic600/smbg/entered-in-sensor-calib",
          "medtronic600/smbg/remote-bg-acceptance-screen-timeout",
          "medtronic600/smbg/user-accepted-remote-bg",
          "medtronic600/smbg/user-rejected-remote-bg",
          "medtronic600/smbg/user-rejected-sensor-calib",
          "spring-forward",
          "stats-how-calculated",
          "stats-how-calculated-average-cbg",
          "stats-how-calculated-average-smbg",
          "stats-how-calculated-range-cbg",
          "stats-how-calculated-range-smbg",
          "stats-how-calculated-ratio",
          "stats-insufficient-data",
          "status/incomplete-tuple",
          "tandem/basal/fabricated-from-new-day",
          "tandem/basal/temp-without-rate-change",
          "tandem/pumpSettingsOverride/estimated-duration",
          "tandem/pumpSettingsOverride/fabricated-from-new-day",
          "time-change",
          "uncertain-timestamp",
          "wizard/target-automated",
          "wrong-device-time"
        ],
        "example": "wrong-device-time"
      },
      "bgoutofrange.v1": {
        "title": "Blood Glucose Out of Range",
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "bg/out-of-range"
            ],
            "example": "bg/out-of-range"
          },
          "value": {
            "type": "string",
            "enum": [
              "low",
              "high"
            ],
            "example": "low"
          },
          "threshold": {
            "type": "number",
            "example": 40
          }
        },
        "required": [
          "code",
          "value",
          "threshold"
        ]
      },
      "annotation.v1": {
        "title": "Annotation",
        "description": "Annotation attached to the diabetes data record to provide additional information. Annotation is at minimum a `code` (string) that describes the annotation. It may also include additional properties that further describe the annotation. The maximum size is 4K bytes.",
        "type": "object",
        "allOf": [
          {
            "type": "object",
            "properties": {
              "code": {
                "$ref": "#/components/schemas/code.v1"
              }
            },
            "required": [
              "code"
            ]
          },
          {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "$ref": "#/components/schemas/code.v1"
                  }
                },
                "required": [
                  "code"
                ]
              },
              {
                "$ref": "#/components/schemas/bgoutofrange.v1"
              }
            ]
          }
        ]
      },
      "annotationarray.v1": {
        "title": "Annotation Array",
        "description": "An array of annotations.",
        "type": "array",
        "uniqueItems": true,
        "minItems": 0,
        "maxItems": 100,
        "items": {
          "$ref": "#/components/schemas/annotation.v1"
        }
      },
      "datetime.v1": {
        "title": "Date/Time",
        "description": "[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) / [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp _with_ timezone information",
        "type": "string",
        "format": "date-time",
        "example": "2017-02-06T02:37:46Z",
        "x-go-type": "string"
      },
      "datasetid.v1": {
        "title": "Data Set ID",
        "type": "string",
        "pattern": "^(upid_[0-9a-f]{12}|upid_[0-9a-f]{32}|[0-9a-f]{32})$",
        "minLength": 17,
        "maxLength": 37,
        "example": "ce8cc5f7595575945f91fc6710db6fef",
        "x-tags": [
          "Data"
        ]
      },
      "association-type.v1": {
        "title": "Association Type",
        "description": "The type of the association. If type is `blob`, `datum`, or `image`, then `id` must also be specified. If type is `url`, then url must also be specified.",
        "type": "string",
        "enum": [
          "blob",
          "datum",
          "image",
          "url"
        ],
        "example": "blob",
        "x-go-type": "string"
      },
      "reason.v1": {
        "title": "Association Reason",
        "description": "The reason for the association.",
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
      },
      "association-id.v1": {
        "title": "Association ID",
        "description": "The ID of the associated Tidepool resource if type is blob, datum, or image.",
        "type": "string"
      },
      "url.v1": {
        "title": "URL",
        "description": "URL",
        "type": "string",
        "format": "uri"
      },
      "blob.v1": {
        "title": "Association (blob)",
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/association-type.v1"
          },
          "reason": {
            "$ref": "#/components/schemas/reason.v1"
          },
          "id": {
            "$ref": "#/components/schemas/association-id.v1"
          },
          "url": {
            "$ref": "#/components/schemas/url.v1"
          }
        },
        "required": [
          "type",
          "id"
        ]
      },
      "datum.v1": {
        "title": "Association (datum)",
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/association-type.v1"
          },
          "reason": {
            "$ref": "#/components/schemas/reason.v1"
          },
          "id": {
            "$ref": "#/components/schemas/association-id.v1"
          },
          "url": {
            "$ref": "#/components/schemas/url.v1"
          }
        },
        "required": [
          "type",
          "id"
        ]
      },
      "image.v1": {
        "title": "Association (image)",
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/association-type.v1"
          },
          "reason": {
            "$ref": "#/components/schemas/reason.v1"
          },
          "id": {
            "$ref": "#/components/schemas/association-id.v1"
          },
          "url": {
            "$ref": "#/components/schemas/url.v1"
          }
        },
        "required": [
          "type",
          "id"
        ]
      },
      "url-association.v1": {
        "title": "Association (url)",
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/association-type.v1"
          },
          "reason": {
            "$ref": "#/components/schemas/reason.v1"
          },
          "id": {
            "$ref": "#/components/schemas/association-id.v1"
          },
          "url": {
            "$ref": "#/components/schemas/url.v1"
          }
        },
        "required": [
          "type",
          "id",
          "url"
        ]
      },
      "association.v1": {
        "title": "Association",
        "description": "Associate this resource with another Tidepool resource ID.",
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/blob.v1"
          },
          {
            "$ref": "#/components/schemas/datum.v1"
          },
          {
            "$ref": "#/components/schemas/image.v1"
          },
          {
            "$ref": "#/components/schemas/url-association.v1"
          }
        ]
      },
      "associationarray.v1": {
        "title": "Association Array",
        "description": "An array of associations for the resource.",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/association.v1"
        }
      },
      "clockdriftoffset.v1": {
        "title": "Clock Drift Offset",
        "description": "Clock drift offset, expressed as milliseconds.",
        "type": "integer",
        "format": "int64",
        "minimum": -86400000,
        "maximum": 86400000,
        "example": 0,
        "x-tags": [
          "Data"
        ]
      },
      "conversionoffset.v1": {
        "title": "Conversion Offset",
        "description": "Conversion offset, expressed as milliseconds.",
        "type": "integer",
        "format": "int64",
        "example": 0,
        "x-tags": [
          "Data"
        ]
      },
      "tidepooluserid": {
        "type": "string",
        "title": "Tidepool User ID",
        "pattern": "^([0-9a-f]{10}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$",
        "description": "String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random))",
        "readOnly": true,
        "x-go-type": "string"
      },
      "semanticversion.v1": {
        "title": "Semantic Version Number",
        "description": "[Semantic Version Number 2.0.0](http://semver.org/). Regex from their [site](https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string).",
        "type": "string",
        "minLength": 5,
        "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
        "example": "2.36.1"
      },
      "reversedomainname.v1": {
        "title": "Reverse Domain Name",
        "description": "Name in the [reverse domain name notation](https://en.wikipedia.org/wiki/Reverse_domain_name_notation).",
        "type": "string",
        "pattern": "^[a-zA-Z0-9](|[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(\\.[a-zA-Z0-9](|[a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))+$",
        "example": "org.tidepool.uploader"
      },
      "deduplicatordescriptor.v1": {
        "title": "Deduplicator Descriptor",
        "type": "object",
        "properties": {
          "hash": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "$ref": "#/components/schemas/semanticversion.v1"
          },
          "name": {
            "$ref": "#/components/schemas/reversedomainname.v1"
          }
        },
        "required": [
          "name",
          "version"
        ],
        "x-tags": [
          "Data"
        ]
      },
      "deviceid.v1": {
        "title": "Device ID",
        "description": "Globally unique to device and repeatable with each upload, e.g. device make and model with serial number",
        "type": "string",
        "minLength": 1,
        "example": "MMT-1711:12345678",
        "x-tags": [
          "Data"
        ]
      },
      "datetimenotz.v1": {
        "title": "Date/Time without Timezone",
        "description": "[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) / [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp _without_ timezone information",
        "type": "string",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
        "example": "2017-02-06T02:37:46",
        "x-go-type": "string"
      },
      "jsonpatch.v1": {
        "title": "JSONPatch",
        "oneOf": [
          {
            "properties": {
              "op": {
                "type": "string",
                "description": "The operation to perform.",
                "enum": [
                  "add",
                  "replace",
                  "test"
                ]
              },
              "path": {
                "type": "string",
                "description": "A JSON Pointer path."
              },
              "value": {
                "description": "The value to add, replace or test."
              }
            },
            "required": [
              "op",
              "path",
              "value"
            ]
          },
          {
            "properties": {
              "op": {
                "type": "string",
                "description": "The operation to perform.",
                "enum": [
                  "remove"
                ]
              },
              "path": {
                "type": "string",
                "description": "A JSON Pointer path."
              }
            },
            "required": [
              "op",
              "path"
            ]
          },
          {
            "properties": {
              "op": {
                "type": "string",
                "description": "The operation to perform.",
                "enum": [
                  "move",
                  "copy"
                ]
              },
              "from": {
                "description": "A JSON Pointer path pointing to the location to move/copy from.",
                "type": "string"
              },
              "path": {
                "type": "string",
                "description": "A JSON Pointer path."
              }
            },
            "required": [
              "op",
              "from",
              "path"
            ]
          }
        ],
        "type": "object",
        "description": "Only have this here because Stoplight doesn't seem to like using the JSONSchema directly as a ref from http://json.schemastore.org/json-patch"
      },
      "eventhistory.v1": {
        "title": "Event History [Proposed]",
        "description": "Revision history of the event",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "time": {
              "$ref": "#/components/schemas/datetime.v1"
            },
            "changes": {
              "$ref": "#/components/schemas/jsonpatch.v1"
            }
          },
          "required": [
            "time",
            "changes"
          ]
        },
        "x-tags": [
          "Data"
        ]
      },
      "origin-id.v1": {
        "title": "Origin ID",
        "description": "Any external identifier uniquely identifying the resource at the origin source.",
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "name.v1": {
        "title": "Origin Name",
        "description": "A human-readable name for the origin source.",
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "payload.v1": {
        "title": "Payload",
        "description": "Grab bag field for data that isn't yet part of the data model. The maximum size is 4K bytes.",
        "type": "object",
        "additionalProperties": true
      },
      "origin-type.v1": {
        "title": "Origin Type",
        "description": "The type of the origin source.",
        "type": "string",
        "enum": [
          "application",
          "device",
          "manual",
          "service"
        ],
        "example": "device"
      },
      "version.v1": {
        "title": "Origin Version",
        "description": "The version of the origin source at the time the resources was obtained.",
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "origin.v1": {
        "title": "Origin",
        "description": "External origin information for the source of the resource.",
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/origin-id.v1"
          },
          "name": {
            "$ref": "#/components/schemas/name.v1"
          },
          "payload": {
            "$ref": "#/components/schemas/payload.v1"
          },
          "time": {
            "$ref": "#/components/schemas/datetime.v1"
          },
          "type": {
            "$ref": "#/components/schemas/origin-type.v1"
          },
          "version": {
            "$ref": "#/components/schemas/version.v1"
          }
        },
        "required": [
          "id",
          "name",
          "time",
          "type",
          "version"
        ]
      },
      "longitude.v1": {
        "title": "Longitude",
        "description": "The prime meridian, which passes near the Royal Observatory, Greenwich, England, is defined as 0° longitude by convention. Positive longitudes are east of the prime meridian, and negative ones are west.",
        "type": "object",
        "properties": {
          "units": {
            "type": "string",
            "enum": [
              "degrees"
            ],
            "example": "degrees"
          },
          "value": {
            "type": "number",
            "format": "double",
            "minimum": -180,
            "maximum": 180,
            "example": -122.1625595
          }
        },
        "required": [
          "units",
          "value"
        ]
      },
      "latitude.v1": {
        "title": "Latitude",
        "description": "Latitude is an angle which ranges from -90° at the South pole to 0° at the Equator to 90° at the North pole.",
        "type": "object",
        "properties": {
          "units": {
            "type": "string",
            "enum": [
              "degrees"
            ],
            "example": "degrees"
          },
          "value": {
            "type": "number",
            "format": "double",
            "minimum": -90,
            "maximum": 90,
            "example": 37.4454404
          }
        },
        "required": [
          "units",
          "value"
        ]
      },
      "meters.v1": {
        "title": "Accuracy (meters)",
        "description": "Accuracy of a measurement, expressed as meters.",
        "type": "object",
        "properties": {
          "value": {
            "type": "number",
            "format": "double",
            "minimum": 0,
            "maximum": 1000,
            "example": 42
          },
          "units": {
            "type": "string",
            "enum": [
              "meters"
            ],
            "example": "meters"
          }
        },
        "required": [
          "units"
        ]
      },
      "accuracy-feet.v1": {
        "title": "Accuracy (feet)",
        "description": "Accuracy of a measurement, expressed in `feet`.",
        "type": "object",
        "properties": {
          "value": {
            "type": "number",
            "format": "double",
            "minimum": 0,
            "maximum": 3280,
            "example": 42
          },
          "units": {
            "type": "string",
            "enum": [
              "feet"
            ],
            "example": "feet"
          }
        },
        "required": [
          "units"
        ]
      },
      "accuracy.v1": {
        "title": "Accuracy",
        "description": "Accuracy of a measurement",
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/meters.v1"
          },
          {
            "$ref": "#/components/schemas/accuracy-feet.v1"
          }
        ]
      },
      "floor.v1": {
        "title": "Floor",
        "type": "integer",
        "format": "int32",
        "minimum": -1000,
        "maximum": 1000
      },
      "elevation-meters.v1": {
        "title": "Elevation (meters)",
        "type": "object",
        "properties": {
          "units": {
            "type": "string",
            "enum": [
              "meters"
            ],
            "example": "meters"
          },
          "value": {
            "type": "number",
            "format": "double",
            "minimum": 0,
            "maximum": 10000,
            "example": 42
          }
        },
        "required": [
          "units",
          "value"
        ]
      },
      "elevation-feet.v1": {
        "title": "Elevation (feet)",
        "type": "object",
        "properties": {
          "units": {
            "type": "string",
            "enum": [
              "feet"
            ],
            "example": "feet"
          },
          "value": {
            "type": "number",
            "format": "double",
            "minimum": 0,
            "maximum": 32808,
            "example": 42
          }
        },
        "required": [
          "units",
          "value"
        ]
      },
      "elevation.v1": {
        "title": "Elevation",
        "description": "Elevation, expressed as `meters` or `feet`.",
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/elevation-meters.v1"
          },
          {
            "$ref": "#/components/schemas/elevation-feet.v1"
          }
        ]
      },
      "gps.v1": {
        "title": "GPS",
        "description": "GPS coordinates and related information.",
        "type": "object",
        "properties": {
          "origin": {
            "$ref": "#/components/schemas/origin.v1"
          },
          "longitude": {
            "$ref": "#/components/schemas/longitude.v1"
          },
          "latitude": {
            "$ref": "#/components/schemas/latitude.v1"
          },
          "horizontalAccuracy": {
            "$ref": "#/components/schemas/accuracy.v1"
          },
          "verticalAccuracy": {
            "$ref": "#/components/schemas/accuracy.v1"
          },
          "floor": {
            "$ref": "#/components/schemas/floor.v1"
          },
          "elevation": {
            "$ref": "#/components/schemas/elevation.v1"
          }
        },
        "required": [
          "longitude",
          "latitude"
        ]
      },
      "location.v1": {
        "title": "Location",
        "type": "object",
        "description": "Location information associated with the resource. One or both of `name` and `gps` must be specified.",
        "properties": {
          "name": {
            "type": "string",
            "description": "A name for the location.",
            "minLength": 1,
            "maxLength": 100
          },
          "gps": {
            "$ref": "#/components/schemas/gps.v1"
          }
        }
      },
      "note.v1": {
        "title": "Note",
        "description": "A note associated with the resource.",
        "type": "string",
        "minLength": 1,
        "maxLength": 1000
      },
      "notearray.v1": {
        "title": "Note Array",
        "description": "An array of 1 to 100 notes.",
        "type": "array",
        "minItems": 1,
        "maxItems": 100,
        "items": {
          "$ref": "#/components/schemas/note.v1"
        }
      },
      "tag.v1": {
        "title": "Tag",
        "description": "A tag associated with the resource.",
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "tagarray.v1": {
        "title": "Tag Array",
        "description": "An array of tags.",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/tag.v1"
        }
      },
      "timezonename.v1": {
        "title": "Time Zone",
        "description": "A string timezone name from the [IANA timezone database](https://www.iana.org/time-zones)",
        "type": "string",
        "example": "Europe/London",
        "x-tags": [
          "Data"
        ]
      },
      "timezoneoffset.v1": {
        "title": "Time Zone offset",
        "description": "Time zone offset, expressed as positive or negative number of minutes from UTC.",
        "type": "integer",
        "format": "int32",
        "minimum": -10080,
        "maximum": 10080,
        "example": -420,
        "x-tags": [
          "Data"
        ]
      },
      "datatype.v1": {
        "title": "Tidepool Data Type",
        "description": "Data type",
        "type": "string",
        "enum": [
          "alert",
          "basal",
          "bloodKetone",
          "bolus",
          "cbg",
          "cgmSettings",
          "controllerSettings",
          "controllerStatus",
          "deviceEvent",
          "deviceStatus",
          "dosingDecision",
          "food",
          "insulin",
          "physicalActivity",
          "pumpSettings",
          "pumpStatus",
          "reportedState",
          "smbg",
          "upload",
          "water",
          "wizard"
        ],
        "example": "upload",
        "x-tags": [
          "Data"
        ]
      },
      "uploadid.v1": {
        "title": "Upload ID",
        "description": "An upload identifier; this field should be the uploadId of the corresponding upload record",
        "type": "string",
        "pattern": "^([0-9a-f]{32}|upid_[0-9a-f]{12})$",
        "minLength": 17,
        "maxLength": 32,
        "example": "0d92d5c1c22117a18f3620b9e24d3c06",
        "x-tags": [
          "Data"
        ]
      },
      "base.v1": {
        "title": "Base",
        "description": "An abstract base data type for all Tidepool diabetes data objects.",
        "type": "object",
        "properties": {
          "annotations": {
            "$ref": "#/components/schemas/annotationarray.v1"
          },
          "archivedTime": {
            "allOf": [
              {
                "$ref": "#/components/schemas/datetime.v1"
              }
            ],
            "readOnly": true
          },
          "archivedDatasetId": {
            "$ref": "#/components/schemas/datasetid.v1"
          },
          "associations": {
            "$ref": "#/components/schemas/associationarray.v1"
          },
          "clockDriftOffset": {
            "$ref": "#/components/schemas/clockdriftoffset.v1"
          },
          "conversionOffset": {
            "$ref": "#/components/schemas/conversionoffset.v1"
          },
          "createdTime": {
            "$ref": "#/components/schemas/datetime.v1"
          },
          "createdUserId": {
            "$ref": "#/components/schemas/tidepooluserid"
          },
          "deduplicator": {
            "$ref": "#/components/schemas/deduplicatordescriptor.v1"
          },
          "deletedTime": {
            "$ref": "#/components/schemas/datetime.v1"
          },
          "deletedUserId": {
            "$ref": "#/components/schemas/tidepooluserid"
          },
          "deviceId": {
            "$ref": "#/components/schemas/deviceid.v1"
          },
          "deviceTime": {
            "$ref": "#/components/schemas/datetimenotz.v1"
          },
          "guid": {
            "type": "string",
            "description": "A string ID. Added to each event during data processing in the Tidepool Uploader or upon ingestion by the platform data ingestion service.",
            "deprecated": true
          },
          "history": {
            "$ref": "#/components/schemas/eventhistory.v1"
          },
          "id": {
            "$ref": "#/components/schemas/datasetid.v1"
          },
          "location": {
            "$ref": "#/components/schemas/location.v1"
          },
          "modifiedTime": {
            "$ref": "#/components/schemas/datetime.v1"
          },
          "modifiedUserId": {
            "$ref": "#/components/schemas/tidepooluserid"
          },
          "notes": {
            "$ref": "#/components/schemas/notearray.v1"
          },
          "origin": {
            "$ref": "#/components/schemas/origin.v1"
          },
          "payload": {
            "$ref": "#/components/schemas/payload.v1"
          },
          "source": {
            "type": "string",
            "enum": [
              "carelink"
            ]
          },
          "tags": {
            "$ref": "#/components/schemas/tagarray.v1"
          },
          "time": {
            "$ref": "#/components/schemas/datetime.v1"
          },
          "timezone": {
            "$ref": "#/components/schemas/timezonename.v1"
          },
          "timezoneOffset": {
            "$ref": "#/components/schemas/timezoneoffset.v1"
          },
          "type": {
            "$ref": "#/components/schemas/datatype.v1"
          },
          "uploadId": {
            "$ref": "#/components/schemas/uploadid.v1"
          }
        },
        "required": [
          "id",
          "type",
          "time"
        ],
        "x-tags": [
          "Data"
        ]
      },
      "calories.v1": {
        "title": "Energy (calories)",
        "type": "object",
        "properties": {
          "units": {
            "type": "string",
            "enum": [
              "calories"
            ]
          },
          "value": {
            "type": "number",
            "format": "float",
            "minimum": 0,
            "maximum": 10000000
          }
        },
        "required": [
          "units",
          "value"
        ]
      },
      "kilocalories.v1": {
        "title": "Energy (kilocalories)",
        "type": "object",
        "properties": {
          "units": {
            "type": "string",
            "enum": [
              "kilocalories"
            ]
          },
          "value": {
            "type": "number",
            "format": "float",
            "minimum": 0,
            "maximum": 10000
          }
        },
        "required": [
          "units",
          "value"
        ]
      },
      "joules.v1": {
        "title": "Energy (joules)",
        "type": "object",
        "properties": {
          "units": {
            "type": "string",
            "enum": [
              "joules"
            ]
          },
          "value": {
            "type": "number",
            "format": "float",
            "minimum": 0,
            "maximum": 41858000
          }
        },
        "required": [
          "units",
          "value"
        ]
      },
      "kilojoules.v1": {
        "title": "Energy (kilojoules)",
        "type": "object",
        "properties": {
          "units": {
            "type": "string",
            "enum": [
              "kilojoules"
            ]
          },
          "value": {
            "type": "number",
            "format": "float",
            "minimum": 0,
            "maximum": 41858
          }
        },
        "required": [
          "units",
          "value"
        ]
      },
      "energy.v1": {
        "title": "Energy",
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/calories.v1"
          },
          {
            "$ref": "#/components/schemas/kilocalories.v1"
          },
          {
            "$ref": "#/components/schemas/joules.v1"
          },
          {
            "$ref": "#/components/schemas/kilojoules.v1"
          }
        ]
      },
      "nutrition.v1": {
        "title": "Nutrition",
        "type": "object",
        "properties": {
          "absorptionDuration": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "maximum": 86400,
            "description": "The duration it takes to fully digest/absorb the nutrients, in `seconds`"
          },
          "carbohydrate": {
            "type": "object",
            "properties": {
              "dietaryFiber": {
                "type": "number",
                "format": "float",
                "minimum": 0,
                "maximum": 1000
              },
              "net": {
                "type": "number",
                "format": "float",
                "minimum": 0,
                "maximum": 1000
              },
              "sugars": {
                "type": "number",
                "format": "float",
                "minimum": 0,
                "maximum": 1000
              },
              "total": {
                "type": "number",
                "format": "float",
                "minimum": 0,
                "maximum": 1000
              },
              "units": {
                "type": "string",
                "enum": [
                  "grams"
                ]
              }
            },
            "required": [
              "net",
              "units"
            ]
          },
          "energy": {
            "$ref": "#/components/schemas/energy.v1"
          },
          "fat": {
            "type": "object",
            "properties": {
              "total": {
                "type": "number",
                "format": "float",
                "minimum": 0,
                "maximum": 1000
              },
              "units": {
                "type": "string",
                "enum": [
                  "grams"
                ]
              }
            },
            "required": [
              "total",
              "units"
            ]
          },
          "protein": {
            "type": "object",
            "properties": {
              "total": {
                "type": "number",
                "format": "float",
                "minimum": 0,
                "maximum": 1000
              },
              "units": {
                "type": "string",
                "enum": [
                  "grams"
                ]
              }
            },
            "required": [
              "total",
              "units"
            ]
          }
        },
        "example": {
          "absorptionDuration": 10800,
          "carbohydrate": {
            "net": 25,
            "units": "grams"
          }
        }
      },
      "valuemgdl.v1": {
        "title": "Blood Value (mg/dL)",
        "description": "An integer value representing a `mg/dL` value.",
        "type": "integer",
        "format": "int32",
        "minimum": 0,
        "maximum": 1000,
        "example": 105,
        "x-tags": [
          "Data"
        ]
      },
      "valuemmol.v1": {
        "title": "Blood Value (mmol/L)",
        "description": "A floating point value representing a `mmol/L` value.",
        "type": "number",
        "format": "float",
        "minimum": 0,
        "example": 5.5,
        "x-tags": [
          "Data"
        ]
      },
      "value.v1": {
        "title": "Blood Value (in mg/dL or mmol/L units)",
        "oneOf": [
          {
            "$ref": "#/components/schemas/valuemgdl.v1"
          },
          {
            "$ref": "#/components/schemas/valuemmol.v1"
          }
        ],
        "x-tags": [
          "Data"
        ]
      },
      "bloodglucose.v1": {
        "title": "Blood Glucose for Dosing Decision",
        "description": "A simple blood glucose for a dosing decision.",
        "type": "object",
        "properties": {
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "value": {
            "$ref": "#/components/schemas/value.v1"
          }
        },
        "required": [
          "value"
        ],
        "x-tags": [
          "Data"
        ]
      },
      "targetmgdl.v1": {
        "title": "Blood Glucose Target Value (mg/dL)",
        "description": "Blood glucose target values, in `mg/dL`",
        "type": "object",
        "properties": {
          "high": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000,
            "description": "An integer encoding the upper bound of a PWD's blood glucose target.\n\nThe minimum value should be >= `low` or `target`, whichever present"
          },
          "low": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000,
            "description": "An integer encoding the lower bound of a PWD's blood glucose target."
          },
          "range": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000,
            "description": "An integer encoding the allowed deviation above or below the PWD's target blood glucose.\n\nMaximum should be min(`target`, 1000 - `target`) such that `target`-`range` >= 0 and `target`+`range` <= 1000"
          },
          "target": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000,
            "description": "An integer encoding the PWD's target blood glucose as a single value."
          }
        },
        "example": {
          "high": 180,
          "low": 80
        },
        "x-tags": [
          "Data"
        ]
      },
      "targetmmol.v1": {
        "title": "Blood Glucose Target Value (mmol/L)",
        "description": "Blood glucose target values, in `mmol/L`",
        "type": "object",
        "properties": {
          "high": {
            "type": "number",
            "description": "An integer encoding the upper bound of a PWD's blood glucose target.\n\nThe minimum value should be >= `low` or `target`, whichever present",
            "minimum": 0,
            "maximum": 55
          },
          "low": {
            "type": "number",
            "minimum": 0,
            "maximum": 55,
            "description": "An integer encoding the lower bound of a PWD's blood glucose target."
          },
          "range": {
            "type": "number",
            "minimum": 0,
            "maximum": 55,
            "description": "An integer encoding the allowed deviation above or below the PWD's target blood glucose.\n\nMaximum should be min(`target`, 1000 - `target`) such that `target`-`range` >= 0 and `target`+`range` <= 1000"
          },
          "target": {
            "type": "number",
            "minimum": 0,
            "maximum": 55,
            "description": "An integer encoding the PWD's target blood glucose as a single value."
          }
        },
        "x-tags": [
          "Data"
        ]
      },
      "target.v1": {
        "title": "Blood Glucose Target",
        "oneOf": [
          {
            "$ref": "#/components/schemas/targetmgdl.v1"
          },
          {
            "$ref": "#/components/schemas/targetmmol.v1"
          }
        ],
        "x-tags": [
          "Data"
        ]
      },
      "start.v1": {
        "title": "Start Time",
        "description": "Start time as millisecond offset from midnight",
        "type": "object",
        "properties": {
          "start": {
            "type": "number",
            "minimum": 0,
            "maximum": 86400000
          }
        },
        "required": [
          "start"
        ],
        "x-tags": [
          "Data"
        ]
      },
      "targetstart.v1": {
        "title": "Blood Glucose Target Start",
        "description": "",
        "allOf": [
          {
            "$ref": "#/components/schemas/target.v1"
          },
          {
            "$ref": "#/components/schemas/start.v1"
          }
        ],
        "x-tags": [
          "Data"
        ]
      },
      "issue.v1": {
        "title": "Issue for Dosing Decision",
        "description": "An issue for a dosing decision.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "id"
        ],
        "example": {
          "id": "unknown",
          "metadata": {
            "extra": "information"
          }
        },
        "x-tags": [
          "Data"
        ]
      },
      "unitsmgdl.v1": {
        "title": "Blood Unit (mg/dL)",
        "type": "string",
        "enum": [
          "mg/dL",
          "mg/dl"
        ],
        "example": "mg/dL",
        "x-tags": [
          "Data"
        ]
      },
      "unitsmmol.v1": {
        "title": "Blood Unit (mmol/L)",
        "type": "string",
        "enum": [
          "mmol/L",
          "mmol/l"
        ],
        "example": "mmol/L",
        "x-tags": [
          "Data"
        ]
      },
      "units.v1": {
        "title": "Blood Unit (mg/dL or mmol/L)",
        "oneOf": [
          {
            "$ref": "#/components/schemas/unitsmgdl.v1"
          },
          {
            "$ref": "#/components/schemas/unitsmmol.v1"
          }
        ],
        "x-tags": [
          "Data"
        ]
      },
      "dosingdecision.v1": {
        "title": "Dosing Decision",
        "description": "A dosing decision",
        "allOf": [
          {
            "$ref": "#/components/schemas/base.v1"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "dosingDecision"
                ]
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "example": "bolus"
              },
              "originalFood": {
                "type": "object",
                "properties": {
                  "time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "nutrition": {
                    "$ref": "#/components/schemas/nutrition.v1"
                  }
                },
                "required": [
                  "nutrition"
                ]
              },
              "food": {
                "type": "object",
                "properties": {
                  "time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "nutrition": {
                    "$ref": "#/components/schemas/nutrition.v1"
                  }
                },
                "required": [
                  "nutrition"
                ]
              },
              "smbg": {
                "$ref": "#/components/schemas/bloodglucose.v1"
              },
              "carbsOnBoard": {
                "type": "object",
                "properties": {
                  "time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "amount": {
                    "type": "number",
                    "format": "double",
                    "minimum": 0,
                    "maximum": 1000,
                    "example": 18
                  }
                },
                "required": [
                  "amount"
                ]
              },
              "insulinOnBoard": {
                "type": "object",
                "properties": {
                  "time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "amount": {
                    "type": "number",
                    "format": "double",
                    "minimum": -1000,
                    "maximum": 1000,
                    "example": 0.75
                  }
                },
                "required": [
                  "amount"
                ]
              },
              "bgTargetSchedule": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/targetstart.v1"
                }
              },
              "bgHistorical": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/bloodglucose.v1"
                }
              },
              "bgForecast": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/bloodglucose.v1"
                }
              },
              "recommendedBasal": {
                "type": "object",
                "properties": {
                  "rate": {
                    "type": "number",
                    "format": "double",
                    "minimum": 0,
                    "maximum": 100,
                    "example": 1.25
                  },
                  "duration": {
                    "type": "number",
                    "format": "int32",
                    "minimum": 0,
                    "maximum": 86400000,
                    "example": 180000
                  }
                },
                "required": [
                  "rate"
                ]
              },
              "recommendedBolus": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "format": "double",
                    "minimum": 0,
                    "maximum": 1000,
                    "example": 2.5
                  }
                },
                "required": [
                  "amount"
                ]
              },
              "requestedBolus": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "format": "double",
                    "minimum": 0,
                    "maximum": 1000,
                    "example": 2
                  }
                },
                "required": [
                  "amount"
                ]
              },
              "warnings": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/issue.v1"
                }
              },
              "errors": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/issue.v1"
                }
              },
              "scheduleTimeZoneOffset": {
                "type": "number",
                "format": "int32",
                "minimum": -10080,
                "maximum": 10080,
                "example": -480
              },
              "units": {
                "type": "object",
                "properties": {
                  "bg": {
                    "$ref": "#/components/schemas/units.v1"
                  },
                  "carb": {
                    "type": "string",
                    "enum": [
                      "exchanges",
                      "grams"
                    ],
                    "example": "grams"
                  },
                  "insulin": {
                    "type": "string",
                    "enum": [
                      "Units"
                    ]
                  }
                },
                "required": [
                  "bg",
                  "carb",
                  "insulin"
                ]
              }
            },
            "required": [
              "reason",
              "units"
            ]
          }
        ],
        "x-tags": [
          "Data"
        ]
      }
    }
  }
}
```

## Overview

This is the Tidepool data type representing a dosing decision.

## Type (`type`)

This is the Tidepool data type to represent a dosing decision.

## Reason (`reason`)

The reason for the dosing decision. The reason is specific to the client performing the dosing decision.

## Original Food (`originalFood`)

If the dosing decision is due to an updated carbohydrate entry then this contains the following:

* Time
* Nutrition


### Time (`time`) (Original Food)

The time associated with the original, pre-updated food.

### Nutrition (`nutrition`) (Original Food)

The nutrition associated with the original, pre-updated food.

## Food (`food`)

If the dosing decision is due to a new or updated carbohydrate entry then this contains the following:

* Time
* Nutrition


### Time (`time`) (Food)

The time associated with the new or post-updated food.

### Nutrition (`nutrition`) (Food)

The nutrition associated with the new or post-updated food.

## Self Monitored Blood Glucose (`smbg`)

If the dosing decision is due to a simple bolus requested by the user and the user inputs a self monitored blood glucose then this contains the following:

* Time
* Value


### Time (`time`) (Self Monitored Blood Glucose)

The time associated with the self monitored blood glucose.

### Value (`value`) (Self Monitored Blood Glucose)

The value of the self monitored blood glucose.

## Carbohydrates On Board (`carbsOnBoard`)

The current carbohydrates on board for the dosing decision. Contains the following properties:

* Time
* Amount


### Time (`time`) (Carbohydrates On Board)

The time associated with the carbohydrates on board.

### Amount (`amount`) (Carbohydrates On Board)

The amount of the carbohydrates on board.

## Insulin On Board (`insulinOnBoard`)

The current insulin on board for the dosing decision. Contains the following properties:

* Time
* Amount


### Time (`time`) (Insulin On Board)

The time associated with the insulin on board.

### Amount (`amount`) (Insulin On Board)

The amount of the insulin on board.

## Blood Glucose Target Schedule (`bgTargetSchedule`)

The blood glucose target schedule used in the dosing decision. See [Blood Glucose Target](/docs/device-data/data-types/pump-settings#blood-glucose-target-bgtarget).

## Blood Glucose Historical (`bgHistorical`)

An array of historical blood glucose values. The array contain zero to many objects with the following properties:

* Time
* Value


### Time (`time`) (Blood Glucose Historical)

The time of this historical blood glucose.

### Value (`value`) (Blood Glucose Historical)

The value of this historical blood glucose.

## Blood Glucose Forecast (`bgForecast`)

An array of forecast blood glucose values. The array contain zero to many objects with the following properties:

* Time
* Value


### Time (`time`) (Blood Glucose Forecast)

The time of this forecast blood glucose.

### Value (`value`) (Blood Glucose Forecast)

The value of this forecast blood glucose.

## Recommended Basal (`recommendedBasal`)

The basal recommended by the client. Contains the following field:

* Rate
* Duration


### Rate (`rate`) (Recommended Basal)

The rate of basal insulin delivery as recommended by the client.

### Duration (`duration`) (Recommended Basal)

The duration of basal insulin delivery as recommended by the client.

## Recommended Bolus (`recommendedBolus`)

The bolus recommended by the client. Contains the following field:

* Amount


### Amount (`amount`) (Recommended Bolus)

The amount of insulin to bolus as recommended by the client.

## Requested Bolus (`requestedBolus`)

The actual bolus requested by the user. Contains the following field:

* Amount


### Amount (`amount`) (Requested Bolus)

The amount of insulin to bolus as requested by the user.

## Warnings (`warnings`)

All warnings that occurred while calculating the dosing decision. The array contains zero to many objects each containing the following properties:

* ID
* Metadata


### ID (`id`) (Warnings)

The identifier of the warning. This is specific to the client making the dosing decision.

### Metadata (`metadata`) (Warnings)

Any metadata associated with the warning. This is a dictionary with key and value of strings.

## Errors (`errors`)

All errors that occurred while calculating the dosing decision. The array contains zero to many objects each containing the following properties:

* ID
* Metadata


### ID (`id`) (Errors)

The identifier of the error. This is specific to the client making the dosing decision.

### Metadata (`metadata`) (Errors)

Any metadata associated with the error. This is a dictionary with key and value of strings.

## Schedule Time Zone Offset (`scheduleTimeZoneOffset`)

The time zone offset in minutes for any schedule specified in the dosing decision (e.g. Blood Glucose Target Schedule).

## Units (`units`)

The units of the dosing decision. Contains the following fields:

* Blood Glucose
* Carbohydrate
* Insulin


### Blood Glucose (`bg`) (Units)

The blood glucose units of the dosing decision. Can be one of `mg/dL` or `mmol/L`.

### Carbohydrate (`carb`) (Units)

The carbohydrate units of the dosing decision. Can be one of `grams` or `exchanges`.

### Insulin (`insulin`) (Units)

The insulin units of the dosing decision. Can be one of `Units`.


```json Example Dosing Decision
{
    "id": "02ccebd2affc472d9b296d4f1f800dfd",
    "time": "2018-05-14T08:17:07.560Z",
    "type": "dosingDecision",
    "uploadId": "0d92d5c1c22117a18f3620b9e24d3c06"
    "originalFood": {
      "time": "2019-08-24T14:15:22Z",
      "nutrition": {
        "absorptionDuration": 10800,
        "carbohydrate": {
          "net": 15
        }
      }
    },
    "food": {
      "time": "2019-08-24T14:15:22Z",
      "nutrition": {
        "absorptionDuration": 10800,
        "carbohydrate": {
          "net": 25
        }
      }
    },
    "smbg": {
      "time": "2019-08-24T14:15:22Z",
      "value": 105
    },
    "carbsOnBoard": {
      "time": "2019-08-24T14:15:22Z",
      "amount": 18
    },
    "insulinOnBoard": {
      "time": "2019-08-24T14:15:22Z",
      "amount": 0.75
    },
    "bgTargetSchedule": [
      {
        "high": 180,
        "low": 80,
        "start": 0
      }
    ],
    "bgHistorical": [
      {
        "time": "2019-08-24T14:15:22Z",
        "value": 105
      }
    ],
    "bgPredicted": [
      {
        "time": "2019-08-24T14:15:22Z",
        "value": 110
      }
    ],
    "recommendedBasal": {
      "rate": 1.25,
      "duration": 180000
    },
    "recommendedBolus": {
      "amount": 2.5
    },
    "requestedBolus": {
      "amount": 2
    },
    "warnings": [
      {
        "id": "unknown",
        "metadata": {
          "extra": "information"
        }
      }
    ],
    "errors": [
      {
        "id": "unknown",
        "metadata": {
          "extra": "information"
        }
      }
    ],
    "scheduleTimeZoneOffset": -480,
    "units": {
      "bg": "mg/dL",
      "carb": "grams",
      "insulin": "Units"
    }
}
```

## Keep Reading

* [Annotations](/docs/device-data/annotations)
* [Common Fields](/docs/device-data/common-fields)
* [Out Of Range Values](/docs/device-data/oor-values)
* [Units](/docs/device-data/units)