From 89edb3f077f207896d0a5c6fdfd06d3492e1ad5d Mon Sep 17 00:00:00 2001 From: kappa44 <6469032-kappa44@users.noreply.gitlab.com> Date: Mon, 26 Apr 2021 10:02:30 +1000 Subject: [PATCH] Correct Total Time and AHI in CSV Export when non-CPAP devices are used --- Htmldocs/release_notes.html | 1 + oscar/exportcsv.cpp | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Htmldocs/release_notes.html b/Htmldocs/release_notes.html index 2c145d8f..56808409 100644 --- a/Htmldocs/release_notes.html +++ b/Htmldocs/release_notes.html @@ -45,6 +45,7 @@
Changes and fixes in OSCAR v1.2.0 diff --git a/oscar/exportcsv.cpp b/oscar/exportcsv.cpp index a5a21e80..f28cab24 100644 --- a/oscar/exportcsv.cpp +++ b/oscar/exportcsv.cpp @@ -248,14 +248,13 @@ void ExportCSV::on_exportButton_clicked() data += sep + QString::number(day->size(), 10); data += sep + start.toString(Qt::ISODate); data += sep + end.toString(Qt::ISODate); - int time = day->total_time() / 1000L; + // Given this is a CPAP specific report, just report CPAP hours + int time = int(day->hours(MT_CPAP) * 3600L); int h = time / 3600; int m = int(time / 60) % 60; int s = int(time) % 60; data += sep + QString().sprintf("%02i:%02i:%02i", h, m, s); - float ahi = day->count(CPAP_Obstructive) + day->count(CPAP_Hypopnea) + day->count( - CPAP_Apnea) + day->count(CPAP_ClearAirway); - ahi /= day->hours(); + float ahi = day->calcAHI(); data += sep + QString::number(ahi, 'f', 3); for (int i = 0; i < countlist.size(); i++) {