Apnea Board Forum - CPAP | Sleep Apnea
Heart rate in Overview... - Printable Version

+- Apnea Board Forum - CPAP | Sleep Apnea (https://www.apneaboard.com/forums)
+-- Forum: Public Area (https://www.apneaboard.com/forums/Forum-Public-Area)
+--- Forum: Software Support Forum (https://www.apneaboard.com/forums/Forum-Software-Support-Forum)
+--- Thread: Heart rate in Overview... (/Thread-Heart-rate-in-Overview)



Heart rate in Overview... - spacewrench - 11-24-2020

I'd like to show daily min/median/max heart rate on the Overview screen...I think similar code could show min/median/max SPO2 as well.  I started writing this up, but I don't understand how the Day manages Machine data.  Of the Day::Min(), Day::Max() and Day::avg() (or Day::wavg()) functions, only Min(OXI_Pulse) seems to return the minimum heart rate that matches the daily view.  Max() returns a number of uncertain import, and I'm not sure how avg() and wavg() correspond to the median displayed in the Statistics panel on the Daily page.

Comparing my code to the Daily code, Max() at least should be returning the right thing, but it's not.



Any help or pointers available for this project?

Thanks!


RE: Heart rate in Overview... - spacewrench - 11-24-2020

Ah, got it, it's the 95th percentile, 99th percentile, or 99.5 percentile, depending on preferences and some other stuff.  I'm not sure that exactly makes sense (if a HRM reports 100BPM, then I'd expect max to be 100) but consistency with other parts of the UI is probably more important.


RE: Heart rate in Overview... - srlevine1 - 11-24-2020

Just a fast note to say thanks for working on this useful feature. -- steve


RE: Heart rate in Overview... - spacewrench - 11-29-2020

Well, it works, but the code is ugly as hell.  I just copied the routines for other graphs and mangled them into submission.  I'm sure this would be an easy job for somebody who's worked with the graphs more, and maybe it'd be worth rewriting just to make it cleaner.  But I can try to make the changes available via Git.


RE: Heart rate in Overview... - GuyScharf - 11-29-2020

Good work!  This looks similar to the existing Pulse Rate Overview graph but with the (meaningless?) part of the bar at the bottom omitted. How does it differ otherwise?

I'm happy to look at your code; contributions are always welcome. The graph code is pretty ugly to start with!

    [Image: attachment.php?aid=28384]


RE: Heart rate in Overview... - spacewrench - 11-29-2020

Weird, I don't have the option for a Pulse Rate graph in my MacOS version 1.1.1 ... uh oh, I thought I had upgraded this machine to 1.2.0. Maybe that's the problem: I was just using an old version?

Let me see if I can get the new version running without losing all my old data.

[...time passes...]

Well lookit that! You have to turn it on in Preferences, but it works fine.

I'll figure out how the current code draws it; maybe I can remove the bottom bar (which, as you say, is not useful). If I do that on Pulse and SPO2, that will allow the scale to expand so that it's easier to see what's happening.