{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Linking Events","llmstxt":{"hide":true}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"linking-events","__idx":0},"children":["Linking Events"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Not all events from diabetes management devices are independent. Some events are logically related — perhaps in a rough cause-and-effect relationship. In cases where there is a logical connection between events, Tidepool endeavors to preserve that connection in the standardized form of data stored in the Tidepool cloud."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"potentially-linked-events","__idx":2},"children":["Potentially Linked Events"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Bolus calculator (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["wizard"]},") -> Bolus (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bolus"]},")"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Alarm (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["alarm"]},") -> Status (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]},")"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Reservoir Change (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["resevoirChange"]},") -> Status (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]},")"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-to-link-events","__idx":3},"children":["How To Link Events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Platform creates GUIDs for the ID of each event. This means that linked events such as pairs of wizard and bolus events ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["cannot"]}," be uploaded separately. Instead, only the \"outer\" event is uploaded with the \"inner\" linked event embedded inside it. Upon ingestion of this compound event, Tidepool's Platform:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Generates the GUID for the inner event and stores it on the inner event's ID field"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Extracts and stores the inner event as an independent event"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Updates the appropriate field on the outer event to contain just the GUID for the inner event instead of the entire object"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The data for ingestion via Platform looks like:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"Sample Data","header":{"title":"Sample Data","controls":{"copy":{}}},"source":"[\n  {\n    \"type\": \"wizard\",\n    \"bgInput\": 32,\n    \"bgTarget\": {\n      \"target\": 85,\n      \"high\": 145\n    },\n    \"bolus\": {\n      \"type\": \"bolus\",\n      \"subType\": \"normal\",\n      \"normal\": 1,\n      \"clockDriftOffset\": 0,\n      \"conversionOffset\": 0,\n      \"deviceId\": \"DevId0987654321\",\n      \"deviceTime\": \"2016-06-14T10:52:45\",\n      \"time\": \"2016-06-14T17:52:45.845Z\",\n      \"timezoneOffset\": -420,\n      \"uploadId\": \"SampleUploadId\"\n  }\n]\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The resulting data looks like:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","data-title":"Sample Response","header":{"title":"Sample Response","controls":{"copy":{}}},"source":"[\n  {\n    \"type\": \"bolus\",\n    \"subType\": \"normal\",\n    \"normal\": 1,\n    \"clockDriftOffset\": 0,\n    \"conversionOffset\": 0,\n    \"deviceId\": \"DevId0987654321\",\n    \"deviceTime\": \"2016-06-14T10:52:45\",\n    \"time\": \"2016-06-14T17:52:45.845Z\",\n    \"timezoneOffset\": -420,\n    \"uploadId\": \"SampleUploadId\",\n    \"_groupId\": \"f4c834c27a\",\n    \"guid\": \"4c2f3acc-8d1d-4df0-bc88-2fad64df8151\",\n    \"id\": \"9006526e4d8344a3987eea1a5f327426\",\n    \"createdTime\": \"2016-06-14T18:03:50.662Z\",\n    \"_version\": 0,\n    \"_active\": true,\n    \"_schemaVersion\": 1\n  }\n]\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"keep-reading","__idx":4},"children":["Keep Reading"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/device-data/data-types/device-event/alarm"},"children":["Alarm"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/device-data/data-types/bolus"},"children":["Bolus"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/device-data/data-types/calculator"},"children":["Bolus Calculator"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/device-data/common-fields"},"children":["Common Fields"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/device-data/data-types/device-event/reservoir-change"},"children":["Reservoir Change"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/device-data/data-types/device-event/status"},"children":["Status"]}]}]}]},"headings":[{"value":"Linking Events","id":"linking-events","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Potentially Linked Events","id":"potentially-linked-events","depth":2},{"value":"How To Link Events","id":"how-to-link-events","depth":2},{"value":"Keep Reading","id":"keep-reading","depth":2}],"frontmatter":{"seo":{"title":"Linking Events"}},"lastModified":"2025-09-04T14:19:18.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/device-data/linking-events","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}