We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Roadmap to an Open Source Artificial Pancreas & Diabetes monitoring with Flask

00:00

Formal Metadata

Title
Roadmap to an Open Source Artificial Pancreas & Diabetes monitoring with Flask
Subtitle
Nightscout + Python + Voice + SMS - Using tech for good!
Title of Series
Number of Parts
130
Author
License
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Open Source has crossed frontiers and is widely used to solve problems in the health & science fields. In this talk we’ll learn about the many moving parts of continuous glucose monitoring for type 1 Diabetes as part of the open-source artificial pancreas project and building a notifier for the most used OSS continuous glucose monitoring dashboard: Nightscout.
61
Thumbnail
26:38
95
106
Open sourceLevel (video gaming)TouchscreenOpen sourceComputer animation
Software developerGoogolExpert systemType theoryArchaeological field surveyOpen sourceLevel (video gaming)Process (computing)InformationCASE <Informatik>Right angleType theoryDependent and independent variablesTwitterOpen sourceSound effectIncidence algebraMereologyExpert systemProcess (computing)Software developerSign (mathematics)Error messageTouchscreenProjective planeLevel (video gaming)Video gameGoogol1 (number)Multiplication signGame controllerCondition numberQuicksortRational numberXMLComputer animation
Context awarenessContinuous functionComputer Graphics MetafileData modelServer (computing)Open sourcePhysical systemAssembly languageRange (statistics)Electric currentOpen setType theoryComputer configurationProgrammschleifeLoop (music)Group actionGroup actionOpen sourceProgrammschleifeFreewareNumberRing (mathematics)Game controllerCombinational logicImplementationReading (process)Process (computing)Arithmetic progressionFormal languageCartesian coordinate systemOpen setTemplate (C++)Repository (publishing)DatabaseMultiplicationWeb 2.0Range (statistics)Multiplication signBulletin board systemTelecommunicationAnalytic continuationReal-time operating systemDecision theoryEndliche ModelltheorieMoment (mathematics)Server (computing)Axiom of choiceCurveEstimatorLevel (video gaming)Link (knot theory)Video gameLinear regressionWeb applicationTraffic reportingMaxima and minimaPredictabilityGodBitInheritance (object-oriented programming)Right angleDifferential equationGraph coloring2 (number)Context awarenessCausalityIncidence algebraPhysical systemMachine visionGoodness of fitMaterialization (paranormal)Type theorySoftwareClosed setArithmetic meanComputer configurationoutputMathematicsCross-site scriptingChemical equationLoop (music)Block (periodic table)Normal (geometry)Computer animation
OvalScalable Coherent InterfaceHyperlinkLink (knot theory)Block (periodic table)SynchronizationLoginMessage passingBuildingWebsiteLevel (video gaming)Range (statistics)CodeInformationBitRight angleVolumenvisualisierungGoogolComputer fileUniform resource locatorBounded variationDisk read-and-write headBlock (periodic table)Process (computing)Template (C++)Content (media)CausalityScripting languageContext awarenessView (database)FrequencyAuthenticationThread (computing)Cartesian coordinate systemAxiom of choiceNumberReading (process)System callRootMereologyFunctional (mathematics)Software developerMessage passingLibrary (computing)Multiplication signCASE <Informatik>DebuggerLoginSet (mathematics)AdditionGoodness of fitArithmetic progressionVariable (mathematics)Open setScheduling (computing)LogicIntegrated development environmentWater vaporFreewareTwitterOnline helpCross-site scriptingPrice indexInheritance (object-oriented programming)Slide ruleRepository (publishing)Cellular automatonMobile appOpen sourceComputer animation
Computer hardwareLibrary (computing)Internet der DingeOpen sourceMobile appCybersexConfiguration spaceStandard deviationAuthenticationInformation securityFile viewerDifferent (Kate Ryan album)Level (video gaming)Term (mathematics)InformationArithmetic progressionMultiplication signComputer animationMeeting/Interview
Transcript: English(auto-generated)
That's great. That's great. And I know that your talk is about road map to open source. That's amazing I think that that's a lot of people found it very interesting and So right now, okay, I can see people are coming back now, so maybe we would just get started when you're ready
I'm ready and I'm ready to share my screen. So Here we go. I'm sure you can see my screen and yes, the Today the title of my talk is road map to an open source artificial pancreas and diabetes monitoring with blast
and if you see a hashtag in here, it's we are not waiting and it's something that signifies a lot for the Diabetes that the do-it-yourself diabetes community. We are now waiting Because we're making things happen
but before I get into the subjects, I like to Introduce myself. My name is Diana Rodriguez, and I'm a Python developer advocate at Vonage I'm also a Google developer expert Aussie or ambassador and Microsoft MVP and all those things actually mean that I'm a person who learns new things every day and
I love interacting with the community so you can find me on Twitter at katufi82 or you can go to my website superdie.dev and Yeah, let's let's talk about Whoo diabetes, I
None Hodgkin's lymphoma survivor One of the side effects and and also one of the things that happen After this battle with cancer was diabetes. It's also a that well, it's part of many things
When I first got the diagnosed I I felt exactly like either of the drawings in this picture it felt like it was too much to handle it felt like I couldn't do it because suddenly the responsibility of regulating
Insulin for my entire body was on my shoulders it was too much information to process and I felt like I Broke insides that I wasn't going to make it Before carrying on let's go over what diabetes and the types are very quickly
So there are various types of diabetes These are the most commonly known type 1 and type 2 So with type 1 diabetes type 1 diabetes also known as juvenile diabetes is an autoimmune disease
Where your body stops producing insulin in my case. It is still an autoimmune disease But it's sort of type 1.5 and it's called latent autoimmune diabetes in adults There's also type 2 Where your body produces insulin but doesn't know what to do with it and it becomes resistant to insulin and
There are more types of diabetes like type 3 when you get your pancreas removed gestational diabetes and so on and you might be thinking well Yeah, why all this fuss? Well, what's the challenge? I mean diabetes is a condition
Yeah, it's an autoimmune disease in some cases. It's An insulin resistance disease in some other cases and so on We have many challenges one of the biggest ones to start with things like access to insulin and medication in
the case of yours truly I live in the United States and This is from four years ago But it's a good picture to compare The fact that we have to spend so much money for essential medication
Access to insulin and medication is so costly that Nowadays People die because their ration their insulin duration in their insulin This was in 2016. If I were to go without insurance, I would probably spend between a
1,500 to $2,000 per month just to be alive and I'll leave you that to sink in Then the other huge burden is Well, we have a chart and a lot of information and what the target blood sugar levels are for people with diabetes
right We're running an automated process Manually with some guidelines and And well what happens when you run an automated process as a human you make it
an error-prone process Then there's the fact that we have to digest all this information that okay when you eat food Part of it is made of carbs or carbohydrates which turn into glucose and then insulin Regulates the right amount of glucose in the bloodstream
When your body stops producing insulin on when it's not using it appropriately Then you have to step in and regulate those processes manually What happens well Those ratios of how much insulin you need To what amount of food you eat are different. Every person has a different ratio
And and those ratios vary over time That's more information and it turns extremely overwhelming And then there's a fact that insulin needs are different for everyone I might need more insulin if I'm stressed or if I'm nervous or
In my case, I need more insulin at night than in the morning and I don't know why I have a friend who needs more insulin in the morning and so on and and then it's The fact that it's too much and not enough at the same time We don't know everything and we're truly never under control
You know, like I said before when a process that should be running Automatically is run by humans it becomes an error-prone process and I know this is a long introduction, but I want to stress the ideas the the basic concepts and
The concerns and the problems that technology can solve People if I don't give myself enough insulin I can die Because high blood sugars it will kill me slowly, but it will kill me
If I give myself too much insulin I can die Much faster. It's extremely dangerous. Imagine the burden of knowing that one mistake can actually kill you and that was something that was It had an emotional toll a huge emotional toll on me thinking. Oh my gosh
If I mess up I can die, you know, it took me a while and a lot of support from the community To get used to it and I still have I still make mistakes There are three main reasons on why I took it to open source to using technology for good
The second and the third reasons are second Community there are many more who could benefit from any work I can do to help with this initiative The third well, I'm a software developer. I know I can help others
I know I can contribute to projects that are already happening and I could inspire others to do so But the first one it's not even me myself It's her I do it for her This is my seven-year-old niece she has type 1 diabetes since she was a baby and in this picture
She's happy and super proud showing her sensor and her insulin pump Thanks to technology. She can lead a mostly normal life like every other kid She can do things that were unthinkable 20 years ago or even
40 years ago so Although we have all this amazing technology that has evolved It's still not enough and I'm sure you might be thinking. Well, how can we help?
Can we have some more context, please? I'll show you basically there are plenty of pumps and Sensors like the one I have here in the market Since I solve the problem of having to prick my finger multiple times a day to just wearing a device that is
Transmitting my blood sugar values without me having to prick my finger many times a day Sometimes obviously technology is not perfect. I have to calibrate sometimes I have to check those values but much less than before and also Palms solve the problem of having to give myself
Multiple daily injections, but um You remember how I said we're never fully in control The issue is that pumps and sensors don't speak the same language and they don't communicate between themselves How difficult is that? We need
that monitoring Versus that insulin delivery to work together so we can recreate as much as we can and with the technology available the same behavior that an actual human pancreas would do and This is where we can step up. We can use tech for good causes
Okay two things were already resolved and and I want to highlight these two initiatives and then show you what my contribution and yours can be The first problem is monitoring and that is solved in a really nice way
We have night scouts. And again the hashtag we are not waiting. We're making things happen. We're making things accessible night scout is a web-based Continuous glucose monitor. It basically shows glucose data in real time and it can also predict
Block glucose values 30 minutes ahead using another regressive second-order model Then what night scout does it's basically a web a web dashboard It's a server that reads from a monger database containing data from this sensor or any sensor
and then it has alarms that are generated for high and low blood glucose values and It's free open source software If you want to check it out in action You can go to dianox.superdive.dev to see my blood sugar levels in real time I don't know if they might be a bit high
Or a bit low, uh when i'm overexcited or nervous actually here they are. They're quite alright um But it looks like something it looks like this actually That's um a screenshot from a while ago So we have that great we found a way to gather the sensor data
and To input things like the amount of carbs we consume um to record Things like if we're stressed or or things like sensor changes, etc Etc. And now we have the ability to run reports with these dashboards and make those accessible to those who are monitoring
Imagine if you're a parent with children Um who are diabetic then, you know, you can keep Um things in check, but what happens the second step is automating that process of gathering that data
And communicating with an insulin pump to make sure that we're delivering the right amount of insulin or that we're at least as close As possible to an actual pancreas and that's the second problem that's already been solved. It's automating And for that we have open aps which stands for open artificial pancreas system
And it's a safe And powerful tool. It's easily understandable uh, it basically Adjusts the insulin pumps delivery to keep those blood glucose levels within range at all times So it communicates with the insulin pump to obtain all the details of all insulin doses
And it communicates with that continuous glucose monitor to obtain those values And estimates and it issues commands to the pump to adjust the dosing as needed
Exactly, like a human pancreas would do As much as as as possible Um, I got this quote from the open aps, uh website and as of july 13 2020 there are more than a huge number of individuals around the world with various types of do-it-yourself closed loop implementations that we know of
And this numbers continues to grow as does the number of options for these types of closed loops and and i'm going to explain Um What looping means looping is basically, um using these tools to automate the process of getting
Blood glucose readings from a sensor and issuing commands from a pump, uh for a pump To do so automatically like a pancreas would do um with Technology like this that is open source and that is accessible for everyone We experience fewer highs
and less severe lows and more timing range and that is the ultimate goal to have um a decent range and to not suffer the consequences of giving ourselves too much insulin or too very or very um or little insulin
got nervous, um And then lead a normal life So Yeah, I have my sensor I can see that my phone I also have this web dashboard And it communicates to my insulin pump and I can make make better balancing decisions
I have the choice to just um See the suggestions And not having those commands be issued to my pump which is called open looping And then to fully automate the process And I have to tell you since I started with this
um all recommendations that were done by by the combination of um my blood glucose readings and My pump has been spot have been spot on And I haven't had any Traumatic episodes where I have seizures or where I pass out
Or I lose vision because i'm too low or because i'm too high or because i'm not in range But anyway What's my? and your contribution Well, you see flask in action um I needed something quick. I needed something I could share and have others develop on top
If you want to add features if anyone wants to contribute And I decided to use flask Because to me it was a right choice choice because of its friendly features The freedom minimalism and learning curve So you'll see two links
There's a repository and there's an application That I will explain i'm using flask With ginger for templates and materialized css for a little bit of color and bonnet communication apis What problem are we solving on top? of all these initiatives Well, the problem is simple
We have all these devices we have the dashboard and and the alarms But you know what in moments of crisis when I sleep I never hear them But strangely I can always hear my phone which is why the idea was to make my life And the lives of those fellow fellow diabetics
simple or simpler People have the same struggles. Maybe you don't hear alarms, but if the phone rings Spot on right So taking advantage of the simplicity of flask and varnish apis to do this was a good choice for me
But how? So we have a range of values And we have phones and we have monitoring So i'm using the sms and voice apis to notify myself in my emergency context of irregular Situations with those levels so I grab readings for the last 60 minutes or any given time frequency
through a python thread with a scheduler If ranges are below or higher than what is configured through environment variables Then it fires on alerts There's also an alert if it doesn't get data for a set period of time
and in this case, it's it sends um A message to all my emergency contacts saying that my dashboard is offline The actual solution in 3d Is a simple flask application That allows people to log in and configure their night scout d cells
An endpoint to grab those readings and the emergency numbers to uh to do so Um, it needed some protection so I used um, google authentication and again Why flask? Because it was the friendliest choice
For me, I love flask. I have to admit that In here I can configure the entries endpoint to grab those readings My phone number to receive a call if my levels are out of whack An emergency contact in this case my mom who will receive notifications should I not pick up the phone
And up to five additional emergency contacts who will be notified should either Of them not pick up one by one But let's have a quick run through on the technical details that made developing this app enjoyable Easy or friendly actually much better for views we use ginger as the template engine
You know, it's basically html and css And we have a parent template defining, uh content blocks to be used by children templates And these blocks will display the code from children templates
um something that I like to um Also highlights is things like the url for function that points to javascript and css resources in a static folder Which is a very comfortable and elegant way to point to css libraries Or any scripts you need to execute for your for your views your front end, right?
I'm going to show an example of this with the login screen you saw before previously the screenshot and if we see um I like how the content blocks I use we we're extending um layout.html
So this is inheriting from layout and then the renderer will load What will load layout with whatever variations we add to this file? And these variants will be defined within the blocks. We see layout for example I'm using the head block in this case and then well, I kind of filled it up with um
a little bit of quotes for you to see uh in context If you go on the python side of things one of the things I I truly love about flask is um the fact that It is Easy or friendly to read it's friendly to understand and it doesn't matter
Um, if you're a beginner or how advanced you are in development Um something to highlight about it is the beautiful syntax for uh, root decorators Where you can specify The roots and the method if applicable and then write your logic
So yeah, um, I wanted to make this as friendly as a glass of water friendlier than free stuff But this is not even the highlight of it If you really want to take a look on the nitty-bitty grits of the code
I already wrote a full Step-by-step tutorial on how to build this application You can go to next.dev forward slash nightscout and you have all the details The most important part of this talk
After giving you all this context on diabetes And showing you a little bit Of what has been done and what I personally did to improve um this community and improve the lives of people like me like my niece and
all the people who are um affected by diabetes worldwide is our challenge We have a tech for good challenge How you operate? head to next.dev Forward slash euro python 2020 We are basically rewarding your contributions
for this application And it doesn't matter your level of expertise or how many years you've been developing It's open for all those who want to contribute Um in this challenge we're asking your help to um
Find features or ways to improve this application to Improve the lives of those who are benefiting from it people like me so we have prices and um we have um a number of um
indications and uh Repository with a really good documentation Um, all the endpoints are documented Everything is laid out beautifully um and in the friendliest way possible for you to take part in so There we go. Also
Tomorrow we will have our booth um our our Vonage booth um Come and see us we can talk about um, all these apis We can talk about the challenge and if there are any more questions I can answer for you Um, we'll be there i'll be there and i'll be happy to talk to all of you
If you would like some more resources and learn more about these initiatives I suggest you to follow a couple of twitter accounts like sarah withy She was one of the people that supported me through. Um this journey on um
coming into the diy diabetes community Um, there's um scott hanselman he's very famous worldwide for being a pioneer and automating these processes And he has amazing information as well There's also the night scout websites and the open api open ap s
Website, um in here you will find more information on these initiatives and how people are using them nowadays and then of course If you want to know a little bit more about me or about what i'm doing you can go to superdi.dev And you need a copy of these slides
Here's the url Again, superdi.dev is my website. And if you want to chat on twitter, um, i'm available cotufi82 Come and see us tomorrow in our booth and I'm excited for what this challenge will bring Um, i'm really excited to see
How can we as a community improve this application that i'm currently using and has saved me from uh quite a few tricky situations and This is what I have for you today Thank you so much for this opportunity and I hope that you feel inspired and motivated to make things happen
And to use your knowledge for good causes Thank you very much Thank you so much diana is really good like it's using open source using python to take care of yourself. This is amazing And um, so we have just like a few questions popping in so maybe we have time for one or two questions
so, um, so one of the The viewers ask like how did you configure cyber security for the app? Cyber security well It's work in progress. I mean if anyone accessed the app, um, it's not like they can issue any commands
to Uh, like no one could kill us Um, it's just information. It's basically entries of blood glucose levels. And that is something that um, I'd I would like to see as the contribution on how can we implement better security?
um, we're basically Just using standard, you know standards as much as possible um so so yeah, so if if you'd like to contribute with more authentication features or or if you have Anything else to contribute in terms of cyber security? I would love to see that personally
Right, so, uh, there's another question. So I think this is the last question now. So like how costly is the hardware? Um Well The hardware the hardware is not
Costly or well it it is in a way, um, we have the Privilege of being well, most of us have the privilege of being insured um, I would say, um, these sensors are around 300 for a 90 day supply, um
we We basically have worked in a diy community to find ways to connect To the sensor apis or through um their dashboards Dexcom has a private api and we can access that we can bridge it to uh, like we can share those details
There are other sensors like the freestyle lever Which are uh less costly and in most countries in europe are subsidized And there's an iot device that goes on top because the the freestyle library is an nfc Um sensor, it doesn't send signal on you know via bluetooth
So there's a small iot device that you put on top that is tapping constantly this um device And then we can connect it to any of the open source dashboards um costs varies in um In different countries, I think the united states being the most Expensive of them all i'd say
300 to 400 dollars per 90 days Out of pocket for dexcom and around 120 From well, that was a thunder from um for uh libre in the united states Right So yeah, thank you so much. I think if you have more questions, you can uh, go to the you know
The channel for the talk to uh, keep on, you know the discussion maybe ask more questions, you know, um Ask diana or continue the discussion or how to contribute you can ask her. Um, so thank you so much