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
#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:
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
#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
#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?
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
#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


Possibly Related Threads...
Thread Author Replies Views Last Post
  csv-converter for like nx-8462 oximeter capman 1 191 03-15-2024, 04:45 AM
Last Post: capman
  thumbdrive-oximeter-format-analysis capman 6 254 03-15-2024, 04:29 AM
Last Post: capman
  CMS50F Oximeter Device not Recognized. ThinMountainAir 20 2,534 03-07-2024, 05:13 PM
Last Post: capman
  csv-format for generic oximeter imports into oscar capman 2 201 03-07-2024, 07:06 AM
Last Post: capman
  python file converter for EMAY sleep pulse oximeter joeblough 1 663 03-04-2024, 10:26 PM
Last Post: ElectricalPaul
  Need Computer drivers for Contec CMS50D+ Oximeter TomElgin 3 279 03-02-2024, 05:27 PM
Last Post: Crimson Nape
  OSCAR Reports do not appear to have O2 and Pulse Data SKPC 5 574 12-31-2023, 11:05 PM
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.