Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -reb3e8ec85b8c2cfd7215d762117c617b8084be45 -r23a126290aecdb5d43c8f5263bd147e91f53f507 --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision eb3e8ec85b8c2cfd7215d762117c617b8084be45) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 23a126290aecdb5d43c8f5263bd147e91f53f507) @@ -647,6 +647,7 @@ self.can_interface.send(message, 0) + def td_vitals_adjustment_response(self,vRejectionReason: int): """ the vitals adjustment response message method(Msg ID: 0x64, 100) @@ -663,6 +664,202 @@ payload=payload) self.can_interface.send(message, 0) + def td_pressure_limits_adjustment_response(self, vRejectionReason: int, + vArterialWindow: int, vVenousWindow: int, vVenousAsymmetricWindow: int, vTmpWindow: int): + """ + the pressure limits adjustment response message method(Msg ID: 0x79, 121) + Args: + @param vRejectionReason (int) : response rejection reason, + if rejection reason is 0, then accepted (0) will be sent, + otherwise rejected (1) + @param vArterialWindow (int) : arterial limit window (mmHg) + @param vVenousWindow (int) : venous limit window (mmHg) + @param vVenousAsymmetricWindow (int) : venous asymmetric window (mmHg) + @param vTmpWindow (int) : tmp limit window (mmHg) + @return: None + """ + payload = conversions.integer_to_bytearray(1 if vRejectionReason == 0 else 0 ) + payload += conversions.integer_to_bytearray(vRejectionReason ) + payload += conversions.integer_to_bytearray(vArterialWindow ) + payload += conversions.integer_to_bytearray(vVenousWindow ) + payload += conversions.integer_to_bytearray(vVenousAsymmetricWindow ) + payload += conversions.integer_to_bytearray(vTmpWindow ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_PRESSURE_LIMITS_CHANGE_RESPONSE .value, + payload=payload) + self.can_interface.send(message, 0) + + + def td_bolus_volume_adjustment_response(self, vRejectionReason: int, vBolusVolume: int,): + """ + the pressure limits adjustment response message method(Msg ID: 0x82, 130) + Args: + @param vRejectionReason (int) : response rejection reason, + if rejection reason is 0, then accepted (0) will be sent, + otherwise rejected (1) + @param vBolusVolume (int) : bolus volume (mL) + @return: None + """ + payload = conversions.integer_to_bytearray(1 if vRejectionReason == 0 else 0 ) + payload += conversions.integer_to_bytearray(vRejectionReason ) + payload += conversions.integer_to_bytearray(vBolusVolume ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_BOLUS_VOLUME_CHANGE_RESPONSE .value, + payload=payload) + self.can_interface.send(message, 0) + + + def td_duration_validate_response(self, vRejectionReason: int, vDuration: int, vUFVolumeGoal: float, vUFRate: float): + """ + the duration validate response message method(Msg ID: 0x84, 132) + Args: + @param vRejectionReason (int) : response rejection reason, + if rejection reason is 0, then accepted (0) will be sent, + otherwise rejected (1) + @param vDuration (int) : treatment duration (min) + @param vUFVolumeGoal (float) : UF volume goal (mL) + @param vUFRate (float) : UF rate (L/hr) + @return: None + """ + payload = conversions.integer_to_bytearray(1 if vRejectionReason == 0 else 0 ) + payload += conversions.integer_to_bytearray(vRejectionReason ) + payload += conversions.integer_to_bytearray(vDuration ) + payload += conversions.float_to_bytearray(vUFVolumeGoal ) + payload += conversions.float_to_bytearray(vUFRate ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_DURATION_VALIDATE_RESPONSE .value, + payload=payload) + self.can_interface.send(message, 0) + + + def td_duration_confirm_response(self, vRejectionReason: int, vDuration: int, vUFVolumeGoal: float, vUFRate: float): + """ + the duration confirm response message method(Msg ID: 0x86, 134) + Args: + @param vRejectionReason (int) : response rejection reason, + if rejection reason is 0, then accepted (0) will be sent, + otherwise rejected (1) + @param vDuration (int) : treatment duration (min) + @param vUFVolumeGoal (float) : UF volume goal (mL) + @param vUFRate (float) : UF rate (L/hr) + @return: None + """ + payload = conversions.integer_to_bytearray(1 if vRejectionReason == 0 else 0 ) + payload += conversions.integer_to_bytearray(vRejectionReason ) + payload += conversions.integer_to_bytearray(vDuration ) + payload += conversions.float_to_bytearray(vUFVolumeGoal ) + payload += conversions.float_to_bytearray(vUFRate ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_DURATION_CONFIRM_RESPONSE .value, + payload=payload) + self.can_interface.send(message, 0) + + + def td_treatment_set_points_change_response(self, vRejectionReason: int, vBloodFlowRate: int, vDialysateFlowRate: int, vDialysateTemperature: float, + vAcidConcentrate: int, vBicarbConcentrate: int): + """ + the treatment set points change response message method(Msg ID: 0x94, 136) + Args: + @param vRejectionReason (int) : response rejection reason, + if rejection reason is 0, then accepted (0) will be sent, + otherwise rejected (1) + @param vBloodFlowRate (int) : blood flow rate (mL/min) + @param vDialysateFlowRate (int) : dialysate flow rate (mL/min) + @param vDialysateTemperature (float) : dialysate temperature (°C) + @param vAcidConcentrate (int) : acid concentrate + @param vBicarbConcentrate (int) : bicarbonate concentrate + + @return: None + """ + payload = conversions.integer_to_bytearray ( 1 if vRejectionReason == 0 else 0 ) + payload += conversions.integer_to_bytearray ( vRejectionReason ) + payload += conversions.integer_to_bytearray ( vBloodFlowRate ) + payload += conversions.integer_to_bytearray ( vDialysateFlowRate ) + payload += conversions.float_to_bytearray ( vDialysateTemperature ) + payload += conversions.integer_to_bytearray ( vAcidConcentrate ) + payload += conversions.integer_to_bytearray ( vBicarbConcentrate ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_TREATMENT_SET_POINTS_CHANGE_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + + def td_treatment_set_point_blood_flow_rate_change_response(self, vRejectionReason: int, vBloodFlowRate: int): + """ + the treatment blood flow rate set point change response message method(Msg ID: 0x96, 138) + Args: + @param vRejectionReason (int) : response rejection reason, + if rejection reason is 0, then accepted (0) will be sent, + otherwise rejected (1) + @param vBloodFlowRate (int) : blood flow rate (mL/min) + + @return: None + """ + payload = conversions.integer_to_bytearray ( 1 if vRejectionReason == 0 else 0 ) + payload += conversions.integer_to_bytearray ( vRejectionReason ) + payload += conversions.integer_to_bytearray ( vBloodFlowRate ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + + def td_treatment_set_point_dialysate_flow_rate_change_response(self, vRejectionReason: int, vDialysateFlowRate: int): + """ + the treatment dialysate flow rate set point change response message method(Msg ID: 0x98, 138) + Args: + @param vRejectionReason (int) : response rejection reason, + if rejection reason is 0, then accepted (0) will be sent, + otherwise rejected (1) + @param vDialysateFlowRate (int) : dialysate flow rate (mL/min) + + @return: None + """ + payload = conversions.integer_to_bytearray ( 1 if vRejectionReason == 0 else 0 ) + payload += conversions.integer_to_bytearray ( vRejectionReason ) + payload += conversions.integer_to_bytearray ( vDialysateFlowRate ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_TREATMENT_SET_POINT_DIALYSATE_FLOW_CHANGE_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + + def td_treatment_set_point_dialysate_temperature_change_response(self, vRejectionReason: int, vDialysateTemperature: float): + """ + the treatment dialysate temperature set point change response message method(Msg ID: 0x9A, 138) + Args: + @param vRejectionReason (int) : response rejection reason, + if rejection reason is 0, then accepted (0) will be sent, + otherwise rejected (1) + @param vDialysateTemperature (float) : dialysate temperature (°C) + + @return: None + """ + payload = conversions.integer_to_bytearray ( 1 if vRejectionReason == 0 else 0 ) + payload += conversions.integer_to_bytearray ( vRejectionReason ) + payload += conversions.float_to_bytearray ( vDialysateTemperature ) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_TREATMENT_SET_POINT_DIALYSATE_TEMPERATURE_CHANGE_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + def td_Treatment_Parameters_CreateRx(self, vRejectionReason: int): """ TD response to in initiate Treatment and enter Create Rx (Msg ID: 0x46, 70) @@ -684,74 +881,74 @@ def td_Treatment_Parameters_Validation( self, - vAccepted : int = 1, - vBloodFlowRateRejectReason : int = 0, - vDialysateFlowRateRejectReason : int = 0, - vTreatmentDurationRejectReason : int = 0, - vSalineBolusVolumeRejectReason : int = 0, - vHeparinStopTimeRejectReason : int = 0, - vHeparinTypeRejectReason : int = 0, - vAcidConcentrateRejectReason : int = 0, - vBicarbonateConcentrateRejectReason : int = 0, - vDialyzerTypeRejectReason : int = 0, - vBloodPressureMeasureIntervalRejectReason : int = 0, - vRinsebackFlowRateRejectReason : int = 0, - vRinsebackVolumeRejectReason : int = 0, - vArterialPressureLimitWindowRejectReason : int = 0, - vVenousPressureLimitWindowRejectReason : int = 0, - vVenousPressureLimitAsymtrcRejectReason : int = 0, - vTrancembrncPressureLimitWindowRejectReason : int = 0, - vDialysateTempRejectReason : int = 0, - vHeparinDispensingRateRejectReason : int = 0, - vHeparinBolusVolumeRejectReason : int = 0 + vAccepted : int = 1, + vBloodFlowRateRejectReason : int = 0, + vDialysateFlowRateRejectReason : int = 0, + vTreatmentDurationRejectReason : int = 0, + vSalineBolusVolumeRejectReason : int = 0, + vHeparinStopTimeRejectReason : int = 0, + vHeparinTypeRejectReason : int = 0, + vAcidConcentrateRejectReason : int = 0, + vBicarbonateConcentrateRejectReason : int = 0, + vDialyzerTypeRejectReason : int = 0, + vBloodPressureMeasureIntervalRejectReason : int = 0, + vRinsebackFlowRateRejectReason : int = 0, + vRinsebackVolumeRejectReason : int = 0, + vArterialPressureLimitWindowRejectReason : int = 0, + vVenousPressureLimitWindowRejectReason : int = 0, + vVenousPressureLimitAsymtrcRejectReason : int = 0, + vTransmembranePressureLimitWindowRejectReason : int = 0, + vDialysateTempRejectReason : int = 0, + vHeparinDispensingRateRejectReason : int = 0, + vHeparinBolusVolumeRejectReason : int = 0 ): """TD Treatment Parameter Validation Response to the SW validation request with sent values of the same parameters.(Msg ID: 0x40, 64) Args: - vAccepted (int, optional): Zero value if rejected. Defaults to 1. - vBloodFlowRateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vDialysateFlowRateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vTreatmentDurationRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vSalineBolusVolumeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vHeparinStopTimeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vHeparinTypeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vAcidConcentrateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vBicarbonateConcentrateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vDialyzerTypeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vBloodPressureMeasureIntervalRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vRinsebackFlowRateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vRinsebackVolumeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vArterialPressureLimitWindowRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vVenousPressureLimitWindowRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vVenousPressureLimitAsymtrcRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vTrancembrncPressureLimitWindowRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vDialysateTempRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vHeparinDispensingRateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. - vHeparinBolusVolumeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vAccepted (int, optional): Zero value if rejected. Defaults to 1. + vBloodFlowRateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vDialysateFlowRateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vTreatmentDurationRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vSalineBolusVolumeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vHeparinStopTimeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vHeparinTypeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vAcidConcentrateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vBicarbonateConcentrateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vDialyzerTypeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vBloodPressureMeasureIntervalRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vRinsebackFlowRateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vRinsebackVolumeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vArterialPressureLimitWindowRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vVenousPressureLimitWindowRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vVenousPressureLimitAsymtrcRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vTransmembranePressureLimitWindowRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vDialysateTempRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vHeparinDispensingRateRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. + vHeparinBolusVolumeRejectReason (int, optional): None zero value of rejection reason. Defaults to 0. """ if not self.can_enabled: raise ValueError("CAN Interface is not enabled") - payload = conversions.integer_to_bytearray(vAccepted ) - payload += conversions.integer_to_bytearray(vBloodFlowRateRejectReason ) - payload += conversions.integer_to_bytearray(vDialysateFlowRateRejectReason ) - payload += conversions.integer_to_bytearray(vTreatmentDurationRejectReason ) - payload += conversions.integer_to_bytearray(vSalineBolusVolumeRejectReason ) - payload += conversions.integer_to_bytearray(vHeparinStopTimeRejectReason ) - payload += conversions.integer_to_bytearray(vHeparinTypeRejectReason ) - payload += conversions.integer_to_bytearray(vAcidConcentrateRejectReason ) - payload += conversions.integer_to_bytearray(vBicarbonateConcentrateRejectReason ) - payload += conversions.integer_to_bytearray(vDialyzerTypeRejectReason ) - payload += conversions.integer_to_bytearray(vBloodPressureMeasureIntervalRejectReason ) - payload += conversions.integer_to_bytearray(vRinsebackFlowRateRejectReason ) - payload += conversions.integer_to_bytearray(vRinsebackVolumeRejectReason ) - payload += conversions.integer_to_bytearray(vArterialPressureLimitWindowRejectReason ) - payload += conversions.integer_to_bytearray(vVenousPressureLimitWindowRejectReason ) - payload += conversions.integer_to_bytearray(vVenousPressureLimitAsymtrcRejectReason ) - payload += conversions.integer_to_bytearray(vTrancembrncPressureLimitWindowRejectReason ) - payload += conversions.integer_to_bytearray(vDialysateTempRejectReason ) - payload += conversions.integer_to_bytearray(vHeparinDispensingRateRejectReason ) - payload += conversions.integer_to_bytearray(vHeparinBolusVolumeRejectReason ) + payload = conversions.integer_to_bytearray(vAccepted ) + payload += conversions.integer_to_bytearray(vBloodFlowRateRejectReason ) + payload += conversions.integer_to_bytearray(vDialysateFlowRateRejectReason ) + payload += conversions.integer_to_bytearray(vTreatmentDurationRejectReason ) + payload += conversions.integer_to_bytearray(vSalineBolusVolumeRejectReason ) + payload += conversions.integer_to_bytearray(vHeparinStopTimeRejectReason ) + payload += conversions.integer_to_bytearray(vHeparinTypeRejectReason ) + payload += conversions.integer_to_bytearray(vAcidConcentrateRejectReason ) + payload += conversions.integer_to_bytearray(vBicarbonateConcentrateRejectReason ) + payload += conversions.integer_to_bytearray(vDialyzerTypeRejectReason ) + payload += conversions.integer_to_bytearray(vBloodPressureMeasureIntervalRejectReason ) + payload += conversions.integer_to_bytearray(vRinsebackFlowRateRejectReason ) + payload += conversions.integer_to_bytearray(vRinsebackVolumeRejectReason ) + payload += conversions.integer_to_bytearray(vArterialPressureLimitWindowRejectReason ) + payload += conversions.integer_to_bytearray(vVenousPressureLimitWindowRejectReason ) + payload += conversions.integer_to_bytearray(vVenousPressureLimitAsymtrcRejectReason ) + payload += conversions.integer_to_bytearray(vTransmembranePressureLimitWindowRejectReason ) + payload += conversions.integer_to_bytearray(vDialysateTempRejectReason ) + payload += conversions.integer_to_bytearray(vHeparinDispensingRateRejectReason ) + payload += conversions.integer_to_bytearray(vHeparinBolusVolumeRejectReason ) message = CAN.DenaliMessage.build_message( channel_id=CAN.DenaliChannels.td_to_ui_ch_id,