Index: firmware/App/Modes/ModeTreatmentParams.c =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -re42bc54b5c3ff134d9f4526034e3c522a64f0cdf --- firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision e42bc54b5c3ff134d9f4526034e3c522a64f0cdf) @@ -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_RO_REJECTION_RATIO_MIN 0.0F ///< Institutional record RO rejection ratio minimum +#define INSTIT_RO_REJECTION_RATIO_MAX 1.0F ///< Institutional record RO rejection ratio maximum /// Record for range and default of treatment parameters. typedef struct @@ -1026,6 +1028,8 @@ ( 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 ); + result &= ( ( nvInstRcrd->roRejectionRatio >= INSTIT_RO_REJECTION_RATIO_MIN ) && + ( nvInstRcrd->roRejectionRatio <= INSTIT_RO_REJECTION_RATIO_MAX ) ? TRUE : FALSE ); return result; } Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -re42bc54b5c3ff134d9f4526034e3c522a64f0cdf --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision e42bc54b5c3ff134d9f4526034e3c522a64f0cdf) @@ -1219,6 +1219,10 @@ handleUIHDResetInServiceModeRequest( message ); break; + case MSG_ID_DG_RO_REJ_RATIO_FROM_HD_INSTIT_RECORD_REQUEST: + handleDGRequestRORejectionRatio( 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 -r371355c43e19849e5b1dd27286f62f4424d07ccf -re42bc54b5c3ff134d9f4526034e3c522a64f0cdf --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 371355c43e19849e5b1dd27286f62f4424d07ccf) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision e42bc54b5c3ff134d9f4526034e3c522a64f0cdf) @@ -3758,7 +3758,36 @@ return result; } +/*********************************************************************//** + * @brief + * The handleDGRequestRORejectionRatio function handles the DG request + * to receive the RO rejection ratio from HD institutional record. + * @details Inputs: none + * @details Outputs: none + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleDGRequestRORejectionRatio( MESSAGE_T* message ) +{ + if ( 0 == message->hdr.payloadLen ) + { + MESSAGE_T msg; + F32 roRejectionRatioInInstitRecord = getRORejectionRatioInInstitRecord(); + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_RO_REJ_RATIO_FROM_HD_INSTIT_RECORD_TO_DG_RESPONSE; + msg.hdr.payloadLen = sizeof( F32 ); + + memcpy( msg.payload, &roRejectionRatioInInstitRecord, sizeof( F32 ) ); + + // 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 -r371355c43e19849e5b1dd27286f62f4424d07ccf -re42bc54b5c3ff134d9f4526034e3c522a64f0cdf --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 371355c43e19849e5b1dd27286f62f4424d07ccf) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision e42bc54b5c3ff134d9f4526034e3c522a64f0cdf) @@ -567,6 +567,9 @@ // MSG_ID_DG_START_STOP_PASSIVE_COOL_HEAT_DISINFECT BOOL sendDGStartHeatDisinfectPassiveCoolModeCommand( BOOL start ); +// MSG_ID_DG_RO_REJ_RATIO_FROM_HD_INSTIT_RECORD_REQUEST +void handleDGRequestRORejectionRatio( MESSAGE_T* message ); + // *********** public test support message functions ********** // MSG_TESTER_LOG_IN