Hello Guest, Welcome to Apnea Board !
As a guest, you are limited to certain areas of the board and there are some features you can't use.
To post a message, you must create a free account using a valid email address.

or Create an Account


New Posts   Today's Posts

Import CSV to Oscar?
#1
Import CSV to Oscar?
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.
Post Reply Post Reply
#2
RE: Import CSV to Oscar?
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.
Post Reply Post Reply
#3
RE: Import CSV to Oscar?
There are a few apps.  I looked over some and just bought this one and tried it: https://apps.apple.com/us/app/health-aut...1115567069 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


Attached Files Thumbnail(s)
   
Post Reply Post Reply
#4
RE: Import CSV to Oscar?
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.
Post Reply Post Reply
#5
RE: Import CSV to Oscar?
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.
Post Reply Post Reply
#6
RE: Import CSV to Oscar?
(02-06-2021, 02:03 PM)happydreams Wrote: I've built a position sensor from a Feather Arduino and a 3D accelerometer. 

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.

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.
Post Reply Post Reply
#7
RE: Import CSV to Oscar?
@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.
Post Reply Post Reply
#8
RE: Import CSV to Oscar?
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.
Useful links
Download OSCAR (current version is 1.5.1)
Best way to organize charts
How to attach charts to your post

Apnea Board Monitors are members who help oversee the smooth functioning of the Board. They are also members of the Advisory Committee which helps shape Apnea Board's rules & policies. Membership in the Advisory Members group does not imply medical expertise or qualification for advising Sleep Apnea patients concerning their treatment.
Post Reply Post Reply
#9
RE: Import CSV to Oscar?
(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).
Post Reply Post Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  O2 import DST > ST 1:14am happened twice dgconder 5 227 11-03-2024, 08:55 PM
Last Post: dgconder
  Oscar Crash to desktop on SP02 import WallyPepper 7 659 11-01-2024, 09:36 PM
Last Post: Crimson Nape
  Trouble understanding how to import O2 ring info into Oscar katbrat 6 481 10-26-2024, 08:25 PM
Last Post: katbrat
  OSCAR: Questions regarding a potential import for Garmin data littleyoda 2 262 10-19-2024, 10:37 AM
Last Post: littleyoda
Idea Generic import to OSCAR? Oscer? I Ardly Know Er 1 416 10-19-2024, 03:48 AM
Last Post: littleyoda
  OSCAR SpO2 CSV import ST Dog 29 5,823 09-11-2024, 05:36 PM
Last Post: Toolworker
  Encore Basic Data Import juan8474 1 533 08-16-2024, 10:07 AM
Last Post: Irish7281


New Posts   Today's Posts


About Apnea Board

Apnea Board is an educational web site designed to empower Sleep Apnea patients.