Import CSV to Oscar? - 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: Import CSV to Oscar? (/Thread-Import-CSV-to-Oscar) |
Import CSV to Oscar? - Ramias - 01-23-2021 Apple Watch 4 user here. There are a few apps that can export Apple Health data to CSV for selected dates and data types. Any way to get heart rate data into Oscar via this path? I’d consider upgrading watches if it can also do SPO2. But I’m mostly interested in heart rate right now, even if the watch only samples every few minutes. RE: Import CSV to Oscar? - sawinglogz - 01-24-2021 Could you point us to one of those apps so that we can look at the CSV it generates? It would be nice to import data from Apple Health. No promises on timeline, of course. The Apple Watch Series 6 only samples SpO2 infrequently. Every few hours when still throughout the day, and roughly every 20-30 minutes while sleeping. RE: Import CSV to Oscar? - Ramias - 01-24-2021 There are a few apps. I looked over some and just bought this one and tried it: https://apps.apple.com/us/app/health-auto-export-to-csv/id1115567069 called Health Auto Export to CSV. They also have a desktop version and apparently it supports Automations on the iphone. $1.99. Screenshot attachment shows the settings I did for a CSV export (that I airdropped to my Mac). It mirrors the data and intervals available on the phone in the health app. Below is a sample of the CSV. Date/Time,Min (count/min),Max (count/min),Avg (count/min) 2021-01-21 00:00:28,73,73,73 2021-01-21 00:04:53,72,72,72 2021-01-21 00:09:53,71,71,71 2021-01-21 00:15:08,71,71,71 2021-01-21 00:19:53,72,72,72 2021-01-21 00:24:58,74,74,74 2021-01-21 00:30:03,72,72,72 2021-01-21 00:34:33,69.82,69.82,69.82 2021-01-21 00:36:19,70,70,70 2021-01-21 00:40:22,69,69,69 2021-01-21 00:46:59,70,70,70 2021-01-21 00:50:29,68,68,68 2021-01-21 00:56:14,68,68,68 2021-01-21 01:00:09,70,70,70 2021-01-21 01:05:55,68,68,68 2021-01-21 01:10:29,70,70,70 2021-01-21 01:14:54,71,71,71 2021-01-21 01:20:04,70,70,70 2021-01-21 01:25:29,70,70,70 2021-01-21 01:30:04,69,69,69 2021-01-21 01:35:24,70,70,70 2021-01-21 01:40:29,69,69,69 2021-01-21 01:45:19,67,67,67 2021-01-21 01:50:11,63,63,63 2021-01-21 01:55:14,63,63,63 2021-01-21 02:03:04,66,66,66 2021-01-21 02:05:04,64,64,64 2021-01-21 02:14:19,65,65,65 2021-01-21 02:15:32,66,66,66 2021-01-21 02:21:54,68,68,68 2021-01-21 02:26:33,68,68,68 2021-01-21 02:34:12,69,69,69 2021-01-21 02:34:34,67.67,67.67,67.67 And here is one for Blood Oxygeon Saturation (used my Withings back in July). Date/Time,Blood Oxygen Saturation (%) 2020-07-09 20:23:45,98 RE: Import CSV to Oscar? - happydreams - 02-06-2021 I've built a position sensor from a Feather Arduino and a 3D accelerometer. It can data log at various rates. Would there be some guidelines as to how to construct a file that could be read by OSCAR? Since I'm the coder, I do have some degrees of freedom. Right now it would be time stamp and orientation. I have a Real Time Clock, so I can timestamp to single discrete values like 10 Hz, 25 Hz, 40 Hz, or 50 Hz. Can I have a time like: 04:29:11.020 ? The actual data could just be an integer representing orientation, or a text string, like "supine", "right", "left", "upright", etc, or the pitch and roll of the sensor (in degrees). Graph could just be simply a multilevel thing with each level corresponding to a state. (Like a sleep state graph.) Or a slightly harder to interpret dual trace pitch and roll. In any case, the file would just be csv, unless there's something better/easier to implement. If something has already been implemented, perhaps I could mimic that data file format. No need to reinvent the wheel. If it works well enough I could make the design available to geeks on AB. RE: Import CSV to Oscar? - Gideon - 02-06-2021 CSV can be bulky, look at EDF, https://www.edfplus.info/ ResMed uses this format and it seems to be a good format for higher frequency data. Since you mentioned coding, are you interested in joining the team? Let me know via PM. RE: Import CSV to Oscar? - kappa - 02-06-2021 (02-06-2021, 02:03 PM)happydreams Wrote: I've built a position sensor from a Feather Arduino and a 3D accelerometer. Hi happydreams, The simple approach is to use the Somnopose importer, and I and others have for positional data import. It just uses a seconds-since-2001-GMT date format which you can provide with whatever precision you like. I should probably contribute back my changes to this importer which allow additional fields and make existing ones optional, as well as multi-file import... See this thread for some discussion and examples of other position/movement sensors. RE: Import CSV to Oscar? - happydreams - 02-06-2021 @kappa, thanks for the link. Seems to make sense to use the somnopose loader. I'll study it a bit. I'll have to write code to convert "perfectly good RTC time" to whatever the somnopose folks decided to use. (I think it's ridiculous, but, oh well.) Does OSCAR use UTC? I sure know they don't do DST, primarily since most PAP machines are blissfully unaware of DST. It looks like somnopose has time, inclination (what I call pitch) and orientation (what I call roll). Is there a restriction on precision in the somnopose csv file? (I'm not talking about however Excel will screw things up, I mean the actual file format.) @Gideon, I will also look into edf. It's roughly the same amount of work for me, either way. From the few edf files I've opened, they seem to be sensible. A while back I downloaded an edf file browser. If I can write binary data, it will be faster and take up less SD card space. RE: Import CSV to Oscar? - GuyScharf - 02-06-2021 OSCAR assumes (yep, that bad word) that the times reported by the CPAP machine are the same timezone that your computer is set to. On import, OSCAR then converts times to UTC under that assumption. When later reading back and displaying data from the database, it again assumes that the computer's UTC offset is the right one to use (rather than remembering what offset the input was). This leads to problems viewing data recorded in DST later in standard time, or in viewing data recording in one timezone in another. As long as you are displaying data in the same timezone as it was recorded, all is well. But it's not so friendly for people who, for example, alternately live in California and then New York. Fixing this is on our list of problems. It probably won't be addressed until we redesign the database. RE: Import CSV to Oscar? - kappa - 02-07-2021 (02-06-2021, 10:12 PM)happydreams Wrote: Is there a restriction on precision in the somnopose csv file? (I'm not talking about however Excel will screw things up, I mean the actual file format.) The CSV import is very basic - no quoting, etc allowed. Time values will be rounded down to the millisecond and the other values are parsed and stored as doubles (but OSCAR only displays 2 digits after the decimal point when you hover). |