I wish your project success, but I think (and I've got a bit of experience) if you can't accept that regulation of health products is almost certainly necessary, and that not producing the "best" results is a reasonable if conservative approach, I will never trust your product.
Different users are willing to accept different amounts of risk for a given quality of life improvement. Besides differing between users, the tradeoff is almost certainly in favor of accepting more risk than a regulator would approve.
Every type 1 diabetic has some parameters that they use to determine how much insulin they need: an insulin to carb ratio, an insulin sensitivity factor, and a basal rate (or several basal rates for different times of day). The way these parameters are traditionally managed is that your devices collect data about your carbohydrate intake and glucose at various times of day, and every 3 or 6 months you bring those devices to an endocrinologist's office where they print them out, a doctor looks at the printouts, and the doctor suggests tweaks to the parameters. This process works very poorly, first of all because 3-6 months is too infrequent, and second because calculating the correct parameter tweak requires a whole lot of math, not just looking at a printout.
The way it works in OpenAPS is that a program runs nightly, looks at historical data, figures out the correct parameter tweak, and applies it for the next day. This works much better. Much better long term health, much better quality of life, much lower short-term risk of death. But if someone dies, there's no doctor to pin it on. So device makers don't include that feature.
(This is the clearest example, but there are others as well. There are also things like where alert thresholds are set; too few alerts and you're at risk of failing to alert the user to something important, too many alerts and you cause alert fatigue and impact quality of life.)
I have, in fact, had incorrect dosing happen, including the worst-case scenario of an incorrect large bolus at night. (That happened because of a bug on the git head branch, not a release version, which is much riskier. As a developer of the system that's a risk I knowingly accept.)
And that's not actually that bad. The important thing to realize is that the point of comparison isn't a zero error rate, it's the error rate a human would make. The worst-case scenario is quite well understood: excess insulin, up to a configured dosage limit. And that's an error which humans definitely make--it's not even a rare mistake, it's a mistake that a human doing everything manually will make multiple times per year, every year.
Is the configuration software controlled? IE, if you had a bug in your configuration or in your microcontroller, could that bug lead to exceeding the configured dosage limit? Or is there a hard limiter (fixed amount of insulin, a physical limit switch, etc) that prevents that.
The chances are this is unlikely, for legal reasons: Medtronic creates regulated medical devices. I wonder whether it would be possible to add something along the lines of "push this (software/hardware) button to allow non-regulated 3rd-party hardware and software to begin controlling your medical device, but doing so will bind you to <insert waiver here>" and get such functionality to pass FDA approval. I somehow suspect not, although I would be very happy to hear otherwise.
As things stand now, though, it sounds like (as the article suggests, with the picture of a "hacked pump") people are still relying on methods and techniques that it sounds like anyone can use. So yes, unfortunately everyone's in a situation where any adversary within Bluetooth range could probably take the device over, and (depending on the severity of the vulnerability being used) perhaps modify the pump itself to pump too much or too little regardless of inputs, or similar.
Quite an uncomfortable situation from a security perspective. :/
For better or for worse, in an environment where "root cause attribution" is such a preoccupation, it's not such a stretch to think that the agents acting in it would be strongly incentivized to minimize their opportunities to be the root cause - in other words, "be blamed if something goes wrong".
I don't think that needs to be interpreted as nefarious. It might just be that everyone looked at making them more automatic, and just decided that the costs to do all the research that would be necessary for CYA and regulatory purposes would be too great.
Another approach would be to focus on patients and ignore punishments. Which is what the hackers are doing: ignoring rewards and punishments that are driving professionals in the field.
One of the things about testing drugs and medical devices is, you really can't cover all your bases. It would be too expensive to construct a clinical trial with the statistical power necessary to reliably detect very rare side effects. I don't think anyone wants to delay releasing all new drugs to the market by 40 years so that we can be sure about what happens if you take it over a lifetime. Even post-release monitoring for these things is potentially tricky, due to the poor interoperability of EHR systems and also, in many jurisdictions, unintended consequences of health care privacy laws.
Meaning that there is no amount of due diligence that will guarantee you can't get sued. Which is fine, you can always go for proportionality instead. But then, the amount of due diligence that's necessary is driven by what costs the legal system is willing and able to impose, and, at least in the legal regime I live under (USA), they've got their own entirely other set of procedures and incentive structures that they're working with.
Also, the amount of insulin used is not significantly different with a closed-loop system vs. not. Although closed-loop systems do increase the benefit of faster-acting insulin relative to slower insulin, and the fastest-acting insulins are more expensive (especially inside the US).
Thanks for being generous.
https://en.wikipedia.org/wiki/Thalidomide
Note the mistake made, and just how subtle it was. During testing a somewhat more ad-hoc process was used to produce the drug that did not result in the bad isomere, and then it was sold with multiple isomeres in the actual drug. Regulators at the time thought that isomeres did not matter and it took years for the effects to become clear. Of course regulators did not test for things they didn't know about. Neither did the companies (not just one). Crucially the drug was NOT tested for the effect on pregnancies (and was therefore not to be taken by pregnant women, like many drugs and even some non-drug products like famously alcohol).
Furthermore: there is at least some amount of "guilt" on the part of some of the mothers: the medicine was NOT approved for use during pregnancy, and stated this.
Result: >10.000 crippled children.
Where is the guilt to be placed for this incident ? I would argue that the primary guilt is with the regulator (government) and a small amount with (most of) the mothers for taking unapproved medicine, with the rest of the mothers following doctors' prescriptions (which of course means those doctors prescribed unapproved medicine). Needless to say, the company was blamed, and forced to pay (essentially in trade for not going to prison). The German government denied any responsibility, and several other governments (famously Spain) went further: they denied anything had happened at all.
So let's say there is a timing bug in this "open source pancreas", and it starts pumping insulin into the patients bodies without cause, say at the unix epoch transition. I would guess that at least half of them won't survive.
What happens next ? Given the Thalomide incident we can make an educated guess: whatever the law says, and despite patients "accepting the risk", even when the patients explicitly make mistakes in the treatment, you can bet the government will go after whoever they can arrest, and force them to pay millions of euros, or throw them in jail for the rest of their life.
People cannot be trusted to accept responsibility for the result of picking their own treatments, even when fully informed about the risks.
Your scary hypothetical is not possible. As if to agree, my pump just beeped at 10PM, announcing that the temporary basal (which can't kill me at maximum setting) expired and a new one was chosen. It's best choice is actually to suspend basal entirely when it knows I've dosed too much, which makes it a very legit safety improvement.
Oh, and a company created the example, which waters down your point - what convinced you that the very capable hands of people affected by the disease directly with a strong desire for data to back every thing up is anything like an accident waiting to happen? There's no profit motive here! (PS: it runs a direct test suite on install, and has cloud CI)
Furthermore, the law did not really support these cases. But when you cripple 10.000 babies, law does not matter. Plus we all know they went after the company, not because it was at fault, but because they could band together against it.
If that were to happen to an open source project (and that seems a reasonable guess for open source "biohacks"/medicine when they screw up) ... the authors will go to jail for life and die bankrupt. It doesn't matter what license, it doesn't matter what contracts say, it wouldn't even matter if you have personal videos of every user saying they will never hold you responsible with a paper around it signed in blood by both the user and a public notary.
THAT's why we have the pharmaceutical industry we have.
That's pretty amazing. You're accusing me of active malice for explaining the (entirely reasonable) thought process behind the government's legal system for regulation that pharma must comply with to operate.
I think when you move from the realm of anecdote to dealing with statistics, products with 100 million users, and historical cases (Therac-25), you gain a perspective that regulation is probably the simplest and most effective mechanism for keeping deaths at a minimum while allowing new products to reach the market.
1) companies have a profit motive and they want to design and sell products
2) historically, we have seen that companies acting with profit motives often have incentives to ignore problems with their products and even actively suppress them
3) the government wants to incentivize companies to make new products that help people
4) but they also don't want large numbers of people to die, or even small numbers of people, due to errors of any kind.
5) we have ample evidence that when unregulated, errors occur and people die. Statistically across large numbers of drugs and medical treatments, we have enough data to make strong, but not perfect statements about which processes minimize negative problems while maximizing availability of product to sick people. In some cases, people die because executives explicitly chose to cut corners. With regulation, we can catch those executives and put them in jail.
6) in general, the one thing that comes out of all of this is that extensive record keeping is required for investigators to deal with problems when they occur. Most of regulation is just record keeping- what did we do, what happened when we did it- and change control. Literally, my job was to ensure that firmware updates didn't change the observable properties of a system that was making a drug that saved people. Yes, when a firmware of a machine that makes drugs is updated, and it has a bug, people can die.
7) given about a hundred years of experience in this area, enough people who work on "reliability" (like SRE in tech) people have developed a set of techniques, called regulation, which attempts to minimize the number of deaths, while still allowing products to reach the market. Like SRE, it's a combination of hard-won experience and a lot of intelligence, along with not enough monitoring data.
8) I also feel pain and unhappiness that pharma doesn't move faster. It wasn't until I worked daily on product development and implementing regulation that I began to appreciate that this is a truly complicated problem with a lot of variables, incentives and players.
9) Even giving my best good faith effort, I simply cannot credit people who give anecdotal evidence about friends with diabetes. There are a number of reasons for this, but basically, if you do enough large-scale decision making, you'll find that anecdotes introduce bias that can lead to poor decision making. I see problems, also, in the DIY community where people sort of assume the best possible results; in science, after you run enough experiments, you get to see: it's easy to fool yourself and think what you've done is good, but it really has to percolate through the system and get evaluated and reproduced by many people before you can trust it.
If you don't think the above logic chain is reasonable, that's OK. Many people aren't happy with how slowly pharma and medical DX industries and FDA work. But, you should basically understand that the entire goal here is to ensure good products make it to the market without "too many unnecessary deaths".
The worst part of all of this is that I dedicated many years of my life to improving the speed at which drugs could be discovered and brought to patients, only to learn that the primary reasons we can't, are political, structural, systemic, and incentivized. If somebody had a better solution than what the current market has, I can point funding at them.
Not that the FDA couldn't be more efficient (possibly considerably more so), but it's clear that most products that go into production work, and that can't be discounted.
As far as doctors are concerned I am an exemplary patient who has shown blood glucose controls as good as they come (A1C of less than 6.5 for more than a decade now for those that know what it means).
I regularly hear from "concerned" people how they know someone else who's blood control isn't as good and they should do better, etc..., etc...
I have personally used some of these DIY products and so I want to be very clear; the difference between "somewhat poorly controlled blood sugar" and just one really bad mistake in "tightly/ best-controlled blood sugar" is this
1) Poorly controlled - in a decade I will start to have some additional health problems (vision impairment/neuropathy/etc)
2) Tightly controlled w/dosing mistake - Coma/Brain Dead/Dead
There is a good reason to test this equipment and take a conservative approach.
Physical activity level and how much active or "on board" insulin you need when you are being active vs inactive can vary by 10x. As an example of this; before I do cardio workouts I intentionally do a carb load and let my blood sugar raise before starting to counter the effect the exercise will have on my blood sugar. Despite this on two occasions during running I have experienced double drops (super fast blood sugar drop to unsafe levels) to levels so low I started to black out.
Nightscout/OpenAps/Dexcom/Medtronic, it doesn't matter open source or closed source none of these devices can handle these scenarios so at the end of the day it is still on me to intervene and make decisions based on what I am going to do. Until something better than pump systems come along (and these "artificial pancreas" systems as they are calling them to day are still just pump systems; I will have to intervene no matter how sophisticated the algorithms.
In summary; just because you care about someone with diabetes, do not presume you know what is best for us.
I'm glad that the open source community is getting involved and I want to see these things help move the industry forward.
My comments were to the parent who presumes
1. To know what is best for diabetics 2. The device is inherently less risky than current options
Nightscout absolutely would not get through FDA approvals today if for nothing other than catastrophic failures. I love the features and think it's way more robust than what is provided by Dexcom, but at the end of the day, I switched back to Dexcom's receiver and app because it doesn't crash.
OpenAPS is great, but requires a level of research and effort than many patients aren't capable of. Then on top of this OpenAPS has this nice disclaimer as an opener, "By proceeding to use these tools or any openaps repositories, you agree to abide by the copyright agreement and release any contributors from any liability."
Now I understand why that statement is there, but when someone dies using this "product" that hasn't been approved by the FDA; well let's just say I hope all parties involved have really good umbrella policies, because I'm not too sure that's going to hold up in a court of law.
"One of the most frequently asked questions is “I have a 723 pump but it has version 2.5B software version. Has anyone figured out a way to make newer model Medronic pumps compatible? Like flash older version of software onto my 723 2.5B pump?” The answer is “No. The ability to downgrade software versions in the pumps does not exist. It has been investigated and nobody has made any successful progress to that end.”"
I'm curious as to what form the investigation took. Are you aware of an online record of this investigation?
Are compatible pumps rare enough that the need to preserve them is constraining reverse engineering efforts?
---
Edit: For those wondering what these things look like, here is the FCC submission including internal photos. FCC is involved because of the integrated wireless link.
https://fccid.io/OH21510/Internal-Photos/Internal-Photos-239...
Looks like a System-on-a-Chip with separate memory chips? Can't make out the numbers. Opening in GIMP, it looks as if the photo has been doctored to remove chip numbers? That 12-pin unpopulated footprint on the processor board is for a test/JTAG header?
A specific X-and-below is required because the RF protocol was reverse-engineered, presented at DEF CON 19 (2011), and the manufacturer locked it down immediately (PSK, gg). The new protocol has not been reverse engineered (this is for Medtronic Minimed)
A newer style of RF pump from a different manufacturer (Insulet OmniPod) has been de-capped and had its protected-mode firmware scanned, and has been disassembled and picked through - and re-flashed firmware has been sent to that pump and works fine, and we understand the cryptographic protection algorithm (we can talk to them) and a great deal of the protocol. That still leaves a massive "forward engineering" and integration efforts that must be non-commercial by nature (because laws)
edit: there are literally 7 of us that have access to the RE'ed firmware repo (it's a private github repo) - PM me if you're interested (there's a really irrelevant NDA that is involved, which I think is spooking wider sharing)
Pump manufacturers are not technology leaders and have no forcing function to create open systems. There is no reason they could not publish the protocol and also allow me to enroll a key (knowingly voiding affected aspects of the warranty) and interact with a device that is legally part of my person.
Of course, this is mostly a USA problem: for other jurisdictions there are open compatible pumps (http://www.sooil.com/eng/product/) that have this, but they are not available (including for insurance support of the consumables) in the USA
Anyway, I would love to help the community with some reverse engineering.
The core problem is that the FDA-approved devices are optimized not for getting the best result, but for ensuring the manufacturer can't be blamed if something goes wrong.
I live with someone who has a CGM (continuous glucose monitor) where the device came in a box with an insert saying "do not use this device to make medical treatment decisions." To see any of the readings you have to install an app whose start screen says it's experimental and, again, can't be used to make treatment decisions. But the user's manual has a chapter titled "Treatment Decisions" that tells you how to use it to decide when to take insulin and how much to take. It's frustrating that the messages have to be so contradictory.
A final question: how essential is it to be tech-savvy to use this technology? Is it sufficient to have somebody tech-savvy close to you who is available every day but not every hour of the day, or is it something that should only be in the hands of someone who understands how it works?
The reason for the mixed messaging about treatment decisions is that the Dexcom G4/G5 (they're the same sensor with a different receiver) spent part of its product life not approved for use as a basis for treatment decisions, and was later approved for use as a basis for treatment decisions, but only under certain circumstances. There are some best-practices around CGM sensors that the manufacturers won't tell you about, like pre-soaking sensors, which greatly improve reliability. And, counter-intuitively, a closed-loop system is actually less demanding of sensor precision than a human giving correction boluses would be.
For OpenAPS, getting started involves installing Linux on an IoT board, setting up a server on Heroku, and monitoring log files. Tech savvy is definitely required, but mostly for setup, and occasional troubleshooting; if you have a tech-savvy person willing to put some time into it, the can set it up, show you how to monitor it, and then step away.
> Do you know why the applicability to type two diabetes is not as clear as for type one?
I'm only stabbing at this, and it's anecdotal, but I believe it is likely due to the lack of consistency across type 2 diabetics. Whilst there is variation in Type 1 Diabetes, it is largely limited to lifestyle but the basic principle is the same - you don't produce insulin yourself. Type 2 diabetes is often caused by insulin resistance, and I guess varies wildly based on the individual, their lifestyle, and their genes.
> I live with someone who has a CGM (continuous glucose monitor) where the device came in a box with an insert saying "do not use this device to make medical treatment decisions." To see any of the readings you have to install an app whose start screen says it's experimental and, again, can't be used to make treatment decisions. But the user's manual has a chapter titled "Treatment Decisions" that tells you how to use it to decide when to take insulin and how much to take. It's frustrating that the messages have to be so contradictory.
I haven't been given a CGM for longer than a few weeks (NHS rules are a bit restrictive in my area if your control is good). However the rationale for not using the CGM to make decisions is based around how it gauges your blood sugar. Because it's relying on blood glucose levels in the skin tissue I have been told that there is a delay, and basically the CGM operates about 15 minutes behind your current glucose levels. This is ok when you're using it to track glucose levels over a day, but not particularly safe if you're relying on it to make a decision for obvious reasons.
> A final question: how essential is it to be tech-savvy to use this technology?
This is a question I have asked myself a few times. As mentioned above, it's pretty difficult to get a pump and CGM on the NHS in my area without proving that you can't treat yourself adequately with regular injections. I am unwilling to sacrifice my health to have a pop at getting a pump, so I had a look at private options. Whilst initially I think there's a fairly steep learning curve, there is quite a lot of documentation provided, and the community is pretty active and helpful. I suppose it's also helped by the fact that there is only a few pumps on the market (relatively speaking). The issue is that if something goes wrong in your config, which is not uncommon for a homebrew solution, then you have to go back to manually adjusting your insulin.
The GCM (Freestyle Libre) has been a life-changer and improved long-term management of diabetes. In particular, it has been helpful for maintaining a reasonably flat glucose level throughout the night (because of better information for evening insulin doses), where they previously had high and low peaks (down to dangerous levels a few times).
I suggest you do everything you can to get a continuous monitoring system. Because you can see your glucose level history, you can then make decisions on whether you need an insulin pump or not. If your night time glucose levels are fine, you might not need one. If there are high or low peaks you can't manage, a pump will improve your life.
Would you say that's because you can get a better idea of trends once you have enough data? My understanding has always been that the true value in a CGM is revealing those trends and patterns that are really unique to the person and that are hard to spot with regular glucose testing.
EDIT: I realise that this is basically what you've said. Apologies, brainfart.
> I suggest you do everything you can to get a continuous monitoring system.
I'm currently jumping through the hoops to get myself one now. I can get my hands on one via the NHS fairly easily, it's just the pumps which are hard to get. I've done a lot of work over the past few years to get my control to a place I am happy with (finishing uni and that awful realisation that you are in fact mortal). I also wanna say that I recognise that as someone who is able to control my diabetes using injections it would be wrong for me to demand a pump when there are others who for various reasons can't control their condition. In a perfect world it would be great, but hey, we work with what we've got, right.
If you can't get the NHS to give you one, it might be worth it to get it for at least some period (say 3-6 months) out of pocket. By that time it should have given you insights on your treatment and allow you to better assess if an insulin pump is the right thing for you.
What happens when the sensor is not reading correctly? Isn’t that the biggest possible danger? The human “knows” it’s wrong but software?
And again, you get at least 8 hours of history graphed on the display now. If it doesn't look sensible (w.r.t eating and insulin doses), you need a backup. If the old fashioned blood glucose meter gives a wrong reading, you are much worse off.
Note that the sensors are tested and approved, not the DIY hack the article talks about.
And the danger of “fully automatic” is there.
A sensor failure in closed loop is dangerous. I do not know how the control software detects and deals with this. I have no experience with them.
The new oref1 algorithm uses a method called super micro boluses, which can detect a sudden peak or unannounced meal, sees the first jump up, gives you a bolus so it borrows from the basals, setting the basals to 0%. The algorithm works really well for things such as eating a pizza, where you get about 50% of the carbs immediately and the rest + a bit more during the next five hours. So you take a bolus for the food, then when the fat hits in the oref1 will give you tiny boluses.
The latter is more sensitive to sensor failures, so it is on only when you told the system you have some carbs in your body, or if you happen to have a Dexcom G5 or G6 sensor with good noise readings, it will be on all the time and the system knows when the reading is faulty.
https://forum.fudiabetes.org/t/dexcom-out-of-range-calibrati...
The sensors are big things with the needle permanently in your body. You don't want three needles permanently to be sure that at least 2 from 3 work. If you have only one, you have a real problem if you trust it blindly.
Yes, it's good that some people try. But there are real risks, due to the current limitations as explained.
I know that most of the population is actually not technical, and that they can easily understand “correct when high, eat when low” but complex technical reasoning can’t be expected from them. In that context, sensors not functioning as in ideal lab conditions is a big issue.
As a type1 you must have a lot of knowledge to be able to survive. The software is a tool you must learn how to use, but takes away lots of burden from the decision making.
Can you give some more details please? I ask for a friend of mine. Thanks.
https://www.hanselman.com/blog/ThePromisingStateOfDiabetesTe...
read similar stories on r/medicine
advanced surgeons coming into the operating room with their lawyer in mind, entirely logical, totally sad
No, they're optimized for reducing risk as much as possible. The amount of scrutiny on a commercial product from a Fortune 200 company is about 2 orders of magnitude more than any DIY project would ever get.
To take a less sensitive example, NASA refused to allow SpaceX to do retropulsive soft landings for their Dragon crew/cargo capsules without a whole slew of regulatory work, which was just not a very effective allocation of resources for SpaceX. So instead of coming down retropulsively, similar to how they now regularly land their massive first stages with, the capsules come down using parachutes and a not-so-soft 'soft' landing as we've been doing since the 60s.
So you could argue this is safer. But that's not clear. What is entirely clear is that the cost and time effort that would be required to abide the regulatory requirements resulted in the entire idea being scrapped, derailing technological progress on that front. Perhaps with some irony, the capsules will still have the thrusters on the capsules to be used in case of an emergency abort - they just can't use them to enable genuinely soft landings.
None of this is to say I'm against any effort to develop an artificial pancreas. I used to work at Medtronic Diabetes. The slothful pace with which this endeavor is proceeding, despite the mountains of money behind it and the obvious and profound unmet clinical need, pains all of us. But "why was it taken so long?" is a question to which there is no simple answer. And though FDA is very much in the corner of "let's get it done" now, that was not always so.
For instance, the quote from the director at FDA re: "you can do everything but manage diabetes on your phone, you should be able to do that as well" masks the history of the med device industry for years trying to get applications on the iPhone approved by FDA and not being able to do so because you couldn't lock the iPhone down (i.e. prevent programmatically anyone from running any other program).
You might say in response it will "almost never" happen, but when it happens to your loved one it most certainly matters a lot.
But the alternative isn't that too-high doses of insulin never happen. The alternative is that all insulin doses are selected by a human, and subject to human error. And having a low blood sugar event due to too much insulin is not a rare occurrence for T1 diabetics at all.