Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml =================================================================== diff -u -r736a7be958ca343f17b50e9e0d85cd395e8037e7 -r477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml (.../TreatmentAdjustmentVitals.qml) (revision 736a7be958ca343f17b50e9e0d85cd395e8037e7) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentVitals.qml (.../TreatmentAdjustmentVitals.qml) (revision 477c26a4e1dcbdf7ad0f29ae7a1df4738d4dcce2) @@ -23,21 +23,22 @@ TreatmentAdjustmentBase { id: _root contentItem.objectName: "TreatmentAdjustmentVitals" - titleText : qsTr("VITALS") - confirmEnabled : _bphrEntry.isValid - height : 500 - width : 750 + height : Variables.numPadHeight + width : 850 x : numPad.isOpened ? Math.round((Variables.applicationWidth - width) / 2) - 200 : Math.round((Variables.applicationWidth - width) / 2) notification.textfontSize: 20 notification.visible: vTreatmentVitals.lastRead || vTreatmentAdjustmentVitals.adjustment_ReasonText - property string notificationTextString: qsTr("Interval:" ) - + " " + (vTreatmentVitals.interval ? (vTreatmentVitals.interval + qsTr("min")) : qsTr("OFF")) - + " , " - + qsTr("Last Read:") - + " " + vTreatmentVitals.lastRead + readonly property string intervalTextString : qsTr("Interval:" ) + + " " + (vTreatmentVitals.interval ? (vTreatmentVitals.interval + qsTr("min")) : qsTr("OFF")) + + " , " + + qsTr("Last Read:") + + " " + vTreatmentVitals.lastRead + readonly property string rejectionTextString : qsTr("Rejected Reason: %1").arg(vTreatmentAdjustmentVitals.adjustment_ReasonText) + readonly property string notificationTextString : vTreatmentAdjustmentVitals.adjustment_ReasonText ? rejectionTextString : + intervalTextString function update(vSystolic, vDiastolic ,vHeartRate) { _bphrEntry.systolic = vSystolic ? vSystolic : "" @@ -55,47 +56,87 @@ } onOpened: { - notificationText = vTreatmentAdjustmentVitals.adjustment_ReasonText ? qsTr("Rejected Reason: %1").arg(vTreatmentAdjustmentVitals.adjustment_ReasonText) : - notificationTextString + notificationText = notificationTextString vTreatmentVitals.doTimerStop() } onClosed: vTreatmentVitals.doTimerStart() - onConfirmClicked: { - numPad.hide() - _root.close() - _root.confirm() - } - onCloseClicked: { numPad.hide() vTreatmentVitals.doSkip() } - BPHREntry { id: _bphrEntry - contentRectHeight : 350 + BPHREntry { id: _bphrEntry } + + Row { id: _buttonRow + spacing: Variables.defaultMargin * 2 + + anchors { + bottom : _root.contentItem.bottom + bottomMargin : notification.visible ? Variables.defaultMargin * 4.5 : Variables.defaultMargin * 2 + horizontalCenter: _root.contentItem.horizontalCenter + } + + TouchRect { id : _requestButton + width : Variables.confirmButtonWidth + height : Variables.contentHeight + isDefault : true + + text { + text : qsTr("REQUEST") + font.bold : true + font.pixelSize : Fonts.fontPixelConfirm + } + + onClicked: { vTreatmentAdjustmentVitals.doRequest() ; print ("BPHREntry doRequest") } + } + + ConfirmButton { id : _confirmButton + enabled : _bphrEntry.isValid + + anchors { + top : undefined + right : undefined + margins : 0 + } + onClicked : { + numPad.hide() + _root.close() + _root.confirm() + } + } + + Behavior on anchors.bottomMargin { NumberAnimation { duration: 300} } } Connections { target: vTreatmentVitals - function onDidTrigger () { - vTreatmentAdjustmentVitals.doRequest() - } + function onDidTrigger () { vTreatmentAdjustmentVitals.doRequest() } } Connections { target: vTreatmentAdjustmentVitals function onAdjustmentTriggered ( vValue ) { if ( vTreatmentAdjustmentVitals.adjustment_Accepted ) { // on accepted read vital data and populate _root.update ( vTreatmentVitals.systolic__rt, vTreatmentVitals.diastolic_rt, vTreatmentVitals.heartRate_rt ) - _root.confirm() - vTreatmentVitals.doTimerStart() + + // confirm only if triggered from interval timer and popup is not open + if ( ! _root.visible) { + _root.confirm() + vTreatmentVitals.doTimerStart() + } } else { // on rejected prompt user to enter vitals manually if ( vTreatmentVitals.enableDialog ) { _root.open () } + + notificationText = rejectionTextString + _bphrEntry.systolic = "" + _bphrEntry.diastolic = "" + _bphrEntry.heartRate = "" } + } }