/************************************************************************** * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file ModeTreatmentParams.h * * @author (last) Sean Nash * @date (last) 29-May-2020 * * @author (original) Sean Nash * @date (original) 29-May-2020 * ***************************************************************************/ #ifndef __MODE_OP_PARAMS_H__ #define __MODE_OP_PARAMS_H__ #include "HDCommon.h" #include "HDDefs.h" #include "Utilities.h" /** * @defgroup HDTreatmentParamsMode HDTreatmentParamsMode * @brief Treatment parameters mode module. * * @addtogroup HDTreatmentParamsMode * @{ */ // ********** public definitions ********** /// Record structure for a treatment parameters payload. typedef struct { U32 bloodFlowRate_mL_min; U32 dialysateFlowRate_mL_min; U32 treatmentDuration_min; U32 heparinPreStop_min; U32 salineBolusVolume_mL; U32 acidConcentrate; U32 bicarbConcentrate; U32 dialyzerType; U32 bloodPressureMeasurementInterval_min; U32 rinsebackFlowRate_mL_min; S32 arterialPressureLowLimit_mmHg; S32 arterialPressureHighLimit_mmHg; S32 venousPressureLowLimit_mmHg; S32 venousPressureHighLimit_mmHg; F32 heparinDispenseRate_mL_hr; F32 heparinBolusVolume_mL; F32 dialysateTemperature_degC; } TREATMENT_PARAMS_DATA_PAYLOAD_T; /// Record structure for adjustable treatment parameters typedef struct { U32 bloodFlowRate_mL_min; U32 dialysateFlowRate_mL_min; U32 treatmentDuration_min; S32 arterialPressureLowLimit_mmHg; S32 arterialPressureHighLimit_mmHg; S32 venousPressureLowLimit_mmHg; S32 venousPressureHighLimit_mmHg; F32 uFVolume_L; } ADJ_TREATMENT_PARAMS_T; // ********** public function prototypes ********** void initTreatParamsMode( void ); // initialize this module void transitionToTreatParamsMode( void ); // prepares for transition to treatment parameters mode U32 execTreatParamsMode( void ); // execute the treatment parameters mode state machine (call from OperationModes) BOOL validateAndSetTreatmentParameters( TREATMENT_PARAMS_DATA_PAYLOAD_T params ); // user provided treatment params to be set and validated BOOL signalUserConfirmationOfTreatmentParameters( void ); // User has confirmed treatment parameters BOOL signalUserCancelTreatment( void ); // User has cancelled treatment BOOL setTreatmentParameterU32( TREATMENT_PARAM_T param, U32 value ); // Set a specified unsigned integer treatment parameter value BOOL setTreatmentParameterS32( TREATMENT_PARAM_T param, S32 value ); // Set a specified signed integer treatment parameter value BOOL setTreatmentParameterF32( TREATMENT_PARAM_T param, F32 value ); // Set a specified floating point treatment parameter value U32 getTreatmentParameterU32( TREATMENT_PARAM_T param ); // Get a specified unsigned integer treatment parameter S32 getTreatmentParameterS32( TREATMENT_PARAM_T param ); // Get a specified signed integer treatment parameter F32 getTreatmentParameterF32( TREATMENT_PARAM_T param ); // Get a specified floating point treatment parameter BOOL testSetTreatmentParameter( TREATMENT_PARAM_T param, CRITICAL_DATAS_T value ); // Set a specific treatment parameter value /**@}*/ #endif