Index: leahi_dialin/common/msg_ids.py =================================================================== diff -u -r56ef7c146cfc502992a01f639cc9bfa0b002623a -r849e6b1d5227a2edd9a0070cbe4dcc5a5075002c --- leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 56ef7c146cfc502992a01f639cc9bfa0b002623a) +++ leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 849e6b1d5227a2edd9a0070cbe4dcc5a5075002c) @@ -133,6 +133,14 @@ MSG_ID_TD_DURATION_VALIDATE_RESPONSE = 0x84 MSG_ID_UI_DURATION_CONFIRM_REQUEST = 0x85 MSG_ID_TD_DURATION_CONFIRM_RESPONSE = 0x86 + MSG_ID_UI_TREATMENT_SET_POINTS_CHANGE_REQUEST = 0x87 + MSG_ID_TD_TREATMENT_SET_POINTS_CHANGE_RESPONSE = 0x88 + MSG_ID_UI_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_REQUEST = 0x89 + MSG_ID_TD_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_RESPONSE = 0x8A + MSG_ID_UI_TREATMENT_SET_POINT_DIALYSATE_FLOW_CHANGE_REQUEST = 0x8B + MSG_ID_TD_TREATMENT_SET_POINT_DIALYSATE_FLOW_CHANGE_RESPONSE = 0x8C + MSG_ID_UI_TREATMENT_SET_POINT_DIALYSATE_TEMPERATURE_CHANGE_REQUEST = 0x8D + MSG_ID_TD_TREATMENT_SET_POINT_DIALYSATE_TEMPERATURE_CHANGE_RESPONSE = 0x8E MSG_ID_DD_PISTON_PUMP_CONTROL_DATA = 0xF0 Index: leahi_dialin/ui/td_messaging.py =================================================================== diff -u -r56ef7c146cfc502992a01f639cc9bfa0b002623a -r849e6b1d5227a2edd9a0070cbe4dcc5a5075002c --- leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 56ef7c146cfc502992a01f639cc9bfa0b002623a) +++ leahi_dialin/ui/td_messaging.py (.../td_messaging.py) (revision 849e6b1d5227a2edd9a0070cbe4dcc5a5075002c) @@ -648,9 +648,53 @@ self.can_interface.send(message, 0) + def td_vitals_adjustment_response(self,vRejectionReason: int): + """ + the vitals adjustment response message method(Msg ID: 0x64, 100) + 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_BLOOD_PRESSURE_RESPONSE.value, + 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, 124) + 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, @@ -671,7 +715,7 @@ def td_duration_validate_response(self, vRejectionReason: int, vDuration: int, vUFVolumeGoal: float, vUFRate: float): """ - the duration validate response message method(Msg ID: 0x84, 126) + 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, @@ -696,7 +740,7 @@ def td_duration_confirm_response(self, vRejectionReason: int, vDuration: int, vUFVolumeGoal: float, vUFRate: float): """ - the duration confirm response message method(Msg ID: 0x86, 128) + 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, @@ -719,50 +763,103 @@ self.can_interface.send(message, 0) - def td_pressure_limits_adjustment_response(self, vRejectionReason: int, - vArterialWindow: int, vVenousWindow: int, vVenousAsymmetricWindow: int, vTmpWindow: int): + def td_treatment_set_points_change_response(self, vRejectionReason: int, vBloodFlowRate: int, vDialysateFlowRate: int, vDialysateTemperature: float, + vAcidConcentrate: int, vBicarbConcentrate: int): """ - the pressure limits adjustment response message method(Msg ID: 0x79, 121) + the treatment set points change response message method(Msg ID: 0x88, 136) 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) + @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(vArterialWindow ) - payload += conversions.integer_to_bytearray(vVenousWindow ) - payload += conversions.integer_to_bytearray(vVenousAsymmetricWindow ) - payload += conversions.integer_to_bytearray(vTmpWindow ) + 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_PRESSURE_LIMITS_CHANGE_RESPONSE .value, + message_id=msg_ids.MsgIds.MSG_ID_TD_TREATMENT_SET_POINTS_CHANGE_RESPONSE.value, payload=payload) self.can_interface.send(message, 0) - def td_vitals_adjustment_response(self,vRejectionReason: int): + def td_treatment_set_point_blood_flow_rate_change_response(self, vRejectionReason: int, vBloodFlowRate: int): """ - the vitals adjustment response message method(Msg ID: 0x64, 100) + the treatment blood flow rate set point change response message method(Msg ID: 0x8A, 138) Args: - None + @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 ( 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_BLOOD_PRESSURE_RESPONSE.value, - payload=payload) + 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: 0x8A, 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: 0x8A, 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)