Index: shared/scripts/configuration/config.py =================================================================== diff -u -r741e5fa12b6970490bd1ddecbed3e43494d4cd66 -r09c151304b448aecfed8a67c28800d161018641e --- shared/scripts/configuration/config.py (.../config.py) (revision 741e5fa12b6970490bd1ddecbed3e43494d4cd66) +++ shared/scripts/configuration/config.py (.../config.py) (revision 09c151304b448aecfed8a67c28800d161018641e) @@ -12,6 +12,7 @@ # @date (last) 08-July-2022 # ############################################################################ + import os from pathlib import Path from configuration.strings import * @@ -22,8 +23,8 @@ # -K, --enable-acknow-log Enables Acknowledgment Log AUT_NAME = "denaliSquish -k -K -S" -CONFIG_PATH = Path(os.getcwd()) -HOME_DIR_PATH = CONFIG_PATH.parent.parent.parent +HOME_DIR_PATH = "/home/denali" + SERVICE_CONF_LOCATION ="".join([str(HOME_DIR_PATH),'/Projects/application/resources/settings/Settings/System.conf']) #Post Treatment log file location @@ -56,11 +57,11 @@ GOODEVENING_START_TIME_SEC = 43200 NUM_OF_REQUEST_REJECT_REASONS = 46 #Number of settings change reject codes -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"} + +#Disinfection +DISINFECT_TREATMENT_ID = ["_headStepBullet","_nextStepsBullet"] + CURRENT_COLOR = '#000000' COMPLETE_COLOR = '#4290ec' ENABLED_COLOR = '#fcfcfc' @@ -505,4 +506,9 @@ #heparin cumualtive values HEPARIN_VALUES = {"Cumulative Value": [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 1.0, 15.0, 17.8, 20.0]} +COMPLETE_COLOR= '#4290ec' +ENABLED_COLOR = '#fcfcfc' +INCOMPLETE_COLOR = '#607a91' +NUM_OF_REQUEST_REJECT_REASONS = 46 + Index: shared/scripts/configuration/strings.py =================================================================== diff -u -ra53831cea0eb42896e18bba5fd32e47c667e4c61 -r09c151304b448aecfed8a67c28800d161018641e --- shared/scripts/configuration/strings.py (.../strings.py) (revision a53831cea0eb42896e18bba5fd32e47c667e4c61) +++ shared/scripts/configuration/strings.py (.../strings.py) (revision 09c151304b448aecfed8a67c28800d161018641e) @@ -8,11 +8,98 @@ # # @file strings.py # -# @author (last) LTTS -# @date (last) 18-Jan-2022 -# +# @author (last) LTTS +# @date (last) 14-June-2022 ############################################################################ + +BLOOD_PRIMING_UNIT = "mL" +BLOOD_PRIMING_VALUE_0 = "0" +BLOOD_PRIMING_DEFAULT_VALUE = BLOOD_PRIMING_VALUE_0 + " " + BLOOD_PRIMING_UNIT + +#pretreatment_screen_bullets +PRE_TREATMENT_SCREENS = ["Create" , "Sample" , "Consumables" , "Disposables" , "Prime" , "Ultrafiltration" , "BP/HR" , "Connection" , "Start"] +POST_TREATMENT_SCREENS = ["Disconnection", "Review", "Disposables", "Disinfection"] + + +#main_treatment_ultrafilteration +ULTRAFILTRATION_PAUSED_TEXT = "Ultrafiltration Paused" +INCREASE_UF_RATE_TEXT = "Increase UF Rate" +INCREASE_TREATMENT_DURATION_TEXT = "Increase Treatment Duration" +RESUME_TEXT = "RESUME ULTRAFILTRATION" +EDIT_TEXT = "EDIT ULTRAFILTRATION VOLUME" +TITLE_TEXT = "ULTRAFILTRATION VOLUME (L)" + +#recirculate screens +RECIRCULATE_TEXT = "Recirculate" +RECONNECT_BUTTON_TEXT = "RECONNECT" +# 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" +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 line connector.", + 3 : "Connect arterial and venous cartridge lines to your patient access lines." +} + +#rinseback-setup +RINSE_BACK_SETUP_TEXT = "Rinseback Setup" +RINSEBACK_BUTTON_TEXT = "START RINSEBACK" +BACK_TO_TREATMENT_BUTTON_TEXT = "BACK TO TREATMENT" +END_IMAGE_BUTTON_TEXT = "End" +DECELERATE_BUTTON_TEXT = "Decelerate" +ACCELERATE_BUTTON_TEXT = "Accelerate" +PAUSE_BUTTON_TEXT = "Pause" +RESUME_BUTTON_TEXT = "Resume" +RINSEBACK_TEXT = "Rinseback" +RINSEBACK_COMPLETE_TEXT = "Rinseback Complete" +END_TREATMENT_BUTTON_TEXT = "END TREATMENT" +BACK_TO_RECIRCULATE_TEXT = "BACK TO RECIRCULATE" +RECONNECT_TEXT = "Reconnect" + +#main treatment pressure +PRESSURE_TITLE = "PRESSURES" +ARTERIAL_TITLE = "Arterial" +VENOUS_TITLE = "Venous" +VENOUS_UOM = "mmHg" +ARTERIAL_UOM = "mmHg" +LOW_TEXT = "LOW" +HIGH_TEXT = "HIGH" + +#main-treatment heparin +HEPARIN_TEXT = "HEPARIN" +HEPARIN_UNIT = "mL" +HEPARIN_DELIVERY_TEXT = "HEPARIN DELIVERY" +HEPARIN_DELIVERY_OFF_TEXT = "OFF" +HEPARIN_STOP_TEXT = "Delivery Stopped" +HEPARIN_RESUME_DELIVERY_TEXT = "RESUME DELIVERY" +HEPARIN_BOLUS_ACTIVE_TEXT = "Bolus Active" +HEPARIN_BOLUS_DISPENSING_TEXT = "Dispensing Active" +HEPARIN_PAUSE_DELIVERY_TEXT = "PAUSE DELIVERY" +HEPARIN_MAXIMUM_VOLUME_DELIVERED_TEXT = "Maximum Cumulative Heparin Volume Delivered" +HEPARIN_SYRINGE_EMPTY_TEXT = "Syringe Empty" +HEPARIN_DISPENSING_RATE = "Heparin Dispensing Rate" +HEPARIN_BOLUS_VOLUME = "Heparin Bolus Volume" +HEPARIN_STOP_TIME = "Heparin Stop Time" +HEPARIN_TYPE_TITLE = "Heparin Type" +VOLUME_DELIVERED_TEXT = "Volume Delivered" +VOLUME_DELIVERED = "0.0" +TREATMENT_TEXT = "Treatment" +TRENDING_TEXT = "Trending" +SETTINGS_TEXT = "Settings" + + #Disinfection string constants DISINFECT_TEXT = "Disinfection" CHEMICAL_DISINFECT_TEXT = "Chemical Disinfect" @@ -75,3 +162,900 @@ 45: "REQUEST_REJECT_REASON_DG_CONCENTRATE_CAP_OPEN", # Concentrate cap open 46: "NUM_OF_REQUEST_REJECT_REASONS" # Number of settings change reject codes } + + +#Alarm List +UNDEFINED_ALARM_ID_MSG = "ALARM_ID_UNDEFINED" +ALARM_TITLE = "Alarm" +ALARM_LIST_TITLE = "Alarm list" +ALARM_PRIORITIES = {1: "LOW", 2: "MEDIUM", 3: "HIGH"} + +ALARM_PRIORITY_OPTIONS = { + 0 : 'ALARM_PRIORITY_NONE' , + 1 : 'ALARM_PRIORITY_LOW' , + 2 : 'ALARM_PRIORITY_MEDIUM', + 3 : 'ALARM_PRIORITY_HIGH', +} + +#Manager +TREATMENT_MANAGEMENT_TEXT = "Treatment Management" +MANAGER_TEXT = "Manager" + +#Setting +DEVICE_SETTINGS_TEXT = "Device Settings" +DEVICE_SETTINGS_SCREEN_PARAMETER = ["Information", "Volume And Brightness", "Wi-Fi", "Bluetooth Cuff", "DG Cleaning", "Service", "Export Logs"] +CLEAR_ALARM_CONDITION_TEXT = "Clear Alarm Condition" +EXPORT_LOGS ="Export Logs" +EXPORT_LOG_TEXT ="Export Logs" +SHUTDOWN_BUTTON_TEXT = "SHUTDOWN" +BACK_BUTTON_TEXT = "BACK" +EXPORT_LOGS_OPTIONS = ["Application", "Treatment", "Service"] +SD_CARD_DETAILS =["SD-Card (MB)", "Free : 0.000","Total: 0.000"] +USB_DRIVE_DETAILS = ["USB Drive (MB)","Free : 0.000","Total: 0.000"] +EXPORT_BUTTON_TEXT = "Export" +SettingsHome_Treatment_Text = "Treatment" +SettingsHome_Manager_Text = "Manager" +SettingsHome_Settings_Text = "Settings" +SERVICE_SCREEN_TITLE_TEXT = "Service" +SERVICE_SCREEN_PARAMETER = ["Information", "Volume And Brightness", "Wi-Fi", "Bluetooth Cuff", "Dialysate Generator Settings", "Services"] + +#create custom treatment +TREATMENT_TITLE = "Create a Custom Treatment" +CONFIRM_TREATMENT_TITLE = "Confirm Treatment" +PRESCRIPTION_TITLE = "PRESCRIPTION" +OPERATING_PARAMETERS_TITLE = "OPERATING PARAMETERS" +PATIENT_ID_TEXT = "Patient ID" +BLOOD_FLOW_RATE = "Blood Flow Rate" +DIALYSATE_FLOW_RATE = "Dialysate Flow Rate" +DURATION = "Duration" +SALINE_BOLUS_VOLUME = "Saline Bolus Volume" + +#main treatment screen +VITALS_TITLE = "VITALS" + + +PATIENT_ID = "demopatientid" +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"] + +SKIP_TEXT = "SKIP" +ON_TEXT = "ON" +OFF_TEXT = "OFF" +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" : "mL/min", "Venous Pressure Limit High": "mmHg", + "Venous Pressure Limit Low": "mmHg" +} + +#Time_Duration +TREATMENT_PAUSED_TEXT = "Treatment Paused" + +#pre-treatment +CONSUMABLE_SELF_TEST_TEXT = "Consumables Self Test" +BICARB_PUMP_CHECK_TEXT = "BiCarb Pump Check" +ACID_PUMP_CHECK_TEXT = "Acid Pump Check" +SELF_TEST_COMPLETE_TEXT = "Self Test Complete!" +BUSY = "Busy" +CHECK = "Check" +BEGIN_PRIME_TITLE = "Begin Prime" +PRIMING_TITLE = "Priming" +SYSTEM_SELF_TEST_TITLE = "System Self Test" +FILTER_FLUSH_TITLE = "Filter Flush" + +#Pre-Treatment Disposables +NEXT_BUTTON_TEXT = "NEXT" +BACK_BUTTON_TEXT = "BACK" +CONFIRM_BUTTON_TEXT = "CONFIRM" + +#Pre_treatment_water_sample +SAMPLE_TEXT = "Sample" +CREATE_TEXT = "Create" +WATER_SAMPLE_BUTTON_TEXT = "WATER SAMPLE" +PASS_TEXT = "PASS" +FAIL_TEXT = "FAIL" +OK_TEXT = "OK" + +#Vitals & pretreatment_patient_connection +SYSTOLIC_TEXT = "systolic" +DIASTOLIC_TEXT = "diastolic" + +#priming +TEST_DRY_STEPS = ["Used Cartridge Check", "Occlusion Sensors Check", "Pressure Sensors Check", "Syringe Pump Check"] +PRIMING_STEPS = ["Blood Circuit Priming", "Dialysate Circuit Priming", "Wet Self Tests"] +SELF_TEST_COMPLETION_MSG = "Self Test Complete!" +PRIMING_COMPLETE_MSG = "Priming Complete!" + +#main_treatment_flows +FLOW_UNIT = "mL/min" +BLOOD_FLOW_TEXT = "blood" +DIALYSATE_FLOW_TEXT = "dialysate" + +LIQUID_UNIT = "mL" + + +#tst_treatment_monitoring +FLOWS_TEXT = "FLOWS" +BLOOD_UNIT = "mL/min" +DIALYSATE_TEXT = "Dialysate" +BLOOD_TEXT = "Blood" +VITALS_TEXT = "VITALS" +BLOOD_PRESSURE_TEXT = "mmHg" +HEARTRATE_UNIT = "BPM" +PRESSURE_TEXT = "PRESSURE (mmHg)" +ARTEREAL_TEXT = "Arterial" +VENOUS_TEXT = "Venous" +TIME_DURATION_TEXT = "Time Remaining" +ULTRAFILTERATION_TEXT = "ULTRAFILTRATION VOLUME (L)" +SALINE_BOLUS = "SALINE BOLUS" +VOLUME_DELIVERED = "Volume Delivered" +CUMULATIVE_DELIVERED = "Cumulative Delivered" + +OFF_TEXT = "OFF" + +#post-treatment +PATIENT_DISCONNECTION_TEXT = "Patient Disconnection" +REVIEW_TEXT = "Review" +PATIENT_DISCONNECTION_CONFIRM_BUTTON_TEXT = "CONFIRM" +DISPOSABLE_TEXT = "Disposables" +NEXT_TEXT = "NEXT" +BACK_TEXT = "BACK" +CONFIRM_TEXT = "CONFIRM" +DISPOSABLES_REMOVAL_TEXT = "Disposables Removal" + +#post treatment review +TREATMENT_REVIEW_TITLE_TEXT = "Treatment Review" +HEPARIN_TYPE = "UFH 1,000 IU/mL" +ACID_CONCENTRATE = ["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", "F Optiflux F200NRe"] +TREATMENT_REVIEW_TITLE_TEXT = "Treatment Review" +EXPORT_TEXT = "Export" +CODE_TEXT = "Code: " +CODE_TEXT_AFTER_LOGGING = "Code: ..." + +POST_TREATMENT_REVIEW_SCREEN_UNITS = { + "Patient ID" : "", + "Heparin Bolus Volume": "mL", + "Heparin Stop" : "min", + "Heparin Dispense Rate" : "mL/hr", + "Heparin Bolus Volume" : "mL", + "Heparin Delivered Volume": "mL", + "Blood Flow Rate" : "mL/min", + "Treatment Start DateTime" : "", + "Dialysate Flow Rate" : "mL/min", + "Treatment End DateTime" : "", + "Treatment Duration" : "min", + "Water Sample Test Result": "", + "Actual Treatment Duration":"min", + "Dialysate Volume Used" : "L", + "Acid ConcentrateType" : "", + "Prescribed UF Volume" : "L", + "Bicarbonate Concentrate Type" : "", + "Target UF Volume" : "L", + "Potassium Concentration" : "mEg/L", + "Actual UF Volume" : "L", + "Calcium Concentration" :"mEg/L", + "Prescribed UF Rate" : "mL/min", + "Bicarbonate Concentration" : "mEg/L", + "Target UF Rate": "mL/min", + "Sodium Concentration" : "mEg/L", + "Actual UF Rate": "mL/min", + "Dialysate Temperature" :"C", + "Saline Bolus Volume" : "mL", + "Dialyzer Type" : "", + "Heparin Type" : "", + "Heparin Concentration" : "IU/mL", + } + +#Information +INFORMATION_TITLES = ["Information", "Versions"] +INFORMATION_PARAMETERS = ["Information", "UI Version", "HD Version", "HD FPGA Version", "HD Serial Number", "DG Version", "DG FPGA Version", "DG Serial Number"] +SERVICE_TEXT = "Service" +SERVICES_PARAMETERS = ["HD Last Service Date", "HD Next Service Date", "DG Last Service Date", "DG Next Service Date"] + +#volume and brightness +VOLUME_AND_BRIGHTNESS_TEXT = "Volume And Brightness" +BRIGHTNESS_TEXT = "Brightness" +ALARM_VOLUME_TEXT = "Alarm Volume" +NOTIFICATION_MESSAGE_TEXT = "The response value is incorrect. [1007]" +CONFIRM_TEXT = "CONFIRM" +SERVICE_BACK_BTN = "BACK" +UNIT_OF_VOLUME_AND_BRIGHTNESS = "%" + +#services +SHUTDOWN_TEXT = "SHUTDOWN" + +# pretreatment_patient_connection & ui logs +ACK_REQ_STATUS = 'Ack Req' +ACK_BAK_STATUS = 'Ack Bak' +PATIENT_CONNECTION_TEXT = "Patient Connection" +UF_VOLUME_TEXT = "Ultrafiltration Volume (L)" +UF_TITLE_TEXT = "Ultrafiltration Setup" +BP_HR_TEXT = "BP/HR" +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." +} + +#End treatment +RINSEBACK_BUTTON_TEXT = "START RINSEBACK" +END_TREATMENT_COMPLETE_STATE_TEXT = "Treatment Complete" +END_TREATMENT_COMPLETE_PAUSED_STATE_TEXT = "Treatment Complete Paused" + +#rinseback-setup +RINSE_BACK_SETUP_TEXT = "Rinseback Setup" +RINSEBACK_BUTTON_TEXT = "START RINSEBACK" +END_IMAGE_BUTTON_TEXT = "End" +DECELERATE_BUTTON_TEXT = "Decelerate" +ACCELERATE_BUTTON_TEXT = "Accelerate" +PAUSE_BUTTON_TEXT = "Pause" +RESUME_BUTTON_TEXT = "Resume" +RINSEBACK_TEXT = "Rinseback" +RINSEBACK_COMPLETE_TEXT = "Rinseback Complete" +END_TREATMENT_BUTTON_TEXT = "END TREATMENT" +ADDITIONAL_BUTTON_TEXT = "ADDITIONAL" +ADDITIONAL_RINSEBACK_TEXT = "Additional Rinseback" +RINSEBACK_UNIT = " mL" +RINSEBACK_UNIT_MIN = " mL/min" + + +ALARM_ID_AND_MESSAGES = { + +0 : "Indication for when no alarms is a possible situation." , +1 : "Stuck button POST failure.\nStop or Off button detected to be pressed for at least 1 second during test shortly after power up." , +2 : "HD FPGA POST failure." , +3 : "DG FPGA POST failure." , +4 : "HD Watchdog POST failure." , +5 : "DG Watchdog POST failure.", +6 : "UI communication POST failure.\nUI failed to communicate within a reasonable time after power up." , +7 : "HD RTC battery low." , +8 : "HD accelerometer failed POST." , +9 : "DG accelerometer failed POST." , +10 : "Not used.", +11 : "HD dialysate temperature below target temperature." , +12 : "HD firmware image integrity POST test failed.", +13 :"DG firmware image integrity POST test failed." , +14 :"DG invalid usage record CRC.", +15 :"HD invalid usage record CRC." , +16 :"HD alarm audio failed POST." , +17 :"HD UI POST failed." , +18 :"DG load cells invalid calibration record." , +19 :"HD dialysate temperature above target temperature." , +20 :"DG conductivity sensors invalid calibration record." , +21 :"DG drain line volume invalid calibration record." , +22 :"DG reservoirs invalid calibration record.", +23 :"DG acid concentrate calibration record." , +24 :"DG bicarb concentrate calibration record." , +25 :"DG accelerometer invalid calibration record." , +26 :"HD accelerometer invalid calibration record." , +27 :"Not used.", +28 :"Not used." , +29 :"HD heparin force sensor invalid calibration record.", +30 :"HD Software fault.\nSoftware found itself in an unexpected state." , +31 :"Blood pump failed motor controller current check.\nToo high when pump should be off or out of range when pump should be running.", +32 :"Blood pump failed motor off check.\nMeasured speed while commanded off." , +33 :"Blood pump failed motor direction check.\nMeasured vs commanded.", +34 :"Blood pump failed rotor speed check.\nMismatch with rotor and motor speeds." , +35 :"Dialysis inlet pump failed motor controller current check.\nToo high when pump should be off or out of range when pump should be running.", +36 :"Dialysis inlet pump failed motor off check.\nMeasured speed while commanded off.", +37 :"Dialysis inlet pump failed motor direction check.\nMeasured vs commanded.", +38 :"Dialysis inlet pump failed rotor speed check.\nMismatch with rotor and motor speeds." , +39 :"Dialysis outlet pump failed motor controller current check.\nToo high when pump should be off or out of range when pump should be running.", +40 :"Dialysis outlet pump failed motor off check.\nMeasured speed while commanded off.", +41 :"Dialysis outlet pump failed motor direction check.\nMeasured vs commanded." , +42 :"Dialysis outlet pump failed rotor speed check.\nMismatch with rotor and motor speeds." , +43 :"HD blood leak self test fault." , +44 :"User interface communication timeout." , +45 :"HD too many bad communications CRC." , +46 :"System message that required acknowledgment was not acknowledged." , +47 :"Ultrafiltration rate is too high error during treatment." , +48 :"Ultrafiltration volume accuracy error during treatment." , +49 :"HD FPGA communication down for too long." , +50 :"FPGA not accepting commanded valve states." , +51 :"Blood pump failed motor speed check.\nMeasured vs commanded.", +52 :"Dialysate inlet pump failed motor speed check.\nMeasured vs commanded." , +53 :"Dialysate outlet pump failed motor speed check.\nMeasured vs commanded." , +54 :"HD critical data integrity check failed.", +55 :"DG critical data integrity check failed." , +56 :"HD accelerometer error (no readings or FPGA reports error)." , +57 :"DG accelerometer error (no readings or FPGA reports error)." , +58 :"HD valve homing failed." , +59 :"HD valve transition time out." , +60 :"HD valve not functional." , +61 :"HD valve current out of range." , +62 :"HD valve position out of target." , +63 :"FPGA reports failure reading arterial pressure sensor." , +64 :"FPGA reports failure reading venous pressure sensor." , +65 :"HD requests DG command with invalid parameter fault." , +66 :"HD blood leak sensor set point set failure." , +67 :"HD blood pump occlusion self-test failure alarm." , +68 :"HD active reservoir recirculation out of range." , +69 :"HD blood leak sensor invalid calibration record." , +70 :"HD arterial pressure self-test failure alarm." , +71 :"HD venous pressure self-test failure alarm." , +72 :"Not used." , +73 :"Not used." , +74 :"HD blood leak detector self-test transmit timeout." , +75 :"HD syringe pump self-test failure alarm.", +76 :"HD monitored voltage is out of range." , +77 :"DG monitored voltage is out of range." , +78 :"HD syringe pump direction (from encoder) error." , +79 :"HD syringe pump direction (from controller) error." , +80 :"HD syringe pump fault reported by FPGA.", +81 :"HD syringe pump over travel error." , +82 :"HD syringe pump DAC write failure." , +83 :"HD syringe pump is running while the BP is off." , +84 :"HD venous pressure sensor not being read." , +85 :"HD pump track latch opened alarm." , +86 :"HD BP occlusion sensor not being read." , +87 :"DG heating invalid calibration record." , +88 :"DG concentrate pumps hall sensor out of range.", +89 :"HD BP occlusion sensor error." , +90 :"DG load cells FPGA read error." , +91 :"HD No dialysate flow data receive in the last 3 seconds." , +92 :"DG conductivity sensor bad status." , +93 :"DG outlet primary conductivity out of range." , +94 :"DG pressure out of range." , +95 :"DG watchdog expired." , +96 :"Inlet water temperature in high range." , +97 :"Fill conductivity out of range.", +98 :"HD battery communication fault.", +99 :"HD syringe pump stall alarm." , +100 :"HD no cartridge self-test timeout.", +101 :"HD dry self-test timeout.", +102 :"DG heat disinfect temperature gradient out of range." , +103 :"HD invalid calibration CRC.", +104 :"Air trap level sensors reporting illegal combination of air/fluid." , +105 :"DG invalid calibration CRC." , +106 :"DG dialysate flow sensor invalid calibration record.", +107 :"HD reports DG restarted fault." , +108 :"HD syringe pump ADC error." , +109 :"HD syringe pump volume check error." , +110 :"HD syringe pump speed check error." , +111 :"HD syringe pump not stopped in off state error.", +112 :"HD blood leak zero command transmit timeout." , +113 :"HD blood leak zero command fault." , +114 :"HD venous air bubble detector self-test failure." , +115 :"DG temperature sensor out of range.", +116 :"DG temperature sensor ADC fault." , +117 :"DG CAN message not acked." , +118 :"DG RTC config error." , +119 :"DG RTC battery low error.", +120 :"HD pre-treatment mode wet self-test prime check failure." , +121 :"DG main primary heater voltage out of range." , +122 :"DG small primary heater voltage out of range." , +123 :"DG trimmer heater voltage out of range." , +124 :"HD end of treatment alarm (high priority)." , +125 :"Blood sitting too long after treatment stopped by user alarm (>5 min).", +126 :"HD blood leak detected alarm." , +127 :"Venous pressure too low during treatment." , +128 :"HD venous air bubble detected alarm." , +129 :"HD venous air bubble detected rinseback alarm." , +130 :"Venous pressure too high during treatment." , +131 :"Arterial pressure too low during treatment." , +132 :"Arterial pressure too high during treatment." , +133 :"DG fluid leak detected alarm.", +134 :"HD fluid leak detected alarm." , +135 :"HD experienced large acceleration." , +136 :"DG experienced large acceleration." , +137 :"HD tilt exceeds maximum." , +138 :"DG tilt exceeds maximum." , +139 :"HD AC power lost alarm." , +140 :"Dialysate generator communication timeout." , +141 :"Air trap fill timeout during treatment.", +142 :"Blood pump occlusion detected." , +143 :"DG dialysate temperature sensors out of range.", +144 :"DG RO flow sensor invalid calibration record." , +145 :"Concentrate conductivity after adding acid out of range alarm.", +146 :"DG RTC or timer accuracy failure." , +147 :"Wait for the DG to produce dialysate." , +148 :"Inlet water temperature too high." , +149 :"HD watchdog expired." , +150 :"Inlet water conductivity in high range." , +151 :"Inlet water conductivity in low range." , +152 :"Inlet water pressure in low range." , +153 :"HD prime completed high priority alarm." , +154 :"EEPROM operations (read, write, erase) failure." , +155 :"Not used." , +156 :"Not used." , +157 :"DG chemical disinfect prime acid line timeout." , +158 :"Inlet water temperature is in the low range." , +159 :"Dialysate inlet pump failed flow vs motor speed check." , +160 :"Blood pump rotor speed too high." , +161 :"DG comm too many bad CRCs." , +162 :"DG FPGA clock speed check failure." , +163 :"HD sees primary load cell for reservoir 1 change too much too fast." , +164 :"HD sees primary load cell for reservoir 2 change too much too fast." , +165 :"HD in treatment rinseback operation timeout." , +166 :"HD in treatment re-circ sub-mode for too long." , +167 :"HD cartridge door opened alarm." , +168 :"HD active reservoir depletion timeout." , +169 :"Dialysate flow rate out of range." , +170 :"HD syringe empty alarm." , +171 :"HD syringe pump occlusion alarm.", +172 :"HD syringe pump not enough Heparin alarm." , +173 :"HD RTC configuration error." , +174 :"HD RTC or timer accuracy failure." , +175 :"HD pump direction status error." , +176 :"HD dialysate temperature out of high safety range." , +177 :"DG software fault.\nSoftware found itself in an unexpected state." , +178 :"HD communication timeout." , +179 :"DG FPGA communication down for too long." , +180 :"DG load cell ADC error." , +181 :"DG load cells weight out of range for tare." , +182 :"DG load cells invalid calibration.", +183 :"DG invalid load cell value." , +184 :"Inlet or Outlet UV reactor not healthy." , +185 :"DG fan RPM out of range." , +186 :"DG concentrate pump fault." , +187 :"DG concentrate pump CP1 speed control error." , +188 :"DG concentrate pump CP2 speed control error." , +189 :"DG drain pump RPM out of range." , +190 :"DG drain pump off fault." , +191 :"DG flow rate out of upper range." , +192 :"DG flow rate out of lower range." , +193 :"HD dialysate temperature out of low safety range." , +194 :"DG RO pump duty cycle out of range." , +195 :"DG RO pump pressure out of range." , +196 :"DG temperature sensor error bit fault." , +197 :"DG temperature sensors FPGA fault.", +198 :"RO flow too low while primary heater is on." , +199 :"Dialysate flow too low while trimmer heater is on." , +200 :"DG thermistors/sensors temperature out of range." , +201 :"HD pre-treatment mode wet self-test lc vs FMD failure." , +202 :"HD pre-treatment mode dry pressure normal self-test failure." , +203 :"Pressure sensor fault." , +204 :"RO rejection ratio out of range." , +205 :"Conductivity sensor fault." , +206 :"DG dialysate fill runs out of time." , +207 :"DG flow meter check failure alarm.", +208 :"HD venous pressure occlusion alarm." , +209 :"DG drain circulation line timeout." , +210 :"HD battery pack detected an error." , +211 :"Blood sitting too long warning (>4 min).", +212 :"HD end of treatment alarm (user not acting to end treatment).", +213 :"HD prime completed medium priority alarm." , +214 :"HD Saline bolus volume check failure." , +215 :"HD rinseback volume check failure." , +216 :"HD end treatment sub-mode timeout alarm." , +217 :"HD blood prime volume check failure.", +218 :"HD syringe detected alarm.", +219 :"HD syringe pump syringe removed alarm.", +220 :"HD battery pack SOC is too low." , +221 :"HD Saline bag is empty." , +222 :"HD dialysate temperature too high alarm." , +223 :"HD dialysate temperature too low alarm." , +224 :"Treatment stopped by user action." , +225 :"HD end of treatment warning." , +226 :"HD prime completed low priority alarm." , +227 :"HD prime out of time alarm.", +228 :"HD time out on prime sub-mode purge air state." , +229 :"HD prime dialysate dialyzer time out alarm." , +230 :"HD prime dialysate bypass time out alarm." , +231 :"HD pre-treatment mode dry pressure self-test failure." , +232 :"HD pre-treatment mode wet self-test LC vs LC failure.", +233 :"DG barometric sensor coefficients bad CRC." , +234 :"RTC (i.e read time) or RAM operations failure (read or write).", +235 :"HD in treatment stopped sub-mode after rinseback completed (no escalation).", +236 :"HD needs new cartridge to be installed." , +237 :"HD prime saline dialyzer time out alarm." , +238 :"HD no cartridge loaded or installed improperly alarm." , +239 :"HD fail to remove cartridge alarm." , +240 :"Bicarb conductivity out of range during bicarb pump check alarm." , +241 :"DG reservoir drain time out." , +242 :"DG reservoir fill time out." , +243 :"DG reservoir leak time out." , +244 :"DG temperature sensors difference out of range." , +245 :"DG heat disinfect target temperature time out (could not reach to temperature).", +246 :"DG heat disinfect inlet pressure and temperature sensors out of range." , +247 :"DG heat disinfect inlet conductivity and temperature out of range." , +248 :"DG chemical disinfect could not reach to target temperature." , +249 :"DG chemical disinfect inlet pressure and temperature sensors out of range." , +250 :"DG chemical disinfect inlet conductivity and temperature out of range.", +251 :"HD invalid system record." , +252 :"HD invalid service record." , +253 :"DG invalid system record." , +254 :"DG invalid service record." , +255 :"HD and UI software builds are not compatible." , +256 :"HD and DG software builds are not compatible." , +257 :"DG FPGA power out timeout." , +258 :"HD FPGA power out timeout.", +259 :"HD temperatures out of range.", +260 :"UI POST Application Integrity (Sha256Sum) failure.", +261 :"UI POST CANBus failure." , +262 :"UI POST Display failure." , +263 :"UI POST Touch failure." , +264 :"UI POST SD-Card failure." , +265 :"UI POST RTC failure." , +266 :"UI POST WiFi failure.", +267 :"UI POST Bluetooth failure." , +268 :"UI POST Ethernet failure." , +269 :"UI POST Sound failure." , +270 :"HD POST Safety Shutdown failure." , +271 :"DG POST Safety Shutdown failure." , +272 :"HD Fan RPM out of range.", +273 :"HD measured blood pump flow rate is out of range.", +274 :"HD measured dialysate inlet pump flow rate is out of range.", +275 :"HD arterial pressure sensor is reading out of range.", +276 :"HD venous pressure sensor is reading out of range.", +277 :"HD BP occlusion sensor is reading out of range." , +278 :"HD active reservoir weight out of range.", +279 :"DG dialysate drain time out." , +280 :"HD arterial pressure sensor read timeout error." , +281 :"Acid concentration bottle low volume alarm." , +282 :"Bicarbonate concentration bottle low volume alarm." , +283 :"DG load cells weight out of range." , +284 :"DG load cells primary/back up drift out of range.", +285 :"HD treatment recirculate timeout warning." , +286 :"HD treatment rinseback complete timeout warning." , +287 :"HD processor clock speed checks against FPGA clock failure.", +288 :"HD load cells primary/back up drift out of range." , +289 :"DG dialysate or concentrate caps not closed.", +290 :"DG flow too low while heater is on." , +291 :"Total number of alarms.", +292 :"HD processor is in Disinfect Heat mode.", +293 :"HD processor is in Disinfect Chemical mode.", +294 :"HD processor Disinfect Chemical mode instructions to user.", +295 :"Total number of alarms." + + } + + +ALARM_ID_AND_ALARM_MESSAGES = { + 0: "Indication for when no alarms is a possible situation", + 1: "Call service to schedule a repair.", + 2: "Call service to schedule a repair.", + 3: "Call service to schedule a repair.", + 4: "Call service to schedule a repair.", + 5: "Call service to schedule a repair.", + 6: "Call service to schedule a repair.", + 7: "Call service to schedule a repair.", + 8: "Call service to schedule a repair.", + 9: "Call service to schedule a repair." , + 10: "Not used.", + 11: "HD dialysate temperature below target temperature.", + 12: "Call service to schedule a repair.", + 13: "Call service to schedule a repair.", + 14: "DG invalid usage record CRC.", + 15: "HD invalid usage record CRC.", + 16: "Call service to schedule a repair.", + 17: "Call service to schedule a repair.", + 18: "Call service to schedule a repair.", + 19: "Call service to schedule a repair.", + 20: "Call service to schedule a repair.", + 21: "Call service to schedule a repair.", + 22: "Call service to schedule a repair.", + 23: "Call service to schedule a repair.", + 24: "Call service to schedule a repair.", + 25: "Call service to schedule a repair.", + 26: "Call service to schedule a repair.", + 27: "Not used.", + 28: "Not used.", + 29: "Call service to schedule a repair.", + 30: "Call service to schedule a repair.", + 31: "Call service to schedule a repair.", + 32: "Call service to schedule a repair.", + 33: "Call service to schedule a repair.", + 34: "Call service to schedule a repair.", + 35: "Call service to schedule a repair.", + 36: "Call service to schedule a repair.", + 37: "Call service to schedule a repair.", + 38: "Call service to schedule a repair.", + 39: "Call service to schedule a repair.", + 40: "Call service to schedule a repair.", + 41: "Call service to schedule a repair.", + 42: "Call service to schedule a repair.", + 43: "Call service to schedule a repair.", + 44: "Call service to schedule a repair.", + 45: "Call service to schedule a repair.", + 46: "Call service to schedule a repair.", + 47: "Call service to schedule a repair.", + 48: "Call service to schedule a repair.", + 49: "Call service to schedule a repair.", + 50: "Call service to schedule a repair.", + 51: "Call service to schedule a repair.", + 52: "Call service to schedule a repair.", + 53: "Call service to schedule a repair.", + 54: "Call service to schedule a repair.", + 55: "Call service to schedule a repair.", + 56: "Call service to schedule a repair.", + 57: "Call service to schedule a repair.", + 58: "Call service to schedule a repair.", + 59: "Call service to schedule a repair.", + 60: "Call service to schedule a repair.", + 61: "Call service to schedule a repair.", + 62: "Call service to schedule a repair.", + 63: "Call service to schedule a repair.", + 64: "Call service to schedule a repair.", + 65: "Call service to schedule a repair.", + 66: "Call service to schedule a repair.", + 67: "Call service to schedule a repair.", + 68: "Dialysate has recirculated for too long.", + 69: "Call service to schedule a repair.", + 70: "Call service to schedule a repair." , + 71: "Call service to schedule a repair.", + 72: "Not used.", + 73: "Not used.", + 74: "Call service to schedule a repair.", + 75: "Call service to schedule a repair.", + 76: "Call service to schedule a repair.", + 77: "Call service to schedule a repair.", + 78: "Call service to schedule a repair.", + 79: "Call service to schedule a repair.", + 80: "Call service to schedule a repair.", + 81: "Call service to schedule a repair.", + 82: "Call service to schedule a repair.", + 83: "Call service to schedule a repair.", + 84: "Call service to schedule a repair.", + 85: "Open front door and pull pump track lever all the way down.", + 86: "Call service to schedule a repair.", + 87: "DG heating invalid calibration record.", + 88: "DG concentrate pumps hall sensor out of range.", + 89: "Call service to schedule a repair.", + 90: "DG load cells FPGA read error.", + 91: "Call service to schedule a repair.", + 92: "DG conductivity sensor bad status.", + 93: "DG outlet primary conductivity out of range.", + 94: "DG pressure out of range.", + 95: "DG watchdog expired.", + 96: "Inlet water temperature in high range.", + 97: "Fill conductivity out of range.", + 98: "Call service to schedule a repair.", + 99: "Call service to schedule a repair.", + 100: "Call service to schedule a repair.", + 101: "Call service to schedule a repair.", + 102: "Call service to schedule a repair.", + 103: "Call service to schedule a repair.", + 104: "Call service to schedule a repair.", + 105: "Call service to schedule a repair.", + 106: "DG dialysate flow sensor invalid calibration record.", + 107: "Call service to schedule a repair.", + 108: "Call service to schedule a repair.", + 109: "Call service to schedule a repair.", + 110: "Call service to schedule a repair.", + 111: "Call service to schedule a repair.", + 112: "Call service to schedule a repair.", + 113: "Call service to schedule a repair.", + 114: "Call service to schedule a repair.", + 115: "Call service to schedule a repair.", + 116: "Call service to schedule a repair.", + 117: "Call service to schedule a repair.", + 118: "Call service to schedule a repair.", + 119: "Call service to schedule a repair.", + 120: "Call service to schedule a repair.", + 121: "Call service to schedule a repair.", + 122: "Call service to schedule a repair.", + 123: "Call service to schedule a repair.", + 124: "Blood has sat too long in the blood tubing set. No rinseback allowed.", + 125: "Blood has sat too long in the blood tubing set. Treatment must end.", + 126: "A blood leak has been detected. Treatment must end.", + 127: "Venous pressure is low. Check to be sure your blue venous connections are secure and that your venous access is intact." , + 128: "Venous air bubble detected. Check for air bubbles in the venous line. If bubbles are present, tap the tubing to move the bubbles up to the air trap. If bubbles cannot be removed, treatment must end.", + 129: "Venous air bubble detected. Check for air bubbles in the venous line. If bubbles are present, tap the tubing to move the bubbles up to the air trap. If bubbles cannot be removed, treatment must end.", + 130: "Venous pressure is high. Check to be sure your blue venous connections are secure and that there are no kinks or clots in the tubing.", + 131: "Arterial pressure is low. Check to be sure your red arterial connections are secure and that there are no kinks or clots in the tubing.", + 132: "Arterial pressure is low. Check to be sure your red arterial connections are secure and that your venous access is intact.", + 133: "Fluid leak detected in Dialysate Generation", + 134: "Fluid leak detected in Hemodialysis Delivery device. Clean up the spill before continuing." , + 135: "Excessive movement detected with Hemodialysis Delivery device. Confirm the device is stationary and level before continuing.", + 136: "Excessive movement detected with Dialysis Generation device. Confirm the device is stationary and level before continuing.", + 137: "Excessive tilt detected with Hemodialysis Delivery device. Confirm the device is stationary and level before continuing.", + 138: "Excessive tilt detected with Dialysis Generation device. Confirm the device is stationary and level before continuing.", + 139: "Power has been lost. Check all electrical connections. The display and CPU will run off of the battery until power returns.", + 140: "Communication failure with Dialysis Generator. Ensure all cords are securely connected.", + 141: "Failure to fill the Air Trap. Check the air trap vent line and the transducer protector. If the transducer protector is wet, replace it.", + 142: "Occlusion detected after the blood pump. Check for clots or kinks around the dialyzer and in the venous line.", + 143: "Call service to schedule a repair.", + 144: "DG RO flow sensor invalid calibration record.", + 145: "Dialysate conductivity is out of range. Check the acid dialysate concentrates and make sure the correct concentrate is connected.", + 146: "Call service to schedule a repair.", + 147: "Call service to schedule a repair.", + 148: "Inlet water temperature is high. Check the incoming water for issues with cold water supply.", + 149: "Inlet water temperature is low. Check the incoming water for issues with hot water supply.", + 150: "Inlet water conductivity is high. Check the incoming water for issues.", + 151: "Inlet water conductivity is low. Check the incoming water for issues.", + 152: "Inlet water pressure is low. Check the incoming water supply.", + 153: "Prime of the bloodlines is complete.", + 154: "Communication has been lost. Ensure all cords are securely connected.", + 155: "Not used.", + 156: "Not used.", + 157: "DG chemical disinfect prime acid line timeout.", + 158: "Inlet water temperature is in the low range.", + 159: "Dialysate pump failure. Check there are no kinks in the dialysate tubing.", + 160: "Blood pump failure. Check the pump rotor for secure connection.", + 161: "Call service to schedule a repair.", + 162: "DG FPGA clock speed check failure.", + 163: "Ultrafiltration error.", + 164: "Ultrafiltration error.", + 165: "Maximum Rinseback time exceeded. Rinseback must end.", + 166: "Maximum Recirculation time exceeded. Treatment must end.", + 167: "Hemodialysis Delivery device door open.", + 168: "Dialysate recirculation error.", + 169: "Call service to schedule a repair.", + 170: "Heparin syringe empty. Option to resume treatment without heparin.", + 171: "Heparin pump occlusion detected. Check heparin line is unclamped and there are no kinks in the heparin line.", + 172: "Not enough heparin is available for treatment. Check if syringe pump is touching syringe plunger. If syringe pump is touching syringe plunger, end treatment. If syringe pump is not touching syringe plunger, reload syringe with enough heparin.", + 173: "Call service to schedule a repair.", + 174: "Call service to schedule a repair.", + 175: "Blood pump eailure. Check the pump rotor for secure connection.", + 176: "HD dialysate temperature out of high safety range.", + 177: "Call service to schedule a repair.", + 178: "HD communication timeout.", + 179: "Call service to schedule a repair.", + 180: "Call service to schedule a repair.", + 181: "Call service to schedule a repair.", + 182: "Call service to schedule a repair.", + 183: "Call service to schedule a repair.", + 184: "Call service to schedule a repair.", + 185: "Fan failure. Check that the fans inlets are not blocked or obstructed.", + 186: "Call service to schedule a repair.", + 187: "Call service to schedule a repair.", + 188: "Call service to schedule a repair.", + 189: "Call service to schedule a repair.", + 190: "Call service to schedule a repair.", + 191: "Call service to schedule a repair.", + 192: "Call service to schedule a repair.", + 193: "HD dialysate temperature out of low safety range.", + 194: "Call service to schedule a repair.", + 195: "Call service to schedule a repair.", + 196: "Call service to schedule a repair.", + 197: "Call service to schedule a repair.", + 198: "Call service to schedule a repair.", + 199: "Dialysate flow too low while trimmer heater is on.", + 200: "Call service to schedule a repair.", + 201: "Inlet water quality is bad.", + 202: "Inlet water quality is bad.", + 203: "Call service to schedule a repair.", + 204: "Call service to schedule a repair.", + 205: "Call service to schedule a repair.", + 206: "Call service to schedule a repair.", + 207: "Call service to schedule a repair.", + 208: "Call service to schedule a repair.", + 209: "Call service to schedule a repair.", + 210: "Battery pack error.", + 211: "Maximum time for blood stoppage has been exceeded.", + 212: "Maximum time for blood stoppage has been exceeded.", + 213: "Prime of the bloodlines is complete.", + 214: "Inability to deliver saline bolus. Check for kinks or clamped lines in the saline line.", + 215: "Unable to complete Rinseback. Check for kinks or clamped blood lines.", + 216: "Treatment has ended", + 217: "Blood prime error. Check for kinks or clamped blood lines.", + 218: "Heparin syringe not detected.", + 219: "Heparin syringe removed.", + 220: "Battery pack error.", + 221: "Saline back appears empty. Please check saline bag and line and replace if saline bag is empty.", + 222: "Dialysate temperature high.", + 223: "Dialysate temperature low.", + 224: "Treatment paused.", + 225: "Treatment has ended", + 226: "Prime of the bloodlines is complete.", + 227: "Maximum time for blood prime has been exceeded.", + 228: "Priming failure. Check blood and dialysate lines for clamps and kinks.", + 229: "Priming failure. Check blood and dialysate lines for clamps and kinks.", + 230: "Priming failure. Check blood and dialysate lines for clamps and kinks.", + 231: "Self Test Failure. Please ensure the disposable cartridge is completely installed and the handle moved to the down position.", + 232: "Self Test Failure. Please ensure the disposable cartridge is completely installed and the handle moved to the down position. Check for closed clamps or kinks in the tubing.", + 233: "DG barometric sensor coefficients bad CRC.", + 234: "Communication failure. Ensure all cords are securely connected.", + 235: "Rinseback has been completed.", + 236: "New cartridge needs to be installed.", + 237: "HD prime saline dialyzer time out alarm.", + 238: "Cartridge not loaded or loaded improperly. Check that a cartridge is properly installed.", + 239: "Cartridge not unloaded, or unloaded improperly. Check that the cartridge has been removed.", + 240: "Dialysate conductivity out of range. Check the bicarbonate dialysate concentrates and make sure the correct concentrate is connected.", + 241: "Call service to schedule a repair.", + 242: "Call service to schedule a repair.", + 243: "Call service to schedule a repair.", + 244: "Call service to schedule a repair.", + 245: "Call service to schedule a repair.", + 246: "Call service to schedule a repair.", + 247: "Call service to schedule a repair.", + 248: "Call service to schedule a repair.", + 249: "Call service to schedule a repair.", + 250: "Call service to schedule a repair.", + 251: "Call service to schedule a repair.", + 252: "Call service to schedule a repair.", + 253: "Call service to schedule a repair.", + 254: "Call service to schedule a repair.", + 255: "Call service to schedule a repair.", + 256: "Call service to schedule a repair.", + 257: "Call service to schedule a repair.", + 258: "HD FPGA power out timeout.", + 259: "Call service to schedule a repair.", + 260: "Call service to schedule a repair.", + 261: "Call service to schedule a repair.", + 262: "Call service to schedule a repair.", + 263: "Call service to schedule a repair.", + 264: "Power cycle the system.\nCall service to schedule a repair if problem persist.", + 265: "Call service to schedule a repair.", + 266: "Call service to schedule a repair.", + 267: "Call service to schedule a repair.", + 268: "Call service to schedule a repair.", + 269: "Call service to schedule a repair.", + 270: "Call service to schedule a repair.", + 271: "Call service to schedule a repair.", + 272: "Fan failure. Check that the fans inlets are not blocked or obstructed.", + 273: "Call service to schedule a repair.", + 274: "Call service to schedule a repair.", + 275: "Call service to schedule a repair.", + 276: "Call service to schedule a repair.", + 277: "Call service to schedule a repair.", + 278: "Ultrafiltration error.", + 279: "DG dialysate drain time out.", + 280: "Call service to schedule a repair.", + 281: "Acid concentrate low. Replace acid concentrate bottle.", + 282: "Bicarbonate concentrate low. Replace bicarbonate concentrate bottle.", + 283: "Call service to schedule a repair.", + 284: "Call service to schedule a repair.", + 285: "Dialysate recirculation error.", + 286: "Rinseback complete.", + 287: "Call service to schedule a repair.", + 288: "Call service to schedule a repair.", + 289: "Check dialysate/concentrate caps.", + 290: "DG flow too low while heater is on.", + 291: "HD processor is in Disinfect Flush mode.", + 292: "HD processor is in Disinfect Heat mode.", + 293: "HD processor is in Disinfect Chemical mode.", + 294: "HD processor Disinfect Chemical mode instructions to user.", + 295: "Total number of alarms." + } + +ALARM_PRIORITIES = {1: "LOW", 2: "MEDIUM", 3: "HIGH"} +ALARM_LIST_TITLE = "Alarm list" + +# dictionary of rejection reason from application source code. +# message location -> denali-> Headers-> common-> MsgDefs.h + +#wifi +WIFI_TITLE_TEXT = "Wi-Fi" +IP_ADDRESS_TEXT = "IP Address" +GATEWAY_TEXT = "Gateway" +SUBNET_MASK_TEXT = "Subnet Mask" +DNS_TEXT = "DNS" +SSID_TEXT = "SSID" +SCAN_TEXT = "SCAN" +SCAN_FINISHED_TEXT = "Scan Finished" + +#Bluetooth cuff +BLUETOOTH_CUFF_TITLE_TEXT = "Bluetooth Cuff" +DEVICES_TEXT = "Devices" +BLUETOOTH_CUFF_NOTIFICATION_MESSAGE_TEXT = "The Bluetooth cuff pair clear error. [1001]" + +OPERATIONAL_PARAMETERS = {"Heparin Type": HEPARIN_TYPE, "Acid Concentrate": "Fres. Naturalyte", + "Bicarbonate Concentrate": BICARBONATE_CONCENTRATE, "Dialyzer Type": "BB Diacap Pro 16H"} + + + +#Settings +BLOOD_PRIMING_TEXT = "Blood Priming" +SALINE_UNIT = "mL" + +#DG Cleaning +DG_CLEANING_TITLE_TEXT = "DG Cleaning" +WATER_FLUSH_TEXT = "Water Flush" +HEAT_DISINFECTION_TEXT = "Heat Disinfection" +WATER_FLUSH_TIME_TEXT = "Time (HH:MM)" +WATER_FLUSH_CYCLE_TEXT = "Cycle (Days)" +HEAT_DISINFECTION_TIME_TEXT = "Time (HH:MM)" +HEAT_DISINFECTION_CYCLE_TEXT = "Cycle (Days)" + + Index: shared/scripts/configuration/utility.py =================================================================== diff -u -ra53831cea0eb42896e18bba5fd32e47c667e4c61 -r09c151304b448aecfed8a67c28800d161018641e --- shared/scripts/configuration/utility.py (.../utility.py) (revision a53831cea0eb42896e18bba5fd32e47c667e4c61) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 09c151304b448aecfed8a67c28800d161018641e) @@ -6,19 +6,945 @@ # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file utils.py -# -# @author (last) Joseph varghese + +# @author (last) LTTS # @date (last) 15-Jan-2022 # ############################################################################ -import squish -import object +import builtins +import csv +import glob +import math import names +import os +import object +import sys +import squish +import time import test +from builtins import format +from builtins import str as pyStr +from builtins import int as pyInt from configuration import config +from dialin.ui import utils +from dialin.utils import * +from dialin.common.msg_ids import MsgIds +from dialin.ui.hd_simulator import HDSimulator +from dialin.protocols import DenaliMessage, DenaliCanMessenger, DenaliChannels +from datetime import timezone +from datetime import datetime + + +def color_verification(exp_val = "Red", act_val = "#c53b33"): + test.compare(config.COLOR_CODES[color_name],(act_val.color[name])) + + +def get_text_object(screen_obj, txt): + """ + To obtain a text object based on text provided + @param screen_obj: provides the container on which the txt must be present + @returns a real name object + """ + names.o_text_object["container"] = screen_obj + names.o_text_object["text"] = txt + return names.o_text_object + +def get_bullet_object(screen_obj, num): + """ + To obtain a bullet object based on occurrence provided. + @param screen_obj: provides the container on which the bullet must be present + @param num: provides the occurrence value + @returns a real name object + """ + names.o_bullet_object["container"] = screen_obj + names.o_bullet_object["occurrence"] = num + 1 + return names.o_bullet_object + +def get_indicators(screen_obj, txt): + """ + Verifying the busy indicators for BiCarb Pump Check and Acid Pump Check. + indicator object of expected text + @param step - (str) expected text + @return indicators - (obj) list of busy and check indicator + """ + parent_obj = object.parent(squish.waitForObjectExists(get_text_object(screen_obj,txt))) + children_obj = object.children(parent_obj) + indicator_parent = children_obj[2] + indicators = object.children(indicator_parent) + return indicators + + +def check_if_object_is_within_the_container(obj=None, container=None): + """ + check if an object is inside a container + @param obj - child UI object + @param container - container UI object + @return boolean True/False + """ + container = squish.findObject(container) + containerPos = container.mapToGlobal(squish.QPoint(0, 0)) + container_x, container_y = pyInt(containerPos.x), pyInt(containerPos.y) + container_width, container_height = pyInt(container.width), pyInt(container.height) + + obj = squish.findObject(obj) + objPos = obj.mapToGlobal(squish.QPoint(0, 0)) + obj_x, obj_y = pyInt(objPos.x), pyInt(objPos.y) + obj_width, obj_height = pyInt(obj.width), pyInt(obj.height) + + if obj_x >= container_x and obj_y >= container_y: + if (obj_x + obj_width) <= (container_x + container_width) and (obj_y + obj_height) <= (container_y + container_height): + return True + + return False + + +def pressure_pop_up_text_obj(text): + names.o_pop_up_pressure_text_obj["text"] = text + return names.o_pop_up_pressure_text_obj + return names.o_bullet_object + + +def verify_bullet_navigation(num, num_of_instructions, screen_obj): + """ + Method to verify status of bullets based + on number of instruction screen + @param num - (int) number of indicator + @param num_of_instructions- (int) count the number of instructions + @param object - screen_obj - (str) Screen object + """ + test.startSection("instruction bullet verification for screens") + for instruction in range(1, num_of_instructions): + bullet_children = object.children(squish.waitForObjectExists(get_bullet_object(screen_obj,(0 + instruction) - 1))) + bullet_circle_color = bullet_children[0].color.name + bullet_border_color = bullet_children[0].border.color.name + if instruction <= num: + test.compare(bullet_circle_color, config.COMPLETE_COLOR) + test.compare(bullet_border_color,config.COMPLETE_COLOR) + test.log(str(instruction) + " Complete bullet") + else: + test.compare(bullet_circle_color, config.CURRENT_COLOR) + test.compare(bullet_border_color,config.INCOMPLETE_COLOR) + test.log(str(instruction) + " Incomplete bullet") + test.endSection() + +def convert_seconds_into_min_and_sec(seconds, time_format="%M:%S"): + """ + Method to convert seconds into minute format. + @param seconds - time in seconds. + @param time_format (str) - time format. + @return (int) - minute time + """ + seconds = int(seconds) + min_and_sec = time.strftime(time_format, time.gmtime(seconds)) + return min_and_sec + + +def verify_missing_object(object_to_check): + """ + Method to verify the given object is invisible or is not present on the screen + @param object_to_check: the object whose invisibility must be verified + """ + try: + squish.testSettings.objectNotFoundDebugging = False + squish.waitForObject(object_to_check,3000) + test.fail("Given object should not be present initially") + except LookupError as _: + test.passes("object is not present as expected") + squish.testSettings.objectNotFoundDebugging = True + + +def pressure_pop_up_text_obj(text): + names.o_pop_up_pressure_text_obj["text"] = text + return names.o_pop_up_pressure_text_obj + +def pressure_text_obj(text): + names.o_pressure_text_obj["text"] = text + return names.o_pressure_text_obj + +def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M'): + date = datetime.now() + return str(date.strftime(date_format)) + + +def vitals_reading_obj(reading): + names.o_vitals_reading["text"] = reading + return names.o_vitals_reading + + +def enter_keypad_value(entry): + """ + Method to enter user desired + value using keypad + @param entry: (int) User expected value + """ + test.startSection("Entering {}".format(entry)) + entry = pyStr(entry) + for value in entry: + squish.mouseClick(squish.waitForObject(keypad_input(value))) + test.endSection() + +def erase_entered_value(input_field): + """ + Method to erase the entered value + @param input_field - (obj) object of input field + """ + test.startSection("Erasing value") + input_field= squish.waitForObject(input_field) + entered_value = str(input_field.text) + for value in range(len(entered_value)+1): + utils.waitForGUI(0.1) + squish.mouseClick(squish.waitForObjectExists(names.o_back_space_key)) + test.compare(str(input_field.text), "", "Input field should be empty") + test.endSection() + +def vitals_reading_obj(reading): + names.o_vitals_reading["text"] = reading + return names.o_vitals_reading + +def keypad_input(key_value): + names.o_keypad_input["text"] = key_value + return names.o_keypad_input + + +def scroll_to_zone(zone=None, screen_object=None, direction = None): + """ + scroll to the to the value if object is hidden + @param value - (obj) value object + @param container - (obj) Container of the value + @return boolean true and false + """ + counter = 0 + while counter <= 100: + try: + counter += 1 + squish.findObject(zone) + squish.snooze(0.5) + if check_if_object_is_within_the_container(obj=zone, container=screen_object): + return True + else: + raise RuntimeError + except RuntimeError: + ScreenObj = squish.findObject(screen_object) + screenHeight = pyInt(ScreenObj.height) + screenWidth = pyInt(ScreenObj.width) + if direction is None: + squish.mouseWheel(ScreenObj, (screenWidth-100), 107, 0, -(screenHeight-460), squish.Qt.NoModifier) + else: + squish.mouseWheel(ScreenObj, (screenWidth-100), -(screenHeight-700), 0, 200, squish.Qt.NoModifier) + + raise LookupError("zone object is not in view to the user after trying 100 times") + + +def get_alarm_id_obj(id): + names.o_alarm_id["text"] = id + return names.o_alarm_id + +def get_alarm_msg_obj(msg): + names.o_alarm_message["text"] = msg + return names.o_alarm_message + +def rejection_msg(text): + names.o_rejection_msg["text"] = text + return names.o_rejection_msg + +def verify_page_step_indicator(screen_obj, treatment_step, treatment_screens): + """ + Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] + @param treatment_step : indicates the Current treatment step + """ + test.startSection("verification of page step indicators") + for page in range(len(treatment_screens)): + bullet_children = object.children(squish.waitForObjectExists(get_bullet_object(screen_obj, page))) + bullet_circle_color = bullet_children[0].color.name + bullet_border_color = bullet_children[0].border.color.name + step_title = squish.waitForObjectExists(get_text_object(screen_obj, treatment_screens[page])) + + #To verify the step indicators of the completed treatment screens + if page < treatment_step: + test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) + test.compare(bullet_circle_color, config.COMPLETE_COLOR) + test.compare(bullet_border_color,config.COMPLETE_COLOR) + test.compare(step_title.color.name,config.ENABLED_COLOR) + #To verify the step indicators of the current treatment screen + elif page == treatment_step: + test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) + test.compare(bullet_circle_color, config.CURRENT_COLOR) + test.compare(bullet_border_color, config.COMPLETE_COLOR) + test.compare(step_title.color.name, config.ENABLED_COLOR) + test.verify(step_title.font.bold) + #To verify the step indicators of the remaining treatment screens + else: + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete,) + test.compare(step_title.color.name, config.INCOMPLETE_COLOR) + test.compare(bullet_circle_color, config.CURRENT_COLOR) + test.compare(bullet_border_color, config.INCOMPLETE_COLOR) + test.endSection() + + +def set_arterial_ranges_min_val(art_low): + """ + Method to set the Arterial range maximum value to user expected value + @param art_low - (int) user expected value + """ + 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() + +def set_venous_ranges_max_val(ven_high): + """ + Method to set the Venous range maximum value to user expected value + @param ven_high - (int) user expected value + """ + 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: + test.compare(ven_max, ven_high, "Actual Venous range maximum value: {} is equal to Expected value: {}".format(ven_max, ven_high)) + test.endSection() + +#Methods for create custom treatment +def set_venous_ranges_min_val(ven_low): + """ + Method to set the Venous range maximum value to user expected value + @param ven_low - (int) user expected value + """ + 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: + test.compare(ven_min, ven_low, "Actual Venous range minimum value: {} is equal to Expected value: {}".format(ven_min, ven_low)) + test.endSection() + + +def expected_heparin_value(val): + names.o_heparin_value["text"] = val + return names.o_heparin_value + + +def msg(string): + """ + Added ### at the right side of the string to make sure that it is a message. + @param string: (str) the string to add trailing ### to + @return pad_str: (str) padded string + """ + padded_str = "###"+string + return padded_str + +def navigate_to_pretreatment_screen(mode): + """ + Method to navigate to sub mode under pre-treatment screen + @param mode - (int) pre treatment state + """ + hd_simulator.cmd_set_hd_operation_mode_data(HDOpModes.MODE_PRET.value,0) + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=mode, water_sample_state=0, + consumables_self_test_state=0, no_cartridge_self_test_state=0, + installation_state=0, dry_self_test_state=0, prime_state=0, + recirculate_state=0, patient_connection_state=0) + +def self_test_dry_check_list_text(text): + names.o_self_test_dry_check_list_text["text"] = text + return names.o_self_test_dry_check_list_text + +def get_time(screen_title): + """ + Method to return the current count down + in the application + @param screen_title - (str) current title of the screen + @return time_text - (str) count down in the application + """ + if screen_title == config.BEGIN_PRIME_TITLE or screen_title == config.PRIMING_TITLE: + parent_object = object.parent(squish.waitForObjectExists(self_test_dry_check_list_text(screen_title))) + elif screen_title == config.SYSTEM_SELF_TEST_TITLE: + parent_object = object.parent(squish.waitForObjectExists(names.o_system_self_test)) + else: + parent_object = object.parent(squish.waitForObjectExists(names.o_PreTreatmentBase_Filter_Flush_Text)) + time_parent_children = object.children(parent_object) + progress_circle_parent = time_parent_children[4] + progress_circle_parent = object.children(progress_circle_parent) + progress_circle_parent = progress_circle_parent[0] + progress_circle_parent = object.children(progress_circle_parent) + progress_circle_children = object.children(progress_circle_parent[0]) + time_text = progress_circle_children[1] + return time_text.time + +def verify_countdown(screen_title, time_out, hd_simulator, dg_simulator): + """ + Method to verify the count down + time in application + @param screen_title - (str) current title of the screen + @param time_out - (int) time out duration in secs + @Param hd_simulator - Instance of class HDSimulator + @Param dg_simulator - Instance of class DGSimulator + """ + test.startSection("Verify the count down time in application") + for count_down in range(config.COUNT_DOWN_TIME_100, config.MINIMUM_COUNTDOWN_TIME-1, -1): + if screen_title == config.BEGIN_PRIME_TITLE: + hd_simulator.cmd_send_pre_treatment_self_test_dry_progress_data(time_out, count_down) + elif screen_title == config.PRIMING_TITLE: + hd_simulator.cmd_send_pre_treatment_disposables_prime_progress_data(time_out, count_down) + elif screen_title == config.SYSTEM_SELF_TEST_TITLE: + hd_simulator.cmd_send_pre_treatment_self_test_no_cartridge_progress_data(time_out, count_down) + else: + dg_simulator.cmd_send_dg_pre_treatment_filter_flush_progress_data(time_out, count_down) + actual_time = get_time(screen_title) + expected_time = convert_seconds_into_min_and_sec(count_down) + test.compare(actual_time, expected_time, "Actual count down time: {} should be equal to expected count down time {}".format(actual_time, expected_time)) + verify_the_progress(count_down, screen_title, time_out) + test.endSection() + +def verify_the_progress(count_down, screen_title, time_out): + """ + Method to verify the current progress + @param count_down - (int) current count down time + @param screen_title - (str) current title of the screen + @param time_out - (int) time out duration in secs + """ + test.startSection("Verifying the current progress") + if screen_title == config.BEGIN_PRIME_TITLE or screen_title == config.PRIMING_TITLE: + current_progress = (squish.waitForObjectExists(names.o_self_test_dry_progress)).progressValue + elif screen_title == config.SYSTEM_SELF_TEST_TITLE: + current_progress = (squish.waitForObjectExists(names.o_system_self_test_progress)).progressValue + else: + current_progress = (squish.waitForObjectExists(names.o_filter_flush_progress)).progressValue + #Since progress value is equal maximum count down value - current count down value + expected_progress = time_out - count_down + test.compare(current_progress, expected_progress, "{} should be the current progress".format(expected_progress)) + test.endSection() + +def verify_page_step_indicator(screen_obj, treatment_step, treatment_screens): + """ + Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] + @param treatment_step : (int) indicates the Current treatment step + """ + test.startSection("verification of page step indicators") + for page in range(len(treatment_screens)): + bullet_children = object.children(squish.waitForObjectExists(get_bullet_object(screen_obj, page))) + bullet_circle_color = bullet_children[0].color.name + bullet_border_color = bullet_children[0].border.color.name + step_title = squish.waitForObjectExists(get_text_object(screen_obj, treatment_screens[page])) + #To verify the step indicators of the completed treatment screens + if page < treatment_step: + test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) + test.compare(bullet_circle_color, config.COMPLETE_COLOR) + test.compare(bullet_border_color, config.COMPLETE_COLOR) + test.compare(step_title.color.name, config.ENABLED_COLOR) + #To verify the step indicators of the current treatment screen + elif page == treatment_step: + test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) + test.compare(bullet_circle_color, config.CURRENT_COLOR) + test.compare(bullet_border_color, config.COMPLETE_COLOR) + test.compare(step_title.color.name, config.ENABLED_COLOR) + test.verify(step_title.font.bold) + #To verify the step indicators of the remaining treatment screens + else: + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete,) + test.compare(step_title.color.name, config.INCOMPLETE_COLOR) + test.compare(bullet_circle_color, config.CURRENT_COLOR) + test.compare(bullet_border_color, config.INCOMPLETE_COLOR) + test.endSection() + +def verify_missing_object(object_to_check): + """ + Method to verify the given object is invisible or is not present on the screen + @param object_to_check: the object whose invisibility must be verified + """ + try: + squish.testSettings.objectNotFoundDebugging = False + squish.waitForObject(object_to_check,3000) + test.fail("Given object should not be present initially") + except LookupError as _: + test.passes("object is not present as expected") + squish.testSettings.objectNotFoundDebugging = True + +def get_text_object(screen_obj, txt): + """ + To obtain a text object based on text provided + @param screen_obj: provides the container on which the txt must be present + @returns a real name object + """ + names.o_text_object["container"] = screen_obj + names.o_text_object["text"] = txt + return names.o_text_object + + +def verify_color_of_entry(entry, vital_parameter, input_field): + """ + Method to verify the color of entry + of systolic, diastolic and heart rate + @param entry: (int) user user entered value + @param vital_parameter - (str) parameter name under which user is entering value (sys/dia/heart rate) + @param input_field - (obj) object of input field + """ + test.startSection("Verify the color of {} value {}".format(vital_parameter, entry)) + input_field_color = input_field.color.name + entry = pyInt(entry) + if vital_parameter is config.SYSTOLIC_TEXT: + if (entry < config.SYSTOLIC_LOWER_LIMIT) or (entry > config.SYSTOLIC_UPPER_LIMIT): + test.compare(input_field_color, config.OUT_OF_RANGE_COLOR, "systolic value {} is out of range, systolic value should be in range of {} and {}".format(entry, config.SYSTOLIC_LOWER_LIMIT, config.SYSTOLIC_UPPER_LIMIT)) + elif (entry >= config.SYSTOLIC_LOWER_LIMIT) and (entry <= config.SYSTOLIC_UPPER_LIMIT): + test.compare(input_field_color, config.IN_RANGE_COLOR, "systolic value {} is in range of {} and {}".format(entry, config.SYSTOLIC_LOWER_LIMIT, config.SYSTOLIC_UPPER_LIMIT)) + elif vital_parameter is config.DIASTOLIC_TEXT: + if (entry < config.DIASTOLIC_LOWER_LIMIT) or (entry > config.DIASTOLIC_UPPER_LIMIT): + test.compare(input_field_color, config.OUT_OF_RANGE_COLOR, "diastolic value {} is out of range, diastolic value should be in range of {} and {}".format(entry, config.DIASTOLIC_LOWER_LIMIT, config.DIASTOLIC_UPPER_LIMIT)) + elif (entry >= config.DIASTOLIC_LOWER_LIMIT) and (entry <= config.DIASTOLIC_UPPER_LIMIT): + test.compare(input_field_color, config.IN_RANGE_COLOR, "diastolic value {} is in range of {} and {}".format(entry, config.DIASTOLIC_LOWER_LIMIT, config.DIASTOLIC_UPPER_LIMIT)) + elif vital_parameter is config.HEART_RATE_TITLE: + if (entry < config.HEART_RATE_LOWER_LIMIT) or (entry > config.HEART_RATE_UPPER_LIMIT): + test.compare(input_field_color, config.OUT_OF_RANGE_COLOR, "Heart Rate value {} is out of range, Heart Rate value should be in range of {} and {}".format(entry, config.HEART_RATE_LOWER_LIMIT, config.HEART_RATE_UPPER_LIMIT)) + elif (entry >= config.HEART_RATE_LOWER_LIMIT) and (entry <= config.HEART_RATE_UPPER_LIMIT): + test.compare(input_field_color, config.IN_RANGE_COLOR, "Heart Rate value {} is in range of {} and {}".format(entry, config.HEART_RATE_LOWER_LIMIT, config.HEART_RATE_UPPER_LIMIT)) + test.endSection() + + +def keypad_input(key_value): + """ + Method to enter values using application UI keyboard + @param key_value: (str) User expected value + """ + if key_value is not None: + names.o_keypad_input["text"] = key_value + return names.o_keypad_input + else: + test.log("Invalid text for object.") + names.o_keypad_input["text"] = None + + +def enter_keypad_value(entry): + """ + Method to enter user desired + value using keypad + @param entry: (str) User expected value + """ + test.startSection("Entering {}".format(entry)) + entry = pyStr(entry) #type casted into string format + for value in entry: + squish.mouseClick(squish.waitForObject(keypad_input(value))) + test.endSection() + +def is_float(num): + """ + This function checks the value is adaptable for float conversion. + @param num - (string) input value for conversion. + @return True/False- (bool) returns True if the value can type casted into float, else False + """ + try: + if '.' in num: + float(num) + return True + except ValueError: + return False + +def is_intiger(num): + """ + This function checks the value is adaptable for integer conversion. + @param num - (string) (string) input value for conversion. + @return True/False- (bool) returns True if the value can type casted into int, else False + """ + try: + if num.isdigit(): + return True + except ValueError: + return False + +def get_extracted_file(): + """ + This function is the handler for getting file from log folder. + This handler will go inside log folder and looks for newly added log based on current time. + if it satisfied that condition, it will return the exact path of newly created log. + Application log file is automatically created on '/home/denali/Desktop/sd-card/log/ {current_date}_denaliSquish.log' + @return latest_file - (string) returns latest file that append on log folder from sd-data + """ + try: + current_date = get_current_date_and_time(date_format = "%Y_%m_%d") + latest_file = config.LOG_LOCATION + current_date + '_denaliSquish.log' + return latest_file + except: + return False + +def get_message_from_log(file_name, message_text): + + """ + This method intended to extract the message from application log. + For row[index], index represent column to be extracted. + @param file_name - (string) path of the latest log file created. + @param message_text - (string) message text to be extracted. + @return message - (list) API arguments displayed in log. + """ + message = [] + count = 0 + try: + with open(file_name, 'r') as csv_file: + try: + for row in reversed(list(csv.reader(csv_file))): + if row[0].isalpha(): + pass + else: + row_length = sum(1 for values in row) + if row_length >= 4: + if row[3]!= None and row[3] == message_text: + if count == 30: + test.fail("handler unable to find message text from log file.") + message_length = sum(1 for values in row) + for column in range(4, message_length, 1): + message.append(row[column]) + count +=1 + for value in range(len(message)): + float_status = is_float(message[value]) + int_status = is_intiger(message[value]) + if float_status is True: + message[value] = float(message[value]) + if int_status is True: + message[value] = int(message[value]) + test.log(str(message)) + return message + else: + pass + except: + test.fail("application log data is corrupted") + except: + test.fail("Log file is not created or log file is not created based on standard log naming format.") + +def get_ack_request_details(file_name, message_text): + """ + This method intended to extract acknowledgement request status, negative requested acknowledgement + and message id from application log. + For row[index], were index represent column to be extracted. + @param file_name - (string) path of the latest log file created. + @param message_text - (string) message text to be extracted from log. + @return row[3] - (string) acknowledgement request status. + @return row[4] - (string) Negative requested acknowledgement value (Sq). + @return message_id - (string) formatted message id from log. + """ + try: + message_id = " ID" + with open(file_name, 'r') as csv_file: + try: + for row in reversed(list(csv.reader(csv_file))): + if row[0].isalpha(): + pass + else: + row_length = sum(1 for values in row) + if row_length == 6 and row[3] != message_text: + if row[5].split(':')[0] == message_id: + extracted_message_id = pyInt(row[5].split(':')[1], 16) + formatted_message_id = format(extracted_message_id, '#0x') + # MSG_ID_HD_DEBUG_EVENT (0xFFF1) and MSG_ID_DG_DEBUG_EVENT (0xFFF2) hex values are reversed in log. + string_format_id = str(formatted_message_id) + first_two_char = string_format_id[2:4] + last_two_char = string_format_id[-2:] + if last_two_char != '00': + return row[3], row[4], ('0x'+last_two_char+first_two_char) + else: + return row[3], row[4], formatted_message_id.replace("00", "") + else: + pass + except: + test.fail("application log data is corrupted - unable to fetch data") + except: + test.fail("Log file is not created or log file is not created based on standard log naming format.") + +def get_bak_request_details(file_name, ack_bak_value): + """ + This method intended to extract the acknowledgement back status from application log. + For row[index], were index represent column to be extracted. + @param file_name - (string) path of the latest log file created. + @param ack_bak_value - (string) Positive back acknowledgement value (Sq). + @return row[3] - (string) acknowledgement back status. + """ + try: + with open(file_name, 'r') as csv_file: + try: + for row in reversed(list(csv.reader(csv_file))): + if row[0].isalpha(): + pass + else: + row_length = sum(1 for values in row) + if row_length >= 5: + if row[4] == ack_bak_value: + return row[3] + else: + pass + else: + pass + except: + test.fail("application log data is corrupted") + except: + test.fail("Log file is not created or log file is not created based on standard log naming format.") + + +def get_current_log_details(message_ack = False, message_text = None): + """ + This function is capable to perform data analysis from application log folder. + logs are automatically created in path :"/home/denali/Desktop/sd-card/log/*.log". + In row[index], index represent column to be extracted. + @param message_ack - (bool) 'True' - if ack is satisfied in log / 'False' - if ack condition is not satisfied + @param message_text - (string) message text to be extracted from log. + @return content_record - (list) list contains extracted data (ack_req, ack_bak, message, message_id). + """ + content_record = [] + file_name = get_extracted_file() + if message_text != None: + message = get_message_from_log(file_name, message_text) + content_record.append(message) + if message_ack != False: + ack_req_status, ack_req_value, message_id = get_ack_request_details(file_name, message_text) + ack_bak_value = ack_req_value.replace(":-", ":") # getting negative requested ack from positive requested ack + content_record.append(ack_req_status) + content_record.append(message_id.lower()) + if message_ack != False and ack_bak_value != None: + ack_bak_status = get_bak_request_details(file_name, ack_bak_value) + content_record.append(ack_bak_status) + return content_record + + +def vitals_interval_obj(interval): + names.o_time_interval_obj["text"] = interval + return names.o_time_interval_obj + +def keyboard_input(key_value): + names.o_keyboard_object["text"] = key_value + return names.o_keyboard_object + +def enter_keyboard_numeric_value(entry): + """ + Method to enter user desired + value using keypad + @param entry: (str) User expected value + """ + test.startSection("Entering {}".format(entry)) + for value in entry: + if value.isalpha(): + value = pyStr(value) + else: + value = pyInt(value) + key_val = squish.waitForObject(keyboard_input(value)) + squish.mouseClick(key_val) + utils.waitForGUI(0.1) + test.endSection() + + +def end_treatment_states_rejection_msg(text): + names.o_end_treatment_state_rejection_msg["text"] = text + return names.o_end_treatment_state_rejection_msg + +def verify_parameter_from_post_treatment_log(msg_text): + """ + To obtain the details of parameter from post treatment log file. + @param msg_text: parameter to be extracted. + @returns message value and message unit + """ + try: + log_location = str(get_extracted_file_from_post_treatment()) + with open(log_location, 'r') as csv_file: + try: + for row in csv_file: + reader = csv.reader(csv_file) + for row in reader: + row_length = sum(1 for values in row) + for row1 in row: + if row[0]!= None and row[0] == msg_text and row_length == 3: + return (row[1],row[2]) + else: + pass + except: + test.fail("Treatment log data is corrupted") + except: + test.fail("Log file is not created or log file is not created based on standard log naming format.") + +def get_extracted_file_from_post_treatment(): + """ + This function is the handler for getting file from log folder. + This handler will go inside log folder and looks for newly added log based on current time. + if it satisfied that condition, it will return the exact path of newly created log. + @return latest_file - (string) returns latest file that append on log folder from sd-data + """ + try: + list_of_files = glob.glob(config.POST_TREATMENT_LOG_LOCATION) + latest_file = max(list_of_files, key=os.path.getctime) + return latest_file + except: + test.fail("log file is not created during application interaction") + return False + + +def rinseback_rejection_msg(text): + names.o_rinseback_rejection_msg["text"] = text + return names.o_rinseback_rejection_msg + squish.testSettings.objectNotFoundDebugging = True + + +def recirculate_rejection_msg(text): + names.o_recirculate_rejection_msg["text"] = text + return names.o_recirculate_rejection_msg + + +def get_current_date_and_time_in_utc(date_format='%Y/%m/%d - %H:%M:%S'): + """ + Method to get current date and time. + @input date_format (str) - format of date to be retrieved. + @return (str) - date in specified format. + """ + date = datetime.now(timezone.utc) + return str(date.strftime(date_format)) + - def get_disinfect_bullet_object(id, screen_obj): """ To set a custom object based on item from parameters @@ -81,3 +1007,191 @@ names.o_disinfect_dynamic_StepBullet_Text["text"] = text return names.o_disinfect_dynamic_StepBullet_Text + +def append_cloudsync_credentials_file(): + """ + This function is used for creating .pem files in the cloudsync folder. + pem files is created on '/home/denali/Desktop/cloudsync/credentials' + """ + try: + os.makedirs(config.CLOUD_CREDENTIALS_LOCATION, exist_ok = True) + test.log("Directory created successfully") + for file_handler in range(len(config.PEM_FILES)): + path = os.path.join(config.CLOUD_CREDENTIALS_LOCATION, config.PEM_FILES[file_handler]) + with open(path, 'w') as file_reader: + pass + except OSError: + test.log("Directory can not be created") + + +def get_cloud_sync_input_file(): + """ + This function is the handler for getting file from log folder. + Application log file is automatically created on '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_inp.log' + @return latest_file - (string) returns latest input log file path from sd-data + """ + try: + current_date = get_current_date_and_time_in_utc(date_format = "%Y_%m_%d") + latest_file = config.INP_BUF_FILE_LOCATION+current_date+'_inp.buf' + return latest_file + except: + return False + + +def get_cloud_sync_output_file(): + """ + This function is the handler for getting file from log folder. + Application log file is automatically created on '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_out.log' + @return latest_file - (string) returns latest output log file path from sd-data + """ + try: + current_date = get_current_date_and_time_in_utc(date_format = "%Y_%m_%d") + latest_file = config.INP_BUF_FILE_LOCATION+current_date+'_out.buf' + return latest_file + except: + return False + + +def get_current_date_and_time_in_utc(date_format='%Y/%m/%d - %H:%M:%S'): + """ + Method to get current date and time. + @input date_format (str) - format of date to be retrieved. + @return (str) - date in specified format. + """ + date = datetime.now(timezone.utc) + return str(date.strftime(date_format)) + + +def get_extracted_input_buf_file(): + """ + This function is the handler for getting file from cloudsync folder. + This handler will go inside cloudsync folder and looks for newly added input buf file based on current time. + if it satisfied that condition, it will return the exact path of newly created input buf file. + Application input buf file is automatically created in '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_inp.buf' + @return latest_file - (string) returns latest file that append in cloudsync folder + """ + try: + current_date = get_current_date_and_time_in_utc(date_format = "%Y_%m_%d") + latest_file = config.INP_BUF_FILE_LOCATION + current_date + '_inp.buf' + return latest_file + except: + return False + +def retrive_log_data(readline_count = 1): + """ + This function is the handler for getting file from cloudsync folder. + Application log data is automatically appended on '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_inp.buf' + @param: (int) readline_count + @return: (list) cloudsync_data returns latest file that append in cloudsync folder + """ + cloudsync_data = [] + count = 0 + file_name = get_extracted_input_buf_file() + try: + with open(file_name,mode = 'r') as filereader: + contents = csv.reader(filereader) + try: + for reader in reversed(list(contents)): + if readline_count == count: + return cloudsync_data + cloudsync_data.append(reader) + count = count + 1 + except: + test.fail("application log data is corrupted") + except: + test.fail("Log file is not created or log file is not created based on standard log naming format.") + +def get_epoch_value_consistancy(current_epoch_value, expected_epoch_value): + """ + This function is verify consistancy of epoch value. + @input current_epoch_value (float) - current epoch time + @input expected_epoch_value (str) - epoch time from the cloud-sync log. + @return (bool) - True/False + """ + expected_epoch_value = int(expected_epoch_value) + maximum_epoch_value = int(current_epoch_value + 25) + minimum_epoch_value = int(current_epoch_value - 25) + + if expected_epoch_value > minimum_epoch_value and expected_epoch_value < maximum_epoch_value : + return True + return False + +def keyboard_input(key_value): + names.o_keyboard_object["text"] = key_value + return names.o_keyboard_object + +def enter_keyboard_numeric_value(entry): + """ + Method to enter user desired + value using keypad + @param entry: (str) User expected value + """ + test.startSection("Entering {}".format(entry)) + for value in entry: + if value.isalpha(): + value = pyStr(value) + else: + value = pyInt(value) + key_val = squish.waitForObject(keyboard_input(value)) + squish.mouseClick(key_val) + utils.waitForGUI(0.1) + test.endSection() + +def get_extracted_alarm_mapping_file(): + """ + This function is the handler for getting error file from service folder. + + Application log file is automatically created on '/home/denali/Desktop/sd-card/service/ {current_date}_denaliSquish.err ' + + @return latest_file - (string) returns latest file that append on log folder from service + """ + try: + latest_file = config.ALARM_MAPPING_CPP_FILE_LOCATION + return latest_file + except: + return False + + +def scroll_to_value_on_pop_up(value=None, container=None): + """ + scroll to the to the value if object is hidden + @param value - (obj) value object + @param container - (obj) Container of the value + @return boolean true and false + """ + counter = 0 + while counter <= 100: + try: + counter += 1 + squish.findObject(value) + squish.snooze(0.5) + if check_if_object_is_within_the_container(obj=value, container=container): + return True + else: + raise RuntimeError + except RuntimeError: + ScreenObj = squish.waitForObject(container) + screenHeight = pyInt(ScreenObj.height) + screenWidth = pyInt(ScreenObj.width) + squish.mouseWheel(ScreenObj, screenWidth//2, screenHeight//2, 0, -50, squish.Qt.NoModifier) + raise LookupError("value object is not in view to the user after trying 100 times") + + +def get_extracted_error_file(): + """ + This function is the handler for getting error file from service folder. + + Application log file is automatically created on '/home/denali/Desktop/sd-card/service/ {current_date}_denaliSquish.err ' + + @return latest_file - (string) returns latest file that append on log folder from service + """ + try: + current_date = get_current_date_and_time(date_format = "%Y_%m_%d") + latest_file = config.ERROR_FILE_LOCATION + current_date + '_denaliSquish.err' + return latest_file + except: + return False + + raise LookupError("value object is not in view to the user after trying 100 times") + + Index: shared/scripts/names.py =================================================================== diff -u -r86ad4f6650af063df9ffda1d589d4d988407b813 -r09c151304b448aecfed8a67c28800d161018641e --- shared/scripts/names.py (.../names.py) (revision 86ad4f6650af063df9ffda1d589d4d988407b813) +++ shared/scripts/names.py (.../names.py) (revision 09c151304b448aecfed8a67c28800d161018641e) @@ -1016,6 +1016,60 @@ o_SettingsBase_progressCircle_ProgressCircle_2 = {"container": o_SettingsBase_SettingsBase, "id": "_progressCircle", "occurrence": 2, "type": "ProgressCircle", "unnamed": 1, "visible": True} o_SettingsBase_image_Image = {"container": o_SettingsBase_SettingsBase, "id": "_image", "source": "qrc:/images/iEject", "type": "Image", "unnamed": 1, "visible": True} + +##Below set of objects are belongs to Disinfection-it is the combination of Heat,Flush and chemical disinfection. +#Disinfection +o_DisinfectStack_DisinfectStack = {"container": o_Gui_MainView, "objectName": "_DisinfectStack", "type": "DisinfectStack", "visible": True} +o_DisinfectStack_disinfectHome_TreatmentFlowBase = {"container": o_DisinfectStack_DisinfectStack, "objectName": "_disinfectHome", "type": "TreatmentFlowBase", "visible": True} +o_disinfectHome_TouchRect = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "type": "TouchRect", "unnamed": 1, "visible": True} +o_disinfectHome_swipeview_SwipeView = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "id": "_swipeview", "type": "SwipeView", "unnamed": 1, "visible": True} +o_swipeview_Disinfection1_Text = {"container": o_disinfectHome_swipeview_SwipeView, "text": "Disinfection1", "type": "Text", "unnamed": 1, "visible": True} +o_swipeview_Disinfection2_Text = {"container": o_disinfectHome_swipeview_SwipeView, "text": "Disinfection2", "type": "Text", "unnamed": 1, "visible": True} +o_swipeview_Repeater = {"container": o_disinfectHome_swipeview_SwipeView, "index": 0, "type": "Repeater", "unnamed": 1, "visible": True} +#Chemical-Disinfect +o_disinfectHome_Chemical_Disinfect = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "text": "Chemical Disinfect", "type": "Text", "unnamed": 1, "visible": True} +o_DisinfectStack_disinfectChemical_TreatmentFlowBase = {"container": o_DisinfectStack_DisinfectStack, "objectName": "_disinfectChemical", "type": "TreatmentFlowBase", "visible": True} +o_disinfectChemical_Chemical_Disinfect_Text = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "occurrence": 2, "text": "Chemical Disinfect", "type": "Text", "unnamed": 1, "visible": True} +o_disinfectChemical_rightImage_Image = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "id": "_rightImage", "source": "qrc:/images/iArrowRight", "type": "Image", "unnamed": 1, "visible": True} +o_disinfectChemical_leftImage_Image = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "id": "_leftImage", "source": "qrc:/images/iArrowLeft", "type": "Image", "unnamed": 1, "visible": True} +o_disinfectChemical_Chemical_Disinfect_Text_2 = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "text": "Chemical Disinfect", "type": "Text", "unnamed": 1, "visible": True} +o_disinfectChemical_Disinfection_Text = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "text": "Disinfection", "type": "Text", "unnamed": 1, "visible": True} +o_disinfectChemical_gridStepsRest_Grid = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "id": "_gridStepsRest", "occurrence": 2, "type": "Grid", "unnamed": 1, "visible": True} +o_disinfectChemical_gridStepsRest_Grid_2 = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "id": "_gridStepsRest", "occurrence": 3, "type": "Grid", "unnamed": 1, "visible": True} +o_disinfectChemical_headStepBullet_StepBullet = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "id": "_headStepBullet", "occurrence": 2, "type": "StepBullet", "unnamed": 1, "visible": True} +o_disinfectChemical_gridSteps_Grid = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "id": "_gridSteps", "occurrence": 2, "type": "Grid", "unnamed": 1, "visible": True} +o_disinfectChemical_confirmButton_TouchRect = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} +o_disinfectChemical_NotificationBar_NotificationBar = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} +o_disinfectChemical_backButton_BackButton = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "objectName": "_backButton", "type": "BackButton", "visible": True} +o_disinfectChemical_back_navigation = {"container": o_DisinfectStack_disinfectChemical_TreatmentFlowBase, "objectName": "_backButton", "type": "BackButton", "visible": True} +o_disinfectHome_Heat_Disinfect = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "text": "Heat Disinfect", "type": "Text", "unnamed": 1, "visible": True} +o_DisinfectStack_disinfectHeat_TreatmentFlowBase = {"container": o_DisinfectStack_DisinfectStack, "objectName": "_disinfectHeat", "type": "TreatmentFlowBase", "visible": True} +#Disinfection-bullet verification +o_disinfect_dynamic_StepBullet = {"type": "StepBullet", "unnamed": 1, "visible": True} +o_disinfect_dynamic_StepBullet_Text = {"type": "Text", "unnamed": 1, "visible": True} +#Heat-Disinfection +o_disinfectHeat_Heat_Disinfect_Text = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "occurrence": 2, "text": "Heat Disinfect", "type": "Text", "unnamed": 1, "visible": True} +o_disinfectHeat_nextStepsBullet_StepBullet = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "id": "_nextStepsBullet", "type": "StepBullet", "unnamed": 1, "visible": True} +o_disinfectHeat_headStepBullet_StepBullet = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "id": "_headStepBullet", "type": "StepBullet", "unnamed": 1, "visible": True} +o_disinfectHeat_confirmButton_TouchRect = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} +o_disinfectHeat_NotificationBar_NotificationBar = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} +o_disinfectHeat_backButton_BackButton = {"container": o_DisinfectStack_disinfectHeat_TreatmentFlowBase, "objectName": "_backButton", "type": "BackButton", "visible": True} +#Flush-Disinfection +o_DisinfectStack_disinfectFlush_TreatmentFlowBase = {"container": o_DisinfectStack_DisinfectStack, "objectName": "_disinfectFlush", "type": "TreatmentFlowBase", "visible": True} +o_disinfectFlush_Water_Flush_Text = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "occurrence": 2, "text": "Water Flush", "type": "Text", "unnamed": 1, "visible": True} +o_disinfectFlush_nextStepsBullet_StepBullet = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "id": "_nextStepsBullet", "type": "StepBullet", "unnamed": 1, "visible": True} +o_disinfectFlush_headStepBullet_StepBullet = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "id": "_headStepBullet", "type": "StepBullet", "unnamed": 1, "visible": True} +o_disinfectFlush_confirmButton_TouchRect = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} +o_disinfectFlush_NotificationBar_NotificationBar = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "objectName": "NotificationBar", "type": "NotificationBar", "visible": True} +o_disinfectHome_Disinfection_Text = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "occurrence": 2, "text": "Disinfection", "type": "Text", "unnamed": 1, "visible": True} +o_disinfectFlush_backButton_BackButton = {"container": o_DisinfectStack_disinfectFlush_TreatmentFlowBase, "objectName": "_backButton", "type": "BackButton", "visible": True} +#Home-Disinfection +o_MainHome_NotificationBar_NotificationBar = {"container": o_MainHome_MainHome, "objectName": "NotificationBar", "type": "NotificationBar", "visible": False} +o_disinfectHome_gridSteps_Grid = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "id": "_gridSteps", "occurrence": 2, "type": "Grid", "unnamed": 1, "visible": True} +o_disinfectHome_leftImage_Image = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "id": "_leftImage", "source": "qrc:/images/iArrowLeft", "type": "Image", "unnamed": 1, "visible": True} +o_disinfectHome_rightImage_Image = {"container": o_DisinfectStack_disinfectHome_TreatmentFlowBase, "id": "_rightImage", "source": "qrc:/images/iArrowRight", "type": "Image", "unnamed": 1, "visible": True} + + #cloudsync o_mainItem_Item = o_mainItem_Item = {"container": o_Gui_MainView, "id": "_mainItem", "type": "Item", "unnamed": 1, "visible": True} o_PostTreatmentStack_PostTreatmentStack = {"container": o_Gui_MainView, "objectName": "_PostTreatmentStack", "type": "PostTreatmentStack", "visible": True} Index: suite.conf =================================================================== diff -u -r39478bf96ecf784b85a4e580e7041e04d37b5d31 -r09c151304b448aecfed8a67c28800d161018641e --- suite.conf (.../suite.conf) (revision 39478bf96ecf784b85a4e580e7041e04d37b5d31) +++ suite.conf (.../suite.conf) (revision 09c151304b448aecfed8a67c28800d161018641e) @@ -5,6 +5,6 @@ IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_main_treatment_pressure tst_treatment_blood_dialysateflow_rate tst_main_treatment_vitals tst_ui_alarms_list tst_ui_alarms_dialog tst_main_treatment_ultrafiltration tst_main_treatment_heparin tst_pre_treatment_priming pre_treatment_disposables pre_treatment_patient_connection tst_unhandled_message_log tst_instructions_poc tst_service_screen tst_cloud_sync_device_registration tst_rinseback_setup tst_recirculate tst_settings_information tst_cloud_sync - treatment_screen tst_dialin_logs +TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_main_treatment_pressure tst_treatment_blood_dialysateflow_rate tst_main_treatment_vitals tst_ui_alarms_list tst_ui_alarms_dialog tst_main_treatment_ultrafiltration tst_main_treatment_heparin tst_pre_treatment_priming pre_treatment_disposables pre_treatment_patient_connection tst_unhandled_message_log tst_instructions_poc tst_service_screen tst_cloud_sync_device_registration tst_rinseback_setup tst_recirculate tst_settings_information tst_cloud_sync - treatment_screen tst_dialin_logs tst_disinfection VERSION=3 WRAPPERS=Qt