Index: firmware/App/Modes/ModeTreatment.h =================================================================== diff -u -rcd19fd5095128315982b9ef810bd45e68eff8deb -r395522dffef1348e176564925656012f529c1910 --- firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision cd19fd5095128315982b9ef810bd45e68eff8deb) +++ firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision 395522dffef1348e176564925656012f529c1910) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2025-2025 Diality Inc. - All Rights Reserved. +* Copyright (c) 2025-2026 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 * -* @author (last) Sean -* @date (last) 25-Mar-2025 +* @author (last) Varshini Nagabooshanam +* @date (last) 09-Jan-2026 * -* @author (original) Sean -* @date (original) 25-Mar-2025 +* @author (original) Sean Nash +* @date (original) 21-Apr-2025 * ***************************************************************************/ @@ -51,12 +51,22 @@ U32 bldPrimeState; ///< Blood prime state. U32 dialysisState; ///< Dialysis state. U32 isoUFState; ///< Isolated ultrafiltration state. - U32 txStopState; ///< Treatment stop state. + U32 txPausedState; ///< Treatment paused state. U32 rinsebackState; ///< Rinse back state. U32 txRecircState; ///< Treatment recirc state. U32 txEndState; ///< Treatment end state. + U32 txSalBolusState; ///< Saline bolus state. + U32 txHepState; ///< Heparin state. } TREATMENT_STATE_DATA_T; +/// Payload record structure for a treatment set points message. +typedef struct +{ + U32 bloodFlow; ///< Set blood flow rate (mL/min). + U32 dialFlow; ///< Set dialysate flow rate (mL/min). + F32 dialTemp; ///< Set dialysate temperature (deg C). +} TREATMENT_SET_POINTS_T; + /// Payload record structure for a saline bolus data broadcast message. typedef struct { @@ -75,6 +85,11 @@ U32 ufState; ///< Ultrafiltration state. } UF_DATA_PAYLOAD_T; +/// Maximum time in this mode before blood sitting alarm given (in general task intervals). +#define MAX_TIME_BLOOD_SITTING ( ( 5 * SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ) +/// Maximum time in this mode before blood sitting warning given (in general task intervals). +#define WARN_TIME_BLOOD_SITTING ( ( 4 * SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ) + #pragma pack(pop) // ********** public function prototypes ********** @@ -85,6 +100,7 @@ void signalAlarmActionToTreatmentMode( ALARM_ACTION_T action ); // Execute alarm action as appropriate for treatment mode void signalEndTreatment( void ); // Requesting transition to post-treatment mode +void signalBloodPrimeToDialysis( void ); // Blood prime sub-mode is signaling to move on to dialysis sub-mode void broadcastTreatmentTimeAndState( void ); // Broadcast the times and states of this treatment @@ -93,6 +109,8 @@ BOOL isTreatmentResumeBlocked( void ); // Determine whether the treatment is not allowed to be resumed. U32 getTreatmentTimeRemainingSecs( void ); // Determine number of seconds remaining in the treatment U32 getActualTreatmentTimeSecs( void ); // Determine the actual treatment duration in seconds +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) +BOOL getBloodIsPrimed( void ); // Determine whether the blood-side circuit of the dialyzer has been primed with blood U32 getTreatmentStartTimeStamp( void ); // Get the treatment start time stamp U32 getTreatmentEndTimeStamp( void ); // Get the treatment end time stamp