Index: shared/scripts/configuration/config.py =================================================================== diff -u -r7cd0c21e76de3964af8178655467e82ff99ae98d -rd5d976dfec8c5324cd779fb192b1a3e36032547d --- shared/scripts/configuration/config.py (.../config.py) (revision 7cd0c21e76de3964af8178655467e82ff99ae98d) +++ shared/scripts/configuration/config.py (.../config.py) (revision d5d976dfec8c5324cd779fb192b1a3e36032547d) @@ -6,27 +6,86 @@ # 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 utils.py +# @file config.py # # @author (last) LTTS # @date (last) 18-Jan-2022 # ############################################################################ import os +from configuration.strings import * AUT_NAME = "denaliSquish" COMMON_PATH = os.environ['HOME']+"/Projects" -COLOR_CODES = {"Aqua": "#81ffff", "Blue": "#017dea", "Blue 2": "#1090d5", "Green": "#29fd2d", "Grey": "#d3d3d3", - "Lavender": "#db98f5", "Light Blue": "#acd7f1", "Light Teal": "#29f1da","Lime": "#b7fc36", - "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", - "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} +#create custom treatment +HIGHER_VALUE_OF_BLOOD_FLOW_RATE = 500 +LOWER_VALUE_OF_BLOOD_FLOW_RATE = 100 +STEP_VALUE_OF_BLOOD_FLOW_RATE = 25 +BUFFER_LOW_AND_HIGH_LIMITS = 30 +ARTERIAL_VALUE_0 = 0 +ARTERIAL_VALUE_NEGATIVE_300 = -300 +ARTERIAL_VALUE_NEGATIVE_20 = -20 +ARTERIAL_VALUE_NEGATIVE_270 = -270 +VENOUS_VALUE_600 = 600 +VENOUS_VALUE_20 = 20 +VENOUS_VALUE_50 = 50 +VENOUS_VALUE_570 = 570 +POSITIVE_BUFFER = 10 +NEGATIVE_BUFFER = -10 -CREATE_TREATMENT_PARAMETERS = ["Blood Flow Rate", "Dialysate Flow Rate", "Duration","Heparin Dispensing Rate", - "Heparin Bolus Volume","Heparin Stop Time", "Saline Bolus","Dialysate Temperature","Blood Pressure Measurement Interval", - "Rinseback Flow Rate"] +#dictionary consist of custom treatment values +CREATE_CUSTOM_TREATMENT = { + "Blood Flow Rate": 250, + "Dialysate Flow Rate": 400, + "Duration": 270, + "Heparin Dispensing Rate": 0.5, + "Heparin Bolus Volume": 1, + "Heparin Stop Time": 100, + "Saline Bolus Volume": 200, + "Dialysate Temperature": 37, + "Blood Pressure Measurement Interval": 40, + "Rinseback Flow Rate": 100, + "Arterial Pressure Limit Low" : -30, + "Arterial Pressure Limit High" : 0, + "Blood Pressure Measure Interval" : 40, + "Rinseback Rate" : 100, + "Venous Pressure Limit High" : 590, + "Venous Pressure Limit Low": 560 + +} +#dictionary consist of slider values of treatment parameters +CREATE_TREATMENT_PARAMETER_RANGE = { + "Blood Flow Rate": [100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 425, 450, 475, 500], + "Dialysate Flow Rate": [100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600], + "Duration": [60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 240, 255, 270, 285, 300, 315, 330, 345, 360, 375, 390, 405, 420, 435, 450, 465, 480], + "Heparin Dispensing Rate": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 0], + "Heparin Bolus Volume": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 0], + "Heparin Stop Time": [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 0], + "Saline Bolus Volume": [100, 200, 300], + "Dialysate Temperature": [35.0, 35.5, 36.0, 36.5, 37.0, 37.5, 38.0], + "Blood Pressure Measurement Interval": [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 0], + "Rinseback Flow Rate": [50, 75, 100, 125, 150], +} +#dictionary consist of slider minimum value, slider buffer value, width buffer of slider +CREATE_TREATMENT_SLIDER_VALUES = { + + "blood_flow_rate" : [100, 25, 46], + "dialysate_flow_rate" : [100, 50, 75], + "duration" : [60, 15, 26.6], + "heparin_dispensing_rate" : [0, 0.1, 75], + "heparin_bolus_volume" : [0, 0.1, 37], + "heparin_stop_time" : [0, 10, 15.9], + "saline_bolus" : [100, 100, 375], + "dialysate_temperature" : [35, 0.5, 125], + "arterial_pressure_limit_high" : [20, 10, 11.931], + "blood_pressure_measurement_interval" : [0, 5, 62], + "rinseback_flow_rate" : [50, 25, 187], +} + + Index: shared/scripts/configuration/strings.py =================================================================== diff -u -ra309546f47434a0a2a22de97e24947d252b59106 -rd5d976dfec8c5324cd779fb192b1a3e36032547d --- shared/scripts/configuration/strings.py (.../strings.py) (revision a309546f47434a0a2a22de97e24947d252b59106) +++ shared/scripts/configuration/strings.py (.../strings.py) (revision d5d976dfec8c5324cd779fb192b1a3e36032547d) @@ -8,7 +8,7 @@ # # @file strings.py # -# @author (last) LTTS +# @author (last) LTTS # @date (last) 18-Jan-2022 # ############################################################################ @@ -20,27 +20,6 @@ BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" -# pretreatment_patient_connection -DIASTOLIC_TEXT = "diastolic" -SYSTOLIC_TEXT = "systolic" -OUT_OF_RANGE_COLOR = "#c53b33" -IN_RANGE_COLOR = "#fcfcfc" -HEART_RATE_TITLE = "Heart Rate" -BLOOD_PRESSURE_TITLE = "Blood Pressure" -BLOOD_PRESSURE_UNIT = "mmHg" -HEART_RATE_UNIT = "BPM" -PATIENT_CONNECTION_TEXT = "Patient Connection" -UF_VOLUME_TEXT = "Ultrafiltration Volume (L)" -UF_TITLE_TEXT = "Ultrafiltration Setup" -BP_HR_TEXT = "BP/HR" -SKIP_TEXT = "SKIP" -TUTORIAL_TEXT = { - 0 : "Wash your hands and establish vascular access per your clinic's instructions.", - 1 : "Pinch arterial clamp and venous clamp on located on the cartridge patient lines.", - 2 : "Remove arterial and venous shunt.", - 3 : "Connect arterial and venous cartridge lines to your patient access lines." -} - PRE_TREATMENT_SCREENS = { 1 : "Create" , 2 : "Sample" , @@ -53,55 +32,106 @@ 9 : "Start" } - # dictionary of rejection reason from application source code. # message location -> denali-> Headers-> common-> MsgDefs.h REJECTION_REASON = { - 0: "No Active Alarm List", - 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____AVAILABLE_1", # Not used - available for use - 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. - 40: "REQUEST_REJECT_REASON_RESERVOIR_ONE_IS_NOT_READY", # Reservoir one fill is not complete - 41: "REQUEST_REJECT_REASON_PUMP_TRACK_NOT_CLOSED", # Pump track is not ready / closed - 42: "REQUEST_REJECT_REASON_DOOR_NOT_CLOSED", # Door is not closed - 43: "REQUEST_REJECT_REASON_SYRINGE_NOT_PRESENT", # Syringe is not present - } + 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 +} +#create custom treatment +PATIENT_ID = "demopatientid" +TREATMENT_TITLE = "Create a Custom Treatment" +HEPARIN_TYPE = "UFH 1,000 IU/mL" +ACID_CONCENTRATE = ["Fres. Naturalyte", "08-1251-1", "08-2251-0", "08-3251-9"] +BICARBONATE_CONCENTRATE = "Fres. Centrisol" +DIALYZER_TYPE = ["BB Diacap Pro 13H", "BB Diacap Pro 16H", "BB Diacap Pro 19H", "F Optiflux F160NRe", "F Optiflux F180NRe"] +CONFIRM_TREATMENT_TITLE = "Confirm Treatment" +PRESCRIPTION_TITLE = "PRESCRIPTION" +OPERATING_PARAMETERS_TITLE = "OPERATING PARAMETERS" +COLOR_CODES = {"Aqua": "#81ffff", "Blue": "#017dea", "Blue 2": "#1090d5", "Green": "#29fd2d", "Grey": "#d3d3d3", + "Lavender": "#db98f5", "Light Blue": "#acd7f1", "Light Teal": "#29f1da","Lime": "#b7fc36", + "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", + "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} +CURRENT_COLOR = '#000000' +COMPLETE_COLOR= '#4290ec' +ENABLED_COLOR = '#fcfcfc' +INCOMPLETE_COLOR = '#607a91' +BLOOD_FLOW_RATE = "Blood Flow Rate" +DIALYSATE_FLOW_RATE = "Dialysate Flow Rate" +DURATION = "Duration" +HEPARIN_DISPENSING_RATE = "Heparin Dispensing Rate" +HEPARIN_BOLUS_VOLUME = "Heparin Bolus Volume" +HEPARIN_STOP_TIME = "Heparin Stop Time" +SALINE_BOLUS = "Saline Bolus Volume" +HEPARIN_TYPE_TITLE = "Heparin Type" +SALINE_BOLUS_TITLE = "Saline Bolus" +ACID_CONCENTRATE_TITLE = "Acid Concentrate" +BICARBONATE_CONCENTRATE_TITLE = "Bicarbonate Concentrate" +DIALYZER_TYPE_TITLE = "Dialyzer Type" +DIALYSATE_TEMPERATURE = "Dialysate Temperature" +BLOOD_PRESSURE_MEASUREMENT_INTERVAL = "Blood Pressure Measurement Interval" +RINSEBACK_FLOW_RATE = "Rinseback Flow Rate" +CREATE_TREATMENT_PARAMETERS = ["Blood Flow Rate", "Dialysate Flow Rate", "Duration","Heparin Dispensing Rate", + "Heparin Bolus Volume","Heparin Stop Time", "Saline Bolus", "Dialysate Temperature", + "Blood Pressure Measurement Interval", "Rinseback Flow Rate"] +TREATMENT_UNHIGHLIGHTED_COLOR = "#000000" +TREATMENT_HIGHLIGHTED_COLOR = "#135088" +OFF_TEXT = "OFF" +BACK_TEXT = "BACK" +CONTINUE_TEXT = "CONTINUE" + +PRESCRIPTION_DETAILS = { + "Blood Flow Rate": "mL/min", "Dialysate Flow Rate": "mL/min", + "Duration": "min", "Heparin Dispensing Rate": "mL/hr", + "Heparin Bolus Volume": "mL", "Heparin Stop Time": "min", + "Saline Bolus Volume": "mL", + "Dialysate Temperature": "°C", "Arterial Pressure Limit Low": "mmHg", + "Arterial Pressure Limit High": "mmHg","Blood Pressure Measure Interval":"min", + "Rinseback Rate" : "min", "Venous Pressure Limit High": "mmHg", + "Venous Pressure Limit Low": "mmHg" +} + +OPERATIONAL_PARAMETERS = {"Heparin Type": HEPARIN_TYPE, "Acid Concentrate": "Fres. Naturalyte", + "Bicarbonate Concentrate": BICARBONATE_CONCENTRATE, "Dialyzer Type": "BB Diacap Pro 16H"} + Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r208e8f0faa0baf7b5be221c2cae849f371d08fde -rd5d976dfec8c5324cd779fb192b1a3e36032547d --- shared/scripts/configuration/utility.py (.../utility.py) (revision 208e8f0faa0baf7b5be221c2cae849f371d08fde) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision d5d976dfec8c5324cd779fb192b1a3e36032547d) @@ -14,12 +14,13 @@ import names -import sys import test +import object import squish +from configuration import config from builtins import int as pyInt -from builtins import float as pyFloat + def check_if_object_is_within_the_container(obj=None, container=None): """ @@ -76,102 +77,252 @@ raise LookupError("zone object is not in view to the user after " + \ "trying 100 times") + +def page_step_indicator_verification(pre_treatment_step, pre_treatment_items_object): + """ + Method to verify the Page Step indicators on top of the screen which indicates the steps passed, current, remained] + @param pre_treatment_step :(int) indicates the Current pre-treatment step + @param pre_treatment_items_object :(dictionary) pre_treatment bullet object + @return N/A + """ + test.startSection("Method to verify the Page Step indicators") + for page in range(1, len(config.PRE_TREATMENT_SCREENS)): + pre_treatment_items_object["occurrence"] = page + bullet_children = object.children(squish.waitForObject(pre_treatment_items_object)) + bullet_circle_color = bullet_children[0].color.name + bullet_border_color = bullet_children[0].border.color.name + step_title = bullet_children[2] + #To verify the step indicators of the completed pre treatment screens + if page < pre_treatment_step: + test.verify(squish.waitForObjectExists(pre_treatment_items_object).complete, str(config.PRE_TREATMENT_SCREENS[page]+" complete attribute should be True")) + test.verify(not squish.waitForObjectExists(pre_treatment_items_object).current, str(config.PRE_TREATMENT_SCREENS[page]+" current attribute should be false")) + test.compare(bullet_circle_color, config.COMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet color hex should be "+str(config.COMPLETE_COLOR))) + test.compare(bullet_border_color, config.COMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet border color hex should be "+str(config.COMPLETE_COLOR))) + test.compare(step_title.color.name, config.ENABLED_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" title color hex should be "+str(config.ENABLED_COLOR))) + #To verify the step indicators of the current pre treatment screen + elif page == pre_treatment_step: + test.verify(squish.waitForObjectExists(pre_treatment_items_object).current, str(config.PRE_TREATMENT_SCREENS[page]+" complete attribute should be True")) + test.verify(not squish.waitForObjectExists(pre_treatment_items_object).complete, str(config.PRE_TREATMENT_SCREENS[page]+" current attribute should be false")) + test.compare(bullet_circle_color,config.CURRENT_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet color hex should be "+str(config.CURRENT_COLOR))) + test.compare(bullet_border_color,config.COMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet border color hex should be "+str(config.COMPLETE_COLOR))) + test.compare(step_title.color.name,config.ENABLED_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" title color hex should be "+str(config.ENABLED_COLOR))) + test.verify(step_title.font.bold, str(config.PRE_TREATMENT_SCREENS[page]+" title font bold should be "+str(config.ENABLED_COLOR))) + #To verify the step indicators of the remaining pre-treatment screens + else: + test.verify(not squish.waitForObjectExists(pre_treatment_items_object).current, str(config.PRE_TREATMENT_SCREENS[page]+" complete attribute should be false")) + test.verify(not squish.waitForObjectExists(pre_treatment_items_object).complete, str(config.PRE_TREATMENT_SCREENS[page]+" current attribute should be false")) + test.compare(step_title.color.name,config.INCOMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" title color hex should be "+str(config.INCOMPLETE_COLOR))) + test.compare(bullet_circle_color,config.CURRENT_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet circle color hex should be "+str(config.CURRENT_COLOR))) + test.compare(bullet_border_color,config.INCOMPLETE_COLOR, str(config.PRE_TREATMENT_SCREENS[page]+" bullet border color hex should be "+str(config.INCOMPLETE_COLOR))) -def set_slider_value(slider_value= None, slider_object= None, bidirectional= False, - slider_range = None): + test.endSection() + + +#Methods for create custom treatment +def set_venous_ranges_min_val(ven_low): """ - Method to drag slider to desired value - @param slider_value : value in which slider should be placed - @param slider_object : object of the slider - @param bidirectional : True, if slider have 2 handler - @return boolean (True - if user able to select slider. else, false) + Method to set the Venous range maximum value to user expected value + @param ven_low - (int) user expected value """ - slider_value = pyFloat(slider_value) - actual_value = slider_value - if slider_range == "Max": - x_value = 600 + test.startSection("Set Venous range minimum value to {}".format(ven_low)) + ven_min = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous) + ven_min = pyInt(ven_min.minimum) + ven_max = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous) + ven_max = pyInt(ven_max.maximum) + low_handler_parent = object.parent(squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous)) + low_handler_children = object.children(low_handler_parent) + low_handler = low_handler_children[-2] + width = pyInt(low_handler.width) - 15 + height = pyInt(low_handler.height) - 10 + if ven_min == ven_low: + test.passes("Venous range minimum is already set to {}".format(ven_low)) + elif ven_min < ven_low: + while ven_min != ven_low: + squish.mouseDrag(low_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + ven_min += 10 + if ven_min == ven_max - config.BUFFER_LOW_AND_HIGH_LIMITS: # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + squish.mouseDrag(low_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Venous range minimum value cannot be moved beyond {}".format(ven_min)) + break + else: + continue + elif ven_min > ven_low: + while ven_min != ven_low: + squish.mouseDrag(low_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + ven_min -= 10 + # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + if ven_min == ven_max - config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(low_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Venous range minimum value cannot be moved beyond {}".format(ven_min)) + break + else: + continue + # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + if ven_min == ven_max - config.BUFFER_LOW_AND_HIGH_LIMITS: + test.compare(low_handler_parent.minValue, ven_min, + "Venous range minimum value cannot be moved beyond {}".format(ven_min)) else: - x_value = 0 - counter = 0 - while True: - if slider_value < 0: - slider_value = -1 * slider_value - squish.mouseDrag(slider_object, x_value, 0, slider_value, 0, squish.Qt.NoModifier, - squish.Qt.LeftButton) - if counter == 50: - test.fail("User unable to fix slider value") - return False - if bidirectional is True: - if slider_range == "Low": - if actual_value == pyFloat(slider_object.minValue): - return True - if slider_value >= pyFloat(slider_object.minValue): - slider_value = slider_value - 30 - if slider_value <= pyFloat(slider_object.minValue): - slider_value = slider_value + 30 - if slider_range == "Max": - if actual_value == pyFloat(slider_object.maxValue): - return True - if slider_value >= pyFloat(slider_object.maxValue): - slider_value = slider_value + 30 - if slider_value <= pyFloat(slider_object.maxValue): - slider_value = slider_value - 30 - else: - if actual_value == pyFloat(slider_object.value): - return True - if slider_value >= pyFloat(slider_object.value): - slider_value = slider_value + 30 - if slider_value <= pyFloat(slider_object.value): - slider_value = slider_value - 30 - counter = counter + 1 + test.compare(ven_min, ven_low, + "Actual Venous range minimum value: {} is equal to Expected value: {}".format(ven_min, ven_low)) + test.endSection() -def slider_movement_for_negative_values(slider_value= None, slider_object= None, bidirectional= False, - slider_range = None): +def set_venous_ranges_max_val(ven_high): """ - Method to drag slider for negative values value - @param slider_value : value in which slider should be placed - @param slider_object : object of the slider - @param bidirectional : True, if slider have 2 handler - @return boolean (True - if user able to select slider. else, false) + Method to set the Venous range maximum value to user expected value + @param ven_high - (int) user expected value """ - slider_value = pyFloat(slider_value) - actual_value = slider_value - if slider_range == "Max": - x_value = 600 + test.startSection("Set Venous range maximum value to {}".format(ven_high)) + ven_max = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous) + ven_max = pyInt(ven_max.maximum) + ven_min = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous) + ven_min = pyInt(ven_min.minimum) + high_handler_parent = object.parent(squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Venous)) + high_handler_children = object.children(high_handler_parent) + high_handler = high_handler_children[-1] + width = pyInt(high_handler.width) - 15 + height = pyInt(high_handler.height) - 10 + if ven_max == ven_high: + test.passes("Venous range maximum is already set to {}".format(ven_high)) + elif ven_max < ven_high: + while ven_max != ven_high: + squish.mouseDrag(high_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + ven_max += 10 + # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + if ven_max == ven_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(high_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Venous range maximum value cannot be moved beyond {}".format(ven_max)) + break + else: + continue + elif ven_max > ven_high: + while ven_max != ven_high: + squish.mouseDrag(high_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + ven_max -= 10 + # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + if ven_max == ven_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(high_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Venous range maximum value cannot be moved beyond {}".format(ven_max)) + break + else: + continue + # venous blood pressure low limit should be lower than the high limit by at least 30mmHg + if ven_max == ven_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + test.compare(high_handler_parent.maxValue, ven_max, + "Venous range maximum value cannot be moved beyond {}".format(ven_max)) else: - x_value = 0 - counter = 0 - while True: - squish.mouseDrag(slider_object, x_value, 0, slider_value, 0, squish.Qt.NoModifier, - squish.Qt.LeftButton) - if counter == 50: - test.fail("User unable to fix slider slider_value") - return False - if bidirectional is True: - if slider_range == "Low": - if actual_value == pyFloat(slider_object.minValue): - return True - if slider_value >= pyFloat(slider_object.minValue): - slider_value = slider_value + 30 - if slider_value <= pyFloat(slider_object.minValue): - slider_value = slider_value - 30 - if slider_range == "Max": - if actual_value == pyFloat(slider_object.maxValue): - return True - if slider_value >= pyFloat(slider_object.maxValue): - slider_value = slider_value + 30 - if slider_value <= pyFloat(slider_object.maxValue): - slider_value = slider_value - 30 - counter = counter + 1 + test.compare(ven_max, ven_high, + "Actual Venous range maximum value: {} is equal to Expected value: {}".format(ven_max, ven_high)) + test.endSection() -def logErrorDetails(error_message): +def set_arterial_ranges_min_val(art_low): """ - Logs the execution details. + Method to set the Arterial range maximum value to user expected value + @param art_low - (int) user expected value """ - excep_type, excep_val, excep_tb = sys.exc_info() - test.log(str(excep_val)) - test.fail(error_message + ", " + "Exception Type: " + str(excep_type) + "\n" + str(excep_tb)) - + test.startSection("Set Arterial range minimum value to {}".format(art_low)) + arterial_min = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery) + arterial_min = pyInt(arterial_min.minimum) + arterial_max = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery) + arterial_max = pyInt(arterial_max.maximum) + low_handler_parent = object.parent(squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery)) + low_handler_children = object.children(low_handler_parent) + low_handler = low_handler_children[-2] + width = pyInt(low_handler.width) - 8 + height = pyInt(low_handler.height)- 10 + if arterial_min == art_low: + test.passes("Arterial range minimum is already set to {}".format(art_low)) + elif arterial_min < art_low: + while arterial_min != art_low: + squish.mouseDrag(low_handler, width, height, 1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) + arterial_min += 10 + # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg + if arterial_min == arterial_max - config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(low_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Arterial range minimum value cannot be moved beyond {}".format(arterial_min)) + break + else: + continue + elif arterial_min > art_low: + while arterial_min != art_low: + squish.mouseDrag(low_handler, width, height, -1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) + arterial_min -= 10 + # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg + if arterial_min == arterial_max - config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(low_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Arterial range minimum value cannot be moved beyond {}".format(arterial_min)) + break + else: + continue + # arterial blood pressure low limit should be lower than the high limit by atleast 30mmHg + if arterial_min == arterial_max - config.BUFFER_LOW_AND_HIGH_LIMITS: + test.compare(low_handler_parent.minValue, arterial_min, + "Arterial range minimum value cannot be moved beyond {}".format(arterial_min)) + else: + test.compare(arterial_min, art_low, + "Actual Arterial range minimum value: {} is equal to Expected value: {}".format(arterial_min, art_low)) + test.endSection() + +def set_arterial_ranges_max_val(art_high): + """ + Method to set the Arterial range maximum value to user expected value + @param art_high - (int) user expected value + """ + test.startSection("Set Arterial range maximum value to {}".format(art_high)) + arterial_max = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery) + arterial_max = pyInt(arterial_max.maximum) + arterial_min = squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery) + arterial_min = pyInt(arterial_min.minimum) + high_handler_parent = object.parent(squish.waitForObjectExists(names.o_PreTreatmentCreate_rangeRect_RangeRect_Artery)) + high_handler_children = object.children(high_handler_parent) + high_handler = high_handler_children[-1] + width = pyInt(high_handler.width) - 20 + height = pyInt(high_handler.height) - 25 + if arterial_max == art_high: + test.passes("Arterial range maximum is already set to {}".format(art_high)) + elif arterial_max < art_high: + while arterial_max != art_high: + squish.mouseDrag(high_handler, -1, height, width, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) + arterial_max += 10 + # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg + if arterial_max == arterial_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(high_handler, width, height, 1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Arterial range maximum value cannot be moved beyond {}".format(arterial_max)) + break + else: + continue + elif arterial_max > art_high: + while arterial_max != art_high: + squish.mouseDrag(high_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + arterial_max -= 10 + # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg + if arterial_max == arterial_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + squish.mouseDrag(high_handler, width, height, -1, 0, + squish.Qt.NoModifier, squish.Qt.LeftButton) + test.log("Arterial range maximum value cannot be moved beyond {}".format(arterial_max)) + break + else: + continue + # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg + if arterial_max == arterial_min + config.BUFFER_LOW_AND_HIGH_LIMITS: + test.compare(high_handler_parent.maxValue, arterial_max, + "Arterial range maximum value cannot be moved beyond {}".format(arterial_max)) + else: + test.compare(arterial_max, art_high, + "Actual Arterial range maximum value: {} is equal to Expected value: {}".format(arterial_max, art_high)) + test.endSection() + Index: shared/scripts/names.py =================================================================== diff -u -r7a5b9be3631dca85dee5c71e1f3581db4d7db342 -rd5d976dfec8c5324cd779fb192b1a3e36032547d --- shared/scripts/names.py (.../names.py) (revision 7a5b9be3631dca85dee5c71e1f3581db4d7db342) +++ shared/scripts/names.py (.../names.py) (revision d5d976dfec8c5324cd779fb192b1a3e36032547d) @@ -15,24 +15,26 @@ o_PreTreatmentBase_input_TextInput = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} o_PreTreatmentBase_CONFIRM_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate = {"container": o_PreTreatmentCreateStack_PreTreatmentCreateStack, "objectName": "_PreTreatmentCreate", "type": "PreTreatmentCreate", "visible": True} -o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_bloodFlowRate", "type": "SliderCreateTreatment", "visible": True} -o_PreTreatmentCreate_bloodFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_bloodFlowRateSlider", "type": "Slider", "visible": True} -o_PreTreatmentCreate_dialysateFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_dialysateFlowRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodFlowRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_bloodFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodFlowRateSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_dialysateFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialysateFlowRate", "type": "SliderCreateTreatment", "visible": True} o_PreTreatementCreateStack_PreTreatmentBase_TreatmentFlowBase = {"container":o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase,"objectName":"_PreTreatmentBase","type":"TreatmentFlowBase", "visible": True} -o_confirmButton_TouchRect = {"container": o_Gui_MainView, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": False} -o_backButton_BackButton = {"container": o_Gui_MainView, "gradient": 0, "objectName": "_backButton", "type": "BackButton", "visible": False} +o_confirmButton_TouchRect = {"container": o_Gui_MainView, "objectName": "_confirmButton", "type": "TouchRect", "visible": False} +o_backButton_BackButton = {"container": o_Gui_MainView, "objectName": "_backButton", "type": "BackButton", "visible": False} o_NinePatchImage = {"container": o_Gui_MainView, "occurrence": 6, "type": "NinePatchImage", "unnamed": 1, "visible": False} -o_PreTreatmentBase_backgroundRect_Rectangle = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} +o_PreTreatmentBase_backgroundRect_Rectangle = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} t_Text = {"container": o_Gui_MainView, "text": "t", "type": "Text", "unnamed": 1, "visible": True} -o_PreTreatmentBase_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} +o_PreTreatmentBase_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} -#create_treatment +#create_custom treatment testcase +text_object = {"type": "Text", "unnamed": 1, "visible": True} +bullet_object = {"type": "StepBullet", "unnamed": 1, "visible": True} o_PreTreatmentBase_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} -o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_bloodFlowRate", "type": "SliderCreateTreatment", "visible": True} -o_PreTreatmentBase_confirmButton_TouchRect_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} -o_PreTreatmentCreate_heparinDispensingRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_heparinDispensingRate", "type": "SliderCreateTreatment", "visible": True} -o_PreTreatmentBase_backgroundRect_Rectangle_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodFlowRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentBase_confirmButton_TouchRect_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_heparinDispensingRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinDispensingRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentBase_backgroundRect_Rectangle_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} o_PreTreatmentCreateStack_PreTreatmentConfirm_TreatmentFlowBase = {"container": o_PreTreatmentCreateStack_PreTreatmentCreateStack, "objectName": "_PreTreatmentConfirm", "type": "TreatmentFlowBase", "visible": True} o_treatment_confirm_flickable = {"container": o_PreTreatmentCreateStack_PreTreatmentConfirm_TreatmentFlowBase, "objectName": "_PreTreatmentConfirmFlickable", "type": "Flickable", "visible": True} o_prescription_mesurement = {"container": o_PreTreatmentCreateStack_PreTreatmentConfirm_TreatmentFlowBase, "type": "Text", "visible": True} @@ -44,7 +46,65 @@ o_input_patient_id = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} o_confirm_button = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} o_back_button_confirm_treatment = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True} - -#standbymode o_MainHome_MainHome = {"container": o_Gui_MainView, "objectName": "_MainHome", "type": "MainHome", "visible": True} o_standby_page = {"container": o_MainHome_MainHome, "type": "Column", "unnamed": 1, "visible":True} +o_PreTreatmentCreate_progressRect_ProgressRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_progressRect", "type": "ProgressRect", "unnamed": 1, "visible": True} +#create custom treatment slider object property's +#prescription object propert's +o_PreTreatmentCreate_bloodFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodFlowRateSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_dialysateFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialysateFlowRateSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_durationSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_durationSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_heparinDispensingRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinDispensingRateSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinBolusVolumeSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_heparinStopTimeSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinStopTimeSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_salineBolusSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_salineBolusSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_dialysateTemperatureSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialysateTemperatureSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodPressureMeasurementIntervalSlider", "type": "Slider", "visible": True} +o_PreTreatmentCreate_rinsebackFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_rinsebackFlowRateSlider", "type": "Slider", "visible": True} +o_PreTreatmentBase_gridSteps_Grid = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "id": "_gridSteps", "type": "Grid", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_nextStepsBullet_StepBullet = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "type": "StepBullet", "unnamed": 1, "visible": True} +o_PreTreatmentBase_nextStepsBullet_StepBullet = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "type": "StepBullet", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_venousPressureLimitsSlider_RangeSlider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_venousPressureLimitsSlider", "type": "RangeSlider", "visible": True} +o_PreTreatmentCreate_handlerLeft_Rectangle = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_handlerLeft", "occurrence": 2, "type": "Rectangle", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_handlerRight_Rectangle = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "occurrence": 2, "id": "_handlerRight", "type": "Rectangle", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_handlerLeft_Rectangle_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "occurrence": 1, "id": "_handlerLeft", "type": "Rectangle", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_venousColumn_Column = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_venousColumn", "type": "Column", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_mouseArea_MouseArea_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_mouseArea", "occurrence": 33, "type": "MouseArea", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_line_Line = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_line", "type": "Line", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_rangeRect_RangeRect_Venous = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate,"id": "_rangeRect", "occurrence": 2, "type": "RangeRect", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_rangeRect_RangeRect_Artery = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate,"id": "_rangeRect", "occurrence": 1, "type": "RangeRect", "unnamed": 1, "visible": True} +o_PreTreatmentCreate_Heparin_Type_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "Heparin Type", "type": "Text", "unnamed": 1, "visible": True} +#operating parameters object property's +o_PreTreatmentCreate_heparinTypeRect0_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinTypeRect0", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_acidConcentrateRect0_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_acidConcentrateRect0", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_acidConcentrateRect1_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_acidConcentrateRect1", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_acidConcentrateRect2_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_acidConcentrateRect2", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_acidConcentrateRect3_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_acidConcentrateRect3", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect0", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect1", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect2_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect2", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect3_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect3", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect4_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect4", "type": "TouchRect", "visible": True} +o_PreTreatmentCreate_heparinDispensingRateValue_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinDispensingRateValue", "type": "Text", "visible": True} +o_PreTreatmentCreate_heparinBolusVolumeValue_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinBolusVolumeValue", "type": "Text", "visible": True} +o_PreTreatmentCreate_heparinStopTimeValue_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinStopTimeValue", "type": "Text", "visible": True} +o_PreTreatmentCreate_bloodPressureMeasurementIntervalValue_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodPressureMeasurementIntervalValue", "type": "Text", "visible": True} +o_PreTreatmentCreate_duration_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_duration", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_heparinBolusVolume_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinBolusVolume", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_heparinStopTime_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinStopTime", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_salineBolus_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_salineBolus", "type": "SliderCreateTreatment", "visible": True} +#operating parameters object property +o_PreTreatmentCreate_heparinTypeRect_GridSelection = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_heparinTypeRect", "type": "GridSelection", "visible": True} +o_PreTreatmentCreate_acidConcentrateRect_GridSelection = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_acidConcentrateRect", "type": "GridSelection", "visible": True} +o_PreTreatmentCreate_bicarbonateConcentrateRect_GridSelection = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bicarbonateConcentrateRect", "type": "GridSelection", "visible": True} +o_PreTreatmentCreate_dialyzerTypeRect_GridSelection = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialyzerTypeRect", "type": "GridSelection", "visible": True} +o_PreTreatmentCreate_dialysateTemperature_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_dialysateTemperature", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_bloodPressureMeasurementInterval_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bloodPressureMeasurementInterval", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_rinsebackFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_rinsebackFlowRate", "type": "SliderCreateTreatment", "visible": True} +o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_bicarbonateConcentrateRect0", "type": "TouchRect", "visible": True} +#custom treatment title object +o_PreTreatmentCreate_Create_a_Custom_Treatment_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "Create a Custom Treatment", "type": "Text", "unnamed": 1, "visible": True} +#confirm and back button object property +o_PreTreatmentCreate_backButton_BackButton = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_backButton", "type": "BackButton", "visible": True} +o_PreTreatmentCreate_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} + Fisheye: Tag d5d976dfec8c5324cd779fb192b1a3e36032547d refers to a dead (removed) revision in file `tst_In_treatment/verificationPoints/VP1'. Fisheye: No comparison available. Pass `N' to diff? Index: tst_create_custom_treatment/test.py =================================================================== diff -u -r8a20c1bed0da16cd0bda8795aef323ac575288a2 -rd5d976dfec8c5324cd779fb192b1a3e36032547d --- tst_create_custom_treatment/test.py (.../test.py) (revision 8a20c1bed0da16cd0bda8795aef323ac575288a2) +++ tst_create_custom_treatment/test.py (.../test.py) (revision d5d976dfec8c5324cd779fb192b1a3e36032547d) @@ -17,117 +17,67 @@ import names - from dialin.ui import utils -from builtins import str as pyStr from configuration import utility from configuration import config from dialin.common.msg_defs import RequestRejectReasons from dialin.ui.hd_simulator import HDSimulator +hd_simulator = HDSimulator() -PATIENT_ID = "demopatientid" -HEPARIN_TYPE = "UFH 1,000 IU/mL" -ACID_CONCENTRATE = ["Fres. Naturalyte", "08-1251-1", "08-2251-0", "08-3251-9"] -BICARBONATE_CONCENTRATE = "Fres. Centrisol" -DIALYZER_TYPE = ["BB Diacap Pro 13H", "BB Diacap Pro 16H", "BB Diacap Pro 19H", "F Optiflux F160NRe", "F Optiflux F180NRe"] -CONFIRM_TREATMENT_TITLE = "Confirm Treatment" -PRESCRIPTION_TITLE = "PRESCRIPTION" -OPERATING_PARAMETERS_TITLE = "OPERATING PARAMETERS" +PRE_TREATMENT_STEP = 1 -CREATE_TREATMENT_SLIDER_VALUES = { - "Blood Flow Rate": [200, 300, 400], - "Dialysate Flow Rate": [150, 250, 300], - "Duration": [120, 150, 240], - "Heparin Dispensing Rate": [0.2, 0.3, 0.6], - "Heparin Bolus Volume": [0.2, 0.5, 0.8], - "Heparin Stop Time": [20, 60, 270], - "Saline Bolus Volume": [200], - "Dialysate Temperature": [35.5, 36.0, 36.5], - "Venous Pressure Limit High": [550, 510, 500], - "Venous Pressure Limit Low": [120, 140, 110], - "Arterial Pressure Limit High": [-30, -40, -50], - "Arterial Pressure Limit Low": [-280, -260, -290] , - "Blood Pressure Measure Interval": [5, 15, 20], - "Rinseback Rate": [75, 100, 125], - } - -PRESCRIPTION_DETAILS = {"Blood Flow Rate": "mL/min", "Dialysate Flow Rate": "mL/min", - "Duration": "min", "Heparin Dispensing Rate": "mL/hr", - "Heparin Bolus Volume": "mL", "Heparin Stop Time": "min", - "Saline Bolus Volume": "mL", - "Dialysate Temperature": "°C", "Arterial Pressure Limit Low": "mmHg", - "Arterial Pressure Limit High": "mmHg","Blood Pressure Measure Interval":"min", - "Rinseback Rate" : "min", "Venous Pressure Limit High": "mmHg", - "Venous Pressure Limit Low": "mmHg" - } - -OPERATIONAL_PARAMETERS = {"Heparin Type": "UFH 1,000 IU/mL", "Acid Concentrate": ACID_CONCENTRATE, - "Bicarbonate Concentrate": "Fres. Centrisol", "Dialyzer Type": DIALYZER_TYPE} - - def set_parameter_type(text): - if isinstance(text, pyStr): + """ + Method to set object property based on text + @param text : (string) treatment parameter text + """ + if isinstance(text, str): names.o_operating_parameters["text"] = text return names.o_operating_parameters else: - test.log(f"Invalid \"text\": " +text+" for object.") + test.log("Invalid \"text\": " +text+" for object.") names.o_operating_parameters["text"] = None def prescription_measurement_title(text): - if isinstance(text, pyStr): + """ + Method to set object property based on text + @param text : (string) treatment parameter text + """ + if isinstance(text, str): names.o_prescription_mesurement["text"] = text return names.o_prescription_mesurement else: - test.log(f"Invalid \"text\": " +text+" for object.") + test.log("Invalid \"text\": " +text+" for object.") names.o_prescription_mesurement["text"] = None - + -def set_operating_parameters(heparin_type, acid_concentrate, bicarbonate_concentrate, dialyzer_type): +def verify_request_rejection_mode(): """ - Tests that all possible non-slider options are shown. - @Param : operating parameters value - @return: None + Method to verify rejection mode of create custom treatment """ - heparin_parameter_object = set_parameter_type(text = heparin_type) - utility.scroll_to_zone(heparin_parameter_object, names.o_treatment_create_flickable) - tapObject(waitForObject(heparin_parameter_object)) - - object_on_zone = set_parameter_type(text = ACID_CONCENTRATE[3]) - utility.scroll_to_zone(object_on_zone, names.o_treatment_create_flickable) - acid_concentrate_box_obj = set_parameter_type(text = acid_concentrate) - tapObject(waitForObject(acid_concentrate_box_obj)) - - bicarbonate_concentrate_box_obj = set_parameter_type(text = bicarbonate_concentrate) - utility.scroll_to_zone(bicarbonate_concentrate_box_obj, names.o_treatment_create_flickable) - tapObject(waitForObject(bicarbonate_concentrate_box_obj)) - - object_on_zone = set_parameter_type(text = DIALYZER_TYPE[3]) - utility.scroll_to_zone(object_on_zone, names.o_treatment_create_flickable) - dialyzer_type_box_obj = set_parameter_type(text = dialyzer_type) - tapObject(waitForObject(dialyzer_type_box_obj)) - - -def verify_request_rejection_mode(hd_simulator): - reject_reasons = [ RequestRejectReasons.REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE ] * hd_simulator.NUM_TREATMENT_PARAMETERS treatment_status = hd_simulator.cmd_send_treatment_parameter_validation_response(reject_reasons) test.compare(treatment_status, True, "custom treatment should be rejected") -def verify_request_continue_mode(hd_simulator): - +def verify_request_continue_mode(): + """ + Method to accept treatment response. + """ treatment_status = hd_simulator.cmd_send_treatment_parameter_manual_validation_response([ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]) test.compare(treatment_status, True, "custom treatment should be accepted") def verify_custom_treatment_record_rejected(): - + """ + Method to verify custom treatment record, if confirmation rejected + """ test.startSection("Verifying custom treatment record, if confirmation rejected") for expected_treatment_title in config.CREATE_TREATMENT_PARAMETERS: @@ -137,268 +87,551 @@ utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) parameter_text = waitForObject(parameter_object) - parameter_text_color = parameter_text.color + parameter_text_color = parameter_text.color.name test.compare(expected_color, parameter_text_color, "parameter color should be "\ "red for " + expected_treatment_title +" , if the confirmation get rejected !") test.endSection() - -def set_slider_value_for_parameter(index_value = None, item_text = None, slider_value = None, - slider_obj = None, bislider = False, slider_range = None): - parameter = object.children(slider_obj)[index_value] - if bislider is True: - slider_object = object.children(parameter)[1] - else: - slider_object = object.children(parameter)[2] - slider_status = utility.set_slider_value(slider_value, slider_object, bislider, slider_range) - test.compare(slider_status, True, str(item_text) + " should set to value -> " + str(slider_value)) +def test_continue_button(): + """ + Method to verify continue button of create custom treatment page + """ + test.startSection("Verification of continue button from create custom treatment section") + test.compare(waitForObject(names.o_PreTreatmentCreate_confirmButton_TouchRect).text.text, config.CONTINUE_TEXT, "continue button should be displayed") + test.verify(waitForObject(names.o_PreTreatmentCreate_confirmButton_TouchRect).enabled, "continue button should be enabled") + test.endSection() -def create_custom_treatment_record( blood_flow_rate, dialysate_flow_rate, - Duration, heparin_dispensing_rate, - heparin_bolus_volume, heparin_stop_time, - saline_bolus, dialysate_temperature, - blood_pressure_measurement_interval, - rinseback_flowrate, venous_pressure_low_limits, - venous_pressure_high_limits, arterial_pressure_low_limit, - arterial_pressure_high_limit, index - ): +def test_back_button(): """ - Method to set custom treatment slider values for parameters. - @Param : parameters value - @return: None - """ + Method to verify back button of create custom treatment page + """ + test.startSection("Verification of back button from create custom treatment section") - slider_object = waitForObject(names.o_create_treatment_screen) - child = object.children(slider_object)[0] - parameter_child = object.children(child)[0] + test.compare(waitForObject(names.o_PreTreatmentCreate_backButton_BackButton).text.text, config.BACK_TEXT, "Back button should be displayed") + test.verify(waitForObject(names.o_PreTreatmentCreate_backButton_BackButton).enabled, "Back button should be enabled") + test.endSection() - set_slider_value_for_parameter(index_value = 1, item_text = "blood flow rate", - slider_value = blood_flow_rate, slider_obj = parameter_child) - set_slider_value_for_parameter(index_value = 2, item_text = "dialysate flow rate", - slider_value = dialysate_flow_rate, slider_obj = parameter_child) +def create_custom_treatment_record(): + """ + Method to set create custom treatment slider value based on slider buffer on negative direction + """ + test.startSection("Method to set create custom treatment slider based on negative slider buffer") - set_slider_value_for_parameter(index_value = 3, item_text = "Duration", - slider_value = Duration, slider_obj = parameter_child) + #flicker screen into blood dialysate section + parameter_object = set_parameter_type(text = config.BLOOD_FLOW_RATE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable, direction="Top") + + #set custom values for parameters + test.startSection("verification of blood flow values") + test.compare(waitForObject(names.o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment).label, config.BLOOD_FLOW_RATE, "Parameter should be -> "+str(config.BLOOD_FLOW_RATE)) + for blood_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.BLOOD_FLOW_RATE][::-1]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodFlowRateSlider_Slider, blood_flow_rate, config.CREATE_TREATMENT_SLIDER_VALUES["blood_flow_rate"], config.BLOOD_FLOW_RATE) + test.endSection() - parameter_object = set_parameter_type(text = "Heparin Stop Time") + test.startSection("verification of dialysate flow values") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateFlowRate_SliderCreateTreatment).label, config.DIALYSATE_FLOW_RATE, "Parameter should be -> "+str(config.DIALYSATE_FLOW_RATE)) + for dialysate_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DIALYSATE_FLOW_RATE][::-1]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateFlowRateSlider_Slider, dialysate_flow_rate, config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_flow_rate"], config.DIALYSATE_FLOW_RATE) + test.endSection() + + test.startSection("verification of duration values") + test.compare(waitForObject(names.o_PreTreatmentCreate_duration_SliderCreateTreatment).label, config.DURATION, "Parameter should be -> "+str(config.DURATION)) + for duration in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DURATION][::-1]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_durationSlider_Slider, duration, config.CREATE_TREATMENT_SLIDER_VALUES["duration"], config.DURATION) + test.endSection() + + #scroll the screen to the title heparin bolus volume + parameter_object = set_parameter_type(text = config.HEPARIN_BOLUS_VOLUME) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) - set_slider_value_for_parameter(index_value = 4, item_text = "heparin dispensing rate", - slider_value = heparin_dispensing_rate, slider_obj = parameter_child) + test.startSection("verification of heparin dispensing rate values") + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRate_SliderCreateTreatment).label, config.HEPARIN_DISPENSING_RATE, "Parameter should be -> "+str(config.HEPARIN_DISPENSING_RATE)) + for heparin_dispensing_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_DISPENSING_RATE][::-1]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinDispensingRateSlider_Slider, heparin_dispensing_rate, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_dispensing_rate"], config.HEPARIN_DISPENSING_RATE) + test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateValue_Text).text, "OFF text should display for value 0") + test.endSection() - set_slider_value_for_parameter(index_value = 5, item_text = "heparin bolus volume", - slider_value = heparin_bolus_volume, slider_obj = parameter_child) - - parameter_object = set_parameter_type(text = "Saline Bolus") + test.startSection("verification of heparin bolus volume values") + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolume_SliderCreateTreatment).label, config.HEPARIN_BOLUS_VOLUME, "Parameter should be -> "+str(config.HEPARIN_BOLUS_VOLUME)) + for heparin_bolus_volume in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_BOLUS_VOLUME][::-1]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider, heparin_bolus_volume, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_bolus_volume"], config.HEPARIN_BOLUS_VOLUME) + test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinBolusVolumeValue_Text).text, "OFF text should display for value 0") + test.endSection() + + #scroll the screen to the title acid concentrate type + parameter_object = set_parameter_type(text = config.HEPARIN_TYPE_TITLE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + test.startSection("verification of heparin stop time values") + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinStopTime_SliderCreateTreatment).label, config.HEPARIN_STOP_TIME, "Parameter should be -> "+str(config.HEPARIN_STOP_TIME)) + for heparin_stop_time in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_STOP_TIME][::-1]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, heparin_stop_time, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_stop_time"], config.HEPARIN_STOP_TIME) + test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinStopTimeValue_Text).text, "OFF text should display for value 0") + test.endSection() - set_slider_value_for_parameter(index_value = 6, item_text = "heparin stop time", - slider_value = heparin_stop_time, slider_obj = parameter_child) + test.startSection("verification of saline bolus values") + test.compare(waitForObject(names.o_PreTreatmentCreate_salineBolus_SliderCreateTreatment).label, config.SALINE_BOLUS_TITLE, "Parameter should be -> "+str(config.SALINE_BOLUS)) + for saline_bolus in config.CREATE_TREATMENT_PARAMETER_RANGE[config.SALINE_BOLUS][::-1]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_salineBolusSlider_Slider, saline_bolus, config.CREATE_TREATMENT_SLIDER_VALUES["saline_bolus"], config.SALINE_BOLUS) + test.endSection() - set_slider_value_for_parameter(index_value = 7, item_text = "saline bolus", - slider_value = saline_bolus, slider_obj = parameter_child) - - set_operating_parameters(heparin_type = HEPARIN_TYPE, - acid_concentrate = ACID_CONCENTRATE[index], - bicarbonate_concentrate = BICARBONATE_CONCENTRATE, - dialyzer_type = DIALYZER_TYPE[index]) - - parameter_object = set_parameter_type(text = "Venous Pressure Limits (mmHg)") + #scroll the screen to the title blood pressure measurement interval + parameter_object = set_parameter_type(text = config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of dialysate temperature values") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateTemperature_SliderCreateTreatment).label, config.DIALYSATE_TEMPERATURE, "Parameter should be -> "+str(config.DIALYSATE_TEMPERATURE)) + for dialysate_temperature in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DIALYSATE_TEMPERATURE][::-1]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateTemperatureSlider_Slider, dialysate_temperature, config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_temperature"], config.DIALYSATE_TEMPERATURE) + test.endSection() - set_slider_value_for_parameter(index_value = 13, item_text = "dialysate temperature", - slider_value = dialysate_temperature, slider_obj = parameter_child) - - parameter_object = set_parameter_type(text = "Rinseback Flow Rate") + #scroll the screen to the title rinseback flow rate + parameter_object = set_parameter_type(text = config.RINSEBACK_FLOW_RATE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + #set_arterial_high_and_low_limits_using_slider() + set_venous_high_and_low_limits_using_slider() + + test.startSection("verification of blood pressure measurement interval values") + test.compare(waitForObject(names.o_PreTreatmentCreate_bloodPressureMeasurementInterval_SliderCreateTreatment).label, config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL, "Parameter should be -> "+str(config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL)) + for blood_pressure_measurement_interval in config.CREATE_TREATMENT_PARAMETER_RANGE[config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL][::-1]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, blood_pressure_measurement_interval, config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) + test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalValue_Text).text, "OFF text should display for value 0") + test.endSection() - set_slider_value_for_parameter(index_value = 14, item_text = " arterial pressure low limits (mmHg)", - slider_value = arterial_pressure_low_limit, slider_obj = parameter_child, bislider = True, slider_range = "Low") - - set_slider_value_for_parameter(index_value = 14, item_text = "arterial pressure high limits (mmHg)", - slider_value = arterial_pressure_high_limit, slider_obj = parameter_child, bislider = True, slider_range = "Max") - - set_slider_value_for_parameter(index_value = 15, item_text = "venous_pressure_low_limits", - slider_value = venous_pressure_low_limits, slider_obj = parameter_child, bislider = True, slider_range = "Low") - - set_slider_value_for_parameter(index_value = 15, item_text = "venous pressure high limits (mmHg)", - slider_value = venous_pressure_high_limits, slider_obj = parameter_child, bislider = True, slider_range = "Max") + test.startSection("verification of rinseback flow rate values") + test.compare(waitForObject(names.o_PreTreatmentCreate_rinsebackFlowRate_SliderCreateTreatment).label, config.RINSEBACK_FLOW_RATE, "Parameter should be -> "+str(config.RINSEBACK_FLOW_RATE)) + for rinseback_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.RINSEBACK_FLOW_RATE][::-1]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_rinsebackFlowRateSlider_Slider, rinseback_flow_rate, config.CREATE_TREATMENT_SLIDER_VALUES["rinseback_flow_rate"], config.RINSEBACK_FLOW_RATE) + test.endSection() - set_slider_value_for_parameter(index_value = 16, item_text = "blood pressure measurement interval", - slider_value = blood_pressure_measurement_interval, slider_obj = parameter_child) + test_continue_button() + test_back_button() - set_slider_value_for_parameter(index_value = 17, item_text = "rinseback_flowrate", - slider_value = rinseback_flowrate, slider_obj = parameter_child) + test.endSection() def verify_the_confirm_treatment_screen_is_displayed() -> None: - + """ + Method to verify confirm treatment title + """ test.log("Verifying the 'Confirm Treatment' is displayed and its title text") confirm_treatment_title = waitForObject(names.o_confirm_title_text) - test.compare(CONFIRM_TREATMENT_TITLE, confirm_treatment_title.text.toUtf8().constData(), - CONFIRM_TREATMENT_TITLE + " screen is displayed " + - "and title should be " +CONFIRM_TREATMENT_TITLE) + test.compare(config.CONFIRM_TREATMENT_TITLE, confirm_treatment_title.text.toUtf8().constData(), + config.CONFIRM_TREATMENT_TITLE + " screen is displayed " + + "and title should be " +config.CONFIRM_TREATMENT_TITLE) -def verify_prescriptional_details_from_confirm_treatment_screen(index): - +def verify_prescriptional_details_from_confirm_treatment_screen(): + """ + Method to verify prescription details from confirm treatment section. + """ test.startSection("Verifying prescription values from confirm treatment section") verify_the_confirm_treatment_screen_is_displayed() prescription_title = waitForObject(names.o_prescription_title_text) - test.compare(PRESCRIPTION_TITLE, prescription_title.text.toUtf8().constData(), - PRESCRIPTION_TITLE + " title " + "should be " +PRESCRIPTION_TITLE) - option = index - for expected_prescription_title, measurement in PRESCRIPTION_DETAILS.items(): - if expected_prescription_title == "Saline Bolus Volume": - option = 0 + test.compare(config.PRESCRIPTION_TITLE, prescription_title.text.toUtf8().constData(), + config.PRESCRIPTION_TITLE + " title " + "should be " +config.PRESCRIPTION_TITLE) + + for expected_prescription_title, measurement in config.PRESCRIPTION_DETAILS.items(): + + #flickering into expected parameter title parameter_object = prescription_measurement_title(text = expected_prescription_title) utility.scroll_to_zone(parameter_object, names.o_treatment_confirm_flickable) - prescription_title = waitForObject(prescription_measurement_title(\ - text=expected_prescription_title)) + prescription_title = waitForObject(prescription_measurement_title(text=expected_prescription_title)) actual_measurement = object.parent(prescription_title) actual_measurement = object.children(actual_measurement)[-1] test.compare(expected_prescription_title, prescription_title.text.toUtf8().constData(), "title should be " + expected_prescription_title) - unit = CREATE_TREATMENT_SLIDER_VALUES[expected_prescription_title][option] + unit = config.CREATE_CUSTOM_TREATMENT[expected_prescription_title] test.compare(str(unit)+ " " +str(measurement), actual_measurement.text, expected_prescription_title + " corresponding "+ "measured value should be " + str(unit)+" "+str(measurement)) - option = index + test.endSection() -def verify_operational_details_from_confirm_treatment_screen(index): - +def verify_operational_details_from_confirm_treatment_screen(): + """ + Method to verify operational details from confirm treatment section. + """ test.startSection("Verifying operational values from confirm treatment screen") verify_the_confirm_treatment_screen_is_displayed() parameter_object = prescription_measurement_title(text = "Blood Flow Rate") utility.scroll_to_zone(parameter_object, names.o_treatment_confirm_flickable) - for expected_operational_title, measurement in OPERATIONAL_PARAMETERS.items(): + for expected_operational_title, measurement in config.OPERATIONAL_PARAMETERS.items(): operational_title = waitForObject(prescription_measurement_title(\ text=expected_operational_title)) actual_measurement = object.parent(operational_title) actual_measurement = object.children(actual_measurement)[-1] test.compare(expected_operational_title, operational_title.text.toUtf8().constData(), expected_operational_title + " title should be " + expected_operational_title) - if expected_operational_title == "Acid Concentrate" or expected_operational_title == "Dialyzer Type": - measurement = measurement[index] test.compare(measurement, actual_measurement.text.toUtf8().constData(), expected_operational_title +" corresponding "+ "measured value should be " + measurement) test.endSection() - -def main(): - utils.tstStart(__file__) - startApplication(config.AUT_NAME) +def test_custom_treatment_slider(slider_object, value, slider_parameter, parameter): + """ + Method to set slider handle based on custom values + @param slider_object : (dictionary) object of treatment parameters + @param vale : (int)value to be set on slider + @param slider_parameter : (list) consist combination of slider minimum value, slider buffer and width buffer + @param parameter : (str) parameter name + """ + minimum_slider_value = slider_parameter[0] + slider_buffer = slider_parameter[1] + width_buffer = slider_parameter[2] + slider_width = ((value - minimum_slider_value)/slider_buffer) * width_buffer + utils.waitForGUI(0.2) + mouseClick(findObject(slider_object), float(slider_width) , 3, Qt.LeftButton) - hd = HDSimulator() + test.compare(waitForObjectExists(slider_object).value, value, str(parameter)+" slider value should set to"+str(value)) - hd.cmd_send_power_on_self_test_version_request() - hd.cmd_send_hd_operation_mode(4, 0) + +def set_venous_low_and_high_limits_using_slider(): + """ + Method to set the venous low and high limits using slider + """ + test.startSection("Set the venous low and high limits using slider") + utils.waitForGUI(1) + for venous_value in range(config.VENOUS_VALUE_20, config.VENOUS_VALUE_600, config.POSITIVE_BUFFER): + utility.set_venous_ranges_min_val(venous_value) + utility.set_venous_ranges_min_val(config.VENOUS_VALUE_20) + for venous_value in range(config.VENOUS_VALUE_600, config.VENOUS_VALUE_20, config.NEGATIVE_BUFFER): + utility.set_venous_ranges_max_val(venous_value) + + test.endSection() - mouseClick(waitForObject(names.o_input_patient_id)) - type(waitForObject(names.o_input_patient_id), PATIENT_ID) - mouseClick(waitForObject(names.o_confirm_button)) - #set custom values for parameters - create_custom_treatment_record( - blood_flow_rate = CREATE_TREATMENT_SLIDER_VALUES["Blood Flow Rate"][0], - dialysate_flow_rate = CREATE_TREATMENT_SLIDER_VALUES["Dialysate Flow Rate"][0], - Duration = CREATE_TREATMENT_SLIDER_VALUES["Duration"][0], - heparin_dispensing_rate = CREATE_TREATMENT_SLIDER_VALUES["Heparin Dispensing Rate"][0], - heparin_bolus_volume = CREATE_TREATMENT_SLIDER_VALUES["Heparin Bolus Volume"][0], - heparin_stop_time = CREATE_TREATMENT_SLIDER_VALUES["Heparin Stop Time"][0], - saline_bolus = CREATE_TREATMENT_SLIDER_VALUES["Saline Bolus Volume"][0], - dialysate_temperature = CREATE_TREATMENT_SLIDER_VALUES["Dialysate Temperature"][0], - venous_pressure_low_limits = CREATE_TREATMENT_SLIDER_VALUES["Venous Pressure Limit Low"][0], - venous_pressure_high_limits = CREATE_TREATMENT_SLIDER_VALUES["Venous Pressure Limit High"][0], - arterial_pressure_low_limit = CREATE_TREATMENT_SLIDER_VALUES["Arterial Pressure Limit Low"][0], - arterial_pressure_high_limit = CREATE_TREATMENT_SLIDER_VALUES["Arterial Pressure Limit High"][0], - blood_pressure_measurement_interval = CREATE_TREATMENT_SLIDER_VALUES["Blood Pressure Measure Interval"][0], - rinseback_flowrate = CREATE_TREATMENT_SLIDER_VALUES["Rinseback Rate"][0], - index = 0 - ) +def set_arterial_low_and_high_limits_using_slider(): + """ + Method to set the arterial low and high limits using slider + """ + test.startSection("Set the arterial low and high limits using slider") + utils.waitForGUI(1) + for arterial_value in range(config.ARTERIAL_VALUE_0, config.ARTERIAL_VALUE_NEGATIVE_300, config.NEGATIVE_BUFFER): + utility.set_arterial_ranges_max_val(arterial_value) + utility.set_arterial_ranges_max_val(config.ARTERIAL_VALUE_0) + for arterial_value in range(config.ARTERIAL_VALUE_NEGATIVE_300, config.ARTERIAL_VALUE_NEGATIVE_20, config.POSITIVE_BUFFER): + utility.set_arterial_ranges_min_val(arterial_value) + + test.endSection() - verify_request_continue_mode(hd) +def set_venous_high_and_low_limits_using_slider(): + """ + Method to set the venous low and high limits using slider + """ + test.startSection("Set the venous low and high limits using slider") + utils.waitForGUI(1) + for venous_value in range(config.VENOUS_VALUE_50, config.VENOUS_VALUE_600, config.POSITIVE_BUFFER): + utility.set_venous_ranges_max_val(venous_value) + for venous_value in range(config.VENOUS_VALUE_20, config.VENOUS_VALUE_570, config.POSITIVE_BUFFER): + utility.set_venous_ranges_min_val(venous_value) + + test.endSection() - #verification of records from confirm treatment screen - verify_operational_details_from_confirm_treatment_screen(index = 0) - verify_prescriptional_details_from_confirm_treatment_screen(index = 0) - mouseClick(waitForObject(names.o_back_button_confirm_treatment)) +def set_arterial_high_and_low_limits_using_slider(): + """ + Method to set the arterial low and high limits using slider + """ + test.startSection("Set the arterial low and high limits using slider") + utils.waitForGUI(1) + utility.set_arterial_ranges_min_val(config.ARTERIAL_VALUE_NEGATIVE_300) + for arterial_value in range(config.ARTERIAL_VALUE_0, config.ARTERIAL_VALUE_NEGATIVE_270, config.NEGATIVE_BUFFER): + utility.set_arterial_ranges_max_val(arterial_value) + + test.endSection() - parameter_object = set_parameter_type(text = config.CREATE_TREATMENT_PARAMETERS[0]) - utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable, direction="Top") +def verify_create_custom_treatment_parameter(): + """ + Method to set create custom treatment slider value based on slider buffer + """ + test.startSection("Method to set create custom treatment slider based on positive slider buffer") + test.compare(waitForObject(names.o_PreTreatmentCreate_Create_a_Custom_Treatment_Text).text, config.TREATMENT_TITLE, "Title text should be -> "+str(config.TREATMENT_TITLE)) + #set custom values for parameters - create_custom_treatment_record( - blood_flow_rate = CREATE_TREATMENT_SLIDER_VALUES["Blood Flow Rate"][1], - dialysate_flow_rate = CREATE_TREATMENT_SLIDER_VALUES["Dialysate Flow Rate"][1], - Duration = CREATE_TREATMENT_SLIDER_VALUES["Duration"][1], - heparin_dispensing_rate = CREATE_TREATMENT_SLIDER_VALUES["Heparin Dispensing Rate"][1], - heparin_bolus_volume = CREATE_TREATMENT_SLIDER_VALUES["Heparin Bolus Volume"][1], - heparin_stop_time = CREATE_TREATMENT_SLIDER_VALUES["Heparin Stop Time"][1], - saline_bolus = CREATE_TREATMENT_SLIDER_VALUES["Saline Bolus Volume"][0], - dialysate_temperature = CREATE_TREATMENT_SLIDER_VALUES["Dialysate Temperature"][1], - venous_pressure_low_limits = CREATE_TREATMENT_SLIDER_VALUES["Venous Pressure Limit Low"][1], - venous_pressure_high_limits = CREATE_TREATMENT_SLIDER_VALUES["Venous Pressure Limit High"][1], - arterial_pressure_low_limit = CREATE_TREATMENT_SLIDER_VALUES["Arterial Pressure Limit Low"][1], - arterial_pressure_high_limit = CREATE_TREATMENT_SLIDER_VALUES["Arterial Pressure Limit High"][1], - blood_pressure_measurement_interval = CREATE_TREATMENT_SLIDER_VALUES["Blood Pressure Measure Interval"][1], - rinseback_flowrate = CREATE_TREATMENT_SLIDER_VALUES["Rinseback Rate"][1], - index = 1 - ) + test.startSection("verification of blood flow values") + test.compare(waitForObject(names.o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment).label, config.BLOOD_FLOW_RATE, "Parameter should be -> "+str(config.BLOOD_FLOW_RATE)) + for blood_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.BLOOD_FLOW_RATE]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodFlowRateSlider_Slider, blood_flow_rate, config.CREATE_TREATMENT_SLIDER_VALUES["blood_flow_rate"], config.BLOOD_FLOW_RATE) + test.endSection() + + test.startSection("verification of dialysate flow values") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateFlowRate_SliderCreateTreatment).label, config.DIALYSATE_FLOW_RATE, "Parameter should be -> "+str(config.DIALYSATE_FLOW_RATE)) + for dialysate_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DIALYSATE_FLOW_RATE]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateFlowRateSlider_Slider, dialysate_flow_rate, config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_flow_rate"], config.DIALYSATE_FLOW_RATE) + test.endSection() + + test.startSection("verification of duration values") + test.compare(waitForObject(names.o_PreTreatmentCreate_duration_SliderCreateTreatment).label, config.DURATION, "Parameter should be -> "+str(config.DURATION)) + for duration in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DURATION]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_durationSlider_Slider, duration, config.CREATE_TREATMENT_SLIDER_VALUES["duration"], config.DURATION) + test.endSection() - verify_request_rejection_mode(hd) + #scroll the screen to the title heparin bolus volume + parameter_object = set_parameter_type(text = config.HEPARIN_BOLUS_VOLUME) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) - parameter_object = set_parameter_type(text = config.CREATE_TREATMENT_PARAMETERS[0]) - utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable, direction="Top") + test.startSection("verification of heparin dispensing rate values") + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinDispensingRate_SliderCreateTreatment).label, config.HEPARIN_DISPENSING_RATE, "Parameter should be -> "+str(config.HEPARIN_DISPENSING_RATE)) + for heparin_dispensing_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_DISPENSING_RATE]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinDispensingRateSlider_Slider, heparin_dispensing_rate, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_dispensing_rate"], config.HEPARIN_DISPENSING_RATE) + test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinDispensingRateValue_Text).text, "OFF text should display for value 0") + test.endSection() - #verification of create treatment screen after request rejection - verify_custom_treatment_record_rejected() + test.startSection("verification of heparin bolus volume values") + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinBolusVolume_SliderCreateTreatment).label, config.HEPARIN_BOLUS_VOLUME, "Parameter should be -> "+str(config.HEPARIN_BOLUS_VOLUME)) + for heparin_bolus_volume in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_BOLUS_VOLUME]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider, heparin_bolus_volume, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_bolus_volume"], config.HEPARIN_BOLUS_VOLUME) + test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinBolusVolumeValue_Text).text, "OFF text should display for value 0") + test.endSection() + + #scroll the screen to the title acid concentrate type + parameter_object = set_parameter_type(text = config.HEPARIN_TYPE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) - parameter_object = set_parameter_type(text = config.CREATE_TREATMENT_PARAMETERS[0]) + test.startSection("verification of heparin stop time values") + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinStopTime_SliderCreateTreatment).label, config.HEPARIN_STOP_TIME, "Parameter should be -> "+str(config.HEPARIN_STOP_TIME)) + for heparin_stop_time in config.CREATE_TREATMENT_PARAMETER_RANGE[config.HEPARIN_STOP_TIME]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, heparin_stop_time, config.CREATE_TREATMENT_SLIDER_VALUES["heparin_stop_time"], config.HEPARIN_STOP_TIME) + test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_heparinStopTimeValue_Text).text, "OFF text should display for value 0") + test.endSection() + + test.startSection("verification of saline bolus values") + test.compare(waitForObject(names.o_PreTreatmentCreate_salineBolus_SliderCreateTreatment).label, config.SALINE_BOLUS_TITLE, "Parameter should be -> "+str(config.SALINE_BOLUS)) + for saline_bolus in config.CREATE_TREATMENT_PARAMETER_RANGE[config.SALINE_BOLUS]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_salineBolusSlider_Slider, saline_bolus, config.CREATE_TREATMENT_SLIDER_VALUES["saline_bolus"], config.SALINE_BOLUS) + test.endSection() + + #scroll the screen to the title acid concentrate type + parameter_object = set_parameter_type(text = config.ACID_CONCENTRATE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of heparin type") + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect_GridSelection).labels, config.HEPARIN_TYPE, "Parameter should be -> "+str(config.HEPARIN_TYPE)) + mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect)) + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect).text.text, config.HEPARIN_TYPE, "heparin text should be :"+ str(config.HEPARIN_TYPE)) + test.compare(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.endSection() + + #scroll the screen to the title dialyste rectangle + parameter_object = set_parameter_type(text = config.DIALYZER_TYPE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of acid concentrate type") + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect_GridSelection).title, config.ACID_CONCENTRATE_TITLE, "Parameter should be -> "+str(config.ACID_CONCENTRATE_TITLE)) + mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect).text.text, config.ACID_CONCENTRATE[0], "Acid concentrate value should be :"+str(config.ACID_CONCENTRATE[0])) + + + mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect1_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect1_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect1_TouchRect).text.text, config.ACID_CONCENTRATE[1], "Acid concentrate value should be :"+str(config.ACID_CONCENTRATE[1])) + + mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect2_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect2_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect2_TouchRect).text.text, config.ACID_CONCENTRATE[2], "Acid concentrate value should be :"+str(config.ACID_CONCENTRATE[2])) + + mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect3_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect3_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_acidConcentrateRect3_TouchRect).text.text, config.ACID_CONCENTRATE[3], "Acid concentrate value should be :"+str(config.ACID_CONCENTRATE[3])) + test.endSection() + + #scroll the screen to the title dialyste rectangle + parameter_object = set_parameter_type(text = config.DIALYZER_TYPE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of bicarbonate concentrate rectangle") + test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect_GridSelection).title, config.BICARBONATE_CONCENTRATE_TITLE, "Parameter should be -> "+str(config.BICARBONATE_CONCENTRATE_TITLE)) + mouseClick(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect).text.text, config.BICARBONATE_CONCENTRATE, "Bicarbonate concentrate value should be :"+str(config.ACID_CONCENTRATE[0])) + test.endSection() + + #scroll the screen to the title dialyste temperature value + parameter_object = set_parameter_type(text = config.DIALYSATE_TEMPERATURE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of dialysate rectangle") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect_GridSelection).title, config.DIALYZER_TYPE_TITLE, "Parameter should be -> "+str(config.DIALYZER_TYPE_TITLE)) + mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect0_TouchRect).text.text, config.DIALYZER_TYPE[0], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[0])) + + mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect).text.text, config.DIALYZER_TYPE[1], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[1])) + + mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect2_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect2_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect2_TouchRect).text.text, config.DIALYZER_TYPE[2], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[2])) + + mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect3_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect3_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect3_TouchRect).text.text, config.DIALYZER_TYPE[3], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[3])) + + mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect4_TouchRect) + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect4_TouchRect).bgColor.name, config.TREATMENT_HIGHLIGHTED_COLOR, str(config.HEPARIN_TYPE)+" checkbox should be highlighted") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialyzerTypeRect4_TouchRect).text.text, config.DIALYZER_TYPE[4], "Dialyzer type value should be :"+str(config.DIALYZER_TYPE[4])) + test.endSection() + + #scroll the screen to the title blood pressure measurement interval + parameter_object = set_parameter_type(text = config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test.startSection("verification of dialysate temperature values") + test.compare(waitForObject(names.o_PreTreatmentCreate_dialysateTemperature_SliderCreateTreatment).label, config.DIALYSATE_TEMPERATURE, "Parameter should be -> "+str(config.DIALYSATE_TEMPERATURE)) + for dialysate_temperature in config.CREATE_TREATMENT_PARAMETER_RANGE[config.DIALYSATE_TEMPERATURE]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateTemperatureSlider_Slider, dialysate_temperature, config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_temperature"], config.DIALYSATE_TEMPERATURE) + test.endSection() + + #scroll the screen to the title rinseback flow rate + parameter_object = set_parameter_type(text = config.RINSEBACK_FLOW_RATE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + set_arterial_low_and_high_limits_using_slider() + set_venous_low_and_high_limits_using_slider() + + test.startSection("verification of blood pressure measurement interval values") + test.compare(waitForObject(names.o_PreTreatmentCreate_bloodPressureMeasurementInterval_SliderCreateTreatment).label, config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL, "Parameter should be -> "+str(config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL)) + for blood_pressure_measurement_interval in config.CREATE_TREATMENT_PARAMETER_RANGE[config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, blood_pressure_measurement_interval, config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) + test.compare(config.OFF_TEXT, waitForObject(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalValue_Text).text, "OFF text should display for value 0") + test.endSection() + + test.startSection("verification of rinseback flow rate values") + test.compare(waitForObject(names.o_PreTreatmentCreate_rinsebackFlowRate_SliderCreateTreatment).label, config.RINSEBACK_FLOW_RATE, "Parameter should be -> "+str(config.RINSEBACK_FLOW_RATE)) + for rinseback_flow_rate in config.CREATE_TREATMENT_PARAMETER_RANGE[config.RINSEBACK_FLOW_RATE]: + test_custom_treatment_slider(names.o_PreTreatmentCreate_rinsebackFlowRateSlider_Slider, rinseback_flow_rate, config.CREATE_TREATMENT_SLIDER_VALUES["rinseback_flow_rate"], config.RINSEBACK_FLOW_RATE) + test.endSection() + + test.endSection() + + +def create_custom_values_for_treatment(): + """ + Method to set create custom treatment slider value based on user input + """ + test.startSection("Method to set treatment value based on user input") + + #flicker screen into blood dialysate section + parameter_object = set_parameter_type(text = config.BLOOD_FLOW_RATE) utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable, direction="Top") - + #set custom values for parameters - create_custom_treatment_record( - blood_flow_rate = CREATE_TREATMENT_SLIDER_VALUES["Blood Flow Rate"][2], - dialysate_flow_rate = CREATE_TREATMENT_SLIDER_VALUES["Dialysate Flow Rate"][2], - Duration = CREATE_TREATMENT_SLIDER_VALUES["Duration"][2], - heparin_dispensing_rate = CREATE_TREATMENT_SLIDER_VALUES["Heparin Dispensing Rate"][2], - heparin_bolus_volume = CREATE_TREATMENT_SLIDER_VALUES["Heparin Bolus Volume"][2], - heparin_stop_time = CREATE_TREATMENT_SLIDER_VALUES["Heparin Stop Time"][2], - saline_bolus = CREATE_TREATMENT_SLIDER_VALUES["Saline Bolus Volume"][0], - dialysate_temperature = CREATE_TREATMENT_SLIDER_VALUES["Dialysate Temperature"][2], - venous_pressure_low_limits = CREATE_TREATMENT_SLIDER_VALUES["Venous Pressure Limit Low"][2], - venous_pressure_high_limits = CREATE_TREATMENT_SLIDER_VALUES["Venous Pressure Limit High"][2], - arterial_pressure_low_limit = CREATE_TREATMENT_SLIDER_VALUES["Arterial Pressure Limit Low"][2], - arterial_pressure_high_limit = CREATE_TREATMENT_SLIDER_VALUES["Arterial Pressure Limit High"][2], - blood_pressure_measurement_interval = CREATE_TREATMENT_SLIDER_VALUES["Blood Pressure Measure Interval"][2], - rinseback_flowrate = CREATE_TREATMENT_SLIDER_VALUES["Rinseback Rate"][2], - index = 2 - ) + test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodFlowRateSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.BLOOD_FLOW_RATE], config.CREATE_TREATMENT_SLIDER_VALUES["blood_flow_rate"], config.BLOOD_FLOW_RATE) + test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateFlowRateSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.DIALYSATE_FLOW_RATE], config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_flow_rate"], config.DIALYSATE_FLOW_RATE) + test_custom_treatment_slider(names.o_PreTreatmentCreate_durationSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.DURATION], config.CREATE_TREATMENT_SLIDER_VALUES["duration"], config.DURATION) + + #scroll the screen to the title heparin bolus volume + parameter_object = set_parameter_type(text = config.HEPARIN_BOLUS_VOLUME) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + #set custom values for parameters + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinDispensingRateSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.HEPARIN_DISPENSING_RATE], config.CREATE_TREATMENT_SLIDER_VALUES["heparin_dispensing_rate"], config.HEPARIN_DISPENSING_RATE) + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinBolusVolumeSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.HEPARIN_BOLUS_VOLUME], config.CREATE_TREATMENT_SLIDER_VALUES["heparin_bolus_volume"], config.HEPARIN_BOLUS_VOLUME) - verify_request_continue_mode(hd) + #scroll the screen to the title acid concentrate type + parameter_object = set_parameter_type(text = config.HEPARIN_TYPE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + #set custom values for parameters + test_custom_treatment_slider(names.o_PreTreatmentCreate_heparinStopTimeSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.HEPARIN_STOP_TIME], config.CREATE_TREATMENT_SLIDER_VALUES["heparin_stop_time"], config.HEPARIN_STOP_TIME) + test_custom_treatment_slider(names.o_PreTreatmentCreate_salineBolusSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.SALINE_BOLUS], config.CREATE_TREATMENT_SLIDER_VALUES["saline_bolus"], config.SALINE_BOLUS) - verify_operational_details_from_confirm_treatment_screen(index = 2) - verify_prescriptional_details_from_confirm_treatment_screen(index = 2) + #scroll the screen to the title acid concentrate type + parameter_object = set_parameter_type(text = config.ACID_CONCENTRATE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + mouseClick(waitForObject(names.o_PreTreatmentCreate_heparinTypeRect0_TouchRect)) - utils.waitForGUI(.5) + #scroll the screen to the title dialyste rectangle + parameter_object = set_parameter_type(text = config.DIALYZER_TYPE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + mouseClick(names.o_PreTreatmentCreate_acidConcentrateRect0_TouchRect) + + #scroll the screen to the title dialyste rectangle + parameter_object = set_parameter_type(text = config.DIALYZER_TYPE_TITLE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + mouseClick(names.o_PreTreatmentCreate_bicarbonateConcentrateRect0_TouchRect) + + #scroll the screen to the title dialyste temperature value + parameter_object = set_parameter_type(text = config.DIALYSATE_TEMPERATURE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + mouseClick(names.o_PreTreatmentCreate_dialyzerTypeRect1_TouchRect) + + #scroll the screen to the title blood pressure measurement interval + parameter_object = set_parameter_type(text = config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + test_custom_treatment_slider(names.o_PreTreatmentCreate_dialysateTemperatureSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.DIALYSATE_TEMPERATURE], config.CREATE_TREATMENT_SLIDER_VALUES["dialysate_temperature"], config.DIALYSATE_TEMPERATURE) + + #scroll the screen to the title rinseback flow rate + parameter_object = set_parameter_type(text = config.RINSEBACK_FLOW_RATE) + utility.scroll_to_zone(parameter_object, names.o_treatment_create_flickable) + + #set custom values for parameters + test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL], config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) + test_custom_treatment_slider(names.o_PreTreatmentCreate_rinsebackFlowRateSlider_Slider, config.CREATE_CUSTOM_TREATMENT[config.RINSEBACK_FLOW_RATE], config.CREATE_TREATMENT_SLIDER_VALUES["rinseback_flow_rate"], config.RINSEBACK_FLOW_RATE) + + test.endSection() + + +def main(): + + utils.tstStart(__file__) + startApplication(config.AUT_NAME) + + hd_simulator.cmd_send_hd_operation_mode(4, 0) + + test.log("Verification of page step indicator from patient id page") + utility.page_step_indicator_verification(PRE_TREATMENT_STEP, names.o_PreTreatmentBase_nextStepsBullet_StepBullet) + + mouseClick(waitForObject(names.o_input_patient_id)) + type(waitForObject(names.o_input_patient_id), config.PATIENT_ID) + mouseClick(waitForObject(names.o_confirm_button)) + + test.log("Verification of page step indicator from create custom treatment page") + utility.page_step_indicator_verification(PRE_TREATMENT_STEP, names.o_PreTreatmentCreate_nextStepsBullet_StepBullet) + + verify_create_custom_treatment_parameter() + + verify_request_rejection_mode() + + #verification of create treatment screen after request rejection + verify_custom_treatment_record_rejected() + + create_custom_treatment_record() + + verify_request_continue_mode() + verify_the_confirm_treatment_screen_is_displayed() + mouseClick(waitForObject(names.o_back_button_confirm_treatment)) + + #set custom values for treatment parameters + create_custom_values_for_treatment() + + verify_request_continue_mode() + + #verification of records from confirm treatment screen + verify_the_confirm_treatment_screen_is_displayed() + verify_operational_details_from_confirm_treatment_screen() + verify_prescriptional_details_from_confirm_treatment_screen() + utils.tstDone()