Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -r1507b3d6f58c87107d96a9da744423d06a70057c -r63062ac38e905678faa6660652ada4a38a0e3b10 --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 1507b3d6f58c87107d96a9da744423d06a70057c) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 63062ac38e905678faa6660652ada4a38a0e3b10) @@ -1,6 +1,6 @@ /************************************************************************** * -* Copyright (c) 2019-2022 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-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. Index: firmware/App/HDCommon.h =================================================================== diff -u -ra5145a9c55cab63544fb158463fba3439bd05f15 -r63062ac38e905678faa6660652ada4a38a0e3b10 --- firmware/App/HDCommon.h (.../HDCommon.h) (revision a5145a9c55cab63544fb158463fba3439bd05f15) +++ firmware/App/HDCommon.h (.../HDCommon.h) (revision 63062ac38e905678faa6660652ada4a38a0e3b10) @@ -1,6 +1,6 @@ /************************************************************************** * -* Copyright (c) 2019-2022 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-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. @@ -25,7 +25,7 @@ #define HD_VERSION_MAJOR 0 #define HD_VERSION_MINOR 6 #define HD_VERSION_MICRO 0 -#define HD_VERSION_BUILD 31 +#define HD_VERSION_BUILD 33 // ********** development build switches ********** Index: firmware/App/Modes/ModeTreatmentParams.c =================================================================== diff -u -r3d72b777cf1ceb673d118341c46e2d6d5b7b75f5 -r63062ac38e905678faa6660652ada4a38a0e3b10 --- firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 3d72b777cf1ceb673d118341c46e2d6d5b7b75f5) +++ firmware/App/Modes/ModeTreatmentParams.c (.../ModeTreatmentParams.c) (revision 63062ac38e905678faa6660652ada4a38a0e3b10) @@ -871,6 +871,7 @@ return ( ( origTreatmentParams.uFVolume_L * ML_PER_LITER ) / origTreatmentParams.treatmentDuration_min ); } + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ @@ -909,7 +910,76 @@ } } } + return result; +} +/*********************************************************************//** + * @brief + * The testUpdateCurrentTreatmentParameters function pulls the current + * treatment parameters from the critical section if data has been + * determined to be valid. Calls sendTestCurrentTreatmentParametersResponse. + * @details Inputs: none + * @details Outputs: CURRENT_TREATMENT_PARAMS_DATA_PAYLOAD_T containing + * treatment parameters. + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testSendCurrentTreatmentParameters( void ) +{ + BOOL result = FALSE; + CURRENT_TREATMENT_PARAMS_DATA_PAYLOAD_T current_treatment_params; + + if ( TRUE == isTestingActivated() ) + { + // Test one parameter for set since all parameters are set after parameter validation. + if(TRUE == isCriticalDataSet( &treatmentParameters[TREATMENT_PARAM_BLOOD_FLOW] )) + { + result = TRUE; + current_treatment_params.accepted = TRUE; + current_treatment_params.treatment_parameters.bloodFlowRate_mL_min = getTreatmentParameterU32(TREATMENT_PARAM_BLOOD_FLOW); + current_treatment_params.treatment_parameters.dialysateFlowRate_mL_min = getTreatmentParameterU32(TREATMENT_PARAM_DIALYSATE_FLOW); + current_treatment_params.treatment_parameters.treatmentDuration_min = getTreatmentParameterU32(TREATMENT_PARAM_TREATMENT_DURATION); + current_treatment_params.treatment_parameters.heparinPreStop_min = getTreatmentParameterU32(TREATMENT_PARAM_HEPARIN_PRE_STOP_TIME); + current_treatment_params.treatment_parameters.salineBolusVolume_mL = getTreatmentParameterU32(TREATMENT_PARAM_SALINE_BOLUS_VOLUME); + current_treatment_params.treatment_parameters.acidConcentrate = getTreatmentParameterU32(TREATMENT_PARAM_ACID_CONCENTRATE); + current_treatment_params.treatment_parameters.bicarbConcentrate = getTreatmentParameterU32(TREATMENT_PARAM_BICARB_CONCENTRATE); + current_treatment_params.treatment_parameters.dialyzerType = getTreatmentParameterU32(TREATMENT_PARAM_DIALYZER_TYPE); + current_treatment_params.treatment_parameters.heparinType = getTreatmentParameterU32(TREATMENT_PARAM_HEPARIN_TYPE); + current_treatment_params.treatment_parameters.bloodPressureMeasurementInterval_min = getTreatmentParameterU32(TREATMENT_PARAM_BP_MEAS_INTERVAL); + current_treatment_params.treatment_parameters.rinsebackFlowRate_mL_min = getTreatmentParameterU32(TREATMENT_PARAM_RINSEBACK_FLOW_RATE); + current_treatment_params.treatment_parameters.arterialPressureLowLimit_mmHg = getTreatmentParameterS32(TREATMENT_PARAM_ART_PRESSURE_LOW_LIMIT); + current_treatment_params.treatment_parameters.arterialPressureHighLimit_mmHg = getTreatmentParameterS32(TREATMENT_PARAM_ART_PRESSURE_HIGH_LIMIT); + current_treatment_params.treatment_parameters.venousPressureLowLimit_mmHg = getTreatmentParameterS32(TREATMENT_PARAM_VEN_PRESSURE_LOW_LIMIT); + current_treatment_params.treatment_parameters.venousPressureHighLimit_mmHg = getTreatmentParameterS32(TREATMENT_PARAM_VEN_PRESSURE_HIGH_LIMIT); + current_treatment_params.treatment_parameters.heparinDispenseRate_mL_hr = getTreatmentParameterF32(TREATMENT_PARAM_HEPARIN_DISPENSE_RATE); + current_treatment_params.treatment_parameters.heparinBolusVolume_mL = getTreatmentParameterF32(TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME); + current_treatment_params.treatment_parameters.dialysateTemperature_degC = getTreatmentParameterF32(TREATMENT_PARAM_DIALYSATE_TEMPERATURE); + current_treatment_params.uFVolume_L = getTreatmentParameterF32(TREATMENT_PARAM_UF_VOLUME); + } + else + { + current_treatment_params.accepted = FALSE; + current_treatment_params.treatment_parameters.bloodFlowRate_mL_min = 0; + current_treatment_params.treatment_parameters.dialysateFlowRate_mL_min = 0; + current_treatment_params.treatment_parameters.treatmentDuration_min = 0; + current_treatment_params.treatment_parameters.heparinPreStop_min = 0; + current_treatment_params.treatment_parameters.salineBolusVolume_mL = 0; + current_treatment_params.treatment_parameters.acidConcentrate = 0; + current_treatment_params.treatment_parameters.bicarbConcentrate = 0; + current_treatment_params.treatment_parameters.dialyzerType = 0; + current_treatment_params.treatment_parameters.heparinType = 0; + current_treatment_params.treatment_parameters.bloodPressureMeasurementInterval_min = 0; + current_treatment_params.treatment_parameters.rinsebackFlowRate_mL_min = 0; + current_treatment_params.treatment_parameters.arterialPressureLowLimit_mmHg = 0; + current_treatment_params.treatment_parameters.arterialPressureHighLimit_mmHg = 0; + current_treatment_params.treatment_parameters.venousPressureLowLimit_mmHg = 0; + current_treatment_params.treatment_parameters.venousPressureHighLimit_mmHg = 0; + current_treatment_params.treatment_parameters.heparinDispenseRate_mL_hr = 0; + current_treatment_params.treatment_parameters.heparinBolusVolume_mL = 0; + current_treatment_params.treatment_parameters.dialysateTemperature_degC = 0; + current_treatment_params.uFVolume_L = 0; + } + sendTestCurrentTreatmentParametersResponse(current_treatment_params); + } return result; } Index: firmware/App/Modes/ModeTreatmentParams.h =================================================================== diff -u -r3d72b777cf1ceb673d118341c46e2d6d5b7b75f5 -r63062ac38e905678faa6660652ada4a38a0e3b10 --- firmware/App/Modes/ModeTreatmentParams.h (.../ModeTreatmentParams.h) (revision 3d72b777cf1ceb673d118341c46e2d6d5b7b75f5) +++ firmware/App/Modes/ModeTreatmentParams.h (.../ModeTreatmentParams.h) (revision 63062ac38e905678faa6660652ada4a38a0e3b10) @@ -72,6 +72,17 @@ F32 uFVolume_L; ///< Original ultrafiltration volume (in L) set by user before treatment start } ADJ_TREATMENT_PARAMS_T; + +/// Record structure for current treatment parameters +typedef struct +{ + U32 accepted; ///< Accepted or rejected based on if critical data has been set. + TREATMENT_PARAMS_DATA_PAYLOAD_T treatment_parameters; ///< Record structure of treatment parameters + F32 uFVolume_L; ///< Current ultrafiltration volume (in L). + +} CURRENT_TREATMENT_PARAMS_DATA_PAYLOAD_T; + + // ********** Public function prototypes ********** void initTreatParamsMode( void ); // Initialize this module @@ -97,6 +108,7 @@ F32 getUltrafiltrationRateOriginal( void ); // Get/calculate the original ultrafiltration rate, by ultrafiltration volume and treatment duration set in pre-treatment mode by user. BOOL testSetTreatmentParameter( TREATMENT_PARAM_T param, CRITICAL_DATAS_T value ); // Set a specific treatment parameter value +BOOL testSendCurrentTreatmentParameters(); // Update current treatment parameters /**@}*/ Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rf15b66d94af1b415f57a7cc37372dba4fa793fbe -r63062ac38e905678faa6660652ada4a38a0e3b10 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision f15b66d94af1b415f57a7cc37372dba4fa793fbe) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 63062ac38e905678faa6660652ada4a38a0e3b10) @@ -7,8 +7,8 @@ * * @file SystemComm.c * -* @author (last) Dara Navaei -* @date (last) 04-Jan-2022 +* @author (last) Hung Nguyen +* @date (last) 17-Feb-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -1611,6 +1611,9 @@ case MSG_ID_HD_FAN_RPM_ALARM_START_TIME_OFFSET_OVERRIDE: handleTestFansRPMAlarmStartTimeOffsetOverrideRequest( message ); + + case MSG_ID_HD_SYRINGE_PUMP_HEPRIN_BOLUS_TARGET_RATE_OVERRIDE: + handleTestSyringePumpHeprinBolusTargetRateOverrideRequest( message ); break; case MSG_ID_HD_REQ_CURRENT_TREATMENT_PARAMETERS: Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r3d72b777cf1ceb673d118341c46e2d6d5b7b75f5 -r63062ac38e905678faa6660652ada4a38a0e3b10 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 3d72b777cf1ceb673d118341c46e2d6d5b7b75f5) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 63062ac38e905678faa6660652ada4a38a0e3b10) @@ -2615,6 +2615,8 @@ return result; } + + /*********************************************************************//** * @brief * The handleChangeUFSettingsRequest function handles a ultrafiltration @@ -6812,4 +6814,48 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } +/*********************************************************************//** + * @brief + * The handleTestCurrentTreamtmentParametersRequest function handles a + * request to retrieve the current treatment parameters. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestCurrentTreamtmentParametersRequest( MESSAGE_T *message ) +{ + BOOL result = FALSE; + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + result = TRUE; + // ACK request + result = testSendCurrentTreatmentParameters(); + } + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The sendTestCurrentTreatmentParametersResponse function constructs a current + * treatment parameter response message to the appropriate CAN channel. + * @details Inputs: none + * @details Outputs: current treatment prameters response msg constructed and queued. + * @param data response data record + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendTestCurrentTreatmentParametersResponse(CURRENT_TREATMENT_PARAMS_DATA_PAYLOAD_T current_params) +{ + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_RES_CURRENT_TREATMENT_PARAMETERS; + msg.hdr.payloadLen = sizeof(CURRENT_TREATMENT_PARAMS_DATA_PAYLOAD_T); + memcpy(payloadPtr, ¤t_params, sizeof(CURRENT_TREATMENT_PARAMS_DATA_PAYLOAD_T)); + + return serializeMessage(msg, COMM_BUFFER_OUT_CAN_PC, ACK_REQUIRED ); +} + /**@}*/ Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -rf15b66d94af1b415f57a7cc37372dba4fa793fbe -r63062ac38e905678faa6660652ada4a38a0e3b10 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision f15b66d94af1b415f57a7cc37372dba4fa793fbe) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 63062ac38e905678faa6660652ada4a38a0e3b10) @@ -7,8 +7,8 @@ * * @file SystemCommMessages.h * -* @author (last) Dara Navaei -* @date (last) 04-Jan-2022 +* @author (last) Hung Nguyen +* @date (last) 15-Feb-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -654,6 +654,9 @@ // MSG_ID_HD_SYRINGE_PUMP_MEASURED_RATE_OVERRIDE: void handleTestSyringePumpMeasuredRateOverrideRequest( MESSAGE_T *message ); +// MSG_ID_HD_SYRINGE_PUMP_HEPRIN_BOLUS_TARGET_RATE_OVERRIDE: +void handleTestSyringePumpHeprinBolusTargetRateOverrideRequest( MESSAGE_T *message ); + // MSG_ID_HD_SYRINGE_PUMP_MEASURED_FORCE_OVERRIDE: void handleTestSyringePumpMeasuredForceOverrideRequest( MESSAGE_T *message );