This image be our episode 2006-183 entitled, using open source tools to visualize the heart rate and blood oxygen saturation level of my step-child. It is posted by your own pattern and in about 32 minutes long, and Karima clean flag. The summary is, using open source tools to visualize the heart rate and blood oxygen saturation level of my step-child. The episode of HBR is brought to you by AnannasToast.com. Get 15% discount on all shared hosting with the offer code HBR15. That's HBR15. Bit your web hosting that's AnastonFair at AnannasToast.com. Thanks for watching! Welcome to my third podcast! If you've never heard of my podcast, I guess you don't have a missed anything. Well, I like to do it, so I made two prior podcasts, and I thought let's give it a try. Again, this time is much more personal subject, it's much more close to me, and at the same time I want to tell you all a technical story. So, bear in mind that everything I tell you is the truth, only the truth and nothing, but the truth, so it's based on stuff that actually happened. It's a human story, but at the same time it has a very technical dimension that I want to share with you all. So, the title of this podcast would be if I did talk about three years ago at a conference, and it's the only time I did this presentation. So, this is, in a way, it's a second time. Okay, so the title was using Python, PHP, JQuery, and mySQL, and Linux to visualize the hard rate and brought oxygen, situational level of my steadorder. And well, you guessed by now that's a personal story, and it is. So, I'm going to tell you who am I, let's make it a sort of a semi formal introduction, who is Anushka, Anushka is the child in question, but more on that later. What happened, what did I do, how it all worked out at the end, at the end, and they all lived happily ever after. So, I already, I spoil it, it was spoiler alert, you know, it has a happy ending in a way. Okay, so more about me, my name is Jerome Betten. Anyway, if you would pronounce it in Dutch, where I'm from, it's your own Barton. So, if you want to visualize that in your Spanish or English, if you would do a Y, ER, UN, and pronounce it in English, then you have something that sounds pretty familiar to you. Anyway, I've been an open source geek since 1997, by now I'm almost 55. Even when this is broadcast, I've, I believe two weeks left before my birthday. I've written several books on Linux and open source, both for educational purposes, also for managers. So, these days I call myself an IT-solutionist because I like to solve problems. I used to be a volunteer firefighter, so I did that, and it was also active in the Boy Scout movement. At home, we drive an adjusted Opel Viro van. Volkswagen would be the brand in the UK. And it's adjusted because it's adjusted for wheelchair, and more on that later, but on the side, on the both sides of the van is a very big touch. There was a present from my wife, one of my birthdays about 10 years ago. And we have a family, we have a family with only daughters, so all in all we have five daughters. We're extremely proud of every child. Two of them are severely disabled. That's the way sometimes stuff goes in life, it just happens, and it just happened to me, and it happened to my wife. So I had three daughters, she had two, and when we made up, well, we ended up with five children. The oldest one is just graduated from university and is an actual doctor and is working in a hospital, so we're very proud of that as well. But and and and two others are still in in college studying and well. But today we go to talk about Anushka. Anushka is the youngest daughter of my wife. She by now is 21. So she was born in 1997, and when she was born, she was diagnosed with what's called spinna bphida. In her case, spinna bphida operator L3 to L5, which means that she has a spinal cord, the opening in a way that was created at a very first weeks of pregnancy. And it has affected her ever since, of course. She can't walk, she can move her legs, but it's more erratic than anything else. But due to this, she also gets a malformation in the skull, which is called Arnold Guillermo formation. She has what's called Hydrocephalus, and for that she has a drain in her head, and well up till today, she has had 43 surgeries in her life. And then there's the extra number of hospital sessions for pneumonia and other stuff we stopped counting. So all in all, she has been in the hospital many, many, many times, so did we. When I met her, she was 10, so I've sort of joined them in these kind of festivities, and I mean that, of course, ironically, for the last 11 years. She's very acquainted with hospital life. She, in a way, it's, oh, do I need to go to the hospital? That's fine, because every Thursday there are the clinic lounge. She focuses on the good stuff that happens there, not realizing that actually you should avoid being in a hospital as much as possible. And well, to give you an example, she, at one point, had surgery to straighten her spinal cord, because she was, when you're 15, 16 years old, and you're always sitting in a wheelchair, sort of your body, your spinal cord is not a straight line anymore, but becomes a sort of an S figure. And everything becomes shorter, all organs become packed together, and at the time that they, I think, the doctors say she's probably not going to grow anymore. That's the time when they do these kinds of adjustments, so they straighten the spinal cord just by, well, pulling it straight, of course, when you're under anesthesia. And then putting two iron rods parallel to your spinal cord. It does take about six weeks of recovery after that to get acquainted, to get your body acquainted with the fact that you can't move your spinal cord anymore. But it's strengthening you, it gives more room to your organs, so all in all, it was, it was an improvement, strangely enough. Anyway, so the surgery session where our journey today starts was a couple of years ago when she had what I would call chronic pain in her hip joint, one of her hip joints, the side doesn't matter, of course. And the cause for that was that there's insufficient joint development simply because you're always in a wheelchair, so normal kids who are standing, the hip joint cup is created because while your body weight is pressing onto your legs, so it sort of forms itself, just by playing and walking etc. If you're sitting and lying all your life, the hip joint doesn't really develop well. So there was some surgery necessary, and actually they cut off the top of the hip bone, rotated it 180 degrees and put it back together, together with some metal and screws. And I won't bother you with the details why, but it was an improvement. But this is where it starts, post surgery, she had low oxygen levels during sleep. So during the day, no problem, everything's fine, but during sleep, her oxygen levels were decreasing, so there was some questions as to, what's the source of this? How severe is this? Can we fix this? Those kind of questions that you ask yourself at that particular point in time. So she was of course taken care of by a pediatrician at her hospital, an excellent pediatrician by the way, excellent guy. One of the things that was ordered was what's called a polysomography, and a polysomography is a difficult word for, let's say, a 24 hour monitoring of your oxygen levels during day and during sleep. So it takes 24 hours. The result of it was that the oxygen levels were varying at night between 85 and 90%. So that doesn't seem to be too bad, 85, 60% to 90%, it's not alarming. So the end conclusion of this polysomography was that the values found were in the gray area, so it's not green, it's not red, it's in between slightly orange maybe, but we call that a gray area. So there were some measures regarding oxygen introduced at home, and the pediatrician said, if only we had more data. If only we had more data, but please, not a huge table with data, this was clearly a picture a guy. And so we came home, we went home, and we got two devices. As if we didn't have enough, but we got two devices. One was an oxygen concentrator, and the other is a saturation measurement device. So the oxygen concentrator is for producing oxygen. We got to fill up, so if a flow oxygen concentrator and no other people say, these things are loud at night, they switch every so many seconds, and it bothers to hell out of me. Strangely enough, it doesn't bother the hell out of Anushka, the child in question, she doesn't care, she just sleeps, which is, of course, marvelous, especially when you've got a device next to your bed, that every, let's say, every 20 seconds goes, and then it's 20 seconds of silence, and it's so, it annoys me, it doesn't annoy her, thank God for small fairs. Anyway, the other thing we got was a saturation measurement for correct level feedback and alarm, and we got to what's called a Masimo Rat 8 or AD8 saturation measurement device, and that's why we begin. But, you know, I'm a nerd, I'm a geek, whatever, and what is that I see on the back of the route, rad8, where hell, believe it or not, it's an RS232 connector, it's a serial interface, yeah, can I play with it, may I play with it? So I go and Google the stuff, and I find the Masimo Rat, I use a manual.pdf, which clearly describes everything that this connector can do, and what does the manual say? Well, there are buttons, where you can set the serial output on and off, and standard, it's 9600 bought, 8 bits, no parity, you want to stop it, one stop, stop it, one stop it, so basically, very simple serial connection, and when I connect this to a Linux system, what do I get? I get a nice string that's output every two seconds, it gives me a date, a time, it gives me a serial number of the measurement we're talking about, it gives me the saturation percentage of oxygen, it gives me a heart rate, and let's see what else, some other stuff that's actually blank, so it's a generic serial library, and the device does not measure everything that's in the library, but it measures enough for us anyway. So next order of business, I create a database, I use my SQL, just you know, simple, it doesn't have to be a rock solid, it doesn't have to be enterprise ready, it's just store some data, and I'll look at it in a later time, so I made a table with a few fields, you know, ID, timestamp, the data received, so that's the complete string. And I also made a separate field for the oxygen percentage, for the heart rate, and, well, yeah, and the time, oh yeah, and the timestamp field that I got from the device, and I create some indexes, and I'm ready to go, so I start programming in Python to import the serial data, and put everything in a database. Now, the device is not stretched, switched on 24 hours a day, so, but the PC that's running on a room, because she is a Ubuntu user, because she had to, and she was familiar with Ubuntu games, because she liked simple games, we just left it running, and I created a service that was running this Python program, and only when there were measurements coming from the serial line, he would store it in the database, so no zero value during the day, only as soon as the unit was switched on, there would be stored in the database. Now, well, what do we have? We have a database, we have, at the end, we add some 7 million, yeah, that's 7 million measurement values, so all strings, measurements strings, and that should be enough 7 million. So, I needed to get the basic heart rate and the zero, sorry, the O2 from the string, so I, well, this is plain and simple update data set, P2 to a substring of the data from 38, 3 characters, update data set, heart rate to a substring, so because it was a fixed length, esky string, no stored procedure, nothing, nothing, just simple, just get the data from the substring and stored in the separate field and work from that. Next thing was, okay, shall I, I need to visualize this data, quick and dirty, and what's the best way to visualize quick and dirty? Obviously, there are other solutions, no doubt people who are listening to this are thinking, oh, that's dumb, you should have used, well, XYZ, whatever. Anyway, so this is, in a way, a random choice, but at the end, I was happy with this, so I used P, PHP, and I used JQuery, and JQuery was simple to get a data selector, because at the time I wrote this, there was no HTML5 with a nice input type, is date, and you get a date selector, you had to build it yourself, so I used JQuery for that. And then I had to find the easy to use PHP visualization library. Of course, I know I knew of JPE graph, because at some time, that was the all around go to graphic library for visualizing graphs in PHP, but when I was looking at it, and this is back in 2015, it turned out to be no longer the leading library. So let's look at what's stayed of the art at that point in time. So there is Google, you know, it's hip, it's happening, they do a lot of stuff, and they have a charts, JavaScript library. Well, that can't be wrong, right? It's Google, wrong, it is, it's now, it was clearly not for me, it was, I don't know, to complex, I do, to buggy, I forgot, but it clearly wasn't for me. So I found, I found, this other thing, it was dy graph, do it yourself graph, dy graph, and basically what you do is you send it CSV form of the data and you're done. So I could make an HTML form, every graph that I wanted, I just, the source of it, will be a PHP script that would only produce CHV form of the data, easy, easy, done, working, it includes zoom functionality out of the box, yay, and that's when I saw the first results. And so I had heart rate, I had auctions and levels, and yes, they were dipping sometimes, they were at 65%, so oh, no, sorry, that's not 65% of the heart rate is 65, no problem there. I've read it, I was reading this wrong, and auctions at level was well, on average I would say 92%, which isn't bad, nothing alarming anyway. So, I changed the measurements, no, I changed the visualization of the measurements to use small range averages. So, as in, give me the average auchu or heart rate for five or six minutes or something, you know, then you can see some more overtrend instead of all the noise if you use two second intervals. And yeah, it gave me some pictures, but I wasn't very happy yet. Anyway, so I basically, in the end, I had three PHP programs, I had index of PHP, which would just say, okay, I'm going to draw two pictures, two graphics. One would be the oxygen PHP, who would generate CSV for the oxygen, another one would be BPM for beats per minute, heart rate dot PHP, to give me CSV values for the heart rate. And then when we were playing around with it during the week, nothing there, and then during the weekend, we could start an experiment, and this is where it becomes a little hairy, but let me explain first before you draw yourself in a 50, because during the weekend, we could switch the oxygen supply off. Now, this sounds dangerous, but she was connected to a saturation alarm. So, if the oxygen level would become too low, the alarm would go off, since we had a permanent communication line with her bedroom. The alarm would wake us and we could go down and to her, she was lying on the ground floor and we won the first floor. And we'd be always in time because this is so, this is seconds, you know, and you only get into trouble after a couple of minutes. So, no danger at all, but if you supply her with oxygen, we could never measure if she needed oxygen, and that was what we needed to find out. So, at Friday evening, we switched off the oxygen, and of course, kept the saturation monitoring, and this was, of course, for also for us still, well, not so much, it's not that it's scary, but it's also not that your ex, I don't know what the word for it is, but it comes close to unnerving, I guess. So, that's my lack of English, sorry for that. Anyway, what we did see during the night, we did this the whole weekend, because, well, 24 hours was not enough, otherwise, the polysumnerography had given us a good result, so we did this the whole weekend. And what we saw was that somewhere at three o'clock in the morning, she would, the oxygen level would dip, would go, what said, a downward peak value, let's say, so the first, it would go to 60% the next day, it would go to 70% the next day, it would go to 80% and it wouldn't be for a long period of time, but, now, this wrong, so it first dipped to 80% then it dipped to 70% and then it dipped to 60%. Not for a long period, but there was a clear in decreasing amount of oxygen over time every night. So, maybe this, I still see the graph in front of me while I'm telling this, but I know it's hard to explain this, so I'm repeating it just to make it clear. So, somewhere around three in the morning, her oxygen level would go down from the normal 90%, 95% the first night, it would go to 80% and then back up to 90% the rest of the night, nothing there. The next night, it would, again, three, four o'clock in the morning, go from 95% down to 70%. Just for a few minutes and then it would go back up again to 95%. And the third night, she would go to 60% of course, we get an alarm by then, so we went and have a look and well, she was just sleeping fine. And there was no real alarm, sure. But at the same time, every morning she woke up, she felt increasingly tired. So, it was sort of an energy drain on her to sleep with our oxygen and we saw an increasing amount of, well, it's decreasing actually. But it's, so it's, the oxygen dip would become increasingly worse. So, three days was more than enough for us to convince us. And we went with these graphics to, to her physician who was very happy to have all this data and all this graphs. And we could put this doubt to rest, whether or not she would actually need oxygen because first it was, well, you know, it's inconclusive, you don't know. So, we're not connected to oxygen during the night, the minimum race will continue to drop during several days. So, oxygen always needed. So, that was at the end, the conclusion that we had to take. The physician was happy with the results. We were happy with the results. I was proud because as a hacker, I could do something really valuable with my skill set in her health care. So, of the day, so was she actually. So, as she's still on oxygen, this is, well, it did have a serious impact, but that has nothing to do with this, this research. But the other thing we had to decide, and that's where Anishka, she, she doesn't have the regular skill set of somebody of 21, it's lower than that, but still at some point, sometimes she can really amaze you by her insights. And when we got the oxygen system at home, in this situation, measurement device, and she knew that these, these situation, measuring devices, they also give out false warnings, every night, if you have a good night, it's one, if you have average night, it will be three false alarms. And we already had our day job, after our day job, we would have our care job taking care of her, and that would mean that we couldn't even sleep normally anymore. So, if you cannot even rest during the night consistently, and I'm not talking about, sometimes the night that you can't sleep, I'm talking about every night that will be broken, you just know when you start down that low road, that this situation will become increasingly worse for us as a parent. So, we had to discuss with her the option of starting to live somewhere else, and she already figured that one out herself. So, when she was 18, because she was very close to her 18th birthday, she started to live somewhere very close by, and she's very happy. As a matter of fact, when I'm recording this, I'm just home, and I picked her up at where she lives, and we went to a Greek restaurant, and I lovely dinner together with her, and we all three of us enjoyed it thoroughly. And I brought her back there, where they can, you know, you can take so much better care for them, we can, at the end you're just simply exhausted, to exhausted, to keep on doing this. Which would, in a way, be a nice intro to a podcast about my burnout, I realize while I'm saying this, but maybe that's something for another episode. And let's not overdo it at this day, maybe this is enough, you know, for today. So, yeah, that was it, using nerd stuff, and open source tools to measure the oxygen levels of your daughter, and to zoom in on the best way of treating and dying nose. And that's it for today. So, yeah, I hope you find it interesting. If you like, please leave a comment, I enjoy the comments that I've read so far on the previous podcast. And then tremendously, too bad there is no reaction button, so I can't respond to comments as I would like to. Maybe I should record a podcast of the comments, but you know, then you get a sort of never ending cycle of responding to comments on podcasts to comments on podcasts, etc. You know, it's never ending route. So, I leave you at that. I hope you enjoyed this, and I would say till we meet or talk or tell you hear me again. Okay, bye-bye. If you ever thought of recording a podcast, then click on our country video to find out how easy it really is. The idea was found by the digital.com and the information computer club, and it's part of the binary revolution at binref.com. If you have comments on today's show, please email the host directly, leave a comment on the website or record a follow up episode yourself. On this otherwise status, today's show is released on the creative comments, attribution, share a like, to the.com license.