These are chat archives for nightscout/intend-to-bolus

7th
Aug 2015
Ben West
@bewest
Aug 07 2015 02:10
I think embedding python would be heavy/hard to work with
there might be another way using message passing between android app and js running in WebView
I've got some js implementations of protocol for both medtronic and dexcom
Ben West
@bewest
Aug 07 2015 02:19
kotlin might be interesting
Jason Calabrese
@jasoncalabrese
Aug 07 2015 06:06
Would be nice if we could setup something kind of generic on Android to run js scripts, pull scripts from git, gist, etc
timomer
@timomer
Aug 07 2015 14:18
Hey, I have a Roche Pump so carelink is of little value to me. Right not I want to be able to log my treatments onto my mobile, combine this with xdrip and get suggestions for boluses. In the end I plan to hack the Bluetooth interface for my pump and send commands to it
This is my first attempt on Android, and I am not a developer - so its hacky to say the least. Will see how far I can get
Right now, I am having difficulty understand the structure of the JSON objects the code uses, so if anyone has a ini file and sample data I could look at would be most helpful
timomer
@timomer
Aug 07 2015 14:42
very keen to get examples of the files that populate these variables: isf_input, glucose_input, iob_input, temps_input, profile_input, clock_input
thanks :)
Scott Leibrand
@scottleibrand
Aug 07 2015 16:42
Tim: perhaps you should start with the Nightscout Care Portal code base? Only thing you'd have to extend is the bolus suggestions.
Jason Calabrese
@jasoncalabrese
Aug 07 2015 16:58
we have bolus wizard preview now, almost a bolus suggestion
timomer
@timomer
Aug 07 2015 17:55
to be honest, I got completely lost in the NS code - openaps-js I could follow. I have most of openaps-js moved, just need to see sample data vars
Scott Leibrand
@scottleibrand
Aug 07 2015 18:36
Maybe go back to nightscout and find the places where I pulled all the initial determine-basal.js code? Then you can trace back where all those variables get populated.
I believe we used my wip/iob-cob branch to start with, not the latest Nightscout. Many of the features have since been ported to dev and master, but I haven't merged in months, and not sure how much of my actual code Jason ended up using and how much he ported or otherwise reimplemented.
Jason Calabrese
@jasoncalabrese
Aug 07 2015 18:38
most of it's still there just setup as plugins, some of cob isn't being used
Scott Leibrand
@scottleibrand
Aug 07 2015 18:43
Nice.
Jason Calabrese
@jasoncalabrese
Aug 07 2015 18:51
I was going to add BGI, but not sure if that still makes sense, cob is good for context
diabeticgonewild
@diabeticgonewild
Aug 07 2015 21:10
Anyone who is closed loop @amazaheri @danamlewis @scottleibrand @bewest may want to look into this "Liraglutide May Reduce Postprandial Hyperglycemia in Closed Loop Setting"
http://www.endocrinologyadvisor.com/ada-75th-scientific-sessions-2015/liraglutide-insulin-closed-loop-type-1-diabetes/article/420370/
It delays gastric emptying so I'm not a candidate as I have severe gastroparesis that is not diabetes related (surprisingly)
Scott Leibrand
@scottleibrand
Aug 07 2015 21:23
Yeah, there are several promising adjuncts we can try once we have OpenAPS' algorithm pretty much locked down. Metformin is another.
timomer
@timomer
Aug 07 2015 21:33
Sure, ill take a look again at NS, with the lack of comments and with so many parts its difficult to follow (not making a dig there!) - openaps-js was easier to focus on
as I will be collecting data myself and pulling BG from xdrip, would be helpful to get sample data for me to see real world examples, especially considering I will not be able to get data from a pump. If I finally do get round to interfacing with my Roche pump I want to be sure I am formatting the data the same to help with intergeneration
Scott Leibrand
@scottleibrand
Aug 07 2015 21:44
Really easy to populate your DB with treatment data using NS care portal and then use that externally for predictions, even if you don't end up extending the NS code base directly.
timomer
@timomer
Aug 07 2015 21:46
sure, I have used the care portal. I want the android app to be standalone, not dependant on anything else and need a network connection
timomer
@timomer
Aug 07 2015 21:53
hence why I want to use the NS / openaps-js code to be ported to android
also working on mixing nightwatch code in there for the visualizations and bg readings, so I will end up with something like nightwatch + NS treatment logging + openaps suggestions
its deff going to be a monster if I can get it to work, but its a start for that platform and a solution that will remove the Pi for users who can connect to their pumps wirelessly
Scott Leibrand
@scottleibrand
Aug 07 2015 22:00
Have you talked to @TC2013 yet?
timomer
@timomer
Aug 07 2015 22:01
no I have not, will ping him, is he working on something similar?
also, are you not on your honeymoon!? ;)
Scott Leibrand
@scottleibrand
Aug 07 2015 22:05
He built an Android implementation of OpenAPS.
timomer
@timomer
Aug 07 2015 22:10
ping him now, thanks for the info
Jason Calabrese
@jasoncalabrese
Aug 07 2015 22:14
the NS code in master is a mess, dev is almost a full rewrite
and I have another huge PR about to be merged
right now the IOB, COB, profile, BWP, etc have a good amount of plugin code
timomer
@timomer
Aug 07 2015 22:15
cool, I am looking at dev, will keep that as my reference
Ben West
@bewest
Aug 07 2015 22:15
yeah, we've been chipping away, piece by piece
we've finally gotten around to most of code base
Jason Calabrese
@jasoncalabrese
Aug 07 2015 22:16
trying to get test coverage up
make it something we can work on without the fear of breaking things with any little change
Ben West
@bewest
Aug 07 2015 22:16
trying to get more hackable/testable/maintenable/readable...
Jason Calabrese
@jasoncalabrese
Aug 07 2015 22:17
plugin were added to make it hackable without merge conflicts
a plugin can override others
set properties used elsewhere
so for example you could override iob, to be that read from a pump, and everything else would just use it
timomer
@timomer
Aug 07 2015 22:18
without sounding like a complete arse, just getting a comment next to the functions with a summary of what they do would be amazingly helpful when reading over the code
yeah, the plugin way is deff the way forward
Jason Calabrese
@jasoncalabrese
Aug 07 2015 22:18
what part are you trying to figure out
timomer
@timomer
Aug 07 2015 22:19
in summary, logging of treatments and how with that data and BG is then being predicted and logged on to the graph
Jason Calabrese
@jasoncalabrese
Aug 07 2015 22:19
I've been trying to use good function/var names over comments, since I have a distrust for comments
Ben West
@bewest
Aug 07 2015 22:19
prediction is AR2
alone
timomer
@timomer
Aug 07 2015 22:19
the fact I am not a developer and getting lost in the code is the main issue
Ben West
@bewest
Aug 07 2015 22:20
oh, dor diyps/iob/cob
timomer
@timomer
Aug 07 2015 22:20
yes, function names are very good - agree
Ben West
@bewest
Aug 07 2015 22:20
openaps-js is easier for that
Jason Calabrese
@jasoncalabrese
Aug 07 2015 22:20
I went a little overboard with the ar2 refactoring
timomer
@timomer
Aug 07 2015 22:20
openaps-js is what I am working form now, it was easier to follow and decode
its just I am lacking details on the format of the JSON Vars
they appear to be read from files, to get examples on them with real data would be amazing
Ben West
@bewest
Aug 07 2015 22:21
for that, look at example outputs
I've demonstrated most of the interstitial steps in public: https://github.com/bewest/openaps-example
the commit log there has the details of every command executed...
timomer
@timomer
Aug 07 2015 22:22
for example the format of isf_input, glucose_input, iob_input, temps_input, profile_input, clock_input
Ben West
@bewest
Aug 07 2015 22:22
yeah, would help to create some simple markdown files that document each of those
timomer
@timomer
Aug 07 2015 22:22
thanks, will read over that tomorrow
i am reading it from the code now, but would make more sense just having a sample file I can open
and be sure the data I am capturing is in the same format, for computability
Ben West
@bewest
Aug 07 2015 22:23
yeah, you should be able to create a dummy openaps instance and feed some sample data through the "uses" manually to see what happens
timomer
@timomer
Aug 07 2015 22:23
compatibility*
Ben West
@bewest
Aug 07 2015 22:23
openaps is just capturing/saving arguents/config to run things
so the basic building block is the "use" command which generally takes some input and makes some output
"reports" build up "flows" of "uses"
and then "alias" can be used to give nicer name to bunch of reports en masse
timomer
@timomer
Aug 07 2015 22:24
so to confirm, your openaps-example is based on openaps-js?
Ben West
@bewest
Aug 07 2015 22:25
err, it predates openaps-js a bit, but the concepts are all the same
I have the determin-baseal or iob.js in there
you can see how I use openaps vendor to configure a "process type" of device, and configure the "use iob.js" device/use
timomer
@timomer
Aug 07 2015 22:25
ok - cool, after moving most of openaps-js over in the last few days I should be able to read it
cool
Ben West
@bewest
Aug 07 2015 22:25
then you configure it to receive as input, the OUTPUT of other "uses"
eg, "fetch history", "clean history"
each of those is a "use" which all take input and produce output
openaps just tracks which things are done in which order
so openaps-js is a "process type" of "vendor" for openaps
because to implement that type of device, it has to execute a shell process
a "device" knows how to "do" a bunch of things, which we know about through how you can "use" the device
so to "use" a a "node js device" in openaps, like openaps-js, you can configure it as a vendor, and tell it in which order to execute the shell process, and which input and output to use
that is to say, you can use: node iob.js <myinput.json> to experiment
without openaps
because openaps is just executing it, in general, with the names of the outputs, inputs of other "reports"
so you can strip away all the reporting, and use it manually in a dummy openaps, or strip away openaps altogether and just call the individual scripts
timomer
@timomer
Aug 07 2015 22:30
ok, ill have a detailed read over this tomorrow - watch out, i maybe asking you questions...!
night all, cheers for the directions - once I have something worth sharing, I will share