Index: firmware/App/Modes/ModeTreatment.h =================================================================== diff -u -rac6532c81f2a6d4ad1c67420c22d59f6aeeaae13 -r24b2fe72608344e67ef37234085d15ad5e4fcc37 --- firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision ac6532c81f2a6d4ad1c67420c22d59f6aeeaae13) +++ firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision 24b2fe72608344e67ef37234085d15ad5e4fcc37) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2022 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 ModeTreatment.h +* @file ModeTreatment.h * -* @author (last) Sean Nash -* @date (last) 28-Aug-2020 +* @author (last) Dara Navaei +* @date (last) 12-Nov-2021 * -* @author (original) Dara Navaei -* @date (original) 05-Nov-2019 +* @author (original) Dara Navaei +* @date (original) 05-Nov-2019 * ***************************************************************************/ @@ -52,6 +52,7 @@ U32 bldPrimeState; U32 txEndState; U32 txStopState; + U32 dialysisState; } TREATMENT_STATE_DATA_T; /// Payload record structure for an ultrafiltration volume change confirmation message. @@ -81,10 +82,20 @@ S32 venHighLimit; } PRESSURE_LIMIT_CHANGE_RESPONSE_T; +/// Payload record structure for the treatment log 30 minutes periodic data. +typedef struct +{ + F32 avgBloodFlowRate; + F32 avgDialysateFlowRate; + F32 avgUFRate; + F32 avgArterialPressure; + F32 avgVenousPressure; +} TREATMENT_LOG_DATA_PERIODIC_T; + // ********** public function prototypes ********** void initTreatmentMode( void ); // Initialize this module -void transitionToTreatmentMode( void ); // Prepares for transition to treatment mode +U32 transitionToTreatmentMode( void ); // Prepares for transition to treatment mode U32 execTreatmentMode( void ); // Execute the treatment mode state machine (call from OperationModes) void signalAlarmActionToTreatmentMode( ALARM_ACTION_T action ); // Execute alarm action as appropriate for Treatment mode void signalGoToTreatmentStopped( void ); // Rinseback or Re-circ sub-mode is signaling to return to treatment stopped sub-mode @@ -96,11 +107,21 @@ TREATMENT_STATE_T getTreatmentState( void ); // Determine the current treatment sub-mode (state) BOOL isTreatmentCompleted( void ); // Determine whether the treatment has completed U32 getTreatmentTimeRemainingSecs( void ); // Determine number of seconds remaining in the treatment +U32 getActualTreatmentTimeSecs( void ); // Determine the actual treatment duration in seconds BOOL getRinsebackCompleted( void ); // Determine whether a rinseback has been completed void setRinsebackIsCompleted( BOOL flag ); // Set whether a rinseback has been completed (T blocks rinseback option) BOOL getBloodIsPrimed( void ); // Determine whether the blood-side circuit of the dialyzer has been primed with blood void setBloodIsPrimed( BOOL flag ); // Set whether the blood-side circuit of the dialyzer has been primed with blood (F causes Tx start/resume to do blood prime first) +F32 getTreatmentAvgBloodFlowRate( void ); // Get the average blood flow rate during treatment +F32 getTreatmentAvgDialysateFlowRate( void ); // Get the average dialysate flow rate during treatment +F32 getTreatmentAvgDialysateTemp( void ); // Get the average dialysate temperature during treatment +F32 getTreatmentAvgArterialPressure( void ); // Get the average arterial pressure during treatment +F32 getTreatmentAvgVenousPressure( void ); // Get the average venous pressure during treatment + +U32 getTreatmentStartTimeStamp( void ); // Get the treatment start time stamp +U32 getTreatmentEndTimeStamp( void ); // Get the treatment end time stamp + void broadcastTreatmentTimeAndState( void ); // Broadcast the times and states of this treatment BOOL verifyTreatmentDurationSettingChange( U32 treatmentTime ); @@ -110,6 +131,12 @@ BOOL verifyPressureLimitsChange( PRESSURE_LIMIT_CHANGE_REQUEST_T *data ); BOOL testSetTreatmentTimeRemainingOverride( U32 value ); +BOOL testSetTreatmentTimePublishIntervalOverride( U32 ms ); +BOOL testResetTreatmentTimePublishIntervalOverride( void ); +BOOL testSetTreatmentStatePublishIntervalOverride( U32 ms ); +BOOL testResetTreatmentStatePublishIntervalOverride( void ); +BOOL testSetTreatmentParamRangesPublishIntervalOverride( U32 ms ); +BOOL testResetTreatmentParamRangesPublishIntervalOverride( void ); /**@}*/