Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r13a064292b5a36a85593f53eabae268ae2bf4bc6 -r07f5eacb31de016583256f704acaec3ff2196176 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 13a064292b5a36a85593f53eabae268ae2bf4bc6) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 07f5eacb31de016583256f704acaec3ff2196176) @@ -25,7 +25,7 @@ #include "ModeInitPOST.h" #include "ModeTreatment.h" #include "ModeTreatmentParams.h" -#include "OperationModes.h" +#include "OperationModes.h" #include "PersistentAlarm.h" #include "SystemComm.h" #include "SystemCommMessages.h" @@ -58,12 +58,12 @@ // ********** private data ********** -// DG status -static DG_OP_MODE_T dgCurrentOpMode; ///< Current DG operation mode. +// DG status +static DG_OP_MODE_T dgCurrentOpMode; ///< Current DG operation mode. static U32 dgSubMode; ///< Current state (sub-mode) of current DG operation mode. -static BOOL dgStartCommandSent; ///< Flag indicates command to start DG has been sent. -static BOOL dgStarted; ///< Flag indicates whether we have commanded the DG to start or stop. -static BOOL dgTrimmerHeaterOn; ///< Flag indicates whether we have commanded the DG to start or stop the trimmer heater. +static BOOL dgStartCommandSent; ///< Flag indicates command to start DG has been sent. +static BOOL dgStarted; ///< Flag indicates whether we have commanded the DG to start or stop. +static BOOL dgTrimmerHeaterOn; ///< Flag indicates whether we have commanded the DG to start or stop the trimmer heater. // DG sensor data static F32 dgDialysateTemp; ///< Dialysate temperature reported by the DG. @@ -125,10 +125,10 @@ U32 i, j; // NOTE: the active reservoir is set to reservoir 1 since DG will send active reservoir 1 as active on power up - dgStarted = FALSE; - dgTrimmerHeaterOn = FALSE; + dgStarted = FALSE; + dgTrimmerHeaterOn = FALSE; dgTrimmerTempSet = 0.0F; - dgTrimmerTempCheckTimerCtr = 0; + dgTrimmerTempCheckTimerCtr = 0; dgActiveReservoirSet = DG_RESERVOIR_2; dgActiveReservoir = DG_RESERVOIR_2; dgDialysateTemp = 0.0F; @@ -912,12 +912,7 @@ { dgCmdResp[ DG_CMD_START_FILL ].commandID = DG_CMD_NONE; - if ( ( FALSE == isAlarmActive( ALARM_ID_DG_ACID_BOTTLE_LOW_VOLUME ) ) && ( FALSE == isAlarmActive( ALARM_ID_DG_BICARB_BOTTLE_LOW_VOLUME ) ) ) - { - // The empty bottle alarms should not be active. If they are, the user shall insert the new bottle first and then hit Ok/Resume and - // then the fill can go. This is to make sure the next fill is done the full bottles - sendDGFillCommand( DG_CMD_START, fillToVolMl, targetFlowLPM ); - } + sendDGFillCommand( DG_CMD_START, fillToVolMl, targetFlowLPM ); } /*********************************************************************//** Index: firmware/App/Modes/ModeTreatmentParams.c =================================================================== diff -u -r13a064292b5a36a85593f53eabae268ae2bf4bc6 -r07f5eacb31de016583256f704acaec3ff2196176 --- firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 13a064292b5a36a85593f53eabae268ae2bf4bc6) +++ firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 07f5eacb31de016583256f704acaec3ff2196176) @@ -43,6 +43,8 @@ #define NO_HEPARIN_TYPE_SET 0xFFFFFFFF ///< UI will send this value for Heparin type if Heparin not used #define INSTIT_CHEM_DISINFECT_ENABLE_RANGE 1 ///< Institutional record chemical disinfect enable/disable allowable range +#define INSTIT_MIN_RO_REJECTION_RATIO_MAX_PCT 99 ///< Institutional record min RO rejection ratio maximum in percent. +#define INSTIT_MAX_INLET_WATER_COND_ALARM_USPCM 300.0F ///< Institutional record max inlet water conductivity alarm in uS/cm. /// Record for range and default of treatment parameters. typedef struct @@ -1026,6 +1028,10 @@ ( nvInstRcrd->maxHeparinBolusVolumeML <= TREAT_PARAMS_PROPERTIES[ TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME ].max.sFlt ) ? TRUE : FALSE ); result &= ( ( nvInstRcrd->minHeparinBolusVolumeML <= nvInstRcrd->maxHeparinBolusVolumeML ) ? TRUE : FALSE ); result &= ( ( nvInstRcrd->enableChemicalDisinfect <= INSTIT_CHEM_DISINFECT_ENABLE_RANGE ) ? TRUE : FALSE ); + // NOTE: min RO rejection ratio is not needed to be >= 0 because it is a U32 + result &= ( ( nvInstRcrd->minRORejectionRatioPCT <= INSTIT_MIN_RO_REJECTION_RATIO_MAX_PCT ) ? TRUE : FALSE ); + result &= ( ( nvInstRcrd->minInletWaterCondAlarmLimitUSPCM >= 0.0F ) && + ( nvInstRcrd->minInletWaterCondAlarmLimitUSPCM <= INSTIT_MAX_INLET_WATER_COND_ALARM_USPCM ) ? TRUE : FALSE ); return result; } Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r13a064292b5a36a85593f53eabae268ae2bf4bc6 -r07f5eacb31de016583256f704acaec3ff2196176 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 13a064292b5a36a85593f53eabae268ae2bf4bc6) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 07f5eacb31de016583256f704acaec3ff2196176) @@ -1219,6 +1219,10 @@ handleUIHDResetInServiceModeRequest( message ); break; + case MSG_ID_DG_INSTIT_VALUES_FROM_HD_INSTIT_RECORD_REQUEST: + handleDGRequestInstitutionalValues( message ); + break; + // NOTE: this always must be the last case case MSG_ID_TESTER_LOGIN_REQUEST: handleTesterLogInRequest( message ); Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rd390fa596f0f36086d017d462924dfd2b46ac56a -r07f5eacb31de016583256f704acaec3ff2196176 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision d390fa596f0f36086d017d462924dfd2b46ac56a) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 07f5eacb31de016583256f704acaec3ff2196176) @@ -93,6 +93,8 @@ F32 minHeparinBolusVolumeML; ///< Min heparin bolus volume in mL. F32 maxHeparinBolusVolumeML; ///< Max heparin bolus volume in mL. U32 enableChemicalDisinfect; ///< Enable/disable chemical disinfect. + U32 minRORejectionRatioPCT; ///< Min RO rejection ratio in percent. + F32 minInletWaterCondAlarmLimitUSPCM; ///< Min inlet water conductivity alarm limit in uS/cm. } HD_INSTITUTIONAL_LOCAL_RECORD_T; typedef struct @@ -3758,7 +3760,38 @@ return result; } +/*********************************************************************//** + * @brief + * The handleDGRequestInstitutionalValues function handles the DG request + * to receive the DG institutional values from HD institutional record. + * @details Inputs: none + * @details Outputs: none + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleDGRequestInstitutionalValues( MESSAGE_T* message ) +{ + if ( 0 == message->hdr.payloadLen ) + { + MESSAGE_T msg; + DG_INSTITUTIONAL_VALUES_T dgInstitValues; + dgInstitValues.minRORejectionRatioPCT = getMinRORejectionRatioInInstitRecordPCT(); + dgInstitValues.minInletWaterCondAlarmLimitUSPCM = getMinInletWaterConductivityLimitInstitRecordUSPCM(); + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_DG_INSTIT_VALUES_FROM_HD_INSTIT_RECORD_RESPONSE; + msg.hdr.payloadLen = sizeof( DG_INSTITUTIONAL_VALUES_T ); + + memcpy( msg.payload, &dgInstitValues, sizeof( DG_INSTITUTIONAL_VALUES_T ) ); + + // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_DG, ACK_REQUIRED ); + } +} + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -rd390fa596f0f36086d017d462924dfd2b46ac56a -r07f5eacb31de016583256f704acaec3ff2196176 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision d390fa596f0f36086d017d462924dfd2b46ac56a) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 07f5eacb31de016583256f704acaec3ff2196176) @@ -567,6 +567,9 @@ // MSG_ID_DG_START_STOP_PASSIVE_COOL_HEAT_DISINFECT BOOL sendDGStartHeatDisinfectPassiveCoolModeCommand( BOOL start ); +// MSG_ID_DG_INSTIT_VALUES_FROM_HD_INSTIT_RECORD_REQUEST +void handleDGRequestInstitutionalValues( MESSAGE_T* message ); + // *********** public test support message functions ********** // MSG_TESTER_LOG_IN