Index: dialin/hd/hemodialysis_device.py =================================================================== diff -u -r32e628abcbbd3fd70866505d9f2836a6f732ef06 -r9192a00f5054666725049057dc55f965a416ef63 --- dialin/hd/hemodialysis_device.py (.../hemodialysis_device.py) (revision 32e628abcbbd3fd70866505d9f2836a6f732ef06) +++ dialin/hd/hemodialysis_device.py (.../hemodialysis_device.py) (revision 9192a00f5054666725049057dc55f965a416ef63) @@ -52,6 +52,7 @@ from .battery import HDBattery from .usage_info_record import HDUsageNVRecord from .hd_test_configs import HDTestConfig +from .institutional_record import HDInstitutionalNVRecords from ..common.msg_defs import MsgIds, MsgFieldPositions from ..protocols.CAN import DenaliMessage, DenaliCanMessenger, DenaliChannels from ..utils.base import AbstractSubSystem, publish, LogManager, INTERVAL_10s @@ -179,6 +180,7 @@ self.battery = HDBattery(self.can_interface, self.logger) self.usage_record = HDUsageNVRecord(self.can_interface, self.logger) self.test_configs = HDTestConfig(self.can_interface, self.logger) + self.institutional_record = HDInstitutionalNVRecords(self.can_interface, self.logger) def __del__(self): self.can_interface.transmit_interval_dictionary[self.callback_id].stop() Index: dialin/hd/institutional_record.py =================================================================== diff -u -r369b3b7cb7d66a4d4c251083c0aea3eacb0b39ea -r9192a00f5054666725049057dc55f965a416ef63 --- dialin/hd/institutional_record.py (.../institutional_record.py) (revision 369b3b7cb7d66a4d4c251083c0aea3eacb0b39ea) +++ dialin/hd/institutional_record.py (.../institutional_record.py) (revision 9192a00f5054666725049057dc55f965a416ef63) @@ -38,6 +38,10 @@ _DEFAULT_MAX_VEN_ASYM_PRESS_LIMIT_WINDOW_MMHG = 35 _DEFAULT_MIN_UF_VOLUME_L = 0.0 _DEFAULT_MAX_UF_VOLUME_L = 8.0 + _DEFAULT_MIN_HEPARIN_DISP_RATE_MLPM = 0.0 + _DEFAULT_MAX_HEPARIN_DISP_RATE_MLPM = 1.0 + _DEFAULT_MIN_HEPARIN_BOLUS_VOLUME_ML = 0.0 + _DEFAULT_MAX_HEPARIN_BOLUS_VOLUME_ML = 2.0 _RECORD_SPECS_BYTES = 12 _DEFAULT_TIME_VALUE = 0 @@ -93,7 +97,7 @@ def cmd_request_hd_institutional_record(self) -> int: """ - Handles getting HD service record from firmware. + Handles getting HD institutional record from firmware. @return: 1 upon success, False otherwise """ @@ -154,10 +158,10 @@ def _handler_hd_institutional_sync(self, message, timestamp=0.0): """ - Handles published HD system record messages. HD system records are captured for - processing and updating the HD system record. + Handles published HD system record messages. HD institutional records are captured for + processing and updating the HD institutional record. - @param message: published HD system record data message + @param message: published HD institutional record data message @return: None """ curr = struct.unpack('i', bytearray( @@ -170,16 +174,16 @@ self._current_message = curr self._total_messages = total self._received_msg_length = length - # The end of calibration_record record payload is from the start index + 12 bytes for the current message +total - # messages + the length of calibration_record. The rest is the CAN messaging CRC that is not needed + # The end of institutional_record record payload is from the start index + 12 bytes for the current message+total + # messages + the length of institutional_record. The rest is the CAN messaging CRC that is not needed # to be kept end_of_data_index = MsgFieldPositions.START_POS_FIELD_1 + self._RECORD_SPECS_BYTES + self._received_msg_length # Get the data only and not specs of it (i.e current message number) self._institutional_data = message['message'][MsgFieldPositions.START_POS_FIELD_1:end_of_data_index] - # Continue getting calibration_record records until the all the calibration_record messages are received. - # Concatenate the calibration_record records to each other + # Continue getting institutional_record records until the all the calibration_record messages are received. + # Concatenate the institutional_record records to each other if self._current_message <= self._total_messages: self._raw_institutional_record += (message['message'][MsgFieldPositions.START_POS_FIELD_1 + self._RECORD_SPECS_BYTES:end_of_data_index]) @@ -259,7 +263,7 @@ # Update the institutional record result.update(function[0]) - # Build the CRC of the main calibration_record record + # Build the CRC of the main institutional_record record record_crc = OrderedDict({'crc': ['