Index: denali.pro.user =================================================================== diff -u -rdb92783a0a9dab0ddf2b68c51d15b1ae1cb3ddcc -r80250cfdbe58a3df17950d342212f155d52d3971 --- denali.pro.user (.../denali.pro.user) (revision db92783a0a9dab0ddf2b68c51d15b1ae1cb3ddcc) +++ denali.pro.user (.../denali.pro.user) (revision 80250cfdbe58a3df17950d342212f155d52d3971) @@ -1,6 +1,6 @@ - + EnvironmentId Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -r7914ad8a4b8450d855fcc75855ca57b6644e9f7c -r80250cfdbe58a3df17950d342212f155d52d3971 --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 7914ad8a4b8450d855fcc75855ca57b6644e9f7c) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 80250cfdbe58a3df17950d342212f155d52d3971) @@ -518,10 +518,10 @@ mData += vData.duration ; mData += vData.heparinStopTime ; mData += vData.salineBolus ; - mData += vData.heparinType ; mData += vData.acidConcentrate ; mData += vData.bicarbonateConcentrate ; mData += vData.dialyzerType ; + mData += vData.heparinType ; mData += vData.bloodPressureMeasureInterval ; mData += vData.rinsebackFlowRate ; mData += vData.arterialPressureLimitLow ; Index: sources/cloudsync/CloudSyncController.cpp =================================================================== diff -u -re2dc7bd9995a3bb410aa472a1f95c1cc9ba3136d -r80250cfdbe58a3df17950d342212f155d52d3971 --- sources/cloudsync/CloudSyncController.cpp (.../CloudSyncController.cpp) (revision e2dc7bd9995a3bb410aa472a1f95c1cc9ba3136d) +++ sources/cloudsync/CloudSyncController.cpp (.../CloudSyncController.cpp) (revision 80250cfdbe58a3df17950d342212f155d52d3971) @@ -23,8 +23,8 @@ #include "GuiController.h" #include "DeviceController.h" #include "FileHandler.h" -//#include "GuiGlobals.h" + /*! * \brief CloudSyncController::CloudSyncController * \details Constructor @@ -151,41 +151,175 @@ if ( vFile != _date_out_File ) return; // ignore unwanted file updates. QString content; Storage::FileHandler::read(vFile, content); - interpreter(content); + sendUIResponse(content); } /*! * \brief CloudSyncController::addCSBuffWatch * \details Adds a watcher on the CloudSync Application output file. * \sa _out_File */ -void CloudSyncController::addCSBuffWatch() +bool CloudSyncController::addCSBuffWatch() { - bool ok = Storage::FileHandler::makeFolder(_location); - if ( ok ) { + bool ok = Storage::FileHandler::makeFolder(_location); + QVariantList args {}; + Errors_Enum error = eError_OK; + + if ( ! ok ) { error = eError_LogFolder; args = {{ _location }}; ok = false; goto lErr; } _date_out_File = _location + // The location _dateFormatted + _dateSeparator + _out_File; // The file name // watching for the cloud sync output file buffer. _DeviceController.doAddWatch(_date_out_File); + return ok; + +lErr: + toLog(error, args); + return ok; +} + +/*! + * \brief CloudSyncController::interpret + * \details Checks the received buffer to make sure it has all the required parameters + * \param vIndex + * \return true if the buffer is correct. + */ +bool CloudSyncController::interpret(const QString &vContent, Message &vMessage) +{ + bool ok = true; + QVariantList args {}; + Errors_Enum error = eError_OK; + + QStringList lines = vContent.split('\n',QString::SkipEmptyParts); + QString buffer = lines.last(); + LOG_DEBUG(QString("CloudSync Message received [%1]").arg(buffer)); + + int index = -1; + Message message ; + + QStringList items = buffer.split(_separator); + int count = items.count(); + + // check the required message length + if ( count < eMessage_Count ) { error = eError_Count ; ok = false; goto lErr; } + index = eMessage_Timestamp ; message.timestamp = items[index].toInt (&ok); if (!ok) { error = eError_Timestamp ; ok = false; goto lErr; } + index = eMessage_Sequence ; message.sequence = items[index].toUInt(&ok); if (!ok) { error = eError_Sequence ; ok = false; goto lErr; } + index = eMessage_MessageID ; message.id = items[index].toInt (&ok); if (!ok) { error = eError_MessageID ; ok = false; goto lErr; } + index = eMessage_ParamCount; message.paramCount = items[index].toInt (&ok); if (!ok) { error = eError_ParamCount ; ok = false; goto lErr; } + index = eMessage_CRC ; message.crc = items[index].toUInt(&ok); if (!ok) { error = eError_CRC ; ok = false; goto lErr; } + + // check the parameters count + if ( count - eMessage_Count < message.paramCount ) { error = eError_Parameter ; ok = false; goto lErr; } + + // getting the parameters + for ( int index = eMessage_Count; index < message.paramCount; index++ ) { + message.params.append( items[index] ); } - else { - LOG_DEBUG(tr("the CloudSync log folder cannot be created.")); + + vMessage = message; + return true; + +lErr: + // building the error info for each error + switch (error) { + case eError_Count : args = { count , eMessage_Count }; break; + case eError_Timestamp : args = { items[index].trimmed() }; break; + case eError_Sequence : args = { items[index].trimmed() }; break; + case eError_MessageID : args = { items[index].trimmed() }; break; + case eError_ParamCount : args = { items[index].trimmed() }; break; + case eError_CRC : args = { items[index].trimmed() }; break; + case eError_Parameter : args = { count - eMessage_Count , message.paramCount }; break; + default : break; } + LOG_DEBUG(toText(error) + " " + toInfo(error, args)); + return false; } /*! - * \brief CloudSyncController::interpreter + * \brief CloudSyncController::toText + * \details returns the error message of the error id. + * \param vErrorID - Error id + * \param vMessage - error message + * \return the error message or empty string if the error is 0 (no error), or Unknown Error if not found + */ +QString CloudSyncController::toText(CloudSyncController::Errors_Enum vErrorID) +{ + QString text; + if ( vErrorID == 0 ) return text; + switch (vErrorID) { + case eError_Count : text = tr( "E,CS,Incorrect header" ) ; break; + case eError_Timestamp : text = tr( "E,CS,Incorrect timestamp" ) ; break; + case eError_Sequence : text = tr( "E,CS,Incorrect sequence" ) ; break; + case eError_MessageID : text = tr( "E,CS,Incorrect ID" ) ; break; + case eError_ParamCount : text = tr( "E,CS,Incorrect parameter length" ) ; break; + case eError_CRC : text = tr( "E,CS,Incorrect CRC" ) ; break; + case eError_Parameter : text = tr( "E,CS,Incorrect parameter count" ) ; break; + case eError_NoHistory : text = tr( "E,CS,No history available for the request" ) ; break; + case eError_LogFolder : text = tr( "E,CS,The log folder cannot be created." ) ; break; + case eError_LogFileInp : text = tr( "E,CS,Error writing to the input file." ) ; break; + default : text = tr( "E,CS,Unknown Error" ) ; break; + } + return text; +} + +QString CloudSyncController::toInfo(CloudSyncController::Errors_Enum vErrorID, const QVariantList &vInfoItems) +{ + // IMPORTANT: Please be careful here used QVariantList::value to act as a loose list. + // It means it is designed to not throw out of bound error and just use "~" as a missing info argument. + auto item = [=](uint i) { return vInfoItems.value(i,"~").toString(); }; + + QString info = ""; + switch (vErrorID) { + case eError_Count : info = QString( "[%1:%2/%3]" ).arg( vErrorID ).arg( item(0) ).arg( item(1) ) ; break; + case eError_Timestamp : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_Sequence : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_MessageID : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_ParamCount : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_CRC : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_Parameter : info = QString( "[%1:%2/%3]" ).arg( vErrorID ).arg( item(0) ).arg( item(1) ) ; break; + case eError_NoHistory : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + default : info = QString( "[%1]" ).arg( vErrorID ) ; break; + } + return info; +} + +/*! + * \brief CloudSyncController::toLog + * \details logs the error in debug mode (service log) + * \param vErrorID - error id + * \param vInfoItems - extra information + */ +void CloudSyncController::toLog(CloudSyncController::Errors_Enum vErrorID, const QVariantList &vInfoItems) +{ + LOG_DEBUG(toText(vErrorID) + " " + toInfo(vErrorID, vInfoItems)); +} + +/*! + * \brief CloudSyncController::sendUIResponse * \details the function to be called after reading the CloudSync out file to interpret the content of the file. * \param vContent - the content to be interpreted. * \return true if the content has a meaning for the interpreter, false otherwise. */ -bool CloudSyncController::interpreter(const QString &vContent) +bool CloudSyncController::sendUIResponse(const QString &vContent) { - LOG_DEBUG(QString("~~~CloudSync Message received [%1]").arg(vContent)); + // IMPORTANT: + // please note the following in development testing it has been found out that. + // Do not use gedit. + // if the out.buf is edited by the "gedit" application the watch will be broken. + // The "nano" application works fine. + // A simple python3 code to open file and write to file works as well and that's sufficient for UI<=>CS communication. // TODO: messages have to have a sequence. // if the seq is duplicate it will be ignored. // seq, id, payload - return true; + // qDebug() << vContent; + + bool ok = true; + Message message; + if ( ! interpret(vContent, message) ) return false; // The error handling internal to interpret method. + switch (message.id) { + case eMessageID_DeviceState : ok = sendUIHistory(message.id); break; // The device state is stored in history but the other might be different so the switch is used. + default : break; + } + return ok; } /*! @@ -195,12 +329,13 @@ void CloudSyncController::checkDate() { _datetime = QDateTime::currentDateTime(); + _secSinceEpoch = _datetime.toSecsSinceEpoch(); _timeFormatted = _datetime.toString(_timeFormat); QString dateFormatted = _datetime.toString(_dateFormat); if (_dateFormatted != dateFormatted) { _dateFormatted = dateFormatted; - // TODO: do we need to remove current watch? - addCSBuffWatch(); + // TODO: do we need to remove previous watch? + addCSBuffWatch(); // bool out is not used here and error handling is internal to the addCSBuffWatch } } @@ -213,24 +348,51 @@ */ bool CloudSyncController::sendUIBuff(const QString &vData) { + bool ok = true; + QVariantList args ; + Errors_Enum error = eError_OK; + QString inpBuff; _date_inp_File = _location + // The location _dateFormatted + _dateSeparator + _inp_File; // The file name - inpBuff = _timeFormatted; + inpBuff = QString::number(_secSinceEpoch); inpBuff += _separator + QString::number(_seq++); inpBuff += _separator + vData; inpBuff += '\n'; // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // writing the message into the buffer. - if ( ! Storage::FileHandler::write(_date_inp_File, inpBuff) ) { - LOG_DEBUG(tr("Error writing to the CloudSync Input file.")); - return false; - } - return true; + if ( ! Storage::FileHandler::write(_date_inp_File, inpBuff) ) { error = eError_LogFileInp; args = { _date_inp_File }; ok = false; goto lErr; } + return ok; + +lErr: + toLog(error, args); + return ok; } /*! + * \brief CloudSyncController::sendUIHistory + * \details sends a response to the cloud sync upon request from the stored history. + * \param vAction - the request id, which in current design is same as the Message comes to the UI. + * \return true if a message history is available, false otherwise. + */ +bool CloudSyncController::sendUIHistory(qint32 vAction) +{ + bool ok = true; + QVariantList args ; + Errors_Enum error = eError_OK; + if ( ! _lastReceivedData.contains( vAction ) ) { error = eError_NoHistory; args = { vAction }; ok = false; goto lErr; } + + sendUIBuff(QString("%1,%2").arg(vAction).arg(_lastReceivedData[ vAction ].join(_separator))); + + return ok; + +lErr: + toLog(error, args); + return ok; +} + +/*! * \brief CloudSyncController::onActionReceive * \details The slot which will be called when a CANBus message is received, and will be sent to CloudSync if related. * \param vAction - The message action @@ -239,6 +401,12 @@ void CloudSyncController::onActionReceive(GuiActionType vAction, const QVariantList &vData) { QString inpBuff; + + // convert the data to the string list store/fetching it out from history. + // the original vData will be used if their actual values needed. + QStringList data; + for (auto datum : vData) { data += datum.toString(); } + switch (vAction) { case GuiActionType::ID_HDOperationModeData: case GuiActionType::ID_PreTreatmentStates : @@ -248,7 +416,12 @@ // TODO: This section is the translation/mapping section // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv // preparing the message - inpBuff = Format::toHexString/*QString::number*//*enumString*/(vAction); + + // store the last message data + _lastReceivedData[eMessageID_DeviceState] = data; + + // prepare the buffer + inpBuff = QString::number(eMessageID_DeviceState); for (auto var : vData) { inpBuff += _separator + var.toString(); } if ( ! sendUIBuff(inpBuff) ) break; Index: sources/cloudsync/CloudSyncController.h =================================================================== diff -u -re2dc7bd9995a3bb410aa472a1f95c1cc9ba3136d -r80250cfdbe58a3df17950d342212f155d52d3971 --- sources/cloudsync/CloudSyncController.h (.../CloudSyncController.h) (revision e2dc7bd9995a3bb410aa472a1f95c1cc9ba3136d) +++ sources/cloudsync/CloudSyncController.h (.../CloudSyncController.h) (revision 80250cfdbe58a3df17950d342212f155d52d3971) @@ -55,6 +55,7 @@ QString _date_out_File = ""; // The dated/actual filename : CloudSync puts its output to this file QString _date_inp_File = ""; // The dated/actual filename : UI Software puts the input data for the CloudSync in this file QDateTime _datetime ; + qint64 _secSinceEpoch ; QString _dateFormatted ; QString _timeFormatted ; @@ -65,8 +66,60 @@ const char _dateSeparator = '_'; // used in filename const char _separator = ','; - quint64 _seq = 0; + quint64 _seq = 0; + enum Errors_Enum { + eError_OK , + eError_Count , + eError_Timestamp , + eError_Sequence , + eError_MessageID , + eError_ParamCount , + eError_CRC , + eError_Parameter , + + eError_NoHistory , + + eError_LogFolder , + eError_LogFileInp , + }; + + typedef QHash MessageList; + MessageList _lastReceivedData ; // sent message history for later send upon request. + + enum Message_Enum { + eMessage_Timestamp , + eMessage_Sequence , + eMessage_MessageID , + eMessage_ParamCount , + eMessage_CRC , + eMessage_Count , + }; + + typedef QStringList Params; + struct Message { + qint64 timestamp = 0; + quint32 sequence = 0; + qint32 id = 0; + qint64 paramCount = 0; + quint8 crc = 0; + Params params { }; + }; + + enum MessageID_Enum { + eMessageID_DeviceInfo = 101, // CS asks for device info and UI sends back + eMessageID_WriteCredentials = 102, // CS asks to store credential and UI stores/confirms + eMessageID_ReadCredentials = 103, // CS asks for credentials and UI reads/sends + eMessageID_ResetFactory = 104, // CS asks for factory reset [no UI ack back yet] + + eMessageID_DeviceState = 201, // CS asks for device state and UI finds the history/sends + eMessageID_PatientID = 202, // [No CS req defined] UI sends the patient ID + eMessageID_TxReport = 203, // [No CS req defined] UI sends the Tx report + eMessageID_DeviceReport = 204, // [No CS req defined] UI sends the device report + + eMessageID_HeartBeat = 900, // CS sends the periodic Hb and UI can set the interval + }; + protected: void timerEvent(QTimerEvent *event) override; @@ -86,8 +139,14 @@ void initThread(QThread &vThread); void quitThread(); - void checkDate(); - void addCSBuffWatch(); - bool interpreter(const QString &vContent); // this function may later need to be a class. - bool sendUIBuff (const QString &vData); + void checkDate (); + bool addCSBuffWatch(); + bool sendUIResponse (const QString &vContent); + bool sendUIBuff (const QString &vData); + bool sendUIHistory (qint32 vAction); + bool interpret(const QString &vContent, Message &vMessage); + + QString toText (Errors_Enum vErrorID); + QString toInfo (Errors_Enum vErrorID, const QVariantList &vInfoItems); + void toLog (Errors_Enum vErrorID, const QVariantList &vInfoItems); }; Index: sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.h =================================================================== diff -u -r7b34653589ba6e4f4705fb4026fcd9319c41c352 -r80250cfdbe58a3df17950d342212f155d52d3971 --- sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.h (.../MPostTreatmentAdjustTreatmentLogResponse.h) (revision 7b34653589ba6e4f4705fb4026fcd9319c41c352) +++ sources/model/hd/adjustment/posttreatment/MPostTreatmentAdjustTreatmentLogResponse.h (.../MPostTreatmentAdjustTreatmentLogResponse.h) (revision 80250cfdbe58a3df17950d342212f155d52d3971) @@ -36,40 +36,42 @@ * * | Payload || * | || - * | 01 - (U32) | \ref Data::mAccepted | The accept or reject bool | | - * | 02 - (U32) | \ref Data::mReason | The rejection reason | | - * | 03 - (U32) | \ref Data::mBloodFlowRate | Blood Flow Rate | (mL/min) | - * | 04 - (U32) | \ref Data::mDialysateFlowRate | Dialysate Flow Rate | (mL/min) | - * | 05 - (U32) | \ref Data::mTreatmentDuration | Treatment Duration | (sec) | - * | 06 - (U32) | \ref Data::mActualTreatmentDuration | Actual Treatment Duration | (sec) | - * | 07 - (U32) | \ref Data::mAcidConcentrateType | Acid Concentrate Type | | - * | 08 - (U32) | \ref Data::mBicarbonateConcentrateType | Bicarbonate Concentrate Type | | - * | 09 - (U32) | \ref Data::mPotassiumConcentration | Potassium Concentration | (mEq/L) | - * | 10 - (U32) | \ref Data::mCalciumConcentration | Calcium Concentration | (mEq/L) | - * | 11 - (U32) | \ref Data::mBicarbonateConcentration | Bicarbonate Concentration | (mEq/L) | - * | 12 - (U32) | \ref Data::mSodiumConcentration | SodiumConcentration | (mEq/L) | - * | 13 - (F32) | \ref Data::mDialysateTemperature | Dialysate Temperature | (Celsius) | - * | 14 - (U32) | \ref Data::mDialyzerType | Dialyzer Type | | - * | 15 - (U32) | \ref Data::mTreatmentStartEpoch | Treatment Start Date and Time | (epoch) | - * | 16 - (U32) | \ref Data::mTreatmentEndEpoch | Treatment End Date and Time | (epoch) | - * | 17 - (F32) | \ref Data::mAverageBloodFlow | Average Blood Flow | (mL/min) | - * | 18 - (F32) | \ref Data::mAverageDialysateFlow | Average Dialysate Flow | (mL/min) | - * | 19 - (F32) | \ref Data::mDialysateVolumeUsed | Dialysate Volume Used | (L) | - * | 20 - (F32) | \ref Data::mAverageDialysateTemp | Average Dialysate Temp | (Celsius) | - * | 21 - (F32) | \ref Data::mTargetUFVolume | Target UF Volume | (L) | - * | 22 - (F32) | \ref Data::mActualUFVolume | Actual UF Volume | (L) | - * | 23 - (F32) | \ref Data::mTargetUFRate | Target UF Rate | (mL/min) | - * | 24 - (F32) | \ref Data::mActualUFRate | Actual UF Rate | (mL/min) | - * | 25 - (U32) | \ref Data::mSalineBolusVolume | Saline Bolus Volume | (mL) | - * | 26 - (F32) | \ref Data::mHeparinBolusVolume | Heparin Bolus Volume | (mL) | - * | 27 - (F32) | \ref Data::mHeparinDispenseRate | Heparin Dispense Rate | (mL/hr) | - * | 28 - (U32) | \ref Data::mHeparinStop | Heparin Pre-Stop | (min) | - * | 29 - (F32) | \ref Data::mHeparinDeliveredVolume | Heparin Delivered Volume | (mL) | - * | 30 - (F32) | \ref Data::mAverageArterialPressure | Average Arterial Pressure | (mmHg) | - * | 31 - (F32) | \ref Data::mAverageVenousPressure | Average Venous Pressure | (mmHg) | - * | 32 - (U32) | \ref Data::mDeviceID | Device ID | | - * | 33 - (U32) | \ref Data::mWaterSampleTestResult | Water Sample Test Result | | - * + * | 01 - (U32) | \ref Data::mAccepted | The accept or reject bool flag | | + * | 02 - (U32) | \ref Data::mReason | The rejection reason | | + * | 03 - (U32) | \ref Data::mBloodFlowRate | Blood Flow Rate | (mL/min) | + * | 04 - (U32) | \ref Data::mDialysateFlowRate | Dialysate Flow Rate | (mL/min) | + * | 05 - (U32) | \ref Data::mTreatmentDuration | Treatment Duration | (sec) | + * | 06 - (U32) | \ref Data::mActualTreatmentDuration | Actual Treatment Duration | (sec) | + * | 07 - (U32) | \ref Data::mAcidConcentrateType | Acid Concentrate Type | | + * | 08 - (U32) | \ref Data::mBicarbonateConcentrateType | Bicarbonate Concentrate Type | | + * | 09 - (U32) | \ref Data::mPotassiumConcentration | Potassium Concentration | (mEq/L) | + * | 10 - (U32) | \ref Data::mCalciumConcentration | Calcium Concentration | (mEq/L) | + * | 11 - (U32) | \ref Data::mBicarbonateConcentration | Bicarbonate Concentration | (mEq/L) | + * | 12 - (U32) | \ref Data::mSodiumConcentration | SodiumConcentration | (mEq/L) | + * | 13 - (F32) | \ref Data::mDialysateTemperature | Dialysate Temperature | (Celsius | + * | 14 - (U32) | \ref Data::mDialyzerType | Dialyzer Type | | + * | 15 - (U32) | \ref Data::mTreatmentStartEpoch | Treatment Start Date and Time | (epoch) | + * | 16 - (U32) | \ref Data::mTreatmentEndEpoch | Treatment End Date and Time | (epoch) | + * | 17 - (F32) | \ref Data::mAverageBloodFlow | Average Blood Flow | (mL/min) | + * | 18 - (F32) | \ref Data::mAverageDialysateFlow | Average Dialysate Flow | (mL/min) | + * | 19 - (F32) | \ref Data::mDialysateVolumeUsed | Dialysate Volume Used | (L) | + * | 20 - (F32) | \ref Data::mAverageDialysateTemp | Average Dialysate Temp | (Celsius | + * | 21 - (F32) | \ref Data::mOriginUFVolume | Origin UF Volume | (L) | + * | 22 - (F32) | \ref Data::mTargetUFVolume | Target UF Volume | (L) | + * | 23 - (F32) | \ref Data::mActualUFVolume | Actual UF Volume | (L) | + * | 24 - (F32) | \ref Data::mOriginUFRate | Origin UF Rate | (mL/min) | + * | 25 - (F32) | \ref Data::mTargetUFRate | Target UF Rate | (mL/min) | + * | 26 - (F32) | \ref Data::mActualUFRate | Actual UF Rate | (mL/min) | + * | 27 - (U32) | \ref Data::mSalineBolusVolume | Saline Bolus Volume | (mL) | + * | 28 - (F32) | \ref Data::mHeparinBolusVolume | Heparin Bolus Volume | (mL) | + * | 29 - (F32) | \ref Data::mHeparinDispenseRate | Heparin Dispense Rate | (mL/hr) | + * | 30 - (U32) | \ref Data::mHeparinStop | Heparin Stop | (min) | + * | 31 - (F32) | \ref Data::mHeparinDeliveredVolume | Heparin Delivered Volume | (mL) | + * | 32 - (U32) | \ref Data::mHeparinType | Heparin Type | | + * | 33 - (F32) | \ref Data::mAverageArterialPressure | Average Arterial Pressure | (mmHg) | + * | 34 - (F32) | \ref Data::mAverageVenousPressure | Average Venous Pressure | (mmHg) | + * | 35 - (U32) | \ref Data::mDeviceID | Device ID | | + * | 36 - (U32) | \ref Data::mWaterSampleTestResult | Water Sample Test Result | | * \sa Data * \sa MAdjustTreatmentLogReq : TreatmentLog Request * \sa MTreatmentTreatmentLog : TreatmentLog Data @@ -108,7 +110,7 @@ Types::U32 mTreatmentEndEpoch ; ///< 16 - (U32) Treatment End Date and Time (epoch) Types::F32 mAverageBloodFlow ; ///< 17 - (F32) Average Blood Flow (mL/min) Types::F32 mAverageDialysateFlow ; ///< 18 - (F32) Average Dialysate Flow (mL/min) - Types::F32 mDialysateVolumeUsed ; ///< 19 - (F32) Dialysate Volume Used (L) + Types::F32 mDialysateVolumeUsed ; ///< 19 - (F32) Dialysate Volume Used (L) Types::F32 mAverageDialysateTemp ; ///< 20 - (F32) Average Dialysate Temp (Celsius) Types::F32 mOriginUFVolume ; ///< 21 - (F32) Origin UF Volume (L) Types::F32 mTargetUFVolume ; ///< 22 - (F32) Target UF Volume (L) Index: sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustParametersValidationResponse.cpp =================================================================== diff -u -r88563177f10f20ced98750b2e40036201728131d -r80250cfdbe58a3df17950d342212f155d52d3971 --- sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustParametersValidationResponse.cpp (.../MPreTreatmentAdjustParametersValidationResponse.cpp) (revision 88563177f10f20ced98750b2e40036201728131d) +++ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustParametersValidationResponse.cpp (.../MPreTreatmentAdjustParametersValidationResponse.cpp) (revision 80250cfdbe58a3df17950d342212f155d52d3971) @@ -27,6 +27,7 @@ _data.acidConcentrate .value, _data.bicarbonateConcentrate .value, _data.dialyzerType .value, + _data.heparinType .value, _data.bloodPressureMeasureInterval .value, _data.rinsebackFlowRate .value, _data.arterialPressureLimitLow .value, @@ -50,6 +51,7 @@ if (GetValue(vByteArray, index, _data.acidConcentrate )) if (GetValue(vByteArray, index, _data.bicarbonateConcentrate )) if (GetValue(vByteArray, index, _data.dialyzerType )) + if (GetValue(vByteArray, index, _data.heparinType )) if (GetValue(vByteArray, index, _data.bloodPressureMeasureInterval )) if (GetValue(vByteArray, index, _data.rinsebackFlowRate )) if (GetValue(vByteArray, index, _data.arterialPressureLimitLow )) @@ -78,6 +80,7 @@ else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } else { if(vIndex) *vIndex = index; return false; } + else { if(vIndex) *vIndex = index; return false; } } MAdjustParametersValidationResponse::Data MAdjustParametersValidationResponse::data() const { @@ -91,6 +94,7 @@ data.acidConcentrate = _data.acidConcentrate .value; data.bicarbonateConcentrate = _data.bicarbonateConcentrate .value; data.dialyzerType = _data.dialyzerType .value; + data.heparinType = _data.heparinType .value; data.bloodPressureMeasureInterval = _data.bloodPressureMeasureInterval .value; data.rinsebackFlowRate = _data.rinsebackFlowRate .value; data.arterialPressureLimitLow = _data.arterialPressureLimitLow .value; Index: sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustParametersValidationResponse.h =================================================================== diff -u -r7914ad8a4b8450d855fcc75855ca57b6644e9f7c -r80250cfdbe58a3df17950d342212f155d52d3971 --- sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustParametersValidationResponse.h (.../MPreTreatmentAdjustParametersValidationResponse.h) (revision 7914ad8a4b8450d855fcc75855ca57b6644e9f7c) +++ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustParametersValidationResponse.h (.../MPreTreatmentAdjustParametersValidationResponse.h) (revision 80250cfdbe58a3df17950d342212f155d52d3971) @@ -41,10 +41,10 @@ * | #04:(U32) | \ref Data::duration | * | #05:(U32) | \ref Data::heparinStopTime | * | #06:(U32) | \ref Data::salineBolus | - * | #07:(U32) | \ref Data::heparinType | - * | #08:(U32) | \ref Data::acidConcentrate | - * | #09:(U32) | \ref Data::bicarbonateConcentrate | - * | #10:(U32) | \ref Data::dialyzerType | + * | #07:(U32) | \ref Data::acidConcentrate | + * | #08:(U32) | \ref Data::bicarbonateConcentrate | + * | #09:(U32) | \ref Data::dialyzerType | + * | #10:(U32) | \ref Data::heparinType | * | #11:(U32) | \ref Data::bloodPressureMeasureInterval | * | #12:(U32) | \ref Data::rinsebackFlowRate | * | #13:(U32) | \ref Data::arterialPressureLimitLow | @@ -78,10 +78,10 @@ Types::U32 duration ; ///< User set treatment duration (in min) Types::U32 heparinStopTime ; ///< User set heparin pre-stop time (in min) Types::U32 salineBolus ; ///< User set saline bolus volume (in mL) - Types::U32 heparinType ; ///< User set heparin type option Types::U32 acidConcentrate ; ///< User set acid concentrate option Types::U32 bicarbonateConcentrate ; ///< User set bicarbonate concentrate option Types::U32 dialyzerType ; ///< User set dialyzer type option + Types::U32 heparinType ; ///< User set heparin type option Types::U32 bloodPressureMeasureInterval ; ///< User set blood pressure measurement interval (in min) Types::U32 rinsebackFlowRate ; ///< User set rinseback flow rate (in mL/min) Types::U32 arterialPressureLimitLow ; ///< User set lower alarm limit for arterial pressure (in mmHg) @@ -106,10 +106,10 @@ quint32 duration = 0; quint32 heparinStopTime = 0; quint32 salineBolus = 0; - quint32 heparinType = 0; quint32 acidConcentrate = 0; quint32 bicarbonateConcentrate = 0; quint32 dialyzerType = 0; + quint32 heparinType = 0; quint32 bloodPressureMeasureInterval = 0; quint32 rinsebackFlowRate = 0; quint32 arterialPressureLimitLow = 0; Index: sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h =================================================================== diff -u -r7914ad8a4b8450d855fcc75855ca57b6644e9f7c -r80250cfdbe58a3df17950d342212f155d52d3971 --- sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h (.../MPreTreatmentAdjustRequests.h) (revision 7914ad8a4b8450d855fcc75855ca57b6644e9f7c) +++ sources/model/hd/adjustment/pretreatment/MPreTreatmentAdjustRequests.h (.../MPreTreatmentAdjustRequests.h) (revision 80250cfdbe58a3df17950d342212f155d52d3971) @@ -80,10 +80,10 @@ * | #03:(U32) | \ref duration | * | #04:(U32) | \ref heparinStopTime | * | #05:(U32) | \ref salineBolus | - * | #06:(U32) | \ref heparinType | - * | #07:(U32) | \ref acidConcentrate | - * | #08:(U32) | \ref bicarbonateConcentrate | - * | #09:(U32) | \ref dialyzerType | + * | #06:(U32) | \ref acidConcentrate | + * | #07:(U32) | \ref bicarbonateConcentrate | + * | #08:(U32) | \ref dialyzerType | + * | #09:(U32) | \ref heparinType | * | #10:(U32) | \ref bloodPressureMeasureInterval | * | #11:(U32) | \ref rinsebackFlowRate | * | #12:(S32) | \ref arterialPressureLimitLow | @@ -103,10 +103,10 @@ quint32 duration = 0; // minutes quint32 heparinStopTime = 0; // min quint32 salineBolus = 0; // mL - quint32 heparinType = 0; // quint32 acidConcentrate = 0; // quint32 bicarbonateConcentrate = 0; // quint32 dialyzerType = 0; // + quint32 heparinType = 0; // quint32 bloodPressureMeasureInterval = 0; // minutes quint32 rinsebackFlowRate = 0; // mL/min qint32 arterialPressureLimitLow = 0; // mmHg @@ -126,10 +126,10 @@ duration , heparinStopTime , salineBolus , - heparinType , acidConcentrate , bicarbonateConcentrate , dialyzerType , + heparinType , bloodPressureMeasureInterval , rinsebackFlowRate , arterialPressureLimitLow , Index: sources/view/VTreatmentCreate.h =================================================================== diff -u -r7914ad8a4b8450d855fcc75855ca57b6644e9f7c -r80250cfdbe58a3df17950d342212f155d52d3971 --- sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision 7914ad8a4b8450d855fcc75855ca57b6644e9f7c) +++ sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision 80250cfdbe58a3df17950d342212f155d52d3971) @@ -201,10 +201,10 @@ protected: PROPERTY(QString , patientID , "") + PROPERTY(QStringList, heparinTypeOptions , {}) PROPERTY(QStringList, acidConcentrateOptions , {}) PROPERTY(QStringList, bicarbonateConcentrateOptions , {}) PROPERTY(QStringList, dialyzerTypeOptions , {}) - PROPERTY(QStringList, heparinTypeOptions , {}) PROPERTY(bool , continueEnabled , false) AdjustParametersValidationRequestData treatmentData; // OK