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

How export all days for oximeter (O2 Ring) data only (no CPAP) ?
#1
Question 
How export all days for oximeter (O2 Ring) data only (no CPAP) ?
Is there a way, via O2 Insight or OSCAR, to export (eg as CSV) all oximeter (only) data ever recorded/imported?

My oximeter is an O2Ring, I import from it daily into O2 Insight and (then) OSCAR.
I see OSCAR has a CSV Export Wizard but when I use it, all I get is headings, no data (maybe only works when there is CPAP data?)

Reason for wanting to export the data:
To quickly/easily experiment with making my own prototype metrics (for oxygen deprivation) and predictors (of energy, mood and headaches)
I am aware of conventional metrics like SpO2 levels and ODI (3% & 4%) but consider these too crude - more "easy to measure" than targeted.
BTW if anyone has interest/opinions/links regarding such metrics/predictord, please let me know.
Post Reply Post Reply






Donate to Apnea Board  
#2
RE: How export all days for oximeter (O2 Ring) data only (no CPAP) ?
Export the oximeter data as csv from the O2 Insight Pro app on your computer.
Jeff8356
Apnea Board Moderator
www.ApneaBoard.com
OSCAR Team

MacBook Air (2017, Intel) | macOS Monterey (12.7) | OSCAR v1.5.1 | VM = Win10/Win11 |
How to Links:
Installing OSCAR on a Mac
Organizing your OSCAR charts
Attaching screenshots and files for the forum
OSCAR Help
OSCAR - The Guide

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply
#3
Question 
RE: How export all days for oximeter (O2 Ring) data only (no CPAP) ?
(06-05-2023, 06:48 AM)Jeff8356 Wrote: Export the oximeter data as csv from the O2 Insight Pro app on your computer.

Thanks Jeff,

I tried that (O2 Insight's [Export as CSV] button), but it only seems to export for a single session.

Even when I selected all the sessions (nights) so far for this month (June), after I exported, the CSV file only contained data for 1 to 2 June (overnight).

Is that (one day at a time) definitely the only option here, or is there a (user-friendly or hack-y) way to get it to export over multiple sessions?
(Even if only to put my mind at rest that I'm not missing something)

I (just now) tried a more hack-y way - opening the (O2 Insight) application's (SQLite) database (db_o2.db, opened in DB Browser for SQLite), but it only contains daily aggregate/summary/score data, not down to the individual samples level.  Shame...

I see also there is code (e.g. Java) on GitHub for reading individual Viatom pulse oximeter binary files, I guess it should in principle be easy to run that (e.g. in a commandline or java for-loop) over all the files in a directory/folder.  But I would prefer "an easy route" if possible.
Post Reply Post Reply
#4
RE: How export all days for oximeter (O2 Ring) data only (no CPAP) ?
The database name is, PlusebitO2.db. The data is stored as a blob type. The path is sleepData/dataBuf. Each record is stored sequentially, and uses the date/time filename field (mFileName) for parsing. I'm sure there must be instructions on the internet to extract and format this data to your needs.

Good luck!
- Red
Crimson Nape
Apnea Board Moderator
www.ApneaBoard.com
___________________________________
Useful Links -or- When All Else Fails:
The Guide to Understanding OSCAR
OSCAR Chart Organization
Attaching Images and Files on Apnea Board
Apnea Helpful Tips

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply






Donate to Apnea Board  
#5
RE: How export all days for oximeter (O2 Ring) data only (no CPAP) ?
I may be wrong, but as near as I can tell the db names for Apple versions are:
  • iOS v16.3.1 - jkdb.sqlite
  • macOS v12.6.6 - db_o2.db

Both db's only hold the summary data for each session. All of the binary files are in their respective locations and hold the detailed data.
Jeff8356
Apnea Board Moderator
www.ApneaBoard.com
OSCAR Team

MacBook Air (2017, Intel) | macOS Monterey (12.7) | OSCAR v1.5.1 | VM = Win10/Win11 |
How to Links:
Installing OSCAR on a Mac
Organizing your OSCAR charts
Attaching screenshots and files for the forum
OSCAR Help
OSCAR - The Guide

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply
#6
RE: How export all days for oximeter (O2 Ring) data only (no CPAP) ?
You're correct, Sir!

I went back and found that in some versions, Viatom had changed the database names. For the databases named, db_o2.db, this is the location to find the data: tb_check/checktime.

Good catch! Thanks

- Red
Crimson Nape
Apnea Board Moderator
www.ApneaBoard.com
___________________________________
Useful Links -or- When All Else Fails:
The Guide to Understanding OSCAR
OSCAR Chart Organization
Attaching Images and Files on Apnea Board
Apnea Helpful Tips

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply
#7
RE: How export all days for oximeter (O2 Ring) data only (no CPAP) ?
Ok, so there is no option apart from getting/writing some custom code to go through all the binary files themselves.

I found what looks like suitable java code here: https://github.com/rileyg98/ViatomDataReader

According to its README.md file:
Code:
Reads raw binary files extracted from Viatom pulse oximeters.
Inspiration (and the header definition) was borrowed from OSCAR, over at https://gitlab.com/pholy/OSCAR-code.
This takes an input file name and an output file name. It does basic sanity checking of the file structure.
This will output a CSV formatted with the following columns: Unix Timestamp, Pulse, Heartrate.

I am on macOS
I tried downloading the above and running it on a binary file ("20230611204719") as follows, in a Terminal window:
Code:
java ViatomReader.java ~/Desktop/20230611204719 ~/Desktop/20230611204719.csv
But it failed with error message: "package com.opencsv does not exist"
So I guess I need to load that package somehow.  Anyone know the most appropriate wat to do this?
From a websearch, so far, it seems recommended to use a tool called 'maven', which (AFAICT) automatically downloads dependencies (presumably to wherever they ought to be!).
Am I on the right track, or is there some nice simple slick and friendly GUI-based java IDE I could be using instead?
Any tips welcome
Post Reply Post Reply






Donate to Apnea Board  
#8
RE: How export all days for oximeter (O2 Ring) data only (no CPAP) ?
The Bing-ChatGPT language-model's recommendation was to use NetBeans as an IDE - easy to learn and quite functional, supports maven.
I found information on that here on StackOverflow.
I will try that out.

Programming in java is new to me.
Post Reply Post Reply
#9
RE: How export all days for oximeter (O2 Ring) data only (no CPAP) ?
For anyone coming across this (including OP) yes this will work. It took me quite a long time to get everything working, but it is possible. The basic steps are:

- grab binary data files (".dat") from phone. It is in "com.viatom.vihealth\files\20\host" where 20 may be different for you. They are names after the timestamp of the recording

- convert them using the tool linked by David, found at the link above (I am new and can't link). It is called "ViatomDatareader" on github. This was kind of the hard part. I downloaded the entire github repository. I then downloaded the Eclipse Java IDE and was able to get it to run. I then outputted it as an executable jar file. I can upload if anyone wants it.

If doing a lot of files, I found it best to list the entire contents of the folder with the data. I opened it in a spreadsheet app (Libreoffice) and then created a column with the following string:

=CONCATENATE("java -jar test.jar ",A1," ",A1,".csv")

where A1 was the column with the filename.

I then ran the entire list of
java -jar test.jar name.dat name.csv
in a windows Powershell. It took a while. I then merged all the .csv's into a single file using

Get-Content .\*.csv | Out-File .\Combined.csv

in Powershell. That also took quite a while.

In the end, I now have a csv with all my timestamped SpO2 and heart rate data.

Sorry this wasn't written out better, it's been a while since I've posted like this and it is getting late. I will try and help if anyone has questions that wants to do this process.

I can upload the executable jar file to save a step (not having to download and run the Eclipse thing). Of course you'd have to trust some random person on the internet in not giving you a virus.
Post Reply Post Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Oscar File Export Sessions DanEm 32 857 09-07-2023, 01:32 AM
Last Post: DanEm
  OSCAR and NONIN 3150 oximeter? Polskafriend 3 197 09-06-2023, 08:33 PM
Last Post: Crimson Nape
  Changed data directory from OneDrive, Now can't read data Rich66 9 492 08-24-2023, 11:32 PM
Last Post: Rich66
  Help organizing Profiles and CPAP Data Cam12 7 206 08-18-2023, 05:52 PM
Last Post: Crimson Nape
  OSCAR: Print multiple days edgreenberg 0 240 08-11-2023, 09:46 AM
Last Post: edgreenberg
  No OSCAR Data Recorded to SD Card for Two Days upsman 4 476 07-01-2023, 03:12 PM
Last Post: Crimson Nape
  OSCAR Crash on Oximeter Import TiredUser 22 3,257 06-22-2023, 11:42 AM
Last Post: Crimson Nape


New Posts   Today's Posts






About Apnea Board

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