Inspiration
Type 1 diabetes is a chronic disease that requires intensive management of blood glucose levels, resulting in countless interrupted meals, sleepless nights, and stress. Tools to automate insulin delivery have been slow to come to market, and are often inaccessible due to their higher costs; all current systems also offer few customization options, locking patients into algorithms that are not tailored to their specific physiology.
What it does
Loop is an open-source automated insulin dosing app that uses historical blood glucose, carbohydrate, and insulin data to automatically set basal (background) insulin rates, minimizing the cognitive burden of diabetes. The app is interoperable with several insulin pumps and continuous glucose monitors to provide maximum patient choice. One important feature is that the algorithm can accommodate the use of multiple types of insulin, a commonly-requested feature that is not found in any other open-source or commercial system and helps tailor the system to the needs of each patient, giving the ability, for example, to inject long acting basal insulin and use Loop for automatic dosing adjustments. Parents of diabetics can actually sleep through the night, while their child enjoys a lower average A1c (a measure of average blood glucose), which has been shown to reduce risk of diabetes-related complications.
How I built it
I took advantage of already-existing frameworks and tools in the DIY diabetes open-source community to accelerate my development, improving user interface and algorithms as I went along. The hardware and transmission protocols to communicate with insulin pumps and continuous glucose monitors are publicly available, making it so I could really focus on improving the software. I collaborated with a physician at the Stanford School of Medicine to gain access to insulin modeling data for the next generation of ultra-rapid-acting insulins, which are commonly used by patients but current automated insulin dosing systems cannot accommodate, which forces patients to choose between advanced insulin formulations and cutting-edge technology.
Challenges I ran into
I spent more than 6 hours debugging issues with Core Data migration, which we found was ultimately caused by a simple sql file misnaming, despite what the (40-page) error message might have said!
Accomplishments that I'm proud of
- Incorporating experimental data from research experiments in order to customize insulin curve modeling
- Crafting a smooth user interface to minimize the number of taps or swipes that are needed to do common actions, like entering mealtime insulin doses
- Enabling patients to enter multiple types of insulin into the system (including insulin doses that weren't given by the pump!) and have it be correctly accounted for, making these patients be able to benefit from automated insulin delivery when they previously could not.
What I learned
I learned SO MUCH about how the Core Data frameworks work under the hood, and about the best debugging practices for Swift/Xcode.
What's next for Loop: Accessible & Customized Automatic Insulin Delivery
The improvements that were made will be tested in patients and contributed back to the #WeAreNotWaiting open-source diabetes community so that as many patients as possible can benefit from the work done at Treehacks.
Log in or sign up for Devpost to join the conversation.