Index: config.xml
===================================================================
diff -u -r0f8c72cdb9ebe10b644674e3d053f81911c867cb -r0af75233cc3f591575f857eaf0e62f9ab3b10f2c
--- config.xml (.../config.xml) (revision 0f8c72cdb9ebe10b644674e3d053f81911c867cb)
+++ config.xml (.../config.xml) (revision 0af75233cc3f591575f857eaf0e62f9ab3b10f2c)
@@ -3,5 +3,6 @@
+
Index: shared/scripts/configuration/config.py
===================================================================
diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r0af75233cc3f591575f857eaf0e62f9ab3b10f2c
--- shared/scripts/configuration/config.py (.../config.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b)
+++ shared/scripts/configuration/config.py (.../config.py) (revision 0af75233cc3f591575f857eaf0e62f9ab3b10f2c)
@@ -32,3 +32,53 @@
BLOOD_PRIMING_TEXT = "Blood Priming"
SALINE_UNIT = "mL"
BLOOD_PRIMING_DEFAULT_VALUE = "0 mL"
+
+
+# dictionary of rejection reason from application source code.
+# message location -> denali-> Headers-> common-> MsgDefs.h
+REJECTION_MESSAGE = {
+ 0 : "REQUEST_REJECT_REASON_NONE" , # Used when there is no rejection
+ 1 : "REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE" , # "REQuest is not allowed in the current operating mode
+ 2 : "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM" , # Validated "REQuest was not confirmed by user in reasonable time
+ 3 : "REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE" , # "REQuest is not allowed if not in treatment mode
+ 4 : "REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE" , # "REQuest is not allowed in current treatment state
+ 5 : "REQUEST_REJECT_REASON_TREATMENT_TOO_CLOSE_TO_FINISHED" , # "REQuest is not allowed so near end of treatment
+ 6 : "REQUEST_REJECT_REASON_TREATMENT_TIME_OUT_OF_RANGE" , # Treatment duration is out of range
+ 7 : "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_CURRENT" , # Treatment time change is less than currently elapsed treatment time
+ 8 : "REQUEST_REJECT_REASON_BLOOD_FLOW_OUT_OF_RANGE" , # Blood flow is out of range
+ 9 : "REQUEST_REJECT_REASON_DIAL_FLOW_OUT_OF_RANGE" , # Dialysate flow is out of range
+ 10 : "REQUEST_REJECT_REASON_DIAL_VOLUME_OUT_OF_RANGE" , # Dialysate flow rate or treatment duration causes dialysate volume to exceed limit
+ 11 : "REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE" , # Ultrafiltration volume is out of range
+ 12 : "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE" , # Ultrafiltration rate is out of range
+ 13 : "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM" , # Treatment time change is less than minimum treatment time
+ 14 : "REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS" , # Ultrafiltration is not currently in progress
+ 15 : "REQUEST_REJECT_REASON_UF_NOT_PAUSED" , # Ultrafiltration is not currently paused
+ 16 : "REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS" , # A saline bolus is in progress
+ 17 : "REQUEST_REJECT_REASON_PARAM_OUT_OF_RANGE" , # A treatment parameter is out of range
+ 18 : "REQUEST_REJECT_REASON_HEPARIN_PRESTOP_EXCEEDS_DURATION" , # The Heparin pre-stop setting is greater than the treatment duration
+ 19 : "REQUEST_REJECT_REASON_ARTERIAL_PRESSURE_LOW_VS_HIGH" , # Arterial pressure low and high alarm limits are not inconsistent
+ 20 : "REQUEST_REJECT_REASON_VENOUS_PRESSURE_LOW_VS_HIGH" , # Venous pressure low and high alarm limits are inconsistent
+ 21 : "REQUEST_REJECT_REASON_SALINE_MAX_VOLUME_REACHED" , # Saline bolus volume maximum has been reached - no more saline allowed
+ 22 : "REQUEST_REJECT_REASON_SALINE_BOLUS_NOT_IN_PROGRESS" , # A saline bolus is not in progress
+ 23 : "REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE" , # "REQuested user action is disabled in current state
+ 24 : "REQUEST_REJECT_REASON_ALARM_IS_ACTIVE" , # "REQuested user action not allowed while alarm is active
+ 25 : "REQUEST_REJECT_REASON_INVALID_COMMAND" , # "REQuested user action invalid
+ 26 : "REQUEST_REJECT_REASON_TREATMENT_IS_COMPLETED" , # The treatment has been completed
+ 27 : "REQUEST_REJECT_REASON_ADDL_RINSEBACK_MAX_VOLUME_REACHED" , # Rinseback additional volume maximum has been reached - no more additional rinsebacks allowed
+ 28 : "REQUEST_REJECT_REASON_UF_VOLUME_NOT_SET" , # Ultrafiltration volume is not set yet
+ 29 : "REQUEST_REJECT_REASON_NO_PATIENT_CONNECTION_CONFIRM" , # The user has not confirmed patient connection
+ 30 : "REQUEST_REJECT_REASON_HEPARIN_PAUSE_INVALID_IN_THIS_STATE" , # Heparin cannot be paused if not currently deliverying Heparin
+ 31 : "REQUEST_REJECT_REASON_HEPARIN_NOT_PAUSED" , # Heparin cannot be resumed if not paused
+ 32 : "REQUEST_REJECT_REASON_DG_COMM_LOST" , # Treatment cannot initiate if DG comm is lost
+ 33 : "REQUEST_REJECT_REASON_DRAIN_NOT_COMPLETE" , # Post-treatment reservoirs drain not complete
+ 34 : "REQUEST_REJECT_REASON_DG_NOT_IN_STANDBY_IDLE_STATE" , # Treatment cannot initiate if DG is not in standby idle state
+ 35 : "REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT" , # "REQuest message not formatted properly
+ 36 : "REQUEST_REJECT_REASON_INVALID_DATE_OR_TIME" , # Given date/time is invalid
+ 37 : "REQUEST_REJECT_REASON_NO_NEW_TREATMENT_ALARM_TRIGGERED" , # Treatment cannot initiate if an alarm with no new treatment property has triggered before
+ 38 : "REQUEST_REJECT_REASON_BATTERY_IS_NOT_CHARGED" , # Battery does not have enough charge to start treatment
+ 39 : "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED" , # Cannot move on to recirculate without completing full rinseback.
+ }
+
+NUM_OF_REQUEST_REJECT_REASONS = 39
+
+
Index: shared/scripts/names.py
===================================================================
diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r0af75233cc3f591575f857eaf0e62f9ab3b10f2c
--- shared/scripts/names.py (.../names.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b)
+++ shared/scripts/names.py (.../names.py) (revision 0af75233cc3f591575f857eaf0e62f9ab3b10f2c)
@@ -1,8 +1,13 @@
# encoding: UTF-8
-
from objectmaphelper import *
+
+# Top Parents
+o_QQuickView = { "type": "QQuickView"}
+o_Overlay = {"container": o_QQuickView, "type": "Overlay"}
+
+
o_Gui_MainView = {"type": "Gui::MainView", "unnamed": 1, "visible": True}
o_Overlay = {"container": o_Gui_MainView, "type": "Overlay", "unnamed": 1, "visible": True}
o_borderRect_Rectangle = {"container": o_Overlay, "gradient": 0, "id": "_borderRect", "type": "Rectangle", "unnamed": 1, "visible": True}
@@ -44,10 +49,19 @@
o_edit_uf_value = {"container": o_Overlay, "text": "EDIT ULTRAFILTRATION VOLUME", "type": "Text", "unnamed": 1, "visible": True}
o_uf_back_button = {"container": o_Overlay, "text": "BACK", "type": "Text", "unnamed": 1, "visible": True}
o_uf_close_button = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1, "visible": True}
-o_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True}
o_cumulative_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Cumulative Delivered", "type": "Text", "unnamed": 1, "visible": True}
+# Saline Bolus
+o_treatmentHome = {"container": o_QQuickView , "id": "_treatmentHome" , "type": "TreatmentHome", "unnamed": 1, "visible": True}
+o_treatmentStart_TreatmentStart = {"container": o_QQuickView, "id": "_treatmentStart", "type": "TreatmentStart", "unnamed": 1, "visible": True}
+o_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True}
+o_treatmentStart_SalineSection = {"container": o_treatmentHome, "id": "_salineTouchArea", "type": "TreatmentSaline", "unnamed": 1, "visible": True}
+o_treatmentHome_ultrafiltrationTouchArea_TreatmentUltrafiltration = {"container": o_treatmentHome, "id": "_ultrafiltrationTouchArea", "type": "TreatmentUltrafiltration", "unnamed": 1, "visible": True}
+o_treatmentHome_startFluidButton_TouchRect = {"container": o_treatmentHome, "id": "_startFluidButton", "type": "TouchRect", "unnamed": 1, "visible": True}
+o_treatment_notification_bar = {"container": ":o_treatmentHome", "occurrence": 3, "objectName": "NotificationBar", "type": "NotificationBarSmall", "visible": True}
+
+
Index: suite.conf
===================================================================
diff -u -r8df6f936193bbd9127d3ec940562e62db0060bcb -r0af75233cc3f591575f857eaf0e62f9ab3b10f2c
--- suite.conf (.../suite.conf) (revision 8df6f936193bbd9127d3ec940562e62db0060bcb)
+++ suite.conf (.../suite.conf) (revision 0af75233cc3f591575f857eaf0e62f9ab3b10f2c)
@@ -1,4 +1,7 @@
AUT=denaliSquish
+ENVVARS=envvars
+HOOK_SUB_PROCESSES=false
+IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAPSTYLE=script
TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment
Index: tst_treatment_saline_data/test.py
===================================================================
diff -u
--- tst_treatment_saline_data/test.py (revision 0)
+++ tst_treatment_saline_data/test.py (revision 0af75233cc3f591575f857eaf0e62f9ab3b10f2c)
@@ -0,0 +1,247 @@
+# -*- coding: utf-8 -*-
+
+##
+# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
+# copyright
+# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM,
+# IN PART OR IN WHOLE,
+# WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
+#
+# file tst_In_treatment
+# date 2020/02/11
+# author Joseph Varghese
+#
+# NOTE:
+# This test contradicts verification of saline bolus in In-treatment section of Application
+
+
+import names
+import re
+from dialin.ui import utils
+from dialin.ui.hd_simulator import HDSimulator
+from dialin.common.ui_defs import TXStates as txStates
+from dialin.common.msg_defs import RequestRejectReasons as rejectReason
+from configuration import config
+
+#testing options for main treatment saline
+SALINE_BOLUS_TARGET = [0, 1, 25, 30, 50, 80, 70, 220, 250, 280, 300]
+SALINE_BOLUS_CUMULATIVE = [0, 1, 150.4, 180.8, 25, 35.5, 88, 180, 225, 280, 290]
+SALINE_BOLUS_DELIVERED = [0, 1, 220.3, 852.6, 98, 758.1, 862, 752, 564, 580, 600]
+
+
+hd_simulator = HDSimulator()
+
+
+def get_unit():
+ """
+ Method to get unit of saline values
+ """
+ return str(waitForObjectExists(names.o_treatmentStart_SalineSection).unit)
+
+
+def verification_of_target_value(expected_target_value):
+ """
+ Method to verify target value on saline section
+ @param expected_target_value: (int) expected target value on saline section
+ """
+ saline_target = object.children(waitForObject(names.o_fluid_text))[0]
+ target_value = re.findall(r'\w+', str(saline_target.text))
+ test.compare(str(expected_target_value), str(target_value[0]), "Target value verified")
+ test.compare(get_unit(), str(target_value[1]), "Target unit verified")
+
+
+def verification_of_cumulative_value(expected_cumulative_value):
+ """
+ Method to verify cumulative value on saline section
+ @param expected_cumulative_value: (int) expected cumulative value on saline section
+ """
+ saline_unit = object.children(waitForObject(names.o_cumulative_fluid_text))[0]
+ if (saline_unit.text == config.SALINE_UNIT) and (saline_unit.text == get_unit()):
+ saline_cumulative = object.children(waitForObject(names.o_cumulative_fluid_text))[1]
+ test.compare(str(expected_cumulative_value), str(saline_cumulative.text))
+ else:
+ test.fail("Deviation observed in unit of saline (fluid)")
+
+
+def verification_of_delivered_value(expected_delivered_value):
+ """
+ Method to verify delivered value on saline section
+ @param expected_delivered_valuee: (int) expected delivered value on saline section
+ """
+ saline_unit = object.children(waitForObject(names.o_fluid_text))[1]
+ if (saline_unit.text == config.SALINE_UNIT) and (saline_unit.text == get_unit()):
+ saline_cumulative = object.children(waitForObject(names.o_fluid_text))[2]
+ test.compare(str(expected_delivered_value), str(saline_cumulative.text))
+ else:
+ test.fail("Deviation observed in unit of saline (fluid)")
+
+
+def goto_screen_contains_treatment_saline_bolus_data():
+ """
+ Method to verify saline bolus data.
+ @param : none
+ @return: none
+ """
+ test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).buttonText), "START BOLUS", "Saline button text is visible")
+ test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).title ), "SALINE BOLUS", "Saline button title is visible")
+ test.compare( waitForObjectExists(names.o_treatmentStart_SalineSection).visible , True, "Saline button is visible")
+ utils.waitForGUI(0.5)
+
+
+def test_ultrafiltration_touchable(enabled_status):
+ """
+ Method to verify uf touchable area state
+ @param : enabled_status: (bool) True/False -> based on visibility
+ @return: none
+ """
+ test.compare(waitForObjectExists(names.o_treatmentHome_ultrafiltrationTouchArea_TreatmentUltrafiltration).isTouchable, enabled_status,\
+ "uf touchable area is visible")
+
+
+def test_state(accept_status, button_text, target, saline_states):
+ """
+ Method to verify rejection message and transition state of saline bolus parameter.
+ @param accept_status: (int) boolean accept/reject response
+ @param button_text: (str) "START"/"STOP" based on button text.
+ @param target: (int) saline bolus Target volume
+ @param saline_states: (int) saline bolus transition State
+ @return: none
+ """
+ rejection_reason = 0
+ # when rejected reason set 16 -> saline bolus in progress
+ if (not accept_status): rejection_reason = rejectReason.REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS.value
+ hd_simulator.cmd_set_saline_bolus_response(accepted = accept_status, reason = rejection_reason, target = target, state = saline_states)
+ if (not accept_status): test.compare(findObject(names.o_treatment_notification_bar).text, config.REJECTION_MESSAGE[rejection_reason], \
+ "expected rejection {msg} displayed".format(msg=config.REJECTION_MESSAGE[rejection_reason]))
+
+ #set saline transition state.
+ hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=saline_states, heparin_state= 0,
+ rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0,
+ treatment_end_state=0, treatment_stop_state= 0)
+
+ test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).buttonText), "{} BOLUS".format(button_text))
+ verification_of_target_value(expected_target_value = target)
+
+
+def test_rejection_message_on_saline_bolus(accept_status, target, saline_states):
+ """
+ verification of rejection messages on saline bolus.
+ @param accept_status: (int) boolean accept/reject response
+ @param target: (int) saline bolus Target volume
+ @param saline_states: (int) saline bolus transition State
+ @return: none
+ """
+ test.startSection("verification of rejection messages on saline bolus")
+ for rejection in range(1, config.NUM_OF_REQUEST_REJECT_REASONS):
+ hd_simulator.cmd_set_saline_bolus_response(accepted = accept_status, reason = rejection, target = target, state = saline_states)
+ rejection_message = findObject(names.o_treatment_notification_bar)
+ test.compare(rejection_message.text, config.REJECTION_MESSAGE[rejection], "expected rejection {msg} displayed".format(msg=config.REJECTION_MESSAGE[rejection]))
+
+ test.endSection()
+
+
+def test_saline_values():
+ """
+ verification of target value, cumulative value and delivered value from dialysis state.
+ @param: none
+ @return: none
+ """
+ test.startSection("verification of saline parameter values on main treatment screen")
+
+ for target_value in SALINE_BOLUS_TARGET:
+ for index in range(0, len(SALINE_BOLUS_DELIVERED)-1):
+ cumulative_value = SALINE_BOLUS_CUMULATIVE[index]
+ delivered_value = SALINE_BOLUS_DELIVERED[index]
+ hd_simulator.cmd_set_treatment_saline_bolus_data(target = target_value,
+ cumulative = cumulative_value,
+ delivered = delivered_value)
+
+ test.log("verification of saline values from dialysis state for target value :" + str(target_value)+\
+ " cumulative value :" +str(cumulative_value)+" and delivered value :"+ str(delivered_value))
+
+ verification_of_target_value(expected_target_value = format(format(target_value, '.0f')))
+ verification_of_delivered_value(expected_delivered_value = format(format(delivered_value, '.0f')))
+ verification_of_cumulative_value(expected_cumulative_value = format(format(cumulative_value, '.0f')))
+
+ test.endSection()
+
+
+def test_saline_stage():
+ """
+ verification of saline states and rejection message on saline bolus section.
+ @param : none
+ @return: none
+ """
+ test.startSection("verification of saline stages on main treatment screen")
+
+ saline_bolus_target = len(SALINE_BOLUS_TARGET)-1
+ saline_target_value = SALINE_BOLUS_TARGET[saline_bolus_target]
+
+ #verification of total rejection message on saline bolus touch section.
+ test_rejection_message_on_saline_bolus(True, saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE)
+
+ # Initial Idle -> Idle/START/UF_True
+ goto_screen_contains_treatment_saline_bolus_data()
+ test_ultrafiltration_touchable(True )
+
+ # Initial Idle => Running => Rejected -> Idle/START/UF_True
+ test_state(False, "START" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE )
+ test_ultrafiltration_touchable(True )
+
+ # retry Idle => Running => Rejected -> Idle/START/UF_True
+ test_state(False, "START" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE )
+ test_ultrafiltration_touchable(True )
+
+ # Still Idle => Running => Accepted -> Running/STOP/UF_False
+ test_state(True , "STOP" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IN_PROGRESS )
+ test_ultrafiltration_touchable(False)
+
+ # Now Running => Idle => Rejected -> Running/STOP/UF_False
+ test_state(True, "STOP" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IN_PROGRESS )
+ test_ultrafiltration_touchable(False)
+
+ # Retry Running => Idle => Rejected -> Running/STOP/UF_False
+ test_state(False, "STOP" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IN_PROGRESS )
+ test_ultrafiltration_touchable(False)
+
+ # Still Running => Idle => Accepted -> Idle/START/UF_True
+ test_state(True , "START" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE )
+ test_ultrafiltration_touchable(True )
+
+ # Now Idle => Running => Rejected -> Idle/START/UF_True
+ test_state(False, "START" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE )
+ test_ultrafiltration_touchable(True )
+
+ # Retry Idle => Running => Rejected -> Idle/START/UF_True
+ test_state(False, "START" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE )
+ test_ultrafiltration_touchable(True )
+
+ # Still Idle => Running => Accepted -> Running/STOP/UF_False
+ test_state(True , "STOP" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IN_PROGRESS )
+ test_ultrafiltration_touchable(False)
+
+ test.endSection()
+
+
+
+def main():
+ utils.tstStart(__file__)
+ startApplication(config.AUT_NAME)
+
+ utils.waitForGUI(2)
+
+ #navigate to dialysis state
+ hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=0, heparin_state= 0,
+ rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0,
+ treatment_end_state=0, treatment_stop_state= 0)
+
+ #verification of target cumulative and delivered value
+ test_saline_values()
+
+
+ #verification of saline stages
+ test_saline_stage()
+
+ utils.tstDone()
+
+
\ No newline at end of file