Index: leahi.qrc =================================================================== diff -u -r9ea642334e5b86e8c32d71de0d4b6894ecf407e0 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- leahi.qrc (.../leahi.qrc) (revision 9ea642334e5b86e8c32d71de0d4b6894ecf407e0) +++ leahi.qrc (.../leahi.qrc) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -106,6 +106,10 @@ resources/images/Vitals_Red.png resources/images/check_green.png resources/images/eye_closed.png + resources/images/empty-heart-favorite.png + resources/images/full-heart-favorite.png + resources/images/ascending-sort-arrow.png + resources/images/descending-sort-arrow.png sources/gui/qml/components/MainMenu.qml Index: sources/gui/qml/components/BaseComboBox.qml =================================================================== diff -u -rb12853c86ef9e517667516dc3e47bca07349cedf -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/components/BaseComboBox.qml (.../BaseComboBox.qml) (revision b12853c86ef9e517667516dc3e47bca07349cedf) +++ sources/gui/qml/components/BaseComboBox.qml (.../BaseComboBox.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -21,15 +21,16 @@ import "qrc:/globals" ComboBox { id: _root - property bool isActive : true // default leave as regular ComboBox behavior - property alias iconSource : _icon.source - property alias iconAnchors : _icon.anchors - property alias backgroundColor : _background.color - property alias dropDownWidth : _popup.width - property int delegateWidth : dropDownWidth - property int delegateHeight : height - property bool canOff : false - property bool centerHorizontally: false + property bool isActive : true // default leave as regular ComboBox behavior + property alias iconSource : _icon.source + property alias iconAnchors : _icon.anchors + property alias backgroundColor : _background.color + property alias dropDownWidth : _popup.width + property int popupX : 0 + property int delegateWidth : dropDownWidth + property int delegateHeight : height + property bool canOff : false + property bool centerHorizontally : false width : 300 @@ -84,7 +85,7 @@ popup: Popup { id: _popup y : _root.height + 10 - x : 0 + x : _root.popupX width : _root.width implicitHeight : contentItem.implicitHeight Index: sources/gui/qml/components/TextEntry.qml =================================================================== diff -u -r86df7ff03ea32f9cd8a18bbbc7b2e01de64c783f -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision 86df7ff03ea32f9cd8a18bbbc7b2e01de64c783f) +++ sources/gui/qml/components/TextEntry.qml (.../TextEntry.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -32,6 +32,7 @@ property alias label : _label property alias separator : _separator property alias validator : _input.validator + property alias inputColor : _input.color property var nextInput : undefined property alias text : _input.text property bool hasCursor : true Index: sources/gui/qml/dialogs/RxManagerDialog.qml =================================================================== diff -u -r47e53a72dae5a817465b3ef0be9f98a9dd16f60a -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/dialogs/RxManagerDialog.qml (.../RxManagerDialog.qml) (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) +++ sources/gui/qml/dialogs/RxManagerDialog.qml (.../RxManagerDialog.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -27,36 +27,28 @@ * \brief Contains the Rx Dialog Implementation */ ModalDialog { id : _root - contentItem.objectName: "_RxManagerDialog" // SquishQt + contentItem.objectName : "_RxManagerDialog" // SquishQt onVisibleChanged: { if (visible) { vRxProfiles.doInitRxProfilesList() } } - - Rectangle {id: _rect - color: "red" - anchors { - fill: parent - } - RxManager { id: _managerDialog - anchors { - fill: parent - } - height : parent.height - width : parent.width - } + RxManager { id: _managerDialog + onShow :false + anchors.fill: parent + onLoadProfile: { + _root.close()} } CloseButton { id : _closeButton - anchors { - right : parent.right - left : undefined - margins : 0 - } + anchors { + right : parent.right + left : undefined + margins : Variables.defaultMargin + } - onClicked : _root.close() + onClicked : _root.close() } } Index: sources/gui/qml/pages/ManagerStack.qml =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/pages/ManagerStack.qml (.../ManagerStack.qml) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/gui/qml/pages/ManagerStack.qml (.../ManagerStack.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -35,14 +35,21 @@ StackItem { id : _root stackView.initialItem : _managerHome RxManager { id: _managerHome + onShow :true onAddProfile:{ + if ( vTreatmentCreate.parametersValidated ) { vTreatmentCreate.doCancel() } _createProfile.clear(true) page( _createProfile) } + onLoadProfile:{ + if ( vTreatmentCreate.parametersValidated ) { vTreatmentCreate.doCancel() } + _createProfile.activateAndRefresh() + _createProfile.patientIdText = vTreatmentCreate.patientID + page( _createProfile) + } onVisibleChanged: { if (visible){ _mainMenu.hidden = false - vRxProfiles.doInitRxProfilesList() } } } Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml =================================================================== diff -u -r582bf281f35b9d85aea94e351b9ab15f15258b06 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision 582bf281f35b9d85aea94e351b9ab15f15258b06) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreate.qml (.../PreTreatmentCreate.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -40,7 +40,8 @@ _preTreatmentCreateContent.validate() onBackClicked : vPreTreatmentAdjustmentInitTreatment.doCancel() - property alias isRxProfile : _preTreatmentCreateContent.isRxProfile + property alias isRxProfile : _preTreatmentCreateContent.isRxProfile + property alias patientIdText: _preTreatmentCreateContent.patientIdText function clear( vValue ) { if ( ! vValue ) return; _preTreatmentCreateContent.clear() } function confirm(){ @@ -49,6 +50,9 @@ function validate(){ _preTreatmentCreateContent.validate() } + function activateAndRefresh(){ + _preTreatmentCreateContent.activateAndRefresh() + } PreTreatmentCreateContent { id: _preTreatmentCreateContent anchors { @@ -59,6 +63,7 @@ rightMargin : anchors.leftMargin bottom : parent.bottom bottomMargin: Variables.notificationHeight + Variables.defaultMargin + } } } Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml =================================================================== diff -u -r582bf281f35b9d85aea94e351b9ab15f15258b06 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 582bf281f35b9d85aea94e351b9ab15f15258b06) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -31,6 +31,7 @@ readonly property int columnSpacing : 15 readonly property bool isValidated : vTreatmentCreate.parametersValidated readonly property bool heparinFeatured: true // TODO: vSettings.heparinSyringePump + property alias patientIdText: _pretreatmentPatientIDEntry.text readonly property string editRx : qsTr( "Edit Rx" ) readonly property string selectRx : qsTr( "Select Rx" ) @@ -72,6 +73,7 @@ function clear () { vTreatmentCreate.patientID = "" + _pretreatmentPatientIDEntry.text = "" _bloodFlowRateControl .clear() _dialysateFlowRateControl .clear() _durationControl .clear() @@ -238,6 +240,7 @@ textInput.echoMode : TextInput.Normal line.visible : false enabled : _root.editingEnabled + inputColor : Colors.textMain onEditingFinished : vTreatmentCreate.patientID = text textInput.validator : RegExpValidator { regExp: _root.isRxProfile Index: sources/gui/qml/pages/rxmanager/RxManager.qml =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/pages/rxmanager/RxManager.qml (.../RxManager.qml) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/gui/qml/pages/rxmanager/RxManager.qml (.../RxManager.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -13,6 +13,7 @@ Item { id: _root signal addProfile() + signal loadProfile() property bool onShow: true property bool showCreateRx: false @@ -30,7 +31,7 @@ onShow: _root.onShow visible: ! showCreateRx onAddClicked:{ - addProfile() + _root.addProfile() } } RxManagerList{ @@ -42,8 +43,12 @@ top : _rxHeader.bottom leftMargin : Variables.defaultMargin * 3 rightMargin : Variables.defaultMargin * 3 - bottomMargin: Variables.notificationHeight + Variables.alarmDialogHeaderHeight + bottomMargin: _root.onShow ? Variables.notificationHeight + Variables.alarmDialogHeaderHeight : Variables.notificationHeight } - model: vRxProfiles.rxProfiles + model: vRxProfiles.rxProfiles + onShow: _root.onShow + onLoadRxProfile:{ + _root.loadProfile() + } } } Index: sources/gui/qml/pages/rxmanager/RxManagerHeader.qml =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/pages/rxmanager/RxManagerHeader.qml (.../RxManagerHeader.qml) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/gui/qml/pages/rxmanager/RxManagerHeader.qml (.../RxManagerHeader.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -69,12 +69,13 @@ color : Colors.highlightMedProgressBar height: 70 width : 70 + borderColor: Colors.transparent property bool isAscending: true // Add a property connected to this button that will; affect the model that has the list View of Rx profiles Image { id : _orderImage - source : _orderButton.isAscending ? "qrc:/images/iArrowLeft" : "qrc:/images/iArrowRight" //"qrc:/images/iAscendingOrderArrow" : "qrc:/images/iDescendingOrderArrow" - width : 50 - height : 50 + source : _orderButton.isAscending ? "qrc:/images/iAscendingSortArrow" : "qrc:/images/iDescendingSortArrow" + width : 35 + height : 35 fillMode : Image.PreserveAspectFit anchors.centerIn: parent } @@ -94,12 +95,17 @@ text.text : qsTr("Import") height: 70 width: 244 + visible: _root.rxProfileCount === 10 && _root.onShow ? false : true + onClicked :{ + print("TODO: import rx profile") + } } TouchRect {id: _rxAddButton text.text : qsTr("Add Prescription") height: 70 width: 244 + visible: _root.rxProfileCount === 10 && _root.onShow ? false : true onClicked :{ addClicked() } Index: sources/gui/qml/pages/rxmanager/RxManagerList.qml =================================================================== diff -u -r47e53a72dae5a817465b3ef0be9f98a9dd16f60a -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/pages/rxmanager/RxManagerList.qml (.../RxManagerList.qml) (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) +++ sources/gui/qml/pages/rxmanager/RxManagerList.qml (.../RxManagerList.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -22,14 +22,24 @@ Item{ id: _root + signal loadRxProfile() property alias model: _listView.model + property bool onShow: true height: parent.height - (Variables.mainMenuHeight + Variables.alarmDialogHeaderHeight) ListView{ anchors.fill: _root clip: true spacing: Variables.defaultMargin id: _listView - delegate: RxProfileContainer { id: _rxProfileContainer } + delegate: Component { + RxProfileContainer { id: _rxProfileContainer + onShow: _root.onShow + onLoadRxProfile: { + _root.loadRxProfile() + } + } + } + } } Index: sources/gui/qml/pages/rxmanager/RxProfileComponent.qml =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/pages/rxmanager/RxProfileComponent.qml (.../RxProfileComponent.qml) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/gui/qml/pages/rxmanager/RxProfileComponent.qml (.../RxProfileComponent.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -23,9 +23,6 @@ property bool buttonsEnabled : true property bool dropShadowEnabled : true - signal increment() - signal decrement() - Text { id: _title objectName: "title" Index: sources/gui/qml/pages/rxmanager/RxProfileContainer.qml =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/gui/qml/pages/rxmanager/RxProfileContainer.qml (.../RxProfileContainer.qml) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/gui/qml/pages/rxmanager/RxProfileContainer.qml (.../RxProfileContainer.qml) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -22,76 +22,153 @@ import "qrc:/components" import "qrc:/pages/rxmanager" -Component { - id: _root Rectangle { - id: _rxItem + id: _root + property bool onShow: true + signal loadRxProfile() + width: ListView.view.width height: 345 color: Colors.mainTreatmentLighterBlue radius: 10 - Column { - id: _componentColumn - spacing: 5 + Item{ + id: _containerHeader anchors { + top : parent.top left : parent.left right : parent.right - leftMargin: Variables.defaultMargin * 2 - rightMargin: Variables.defaultMargin * 2 - topMargin : Variables.defaultMargin * 2 + topMargin : Variables.defaultMargin + rightMargin : Variables.defaultMargin + leftMargin : Variables.defaultMargin * 2 } + height: 50 Text { id: _profileName - text: profileName + anchors.left : _containerHeader.left + text : profileName font.pointSize : Fonts.fontPixelButton * 1.4 - width: parent.width - horizontalAlignment: Text.AlignLeft - color : Colors.pressuresText + horizontalAlignment : Text.AlignHCenter + color : Colors.pressuresText } + Row{ + id: _rxContainerRow + anchors.right : parent.right + spacing : 20 + property int rxProfileCount : vRxProfiles.rxProfiles.rowCount() + readonly property string editRx : qsTr( "Edit" ) + readonly property string duplicateRx : qsTr( "Duplicate" ) + readonly property string exportRx : qsTr( "Export" ) + readonly property string deleteRx : qsTr( "Delete" ) + + TouchRect { id : _rxSelectButton + text.text : qsTr("Select") + height : Variables.defaultButtonHeight + width : Variables.defaultButtonWidth + visible : ! _root.onShow + + onClicked :{ + vTreatmentCreate.doLoadRxProfile(vRxProfiles.rxProfiles.get(index), false) + _root.loadRxProfile() + } + } + + IconButton { id: _favoriteButton + property bool isFavorite: false // Add a property connected to this button that will; affect the model that has the list View of Rx profiles + iconSize : Variables.iconButtonSize + iconImageSource :_favoriteButton.isFavorite ? "qrc:/images/iFullHeartFavorite" : "qrc:/images/iEmptyHeartFavorite" + + onClicked:{ + isFavorite = !isFavorite + // Add signal to change model backend to be favorite or not, eventually connet property to model + } + } + BaseComboBox { id: _rxProfileMenu + model : _rxContainerRow.rxProfileCount === 10 + ? [ _rxContainerRow.editRx, _rxContainerRow.exportRx, _rxContainerRow.deleteRx ] + : [ _rxContainerRow.editRx, _rxContainerRow.duplicateRx, _rxContainerRow.exportRx, _rxContainerRow.deleteRx ] + height : 50 + width : 50 + dropDownWidth : 250 + delegateHeight : 65 + popupX : -250 + displayText : "" + iconSource : "qrc:/images/iMenuDot" + backgroundColor : Colors.transparent + visible : _root.onShow + + onActivated: { + const selectedItem = model[currentIndex] + + // only send AdjustParametersConfirmRequestData::eCancel when validated + // Telling FW user is canceling confirm treatment parameters + if ( vTreatmentCreate.parametersValidated ) { vTreatmentCreate.doCancel() } + + if ( selectedItem === _rxContainerRow.editRx ) { print("TODO: Open and edit current model") + vTreatmentCreate.doLoadRxProfile(vRxProfiles.rxProfiles.get(index), true) + _root.loadRxProfile()} + else if ( selectedItem === _rxContainerRow.duplicateRx ) { print("TODO: Open and edit copy of model") + vTreatmentCreate.doLoadRxProfile(vRxProfiles.rxProfiles.get(index), false) + _root.loadRxProfile()} + else if ( selectedItem === _rxContainerRow.exportRx ) { print("TODO: export copy of model") } + else if ( selectedItem === _rxContainerRow.deleteRx ) { vRxProfiles.doDeleteRxProfile(profileName) } + else { /*Unknown state */ } + + } + } + } + + } + Column { + id: _componentColumn + anchors { + top : _containerHeader.bottom + left : parent.left + right : parent.right + leftMargin : Variables.defaultMargin + rightMargin : Variables.defaultMargin * 2 + } + Row { id: _componentRow spacing: 5 width: parent.width - anchors { - left : _componentColumn.left - } property int componentWidth: parent.width / 8 - 5 RxProfileComponent{ id: _bloodflowComp title : "Blood Flow" - height : _rxItem.height - (100 + Variables.defaultMargin * 2) + height : _root.height - (100 + Variables.defaultMargin * 2) width : _componentRow.componentWidth value : bloodFlow unitText : Variables.unitTextFlowRate } RxProfileComponent{ id: _diaflowComp title : "Dialysate Flow" - height : _rxItem.height - (100 + Variables.defaultMargin * 2) + height : _root.height - (100 + Variables.defaultMargin * 2) width : _componentRow.componentWidth value : dialysateFlow unitText : Variables.unitTextFlowRate } RxProfileComponent{ id: _txDurComp title : "Duration" - height : _rxItem.height - (100 + Variables.defaultMargin * 2) + height : _root.height - (100 + Variables.defaultMargin * 2) width : _componentRow.componentWidth value : treatmentDuration unitText : Variables.unitTextDuration } RxProfileComponent{ id: _HeparinComp title : "Heparin" - height : _rxItem.height - (100 + Variables.defaultMargin * 2) + height : _root.height - (100 + Variables.defaultMargin * 2) width : _componentRow.componentWidth - value : (heparinVolume === "NONE") ? "- -" : heparinVolume + value : (heparinVolume === "NONE" || Number(heparinVolume).toFixed(3) === "0.000" ) ? Variables.emptyEntry : Number(heparinVolume).toFixed(3) unitText : Variables.unitTextFluid } RxProfileComponent{ id: _ACComp title : "Acid" - height : _rxItem.height - (100 + Variables.defaultMargin * 2) + height : _root.height - (100 + Variables.defaultMargin * 2) width : _componentRow.componentWidth value : acidConcentrate.replace(", ", "\n") topTextFont : Fonts.fontPixelRxProfileComponentSmall @@ -100,7 +177,7 @@ RxProfileComponent{ id: _BcComp title : "Bicarbonate" - height : _rxItem.height - (100 + Variables.defaultMargin * 2) + height : _root.height - (100 + Variables.defaultMargin * 2) width : _componentRow.componentWidth value : bicarbConcentrate.replace(" ", "\n") topTextFont : Fonts.fontPixelRxProfileComponentSmall @@ -109,7 +186,7 @@ RxProfileComponent{ id: _DialyzerComp title : "Dialyzer" - height : _rxItem.height - (100 + Variables.defaultMargin * 2) + height : _root.height - (100 + Variables.defaultMargin * 2) width : _componentRow.componentWidth value : dialyzerType.replace(/((?:[^ ]+ ){1}[^ ]+)\s/, "$1\n") topTextFont : Fonts.fontPixelRxProfileComponentSmall @@ -118,21 +195,26 @@ RxProfileComponent{ id: _TempComp title : "Dialysate Temp" - height : _rxItem.height - (100 + Variables.defaultMargin * 2) + height : _root.height - (100 + Variables.defaultMargin * 2) width : _componentRow.componentWidth value : dialysateTemperature unitText : Variables.unitTextTemperature } } - Text { -// anchors.topMargin: Variables.defaultMargin*2 - text : 'Last Modified: ' + lastModifiedDate - width : parent.width - horizontalAlignment : Text.AlignRight -// verticalAlignment : Text.AlignBottom - font.pointSize : Fonts.fontPixelButton - 4 - color : Colors.pressuresText + } + Text { + anchors { + bottom : parent.bottom + right : parent.right + rightMargin : Variables.defaultMargin * 2 + bottomMargin : Variables.defaultMargin } + text : 'Last Modified: ' + lastModifiedDate + width : parent.width + horizontalAlignment : Text.AlignRight + verticalAlignment : Text.AlignBottom + font.pointSize : Fonts.fontPixelButton - 4 + color : Colors.pressuresText } } -} + Index: sources/storage/RxProfilesController.cpp =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/storage/RxProfilesController.cpp (.../RxProfilesController.cpp) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/storage/RxProfilesController.cpp (.../RxProfilesController.cpp) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -71,6 +71,21 @@ emit didFilesList(rxProfilesPath(), { QString("*.%1").arg(_rxProfiles) }); } +void RxProfiles::doDeleteRxProfile(QString vRxProfileName) +{ + qDebug() < vRxProfileDataList; for (const QFileInfo fileInfo:vRxProfileList){ RxProfilesData rxData = initModel(fileInfo) ; - if (rxData.rxProfileContent.size() == Model::RxProfilesIndex::eRxProfilesIndexCount - 1) + if (rxData.rxProfileContent.size() == Model::RxProfilesIndex::eRxProfilesIndexCount ) { vRxProfileDataList.append(rxData); } else LOG_DEBUG(QString("Bad Prescription Log Given: %1, %2").arg(fileInfo.baseName(), QString::number( rxData.rxProfileContent.size() ))); } - //below is Test to write a file -// QStringList rxDataTest = vRxProfileDataList[0].rxProfileContent; -// rxDataTest.replace(Model::RxProfilesIndex::eProfileName, QString("Written New Rx")) ; -// // rxProfileContent -// doSave(rxDataTest); emit didRxProfileList(vRxProfileDataList); } -/*! - * \brief RxProfiles::filelimitReached - * The actual function that checks if RX file limit has been reached for Duplicate, Add, and import events - */ -bool RxProfiles::fileLimitReached() -{ QDir RxProfilesDir(_rxProfilesPath); - int fileCount = RxProfilesDir.count(); - if (fileCount != _RxLimit){ return false; } - LOG_DEBUG(QString("Rx Limit has been reached")); - return true; -} - Index: sources/storage/RxProfilesController.h =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/storage/RxProfilesController.h (.../RxProfilesController.h) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/storage/RxProfilesController.h (.../RxProfilesController.h) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -58,6 +58,7 @@ QString _datetimeFormat = _dateFormat + " " + _timeFormat; QHash vRxProfileHash ; + QString vPreviousRxProfileName = ""; enum Role { eTitle, @@ -83,9 +84,7 @@ bool importLog (); void importLogConcurrent(); - bool fileLimitReached (); - NOTIFIER(isIdle) SINGLETON(RxProfiles) @@ -100,6 +99,15 @@ void insertRxProfileItem(Model::RxProfilesIndex key, const QVariant &value){ vRxProfileHash.insert(key, value); } + void savePreviousRxProfileName(const QString &value){ + vPreviousRxProfileName = value; + } + void clearPreviousRxProfileName(){ + vPreviousRxProfileName = ""; + } + bool isEditMode(const QString &value){ + return vPreviousRxProfileName == value; + } QString rxProfilesPath () ; @@ -115,6 +123,7 @@ void doExport (); void doImport (); void doInitRxProfiles(); + void doDeleteRxProfile(const QString vRxProfileName); // void doValidateRxProfiles(); signals: Index: sources/view/VRxProfiles.cpp =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/view/VRxProfiles.cpp (.../VRxProfiles.cpp) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/view/VRxProfiles.cpp (.../VRxProfiles.cpp) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -36,6 +36,7 @@ _rxProfilesModels(this) { connect (this, SIGNAL(didRxProfileList()), &_RxProfilesController, SLOT(doInitRxProfiles())); + connect (this, SIGNAL(didDeleteRxProfile(const QString &)), &_RxProfilesController, SLOT(doDeleteRxProfile(const QString &))); ACTION_METHOD_BRIDGE_CONNECTION(RxProfileList, _RxProfilesController, QList) @@ -68,9 +69,9 @@ emit didRxProfileList(); } -void VRxProfiles::doSave(const QStringList &vRxModel) +void VRxProfiles::doDeleteRxProfile(const QString &vRxProfileName) { - qDebug() << vRxModel; + emit didDeleteRxProfile(vRxProfileName) ; } /** @@ -92,13 +93,15 @@ emit modelChanged(); } -//void VRxProfiles::onRxProfileList(const QFileInfoList &vRxProfiles) -//{ -// qDebug() << "-meow-" << vRxProfiles; -// QStringList fileNames; -// for (const QFileInfo fileInfo:vRxProfiles){ -// fileNames << fileInfo.baseName().replace("_", " "); -// } -// rxProfilesList(fileNames); -// qDebug() << _rxProfilesList; -//} +bool VRxProfiles::doValidateProfileName(const QString &name) +{ + for (int row = 0; row < rxProfiles()->rowCount(); ++row) { + QModelIndex idx = rxProfiles()->index(row, 0); + if (rxProfiles()->data(idx, eDataRole_ProfileName).toString() == name + && (! _RxProfilesController.isEditMode(name) )) { + return false; + } + } + return true; +} + Index: sources/view/VRxProfiles.h =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/view/VRxProfiles.h (.../VRxProfiles.h) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/view/VRxProfiles.h (.../VRxProfiles.h) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -82,6 +82,8 @@ signals: void didRxProfileList(); + void didDeleteRxProfile(const QString &vRxProfileName); + void modelChanged(); private slots: @@ -90,6 +92,7 @@ public slots: void doInitRxProfilesList (); - void doSave(const QStringList &vRxModel); + void doDeleteRxProfile(const QString &vRxProfileName); + bool doValidateProfileName(const QString &name); }; } Index: sources/view/VTreatmentCreate.cpp =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/view/VTreatmentCreate.cpp (.../VTreatmentCreate.cpp) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -102,6 +102,35 @@ _RxProfilesController.doSave(); } +void VTreatmentCreate::doLoadRxProfile(const QVariant &modelData, const bool isEdit) +{ + if (!modelData.canConvert()) { + qDebug() << "Expected QVariantMap, got" << modelData << isEdit; + return; + } + + QVariantMap modelDataMap = modelData.toMap(); + if (isEdit){_patientID = modelDataMap["profileName"].toString(); + _RxProfilesController.savePreviousRxProfileName(_patientID); + } + else{_patientID = "";} //Also save the previous profile Name in the controller, Clear when exit or completed + + _bloodFlowRate = modelDataMap["bloodFlow" ].toInt() ; + _dialysateFlowRate = modelDataMap["dialysateFlow" ].toInt() ; + _treatmentDuration = modelDataMap["treatmentDuration" ].toInt() ; + _acidConcentrate = modelDataMap["acidConcentrate" ].toInt() ; + _bicarbonateConcentrate = modelDataMap["bicarbConcentrate" ].toInt() ; + _dialysateTemp = modelDataMap["dialysateTemperature" ].toFloat() ; + _dialyzerType = modelDataMap["dialyzerType" ].toInt() ; + _heparinType = modelDataMap["heparinConcentrate" ].toInt() ; + _heparinBolusVolume = modelDataMap["heparinVolume" ].toFloat() ; + _heparinDispensingRate = modelDataMap["heparinDispenseRate" ].toFloat() ; + _heparinStopTime = modelDataMap["heparinStop" ].toInt() ; + _salineBolusVolume = modelDataMap["salineVolume" ].toInt() ; + _bloodPressureMeasureInterval = modelDataMap["vitalSigns" ].toInt() ; + qDebug() << "Received QML model data in C++ slot: " << modelDataMap; +} + /** * \brief VCreateTreatment::doCancel * \details Notifies FW the user has canceled confirming the treatment parameters Index: sources/view/VTreatmentCreate.h =================================================================== diff -u -rb4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4 -readfcc99876849e52370db5dde4c4c42d4dbc76f --- sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision b4d8fe6f11b7cdf0c631b3ab35ba36f18e0d7bc4) +++ sources/view/VTreatmentCreate.h (.../VTreatmentCreate.h) (revision eadfcc99876849e52370db5dde4c4c42d4dbc76f) @@ -145,7 +145,9 @@ void doConfirm (); void doCancel (); void doAddRxProfile (); + void doLoadRxProfile (const QVariant &modelData, const bool isEdit); + QStringList doGetPrescriptionParameterValues(); QStringList doGetOperatingParameterValues(); };