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

OSCAR SpO2 CSV import
#11
RE: OSCAR SpO2 CSV import
(12-02-2023, 08:31 PM)joeblough Wrote: here is a small python script that converts an EMAY oximeter CSV file to a somnopose CSV that can be imported into OSCAR. it takes as a single argument the name of an EMAY csv file and outputs the new CSV file to standard out, so you'll have to use redirection to create the new CSV file.


Awesome.

I'll try to test tomorrow with tonight's results.
Post Reply Post Reply
#12
RE: OSCAR SpO2 CSV import
(12-03-2023, 09:14 AM)ST Dog Wrote: Awesome.

I'll try to test tomorrow with tonight's results.

cool - note also that i wrote an emay to MD300W1 converter that produces the binary file that OSCAR expects. when i woke up in the middle of the night last night (lol) i realized that i should add some more error checking, and maybe try to get it so you can choose an input file from a dialog box. however, i won't be able to test that stuff on windows.

i'll start a new thread when i release that.
Post Reply Post Reply
#13
RE: OSCAR SpO2 CSV import
(12-18-2021, 10:31 AM)ST Dog Wrote: Thanks. I'll look at it tonight or Sunday.  I have a busy day away grom home with family.

i cant post a link due to my low post count, but see the software forum for a new post with the EMAY->dat converter
Post Reply Post Reply
#14
RE: OSCAR SpO2 CSV import
@ST Dog: how is it going ?

@joeblough: your converter threw a syntax-error on line 6.
Post Reply Post Reply
#15
RE: OSCAR SpO2 CSV import
@joeblough: after figuring the code is simple, i ported it into a shellscript.


Attached Files
.txt   emay2somnopose.sh.txt (Size: 620 bytes / Downloads: 15)
Post Reply Post Reply
#16
RE: OSCAR SpO2 CSV import
(03-14-2024, 06:55 PM)capman Wrote: @ST Dog: how is it going ?

@joeblough: your converter threw a syntax-error on line 6.

i guess there is something wrong with your python installation, or maybe you don't have struct installed because there is no syntax error on line 6...

at any rate ElectricalPaul has adopted the code and cleaned it up...

https://github.com/ElectricalPaul/emay2medview


edit: oops, sorry i forgot about this script. i was referring to my other script - it is of course different (emay2somnopose vs. emay2md300w1) - not sure where the problem is in emay2somnopose, on line 6 open() should be built-in to python. unless your interpreter is stripping all comments in which case it's dying on file.readlines(), and i suppose maybe then the python version is to blame?
Post Reply Post Reply
#17
RE: OSCAR SpO2 CSV import
can't wait for the md300 script ;-)


some more about the error:
my cursor becomes a cross and when i draw 3 rectangles with it,
i find 3 adobe postscript 3 files, made by imagemagick,
called sys, datetime and time on disc.

it puts the following errors ,exactly:
./emay_to_somnopose.py EMAY\ SpO2-20211210-113214.csv
./emay_to_somnopose.py: line 6: syntax error near unexpected token `('
./emay_to_somnopose.py: line 6: `file = open(sys.argv[1])'

i have python 3.11.8 installed on debian
and after installing python3-structlog, the error remains there.


i also tried the new converter. it says:

python3 ./emay2medview.py EMAY\ SpO2-20211210-113214.csv
Converting EMAY SpO2-20211210-113214.csv into EMAY SpO2-20211210-113214.dat ...
ERROR:root:Invalid date/time '2021/12/10 11:32:14' on line 2

it creates a datfile with three zeros.
Post Reply Post Reply
#18
RE: OSCAR SpO2 CSV import
(03-15-2024, 06:05 AM)capman Wrote: can't wait for the md300 script ;-)


some more about the error:
my cursor becomes a cross and when i draw 3 rectangles with it,
i find 3 adobe postscript 3 files, made by imagemagick,
called sys, datetime and time on disc.

it puts the following errors ,exactly:
./emay_to_somnopose.py EMAY\ SpO2-20211210-113214.csv
./emay_to_somnopose.py: line 6: syntax error near unexpected token `('
./emay_to_somnopose.py: line 6: `file = open(sys.argv[1])'

i have python 3.11.8 installed on debian
and after installing python3-structlog, the error remains there.


i also tried the new converter. it says:

python3 ./emay2medview.py EMAY\ SpO2-20211210-113214.csv
Converting EMAY SpO2-20211210-113214.csv into EMAY SpO2-20211210-113214.dat ...
ERROR:root:Invalid date/time '2021/12/10 11:32:14' on line 2

it creates a datfile with three zeros.

the script emay_to_somnopose.py doesn't call the python interpreter, i should have put the #! line there but i wouldn't know where python resides on your system. so you need to do 'python3 ./emay_to_somnopose.py' to get it to work. the errors you are seeing are from your shell trying to interpret the file, which it can't, because the shell can't understand python programs.

as for emay2medview.py, i haven't actually tried ElectricalPaul's script. you can file an issue on his github page. i'm wondering if the problem is that you are using european dates - my emay files have dates like 12/5/2023. so both his script and my script would need to be internationalized to make them work for you.
Post Reply Post Reply
#19
RE: OSCAR SpO2 CSV import
still.

with "12/10/2021,11:32:14,98,85":
python3 ./emay2medview.py emay_us.csv
Converting emay_us.csv into emay_us.dat ...
ERROR:root:Invalid date/time '12/10/2021 11:32:14' on line 2

with "10/12/2021,11:32:14,98,85":
python3 ./emay2medview.py emay_us.csv
Converting emay_us.csv into emay_us.dat ...
ERROR:root:Invalid date/time '10/12/2021 11:32:14' on line 2
Post Reply Post Reply
#20
RE: OSCAR SpO2 CSV import
(03-15-2024, 04:06 PM)capman Wrote: still.

with "12/10/2021,11:32:14,98,85":
python3 ./emay2medview.py emay_us.csv
Converting emay_us.csv into emay_us.dat ...
ERROR:root:Invalid date/time '12/10/2021 11:32:14' on line 2

with "10/12/2021,11:32:14,98,85":
python3 ./emay2medview.py emay_us.csv
Converting emay_us.csv into emay_us.dat ...
ERROR:root:Invalid date/time '10/12/2021 11:32:14' on line 2

probably it's also the european time causing problems. my EMAY CSV files say:

12/10/2023,9:57:32 PM,96,93

anyway yeah, the script needs localization...
Post Reply Post Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  O2 import DST > ST 1:14am happened twice dgconder 5 68 11-03-2024, 08:55 PM
Last Post: dgconder
  Oscar Crash to desktop on SP02 import WallyPepper 7 520 11-01-2024, 09:36 PM
Last Post: Crimson Nape
  Trouble understanding how to import O2 ring info into Oscar katbrat 6 395 10-26-2024, 08:25 PM
Last Post: katbrat
  OSCAR: Questions regarding a potential import for Garmin data littleyoda 2 166 10-19-2024, 10:37 AM
Last Post: littleyoda
Idea Generic import to OSCAR? Oscer? I Ardly Know Er 1 336 10-19-2024, 03:48 AM
Last Post: littleyoda
  Encore Basic Data Import juan8474 1 499 08-16-2024, 10:07 AM
Last Post: Irish7281
  OSCAR 1.5.3 Import issue. kayak1 2 323 08-08-2024, 01:21 PM
Last Post: kayak1


New Posts   Today's Posts


About Apnea Board

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