Index: firmware/App/Modes/ModeTreatmentParams.c =================================================================== diff -u -r2ec63f115c0c07825fe21899058872d6ca70746b -r0b8564de1aeab98438bd2e4e1b666d77b4d506df --- firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 2ec63f115c0c07825fe21899058872d6ca70746b) +++ firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 0b8564de1aeab98438bd2e4e1b666d77b4d506df) @@ -1058,8 +1058,12 @@ 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 ); - result &= ( ( nvInstRcrd->minVenPressWideLimitWindowMMHG <= INSTIT_MAX_MIN_VEN_PRES_WIDE_LIMIT_MMHG ) && - ( nvInstRcrd->minVenPressWideLimitWindowMMHG >= INSTIT_MIN_MIN_VEN_PRES_WIDE_LIMIT_MMHG ) ? TRUE : FALSE ); + result &= ( ( nvInstRcrd->minVenPressWideLimitWindowMMHG <= INSTIT_MAX_MIN_VEN_PRES_WIDE_LIMIT_MMHG ) && + ( nvInstRcrd->minVenPressWideLimitWindowMMHG >= INSTIT_MIN_MIN_VEN_PRES_WIDE_LIMIT_MMHG ) ? TRUE : FALSE ); + // NOTE: the treatment end blood flow rate in mL/min can be either 0 or 100 <= blood flow mL/min <= 500. + result &= ( ( ( nvInstRcrd->txEndBloodFlowMLPM == 0 ) || + ( nvInstRcrd->txEndBloodFlowMLPM >= TREAT_PARAMS_PROPERTIES[ TREATMENT_PARAM_BLOOD_FLOW ].min.uInt ) ) && + ( nvInstRcrd->txEndBloodFlowMLPM <= TREAT_PARAMS_PROPERTIES[ TREATMENT_PARAM_BLOOD_FLOW ].max.uInt ) ? TRUE : FALSE ); return result; } @@ -1071,17 +1075,29 @@ * treatment parameters. * @details Inputs: none * @details Outputs: hdInstitutionalRecord - * @param nvInstitutionalRecord pointer to the newly received institutional record - * in the non-volatile data management. - * @return none + * @return Institutional record treatment end blood flow in mL/min *************************************************************************/ void setNVInstitutionalRecordToTxParamsRecord( HD_INSTITUTIONAL_RECORD_T* nvInstitutionalRecord ) { - memcpy( &hdInstitutionalRecord, nvInstitutionalRecord, sizeof(HD_INSTITUTIONAL_RECORD_T) ); + memcpy( &hdInstitutionalRecord, nvInstitutionalRecord, sizeof( HD_INSTITUTIONAL_RECORD_T ) ); } /*********************************************************************//** * @brief + * The getNVInstitutionalRecordTxEndBloodFlowMLPM function returns the institutional + * record's treatment end blood flow in mL/min. + * @details Inputs: hdInstitutionalRecord + * @details Outputs: none + * @return none + *************************************************************************/ +U32 getNVInstitutionalRecordTxEndBloodFlowMLPM( void ) +{ + return hdInstitutionalRecord.txEndBloodFlowMLPM; + +} + +/*********************************************************************//** + * @brief * The extractTreatmentParamsFromPayload function extracts the individual * treatment parameters received from the UI into a staging array where * they will be validated and stay until user confirms them.