Index: shared/scripts/configuration/config.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r2f6839e14432633d5b272cc65fec63bec7aacbeb --- shared/scripts/configuration/config.py (.../config.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/configuration/config.py (.../config.py) (revision 2f6839e14432633d5b272cc65fec63bec7aacbeb) @@ -32,3 +32,53 @@ BLOOD_PRIMING_TEXT = "Blood Priming" SALINE_UNIT = "mL" BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" + + + +NUM_OF_REQUEST_REJECT_REASONS = 39 + +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. + } + + + Index: shared/scripts/names.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r2f6839e14432633d5b272cc65fec63bec7aacbeb --- shared/scripts/names.py (.../names.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/names.py (.../names.py) (revision 2f6839e14432633d5b272cc65fec63bec7aacbeb) @@ -3,6 +3,7 @@ from objectmaphelper import * + 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} @@ -48,6 +49,38 @@ o_cumulative_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Cumulative Delivered", "type": "Text", "unnamed": 1, "visible": True} +# +# Top Parents +o_QQuickView = { "type": "QQuickView"} +o_Overlay = {"container": o_QQuickView, "type": "Overlay" } +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_treatmentStart_treatmentTime_section = {"container": o_treatmentStart_TreatmentStart , "id": "_treatmentTime", "type": "Rectangle" } +p = {"container": o_treatmentStart_treatmentTime_section, "objectName": "_TimeText_minute", "type": "Text", "visible": True} +#p = o_TimeText_minute_Text = {"container": o_Overlay, "objectName": "_TimeText_minute", "type": "Text", "visible": True} +o_Overlay_2 = {"container": o_Gui_MainView, "type": "Overlay", "unnamed": 1, "visible": True} +o_flows_button = {"container": o_Overlay_2, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1, "visible": True} +o_treatmentStart_TreatmentStart = {"container": o_QQuickView, "id": "_treatmentStart", "type": "TreatmentStart", "unnamed": 1, "visible": True} +o_treatmentStart_flowsTouchArea_TreatmentFlows = {"container": o_treatmentStart_TreatmentStart, "id": "_flowsTouchArea", "type": "TreatmentFlows", "unnamed": 1, "visible": True} +""" +o_treatment_blood_flow_touch_area = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "FLOWS", "type": "Text", "unnamed": 1, "visible": True} +o_treatmentStart_TreatmentStart = {"container": o_QQuickView, "id": "_treatmentStart", "type": "TreatmentStart", "unnamed": 1, "visible": True} +o_treatment_blood_flow_rate = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "id": "_bloodFlow", "type": "TextRect", "unnamed": 1, "visible": True} +o_treatment_dialysate_flow_rate = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "id": "_dialysateInletFlow", "type": "TextRect", "unnamed": 1, "visible": True} +o_treatment_blood_flow_adjustment = {"container": o_Overlay, "id": "_bloodFlowTextRect", "type": "TextRect", "unnamed": 1, "visible": True} +o_treatment_dialysate_flow_adjustment = {"container": o_Overlay, "id": "_dialysateInletFlowTextRect", "type": "TextRect", "unnamed": 1, "visible": True} +o_treatment_flow_adjustment_close = {"container": o_Overlay, "id": "_closeButton", "type": "CloseButton", "unnamed": 1, "visible": True} +o_treatment_notification_bar = {"container": o_Overlay, "gradient": 0, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} + + + + + + + + + Index: suite.conf =================================================================== diff -u -r8df6f936193bbd9127d3ec940562e62db0060bcb -r2f6839e14432633d5b272cc65fec63bec7aacbeb --- suite.conf (.../suite.conf) (revision 8df6f936193bbd9127d3ec940562e62db0060bcb) +++ suite.conf (.../suite.conf) (revision 2f6839e14432633d5b272cc65fec63bec7aacbeb) @@ -1,6 +1,6 @@ AUT=denaliSquish LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment +TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_treatment_blood_dialysateflow_rate VERSION=3 WRAPPERS=Qt Index: tst_treatment_blood_dialysateflow_rate/test.py =================================================================== diff -u --- tst_treatment_blood_dialysateflow_rate/test.py (revision 0) +++ tst_treatment_blood_dialysateflow_rate/test.py (revision 2f6839e14432633d5b272cc65fec63bec7aacbeb) @@ -0,0 +1,181 @@ +# -*- 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_Treatment_BloodDialysateFlowRate +# date 2020/02/15 +# author Joseph varghese +# + +import names +from dialin.ui import utils +from dialin.ui.hd_simulator import HDSimulator +from dialin.common.msg_defs import RequestRejectReasons +from configuration import config + + +def verify_flow_rate(expected_blood_flow_vlue = "_", expected_dialysate_flow_rate = "_"): + + test.compare(str(waitForObjectExists(names.o_treatment_blood_flow_rate).label), str(expected_blood_flow_vlue)) + test.compare(str(waitForObjectExists(names.o_treatment_dialysate_flow_rate).label), str(expected_dialysate_flow_rate)) + + +def verify_blood_dialysate_adjustment(expected_blood_flow_vlue = "_", expected_dialysate_flow_rate = "_"): + + test.compare(str(waitForObjectExists(names.o_treatment_blood_flow_adjustment).label), str(expected_blood_flow_vlue)) + test.compare(str(waitForObjectExists(names.o_treatment_dialysate_flow_adjustment).label), str(expected_dialysate_flow_rate)) + + +def test_treatment_adjustment_blood_dialysate(hd): + + mouseClick(waitForObject(names.o_treatment_blood_flow_touch_area)) + for rejection in range(2,3): + hd.cmd_send_treatment_adjust_blood_dialysate_response(accepted = False, reason= rejection, + blood_rate = 110, dialysate_flow_rate = 120) + verify_blood_dialysate_adjustment(expected_blood_flow_vlue = 110, expected_dialysate_flow_rate = 120) + + rejection_message = findObject(names.o_treatment_notification_bar) + test.compare(config.REJECTION_MESSAGE[rejection], rejection_message.text) + + + + snooze(20) + + +def test_blood_flow_rate_and_dialysate(hd): + + hd.cmd_set_treatment_blood_flow_rate(flow_set_pt = 100, measured_flow = 0, + rot_speed = 0, mot_speed = 0, mc_speed = 0, + mc_current = 0, pwm = 0, signal_strength = 0) + utils.waitForGUI() #delay for fetching effect + verify_flow_rate(expected_blood_flow_vlue = 100) + + + hd.cmd_set_treatment_blood_flow_rate(flow_set_pt = 125, measured_flow = 1, + rot_speed = 1, mot_speed = 1, mc_speed = 1, + mc_current = 1, pwm = 1, signal_strength = 1) + utils.waitForGUI() #delay for fetching effect + verify_flow_rate(expected_blood_flow_vlue = 125) + + + hd.cmd_set_treatment_blood_flow_rate(flow_set_pt = 175, measured_flow = 1.45, + rot_speed = 1.45, mot_speed = 1.45, mc_speed = 1.45, + mc_current = 1.45, pwm = 1.45, signal_strength = 1.45) + utils.waitForGUI() #delay for fetching effect + verify_flow_rate(expected_blood_flow_vlue = 175) + + + hd.cmd_set_treatment_blood_flow_rate(flow_set_pt = 600, measured_flow = 4, + rot_speed = 6, mot_speed = 15, mc_speed = 24, + mc_current = 6.25, pwm = 12, signal_strength = 8) + utils.waitForGUI() #delay for fetching effect + verify_flow_rate(expected_blood_flow_vlue = 600) + + + hd.cmd_set_treatment_dialysate_flow_rate(flow_set_pt = 225, measured_flow = 1, + rot_speed = 1, mot_speed = 1, mc_speed = 1, + mc_current = 1, pwm = 1, signal_strength = 1) + utils.waitForGUI() #delay for fetching effect + verify_flow_rate(expected_blood_flow_vlue = 600, expected_dialysate_flow_rate = 225 ) + + + hd.cmd_set_treatment_dialysate_flow_rate(flow_set_pt = 500, measured_flow = 110, + rot_speed = 125, mot_speed = 135, mc_speed = 145, + mc_current = 125, pwm = 185, signal_strength = 155) + utils.waitForGUI() #delay for fetching effect + verify_flow_rate(expected_blood_flow_vlue = 600, expected_dialysate_flow_rate = 500 ) + + mouseClick(waitForObject(names.o_treatment_blood_flow_touch_area)) + verify_blood_dialysate_adjustment(expected_blood_flow_vlue = 600, expected_dialysate_flow_rate = 500) + mouseClick(waitForObject(names.o_treatment_flow_adjustment_close)) + + + hd.cmd_set_treatment_blood_flow_rate(flow_set_pt = 425, measured_flow = 4.25, + rot_speed = 1.25, mot_speed = 9, mc_speed = 1.25, + mc_current = 12, pwm = 1.25, signal_strength = 1.25) + hd.cmd_set_treatment_dialysate_flow_rate(flow_set_pt = 350, measured_flow = 0, + rot_speed = 125, mot_speed = 1.25, mc_speed = 1.25, + mc_current = 1, pwm = 5, signal_strength = 10) + utils.waitForGUI() #delay for fetching effect + verify_flow_rate(expected_blood_flow_vlue = 425, expected_dialysate_flow_rate = 350) + + mouseClick(waitForObject(names.o_treatment_blood_flow_touch_area)) + verify_blood_dialysate_adjustment(expected_blood_flow_vlue = 425, expected_dialysate_flow_rate = 350) + mouseClick(waitForObject(names.o_treatment_flow_adjustment_close)) + + + +def main(): + utils.tstStart(__file__) + + startApplication(config.AUT_NAME) + + hd = HDSimulator() + snooze(2) + + #navigate to In-treatment section + hd.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=1, heparin_state= 0, + rinseback_state= 0, recirculate_state= 0, blood_prime_state= 2, + treatment_end_state=0, treatment_stop_state= 0) + utils.waitForGUI() #delay for fetching effect + + test_blood_flow_rate_and_dialysate(hd) + + test_treatment_adjustment_blood_dialysate(hd) + + """ + hd.cmd_set_treatment_blood_flow_rate(flow_set_pt = 100, measured_flow = 0, + rot_speed = 0, mot_speed = 0, mc_speed = 0, + mc_current = 0, pwm = 0, signal_strength = 0) + verify_blood_flow_rate() + verify_blood_flow_rate() + + + + + + + snooze(10) + + hd.cmd_set_treatment_dialysate_flow_rate(flow_set_pt = 121, measured_flow = 100, + rot_speed = 112, mot_speed = 113, mc_speed = 114, + mc_current = 115, pwm = 116, signal_strength = 117) + snooze(10) + + + + snooze(10) + + hd.cmd_send_treatment_adjust_blood_dialysate_response(accepted = False, reason= 8, + blood_rate = 110, dialysate_flow_rate = 120) + + snooze(10) + + hd.cmd_send_treatment_adjust_blood_dialysate_response(accepted = 0, reason= 1, + blood_rate = 100, dialysate_flow_rate = 102) + + + + mouseClick(waitForObject(names.o_flows_button)) + + + gotoScreenNtest_Contains_FlowsSection() + utils.waitForGUI(1) + + test.compare(str(waitForObjectExists(names.o_treatmentStart_flowsTouchArea_TreatmentFlows).bloodFlowSetPoint), "0") + + + denaliMessages.setTreatmentBloodFlowRate(350, 1, 1, 1, 1, 1, 1) + test.compare(str(waitForObjectExists(names.o_treatmentStart_flowsTouchArea_TreatmentFlows).bloodFlowSetPoint), "350") + """ + utils.tstDone() + + + + +