Real-time medical device programming


/me deals with that field on occasion, yay HIPAA

Though who knows, that field has been getting a bit more wishy-washy lately, so maybe…

I’m not talking about something like HIPPA. I’m talking about the reality of realtime programming. Even if HIPPA was relaxed somehow, would Elixir be a decent choice? I believe it wouldn’t.

I know of your involvement with HIPPA from medical information systems, but have you actually dealt with medical devices? That’s really cool. Could you talk a little about it?

Oh that’s just me complaining about it, not saying it is because of it. ^.^

But no, the medical hardware I’ve dealt with for similar things have very very hard real-time requirements.

Talking to others mostly, only one thing I’ve dealt with directly and it was their vein finder thing (which was bloody cool to be honest, pun intended ^.^).

So, Rust with no_std formally audited with a theorem prover like Coq? Or just C? :stuck_out_tongue:

Heh, C and assembly is what I’ve most seen (some fortran and cobol), with a lot of Java for client-side interfaces (that don’t touch the hardware directly).

Honestly they really should run through Coq or so, but not the ones I saw.

1 Like

Hm… C, assembly, fortran and cobol seem nice, but Java is not exactly real time…

Precisely why it’s not on the hardware, only as a remote interface to the better code that ‘does’ run on the hardware.

On the plus side I saw very few bugs in the hardware, but quite a few in the UI code (so much so that they were risking losing their licensing…). ^.^;


I mean, I know nothing about cobol, but from what I’ve read it has manual memory management (even better, it can only allocate a static amount of memory), so it should be good, I guess

EDIT: “good” as in safe and easy to reason about.

1 Like

Well, you can build an artificial pancreas with Nerves and Elixir :003:


Just because you can do it, it doesn’t mean you should. I have no idea what the granularity of the feedback loop is (one adjustment per decond? One every 2 seconds? Once per minute?), but it’s something that should be handled by a realtime system.

Elixir can’t give you realtime guarantees. For something like a pancreas it’s possible that the soft real time guarantees are enough (and maybe even better than what the endogenous pacreas does), but that’a a risk you have to take.

Insuling is essentially a poison that steals blood sugar from your brain into the muscles. The complications of an overdose are coma and a quick death.

You can kill people with insulin. Until the 50s or 60s (I’m not sure about the datw) it used to be a nice way of disposing of something, because the needle puncture is tiny, and insulin used to be undetectable in the corpse (it can be deteces now)

The long term consequences of being systematically underdosed are very serious too and lead ineviatably to a gruesome death.

So, again without passing definite judgement on Elixir for these kinds of devices, it looks like you might want to choose something other than Elixir.

1 Like

To date, I haven’t heard anyone talking of using Elixir inside a medical device. With a microcontroller to bridge for motor control and sensing, it could be up to the task.

On the other hand, Nerves is fully capable and awesome at doing wireless communications with an ecosystem of devices and coordinating things from a higher level. It handles the packet radio flakiness and the prediction algorithmic side of things very well.


I wonder if it’s more of a liability and risk issue. If medical device manufacturers have a system that works well and is very stable they would need a reason to incur risk. I don’t work with medical devices but do work with health benefits and the rules, regulations, and security requirements are extremely high. I just wonder what it looks like for the medical device companies. I would love to see elixir and nerves in the devices though!