Index: firmware/App/Services/StateServices/TubeSetInstall.c =================================================================== diff -u -rda286decac70b8da5b369ccca36c05fb5bdb7c73 -rc2951f468ebc19160ee9af14cc9c35bc16121889 --- firmware/App/Services/StateServices/TubeSetInstall.c (.../TubeSetInstall.c) (revision da286decac70b8da5b369ccca36c05fb5bdb7c73) +++ firmware/App/Services/StateServices/TubeSetInstall.c (.../TubeSetInstall.c) (revision c2951f468ebc19160ee9af14cc9c35bc16121889) @@ -368,4 +368,39 @@ return currentTubeSetType; } +/*********************************************************************//** + * @brief + * The validateTubeSetType function validates the current installed tube set type + * based on modality. + * @details \b Alarm: + * @details \b Inputs: none + * @details \b Outputs: none + * @return none. + *************************************************************************/ +void validateTubeSetType( void ) +{ + U32 modality = getTreatmentParameterU32( TREATMENT_PARAM_TREATMENT_MODALITY ); + BOOL misMatch = FALSE; + + if ( TREATMENT_MODALITY_HDF_ONLINE_FLUID == modality ) + { + if ( TUBE_SET_TYPE_HDF != currentTubeSetType ) + { + misMatch = TRUE; + } + } + else + { + if ( TREATMENT_MODALITY_HD_SALINE_FLUID != currentTubeSetType ) + { + misMatch = TRUE; + } + } + + if ( TRUE == misMatch ) + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_TUBE_SET_MISMATCH, modality, (U32)currentTubeSetType ); + } +} + /**@}*/