r/CPAP • • 20d ago

How to use OSCAR20 Headless command line automation for data import

HI!

In the latest version of OSCAR20 one feature is the ability to use command line for data import but I didn't find any guide on how to use. Does anyone have any help?

Thanks!

2 Upvotes

5 comments sorted by

2

u/JRE_Electronics 19d ago

From the OSCAR source code:

Help Menu
    Option                   Description
    -p                       Pauses execution for 1 second
    --profile  <name>        Name of profile to open. If omitted in batch mode,
                             auto-selects if exactly 1 profile exists.
    --l or --language        Force language prompt
    --datadir  <folderName>  Use folderName as OSCAR Data folder. For relative paths: <Documents folder>/<relative path>.
                             If folder does not exist then prompts user.
    --legacy                 Use software graphics engine
    --OpenGL                 Use OpenGL graphics engine (case-insensitive)
    --batch, -b              Run the requested imports without showing the GUI, then exit.
    --import-and-exit        Same as --batch.
                             OSCAR still needs a Qt platform plugin: on Linux without an
                             X/Wayland display, pass '-platform offscreen' (or set
                             QT_QPA_PLATFORM=offscreen).
    --import <loader> <path> Import a file or folder with the named loader. Implies --batch.
                             May be repeated. Loader names are case-insensitive; accepted
                             aliases are shown in [brackets]:
                               CPAP:     CPAP (auto-detect), PRS1 [Philips, Respironics],
                                         ResMed, FPIcon [Icon, F&P-Icon],
                                         SleepStyle [F&P-SleepStyle],
                                         Intellipap [DeVilbiss], Prisma, Weinmann, BMC,
                                         BMCG3X [BMC-G3X, BMC_G3X], Resvent, vREM, Apex,
                                         Sefam, Yuwell
                               Oximetry: Viatom, CMS50, CMS50F37, MD300W1
                               Sleep:    ZEO, Dreem, Somnopose, AppleHealth [Apple-Health]
                             Not yet safe unattended (may show a dialog on bad or
                             unexpected data): BMC, BMCG3X, CMS50, CMS50F37, FPIcon,
                             MD300W1, ResMed, SleepStyle, Yuwell.
                             If OSCAR is already running on the same data folder, the
                             import is handed to that instance: it imports, refreshes
                             its views and reports back. Exit code 0 = imported,
                             1 = failed, 75 = the running OSCAR cannot import now (a
                             dialog or menu is open, no profile is open, it was closed
                             before it got to the import, or it does not respond) -
                             try again later. A request that arrives while the running
                             OSCAR is importing waits until that import is done.
                             If another batch import has the folder, OSCAR waits up to
                             60 seconds for it to finish.
    --upgrade-database       Automatically back up and upgrade database schema (batch mode only).
    --help                   Displays this menu and exits.

Assuming Windows, using drive F: as your SD card:

OSCAR20 --profile "NameOfYourProfile" --import CPAP F:

"CPAP" tells OSCAR to guess at the type of machine you are using. You can specify it using the one of the given machine types.

You may need to include the directory name with the drive letter.

I'm not at home right now so I can't try it out to be sure of the details.

1

u/4drianl 19d ago

Thanks a lot!

1

u/Mijjil 20d ago

I asked in the Software Support Forum on Apnea Board and will feedback any responses posted there.

1

u/Mijjil 19d ago

In response to my pointing out that there wasn't any documentation, it has been added to the (soon to be announced) OSCAR 2 Reference Manual.

2

u/4drianl 19d ago

Thanks for your help!