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

Added a new pulse oximeter importer...
#11
RE: Added a new pulse oximeter importer...
Looks like that is unique to Android... may be iOS also.  The PC SQLLite database (tb_check) only has 3 varchar fields that identify the device serial # and date/time stamp... which is enough to point to a particular file.
Post Reply Post Reply






Donate to Apnea Board  
#12
RE: Added a new pulse oximeter importer...
@Crimson Nape:

I'm not having much luck importing both oximeter and motion data from my Viatom data file.  It occurs to me, this might be because the MachineLoader::SerialOximeter::VIATOM machine type is MT_OXIMETER rather than MT_POSITION (which is the group I intended to put my Motion data under).

Is there a way to communicate that a machine (or its data files) contain two different groups / classifications of data?  Perhaps I should add MOTION to the MT_OXIMETER group instead (although not taking the simple way out: adding motion to an OxiRecord!)

Thanks!
Post Reply Post Reply
#13
RE: Added a new pulse oximeter importer...
I'm having a little comprehending. Are you saying there are 2 parallel data streams or are there 2 offsets, one for oximeter and one for motion?
Crimson Nape
Apnea Board Moderator
www.ApneaBoard.com
___________________________________
Useful Links -or- When All Else Fails:
OSCAR Chart Organization
Attaching Images and Files on Apnea Board
Beginner's Guide to Sleepyhead and OSCAR
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
#14
RE: Added a new pulse oximeter importer...
No, it's a single data stream: start time in the header, then 5-byte records with pulse, oxy, motion, and two dummy bytes.  Each 5-byte record is 2000ms after the previous one.

I think my problem is that I started out by copying an existing oximeter and changing as little as possible.  That worked OK for the pulse-oxy data, but the oximeters have added complexity because they can record live or (maybe?) download from a device over a serial line, as well as read a file.

My device _only_ has file reading, so I don't need a lot of the pulseoxy stuff; plus my device has a type of data that the pulseoxy core doesn't support.  I couldn't figure out how to add another EventList for the "motion" data to the pulseoxy Session, and my attempts to add a separate Session didn't go anywhere.

I'm going to try copying the Somnopose loader, but I'll add three EventLists (motion, plus two that look like they came from a PulseOximeter).  Hopefully that'll be easier, cleaner, and work better.
Post Reply Post Reply






Donate to Apnea Board  
#15
RE: Added a new pulse oximeter importer...
I did some digging on iPhone.  I see the SQLLite file, and it has a DataModel table with one entry per session... and a fileData blob field with exact same file data I get on PC download... this is good... so at least I know I can get all the raw data from only iPhone sync... and don't have to be in front of PC to do O2 Insight download.  Although to get the SQLLite file off iPhone is a pain in the a&&.  So the O2 Insight download and then ingest into OSCAR seems like the best path.
Post Reply Post Reply
#16
RE: Added a new pulse oximeter importer...
Would you guys like to make this officially part of OSCAR?
Fred Bonjour - Project Manager and Lead Tester for OSCAR - Open Source CPAP Analysis Reporter

Download OSCAR
New to Apnea? Helpful tips to ensure success
Soft Cervical Collar
Mask Primer
Dealing with a DME
Organize Charts
Optimizing Therapy
Post Reply Post Reply
#17
RE: Added a new pulse oximeter importer...
Well, I'm trying to Do It Right because I can't help myself, but if I get it close enough, I'd be happy to submit the code.  I'm not going to try to get direct Bluetooth downloading working, though.  I don't have BLE (Bluetooth Low Energy) on my PC, and I definitely don't want to try to support it on anybody else's computer!
Post Reply Post Reply






Donate to Apnea Board  
#18
RE: Added a new pulse oximeter importer...
Yay, I got it!  I can load Viatom data from the file the device stores, and it shows up properly as heart rate, pulse O2, and movement.  I don't know how to send the code out for testing, though.  I'm from the old "patch" days; I can make context diffs, but I don't think anybody does that any more.  Git says:
Code:
dhm@vanadium:~/code/OSCAR-code/oscar$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

new file:   SleepLib/loader_plugins/viatom_loader.cpp
new file:   SleepLib/loader_plugins/viatom_loader.h

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

modified:   SleepLib/common.cpp
modified:   SleepLib/common.h
modified:   SleepLib/machine_common.cpp
modified:   SleepLib/machine_common.h
modified:   SleepLib/schema.cpp
modified:   SleepLib/session.cpp
modified:   common_gui.h
modified:   daily.cpp
modified:   main.cpp
modified:   mainwindow.cpp
modified:   mainwindow.h
modified:   mainwindow.ui
modified:   oscar.pro
modified:   welcome.cpp
Post Reply Post Reply
#19
RE: Added a new pulse oximeter importer...
You are almost there, however new code should be collected in a new branch to be submitted as a merge request.
At this point, I would have you copy your new files to a temporary location, clean up your local repository by doing 'git checkout master', and then re-synchronize with the remote master branch by doing a 'git pull'. Now you are ready to create your new branch by doing 'git checkout -b viatom-loader'. With the new branch created, you can copy your saved files back into SleepLib/loader_plugins. At this point, you should probably rebuild OSCAR to make sure that nothing that was updated causes your code to break. If all is well, you can do 'git add oscar-code/oscar/SleepLib/loader_plugins/viatom_loader.*" (depending on what directory you are in, of course!) to tell git about the files you've changed. Then you can do 'git commit -m "your commit message here"' to update your local repository.
At this point, you can push your new branch to your remote GitLab repo, if you have one, and GitLab will prompt you (I think) to create a Merge Request when you sign in to GitLab.com. I'm not entirely sure how things work for Reporter members of the OSCAR group.
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
#20
RE: Added a new pulse oximeter importer...
(11-30-2019, 09:45 AM)pholynyk Wrote: You are almost there, however new code should be collected in a new branch to be submitted as a merge request.

Well, I don't know if I did it right, but I have a new gitlab.com account to which I pushed my version of the code.  I couldn't figure out how to get connected to the official (or any other) version of the code, so I don't know how the push/pull will work.  But I made my spacewrench/OSCAR-code repository public, so if anybody wants to try pulling it, I think you can.
Post Reply Post Reply






Donate to Apnea Board  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Oximeter upload - double sample time? klauskinski 3 80 11-22-2020, 05:39 AM
Last Post: klauskinski
  Pulse Changes missing in Overview OSCAR 1.2.0 SevereApnea 13 294 10-23-2020, 08:01 AM
Last Post: SevereApnea
  How can you get another oximeter supported TURNERSVILLE 6 426 10-12-2020, 01:21 PM
Last Post: pholynyk
  SPO2/Pulse : Apple Watch, Fitbit, etc georgelewisray 2 242 10-02-2020, 11:35 AM
Last Post: Neighborgeek
  Pulse Oximeter Contec CMS50F GerardH 20 1,130 09-21-2020, 11:06 PM
Last Post: Bobaloo
  cms f50 oximeter. Dugy40 29 477 09-17-2020, 01:32 PM
Last Post: jaswilliams
  OSCAR OXIMETER Import Question andrewb340 21 857 09-08-2020, 08:48 PM
Last Post: pholynyk


New Posts   Today's Posts






About Apnea Board

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