Skip to main content
BMJ Case Reports logoLink to BMJ Case Reports
. 2021 Sep 17;14(9):e243522. doi: 10.1136/bcr-2021-243522

Open-source automated insulin delivery systems for the management of type 1 diabetes during pregnancy

Khulood Bukhari 1,, Rana Malek 2
PMCID: PMC8451279  PMID: 34535491

Abstract

A 40-year-old woman used an open-source automated insulin delivery system to manage her type 1 diabetes (T1D) prior to conception. The code for building the iPhone application called ‘Loop’ that carried the software for the hybrid closed-loop controller was available online. Her glycated hemoglobin before conception was 6.4%. Between 6 and 12 weeks gestation, she spent 66% time-in-range (TIR), 28% time-above-range (TAR) and 6% time-below-range (TBR). Between 18 and 24 weeks gestation, she spent 68% TIR, 27% TAR and 5% TBR. During her third trimester, she spent 72% TIR, 21% TAR and 7% TBR. She delivered a healthy infant with no neonatal complications. Clinicians should be aware of this technology as it gains traction in the T1D community and seeks Food and Drug Administration approval.

Keywords: diabetes, endocrinology

Background

Open-source automated insulin delivery (AID) systems were developed under the social media mantra #WeAreNotWaiting by people with diabetes (PwD) interested in the automation of insulin delivery. These systems, also referred to as do-it-yourself artificial pancreas systems (DIY APS), integrate community-developed software with commercially available continuous glucose monitors (CGM) and insulin pumps to deliver insulin in a glucose-responsive manner. The first commercially available hybrid closed-loop system (Medtronic’s MiniMed 670G) received Food and Drug Administration (FDA) approval in September 2016. OpenAPS, the first open-source AID, was launched in December 2014. A growing number of PwD are turning to open-source technology to help manage their type 1 diabetes (T1D), however, reports on their efficacy and safety during pregnancy are limited.1

Case presentation

A 40-year-old woman, G2 P1, presented for diabetes care in her 6th week of pregnancy. Her medical history was significant for T1D diagnosed at the age of 11 and Graves’ disease that was in remission. Her first pregnancy 5 years prior was complicated with recurrent episodes of nocturnal hypoglycaemia and acceleration of proliferative diabetic retinopathy requiring laser treatment. Her infant was large for gestational age (LGA) and weighed 4110 g (9 lbs 1 oz) at birth. The newborn also experienced neonatal hypoglycaemia and required admission to the neonatal intensive care unit (NICU) for close monitoring. She used a Tandem T:slim insulin pump and a Dexcom G5 CGM to manage her diabetes during that time.

She started ‘looping’ 6 months prior to conception with the goal of achieving an A1c <7%. The code for building the iPhone application called ‘Loop’ that carried the algorithm for the hybrid closed-loop controller was available online.2 She used a device called ‘RileyLink’ to connect her iPhone to a compatible Medtronic insulin pump and a Dexcom G6 CGM to build her open-source AID system (figure 1).

Figure 1.

Figure 1

RileyLink. Reproduced with permission.

Instructions on how to build the application were relatively easy-to-follow and were directed at individuals without any technical expertise.2 Our patient faced some difficulties with the initial setup but found the help she needed from the online DIY community. She used an interface called ‘Tidepool’ to view her CGM, insulin pump and blood glucose metre data in one place and share it with her endocrinologist.

The patient expressed a clear understanding of the potential risks associated with the use of a non-FDA-approved AID system and was motivated to continue ‘looping’. Her endocrinologist felt comfortable managing her diabetes on Loop, but they agreed that she needed to have supplies for her Tandem T:slim insulin pump in case Loop failed to accurately adjust for pregnancy-related changes.

Her HbA1c (glycated hemoglobin) prior to conception was 6.4%. The patient’s settings on Loop prior to pregnancy were as follows: three basal rates with an average of 0.75 (minimum 0.7; maximum 0.85) U/hour; insulin-to-carbohydrate ratio (ICHR) 8 g/U; average insulin sensitivity factor (ISF) 90 (minimum 80; maximum 100) mg/dL/U; correction range 100 mg/dL; pre-meal override 85 mg/dL; workout override 130 mg/dL; suspension threshold 70 mg/dL. Her settings at 6 weeks gestation changed to an average basal rate of 0.95 U/hour; ICHR 7 g/U; ISF 80 mg/dL/U and a correction range of 90 mg/dL (table 1).

Table 1.

Pre-pregnancy and trimester-specific settings on Loop and TIR, TAR and TBR

Pre-pregnancy First trimester Second trimester Third trimester
Basal rate
(U/hour)
00:00 0.7
04:00 0.85
15:00 0.75
00:00 1.0
15:00 0.9
00:00 0.75
07:00 1.0
23:00 0.85
07:00 1.0
Insulin-to-carbohydrate ratio
(g/U)
8.0 7.0 6.0 00:00 6.0
12:00 5.0
17:00 7.0
Insulin sensitivity factor, mg/dL/U
(mmol/L/U)
00:00 100 (5.5)
12:00 80 (4.4)
00:00 90 (5.0)
12:00 70 (4.0)
21:00 90 (5.0)
00:00 90 (5.0)
12:00 75 (4.2)
00:00 90 (5.0)
12:00 75 (4.2)
Correction range, mg/dL
(mmol/L)
100
(5.5)
90
(5.0)
90
(5.0)
90
(5.0)
Overrides, mg/dL
(mmol/L)
Pre-meal 85 (4.7)
Workout 130 (7.2)
Pre-meal 80 (4.4)
Workout 120 (6.7)
Pre-meal 80 (4.4)
Workout 120 (6.7)
Pre-meal 80 (4.4)
Workout 120 (6.7)
Suspension threshold, mg/dL
(mmol/L)
70
(4.0)
70
(4.0)
70
(4.0)
70
(4.0)
Time-in-range
(%)
63 66 68 72
Time-above-range (%) 34 28 27 21
Time-below-range (%) 3 6 5 7

TAR, time-above-range; TBR, time-below-range; TIR, time-in-range.

Between 6 and 12 weeks gestation, she spent 66% time-in-range (TIR), 28% time-above-range (TAR) and 6% time-below-range (TBR) (figure 2). She was hospitalised with hyperemesis gravidarum and was allowed to continue looping during her inpatient stay. While looping, her blood glucose levels remained in range despite little food at times with minimal hypoglycaemia. Her basal rate during her second trimester was reduced to an average of 0.875 (minimum 0.75; maximum 1.0) U/hour to prevent overnight hypoglycaemia. ICHR and ISF were reduced to 6 g/U and 82.5 mg/dL, respectively. Between 18 and 24 weeks gestation, she spent 68% TIR, 27% TAR and 5% TBR. Entering her third trimester, the patient’s endocrinologist instructed her to increase her basal rate from 0.75 to 0.85 U/hour from 23:00 to 07:00 to address overnight hyperglycaemia. During her third trimester, she spent 72% TIR, 21% TAR and 7% TBR (table 1). She had an acceleration of diabetic retinopathy but her retinal specialist was able to delay treatment till post-delivery.

Figure 2.

Figure 2

CGM profile derived from Dexcom CLARITY. Target range set at 65–140 mg/dL based on the international consensus on time-in-range (TIR) recommendation that pregnant patients with T1D should have >70% of readings per day in the target range of 63–140 mg/dL. Lower range of target rounded to the nearest 5 mg/dL given setting limitations. T1D, type 1 diabetes.

Outcome and follow-up

The patient went into labour at 37 weeks gestation just before her scheduled caesarean section. She continued to loop during that time and while undergoing an emergency caesarean section. Her blood glucose level for the most part remained in the range of 70–150 mg/dL while in labour (figure 3). The neonate weighed 3742 g (8 lbs 4 oz) and did not suffer from complications related to diabetes in pregnancy including fetal macrosomia, birth defects or neonatal hypoglycaemia and did not require NICU admission.

Figure 3.

Figure 3

Delivery day diabetes data derived from Tidepool. The green line shows blood glucose trend throughout the day.

Discussion

The first DIY initiative, Nightscout (CGM-in-the-cloud), was developed in 2013 by the parents of a 4-year-old boy with newly diagnosed T1D to enable them to access his CGM data remotely while he was at school. Dana Lewis and Scott Leibrand later built on the same software to create a decision assist system for insulin delivery. This later became a closed-loop when Ben West, a software engineer, wrote the code for communicating with Medtronic insulin pumps, retrieving data and issuing insulin dosing commands.1

The three main open-source AID systems include openAPS, Loop and AndroidAPS. Loop is an iOS application that was developed in 2015 by Nate Racklyeft and others. The software encodes a hybrid closed-loop controller that takes into account insulin effect, carbohydrate intake, blood glucose momentum and retrospective correction to predict blood glucose levels and generate recommendations for bolus and temporary basal rates.3

Insulin effect takes into account the amount of insulin on board, the patient’s ISF and the decaying effect of insulin over time. Blood glucose momentum is based on the assumption that the best predictor of the future is the recent past. The last three CGM readings (15 min) are used to create a momentum slope that predicts blood glucose over the next 20 min. Retrospective correction takes into account factors beyond insulin and carbohydrates that may affect blood glucose. Loop assumes that factors such as stress and exercise will persist for some time. It estimates the magnitude of these effects by comparing the retrospective forecast for change in blood glucose to the actual observed changes and applies this to the current forecast to improve accuracy.2

An analysis of 34 OpenAPS users who switched from sensor-augmented pump (SAP) therapy to OpenAPS showed higher TIR (+9.3%±9.5%; p<0.0001), lower estimated HbA1c (−0.4%±0.5%; p<0.0001) and a lower TBR (−0.7%±2.2%; p=0.0171).4 An online survey assessing self-reported clinical outcomes from caregivers of children with T1D using OpenAPS, AndroidAPS, Loop and other open-source AID systems showed statistically significant improvement in TIR from 64.2% to 80.68%.5 The Loop observational study collected data from adults and youth with T1D using the Loop system for insulin delivery. The study was conducted in a real-world setting, with data being provided directly by study participants. Results showed statistically significant improvements in mean TIR from 67%±16% at baseline to 73%±13% during the following 6 months. Mean HbA1c also improved from 6.8±1.0% to 6.5±0.8%. The incidence rate of hypoglycaemia improved from 181 per 100 person-years to 18.7 per 100 person-years. Improvements in patient-reported outcomes on the diabetes management distress scale, Pittsburgh sleep quality index and hypoglycaemia fear survey were also reported. Data from the study reported one pregnancy-related hospitalisation and one device discontinuation related to pregnancy.3

A study by Braune et al investigated the motivations behind building, using and maintaining an open-source AID system among patients with diabetes and their caregivers through the use of a web-based survey. The DIWHY survey included 897 participants from 35 countries and included an assessment of self-reported outcomes before and after open-source AID implementation. The two most common motivations reported by adults were improvements in glycaemic control (93.5%) and a reduction in the risk of acute (87.2%) and long-term (83.4%) complications of diabetes. Other motivations among adults included interacting less frequently with diabetes technology (81.1%), lack of commercially available AID systems in their countries (70.8%), improvement in quality of sleep (71.7%) and unachieved therapy goals (68.4%). Improvements in both TIR (+17.4% on average) and HbA1c (−0.9% on average) were reported.6

Pregnant women with T1D have an increased risk of adverse pregnancy outcomes including congenital anomalies, LGA, preterm delivery and perinatal mortality. The preconception A1c goal for pregnant women with T1D is as close to 6% as possible. Also, the international consensus on TIR recommends that pregnant patients with T1D should have >70% of readings per day in the target range of 63–140 mg/dL. Recommendations for TBR are <4% of readings below 63 mg/dL and <1% below 54 mg/dL. Recommendations for TAR are <25% of readings above 140 mg/dL.7

Overnight closed-loop insulin delivery when compared with SAP therapy during pregnancy in women with T1D is associated with improved glycaemic control and a reduced incidence of maternal hyperglycaemia.8 The Continuous Glucose Monitoring in Women with Type 1 Diabetes in Pregnancy Trial (CONCEPTT) showed that at baseline (<13 weeks gestation), pregnant women with T1D using CGM in combination with an insulin pump or multiple injections spent 52% TIR, 39% TAR and 8% TBR. At 34 weeks gestation, they spent 68% TIR, 27% TAR and 3% TBR.9 Our patient had lower TBR during her first trimester and achieved guideline-recommended TIR during her third trimester. A 5%–7% higher TIR during the second and third trimesters is associated with a decreased risk of macrosomia, shoulder dystocia, neonatal hypoglycaemia and neonatal intensive care admissions.9

A few case studies report the use of a commercialised hybrid closed-loop system, the Minimed Medtronic 670G (MM670G), during pregnancy.10 11 The MM670G is not approved for use during pregnancy and can only be used through an off-label indication. The system, when used in auto mode, has a fixed glycaemic target of 120 mg/dL. This is higher than the recommended fasting goal of <95 mg/dL recommended during pregnancy.12 Participants in the DIWHY survey reported that currently approved hybrid closed-loop systems are not customisable enough for their individual needs, with open-source AID systems offering adjustable settings that improve user experience.6

Patients using open-source AID systems are highly motivated individuals that are actively engaged in the management of their diabetes.1 Among the cohort of patients studied in the DIWHY survey, 82.9% of adults had a university degree or higher and 45.7% had a background in information technology or medicine.6 Findings from observational studies may therefore not be generalisable and may only apply to a similar group of people. Also, most studies looking at open-source AID systems examine self-reported patient outcomes, bringing into question the potential for inaccuracy. While data from randomised controlled trials (RCTs) remain the gold standard for demonstrating evidence of clinical efficacy, real-world data have been shown to be robust and can provide valuable data in situations where RCTs are not feasible.13

Open-source AID technology is unregulated and its use raises ethical and medicolegal questions for healthcare providers. Most physicians have a limited understanding of how these systems work but this information can be readily accessed online. Currently, no guidance exists for healthcare professionals seeing patients who opt to use these systems. In May 2019, the FDA issued a warning against the use of open-source AID systems after a patient experienced an adverse outcome. The FDA warned that when devices not intended for use with other devices are combined, new risks are introduced that have not been properly evaluated by the FDA for safety. They advised that risks may include inaccurate glucose measurements and unsafe insulin dosing leading to hypoglycaemia, diabetic ketoacidosis or death.14 Tidepool and Loop joined forces to create ‘Tidepool Loop’, an interoperable automated glycaemic controller that can pair with an automated controller enabled insulin pump and an interoperable CGM through Bluetooth technology. Tidepool Loop is currently seeking FDA clearance and would be available through the iOS app store.15

Patient’s perspective.

I didn’t realise how poor my quality of life was and how much disease burden I was under until I started looping and some of that was lifted. Being able to sleep through the night and wake up with a normal blood sugar was life-changing. Being able to have a varied eating, activity, sleep and work schedule without constantly fighting a low or high blood sugar was amazing and that was all thanks to Loop. I was finally able to have some time in my life where it wasn’t all about my diabetes and having to plan ahead and that gave me some of my life back.

Learning points.

  • A growing number of people with diabetes are turning to open-source automated insulin delivery (AID) technology to manage their type 1 diabetes.

  • Observational studies on open-source AID systems show improved glycaemic control including increased time-in-range, reduced time-below-range and reduced glycated hemoglobin.

  • Healthcare providers should have an informed discussion with patients about potential risks associated with the use of non-Food and Drug Administration-approved AID systems while respecting their right to choose treatments that best fit their needs.

  • Further studies are needed to determine the safety and efficacy of open-source AID system use during pregnancy.

Acknowledgments

This study was previously presented as an abstract at the American Association of Clinical Endocrinologists 2021 annual meeting.

Footnotes

Twitter: @khuloodbukhari

Contributors: KB researched data and wrote the manuscript. RM reviewed/edited the manuscript.

Funding: The authors have not declared a specific grant for this research from any funding agency in the public, commercial or not-for-profit sectors.

Competing interests: None declared.

Provenance and peer review: Not commissioned; externally peer reviewed.

Ethics statements

Patient consent for publication

Obtained.

References

  • 1.Kesavadev J, Srinivasan S, Saboo B, et al. The do-it-yourself artificial pancreas: a comprehensive review. Diabetes Ther 2020;11:1217–35. 10.1007/s13300-020-00823-z [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Welcome to Loop. Available: https://loopkit.github.io/loopdocs/ [Accessed July 2021].
  • 3.Lum JW, Bailey RJ, Barnes-Lomen V, et al. A real-world prospective study of the safety and effectiveness of the loop open source automated insulin delivery system. Diabetes Technol Ther 2021;23:367–75. 10.1089/dia.2020.0535 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Melmer A, Züger T, Lewis DM, et al. Glycaemic control in individuals with type 1 diabetes using an open source artificial pancreas system (OpenAPS). Diabetes Obes Metab 2019;21:2333–7. 10.1111/dom.13810 [DOI] [PubMed] [Google Scholar]
  • 5.Braune K, O'Donnell S, Cleal B, et al. Real-World use of do-it-yourself artificial pancreas systems in children and adolescents with type 1 diabetes: online survey and analysis of self-reported clinical outcomes. JMIR Mhealth Uhealth 2019;7:e14087. 10.2196/14087 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Braune K, Gajewska KA, Thieffry A, et al. Why #WeAreNotWaiting-Motivations and Self-Reported Outcomes Among Users of Open-source Automated Insulin Delivery Systems: Multinational Survey. J Med Internet Res 2021;23:e25409. 10.2196/25409 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Battelino T, Danne T, Bergenstal RM, et al. Clinical targets for continuous glucose monitoring data interpretation: recommendations from the International consensus on time in range. Diabetes Care 2019;42:1593–603. 10.2337/dci19-0028 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Stewart ZA, Wilinska ME, Hartnell S, et al. Closed-Loop insulin delivery during pregnancy in women with type 1 diabetes. N Engl J Med 2016;375:644–54. 10.1056/NEJMoa1602494 [DOI] [PubMed] [Google Scholar]
  • 9.Feig DS, Donovan LE, Corcoy R, et al. Continuous glucose monitoring in pregnant women with type 1 diabetes (CONCEPTT): a multicentre international randomised controlled trial. Lancet 2017;390:2347–59. 10.1016/S0140-6736(17)32400-5 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Polsky S, Akturk HK. Case series of a hybrid closed-loop system used in pregnancies in clinical practice. Diabetes Metab Res Rev 2020;36:e3248. 10.1002/dmrr.3248 [DOI] [PubMed] [Google Scholar]
  • 11.Moreno-Fernández J, García-Seco JA. Commercialized hybrid closed-loop system (Minimed medtronic 670G) results during pregnancy. AACE Clin Case Rep 2021;7:177–9. 10.1016/j.aace.2020.11.039 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.American Diabetes Association . 14. Management of Diabetes in Pregnancy: Standards of Medical Care in Diabetes-2021. Diabetes Care 2021;44:S200–10. 10.2337/dc21-S014 [DOI] [PubMed] [Google Scholar]
  • 13.Garrison LP, Neumann PJ, Erickson P, et al. Using real-world data for coverage and payment decisions: the ISPOR real-world data Task force report. Value Health 2007;10:326–35. 10.1111/j.1524-4733.2007.00186.x [DOI] [PubMed] [Google Scholar]
  • 14.FDA . FDA Warns people with diabetes and health care providers against the use of devices for diabetes management not authorized for sale in the United States: FDA safety communication. Available: https://www.fda.gov/medical-devices/safety-communications/fda-warns-people-diabetes-and-health-care-providers-against-use-devices-diabetes-management-not [Accessed July 2021].
  • 15.Tidepool . Automating insulin — continuous innovation for your patients with diabetes. Available: https://provider.tidepool.org/automated-insulin-dosing [Accessed July 2021].

Articles from BMJ Case Reports are provided here courtesy of BMJ Publishing Group

RESOURCES