The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

aidR: CareLink export format

library(aidR)

Overview

A CareLink (Medtronic) export is a single semicolon-delimited .csv (or .xlsx) file. The file is divided into sections separated by marker rows of the form -------;MiniMed 780G MMT-1886;Pump;XXXXXXXXXX;-------. Each section has its own header row and its own set of columns:

Last Name;First Name;Patient ID;System ID;Start Date;End Date;Device;MiniMed 780G MMT-1886;Hardware Version;A2.01;Firmware Version;8.13.2
"XXX";"YYY";"";"";"04.07.2026 00:00:00";"05.07.2026 00:00:00";"Serial Number";XXXXXXXXXX;Software Version;
Patient DOB;;;;;;CGM;Guardian™ 4 Sensor


-------;MiniMed 780G MMT-1886;Pump;XXXXXXXXXX;------- 
Index;Date;Time;New Device Time;BG Source;BG Reading (mg/dL);Linked BG Meter ID;Basal Rate (U/h);Temp Basal Amount;Temp Basal Type;Temp Basal Duration (h:mm:ss);Bolus Type;Bolus Volume Selected (U);Bolus Volume Delivered (U);Bolus Duration (h:mm:ss);Prime Type;Prime Volume Delivered (U);Estimated Reservoir Volume after Fill (U);Alert;User Cleared Alerts;Suspend;Rewind;BWZ Estimate (U);BWZ Target High BG (mg/dL);BWZ Target Low BG (mg/dL);BWZ Carb Ratio (g/U);BWZ Insulin Sensitivity (mg/dL/U);BWZ Carb Input (grams);BWZ BG/SG Input (mg/dL);BWZ Correction Estimate (U);BWZ Food Estimate (U);BWZ Active Insulin (U);BWZ Status;Sensor Calibration BG (mg/dL);Sensor Glucose (mg/dL);ISIG Value;Event Marker;Bolus Number;Bolus Cancellation Reason;BWZ Unabsorbed Insulin Total (U);Final Bolus Estimate;Scroll Step Size;Insulin Action Curve Time;Sensor Calibration Rejected Reason;Preset Bolus;Bolus Source;BLE Network Device;Device Update Event;Network Device Associated Reason;Network Device Disassociated Reason;Network Device Disconnected Reason;Sensor Exception;Preset Temp Basal Name;Sensor State
1,00000;2026/07/04;23:09:51;;;;;;;;;;;;;;;;;PERSONAL REMINDER;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2,00000;2026/07/04;23:08:00;;;;;;;;;;;;;;;;PERSONAL REMINDER: vibration;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3,00000;2026/07/04;22:48:05;;;;;;;;;Normal;1,9;1,9;;;;;;;;;;;;;;;;;;;;;;;;205;;;;;;;;CLOSED_LOOP_BG_CORRECTION_AND_FOOD_BOLUS;;;;;;;;

How aidR detects this format

aidR identifies a CareLink export by the keyword MiniMed in the first line.

Sections and the data types they produce

To inspect the files, we parse the export with clean = FALSE, which returns the full information provided by CareLink:

data <- parse_data(id = "1", paths = path, clean = FALSE)
#> Parsing data for id 1...

Because all information is present in one file, most of the parsing work happens up front: the file is split into sections, and the large “Pump” section is then split further into individual event types based on which columns are populated on each row.

The list below describes the different sections and the information we can get from it.

head(data$aggr_auto_insulin)
     Index  timestamp Bolus Type Bolus Volume Selected (U)
1 93,00000 2026-07-04     Normal                    20.494
  Bolus Volume Delivered (U)             Bolus Source
1                     20.494 CLOSED_LOOP_AUTO_INSULIN
head(data$cgm)
      Index           timestamp Sensor Glucose (mg/dL) ISIG Value
1 381,00000 2026-07-04 03:48:00                    109      19.80
2 380,00000 2026-07-04 03:53:00                    114      19.55
3 379,00000 2026-07-04 03:58:00                    106      19.00
4 378,00000 2026-07-04 04:03:00                     96      17.32
5 377,00000 2026-07-04 04:08:00                     89      16.03
6 376,00000 2026-07-04 04:13:00                     81      15.37
         sensor_name
1 Guardian™ 4 Sensor
2 Guardian™ 4 Sensor
3 Guardian™ 4 Sensor
4 Guardian™ 4 Sensor
5 Guardian™ 4 Sensor
6 Guardian™ 4 Sensor

Cleaning files

When parse_data is run with clean = TRUE, the cleaned data types are built from the following raw files and attributes:

Cleaned data type Used files Used attributes of clean = FALSE
cgm carelink_example.csv data$cgm
bolus carelink_example.csv data$bolus
carbs carelink_example.csv data$bwz
SMBG carelink_example.csv data$SMBG
total_bolus carelink_example.csv data$bolus

Note that a CareLink export contains no usable basal data - cgm, bolus, carbs, and SMBG are the core data types available from this platform (see the notes below).

Notes

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.