Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -r18c90a1b2b6c7339bdd192a2d2fac32f2b8a35df -rc5bfcf84ed942ca5841bf9de155aa0f495b4d28d --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 18c90a1b2b6c7339bdd192a2d2fac32f2b8a35df) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision c5bfcf84ed942ca5841bf9de155aa0f495b4d28d) @@ -662,6 +662,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) @@ -1186,6 +1187,63 @@ 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_blood_set_auto_load_response(self,vRejectionReason: int): + """ + the blood set auto eject response message method(Msg ID: 0xXX, XXX) + Args: + None + @return: None + """ + payload = conversions.integer_to_bytearray(1 if vRejectionReason == 0 else 0) + payload += conversions.integer_to_bytearray(vRejectionReason) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_ADJUST_DISPOSABLES_CONFIRM_RESPONSE.value, + payload=payload) + self.can_interface.send(message, 0) + + def td_blood_set_auto_eject_response(self,vRejectionReason: int): + """ + the heparin adjustment response message method(Msg ID: 0xXX, XXX) + Args: + None + @return: None + """ + payload = conversions.integer_to_bytearray(1 if vRejectionReason == 0 else 0) + payload += conversions.integer_to_bytearray(vRejectionReason) + + message = CAN.DenaliMessage.build_message( + channel_id=CAN.DenaliChannels.td_to_ui_ch_id, + message_id=msg_ids.MsgIds.MSG_ID_TD_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_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) @@ -1207,73 +1265,73 @@ 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,