Index: firmware/App/Services/TxParams.c =================================================================== diff -u -r4205dc894c6df0d84072778fcd80dcaed93f75fa -r880a9762cc029d858dfbaadc678afa2c6f8633a2 --- firmware/App/Services/TxParams.c (.../TxParams.c) (revision 4205dc894c6df0d84072778fcd80dcaed93f75fa) +++ firmware/App/Services/TxParams.c (.../TxParams.c) (revision 880a9762cc029d858dfbaadc678afa2c6f8633a2) @@ -1005,8 +1005,8 @@ * The isTreatmentParamInRange function determines whether a given treatment * parameter is in range. * @details \b Alarm: ALARM_ID_TD_SOFTWARE_FAULT if given param is invalid - * @details \b Inputs: treatParamsRanges[], hdInstitutionalRecord - * @details \b Outputs: none + * @details \b Inputs: TREAT_PARAMS_PROPERTIES[]. + * @details \b Outputs: none. * @param param ID of parameter to check range for * @param value value of parameter to check range for * @return TRUE if given treatment parameter is in range, FALSE if not @@ -1475,18 +1475,20 @@ * @brief * The validateAndSetTreatmentDuration function handles the UI treatment * duration validation request during Treatment mode. - * @details \b Message \b Sent: MSG_ID_TD_DURATION_VALIDATE_RESPONSE including acceptance status, rejection reason, requested duration, UF volume goal (L), + * @details \b Message \b Sent: MSG_ID_TD_DURATION_VALIDATE_RESPONSE including acceptance status, + * rejection reason, requested duration, UF volume goal (L), * calculated UF rate (L/hr) and heparin delivery duration (minutes). * @details \b Inputs: none. - * @details \b Outputs: validTreatmentDurationReceived, validatedTreatmentDuration_min, validatedUFRateLhr, validatedHeparinDeliveryDuration_min. + * @details \b Outputs: validTreatmentDurationReceived, validatedTreatmentDuration_min, + * validatedUFRateLhr, validatedHeparinDeliveryDuration_min. * @param message set message from UI which includes the requested treatment duration in minutes. * @return TRUE if response message is sent successfully, FALSE otherwise. *************************************************************************/ BOOL validateAndSetTreatmentDuration( MESSAGE_T *message ) { BOOL result = FALSE; - DURATION_VALIDATE_REQUEST_PAYLOAD_T request; - DURATION_VALIDATE_RESPONSE_PAYLOAD_T response; + TREATMENT_DURATION_VALIDATE_REQUEST_PAYLOAD_T request; + TREATMENT_DURATION_VALIDATE_RESPONSE_PAYLOAD_T response; F32 presUFVolumeMl = getTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME ) * (F32)ML_PER_LITER; F32 elapsedTreatmentTimeMin = (F32)getActualTreatmentTimeSecs() / (F32)SEC_PER_MIN; @@ -1513,9 +1515,9 @@ validatedUFRateLhr = 0.0F; validatedHeparinDeliveryDuration_min = 0U; - if ( message->hdr.payloadLen == sizeof( DURATION_VALIDATE_REQUEST_PAYLOAD_T ) ) + if ( message->hdr.payloadLen == sizeof( TREATMENT_DURATION_VALIDATE_REQUEST_PAYLOAD_T ) ) { - memcpy( &request, &message->payload[ 0 ], sizeof( DURATION_VALIDATE_REQUEST_PAYLOAD_T ) ); + memcpy( &request, &message->payload[ 0 ], sizeof( TREATMENT_DURATION_VALIDATE_REQUEST_PAYLOAD_T ) ); response.duration = request.duration; @@ -1580,7 +1582,7 @@ } } - result = sendMessage( MSG_ID_TD_DURATION_VALIDATE_RESPONSE, COMM_BUFFER_OUT_CAN_TD_2_UI, (U08 *)&response, sizeof( DURATION_VALIDATE_RESPONSE_PAYLOAD_T ) ); + result = sendMessage( MSG_ID_TD_DURATION_VALIDATE_RESPONSE, COMM_BUFFER_OUT_CAN_TD_2_UI, (U08 *)&response, sizeof( TREATMENT_DURATION_VALIDATE_RESPONSE_PAYLOAD_T ) ); return result; } @@ -1589,7 +1591,8 @@ * @brief * The validateAndSetBolusVolume function handles the UI fluid bolus volume * change request during Treatment mode. - * @details \b Message \b Sent: MSG_ID_TD_BOLUS_VOLUME_CHANGE_RESPONSE including acceptance status and rejection reason. + * @details \b Message \b Sent: MSG_ID_TD_BOLUS_VOLUME_CHANGE_RESPONSE including acceptance status + * and rejection reason. * @details \b Inputs: none. * @details \b Outputs: none. * @param message set message from UI which includes the requested bolus volume. @@ -1633,7 +1636,8 @@ * @brief * The pressureLimitHandleChangeRequest function handles the UI pressure * limit change request during Treatment mode. - * @details \b Message \b Sent: MSG_ID_TD_PRESSURE_LIMITS_CHANGE_RESPONSE including acceptance status and per-parameter rejection reasons. + * @details \b Message \b Sent: MSG_ID_TD_PRESSURE_LIMITS_CHANGE_RESPONSE including acceptance status + * and per-parameter rejection reasons. * @details \b Inputs: none. * @details \b Outputs: none. * @param message set message from UI which includes the requested pressure limit windows. @@ -1815,7 +1819,8 @@ * @brief * The validateAndSetUFVolume function handles the UI ultrafiltration * volume validation request during Treatment mode. - * @details \b Message \b Sent: MSG_ID_TD_RESP_ULTRAFILTRATION_VOLUME_TO_VALIDATE including acceptance status, rejection reason, UF volume goal (L), and UF rate (L/hr). + * @details \b Message \b Sent: MSG_ID_TD_TREATMENT_UF_VOLUME_VALIDATE_RESPONSE including acceptance status, + * rejection reason, UF volume goal (L), and UF rate (L/hr). * @details \b Inputs: none. * @details \b Outputs: validUFVolumeReceived, validatedUFVolumeGoalL, validatedUFRateLhr. * @param message set message from UI which includes the requested UF volume in L. @@ -1911,29 +1916,30 @@ /*********************************************************************//** * @brief - * The validateAndSetTreatmentSetPoints function handles a UI treatment - * set point change request during Treatment mode. - * @details \b Message \b Sent: MSG_ID_TD_TREATMENT_SET_POINTS_CHANGE_RESPONSE including acceptance status and rejection reason for each treatment set point parameter. + * The validateAndSetTreatmentSetPoints function handles a UI prescription + * settings change request during Treatment mode. + * @details \b Message \b Sent: MSG_ID_TD_TREATMENT_SET_POINTS_CHANGE_RESPONSE including acceptance status + * and rejection reason for each prescription setting. * @details \b Inputs: none. * @details \b Outputs: none. - * @param message set message from UI which includes the requested treatment set point values. + * @param message set message from UI which includes the requested prescription setting values. * @return TRUE if response message is sent successfully, FALSE otherwise. *************************************************************************/ BOOL validateAndSetTreatmentSetPoints( MESSAGE_T *message ) { BOOL result = FALSE; BOOL isValid = TRUE; CRITICAL_DATAS_T requestedValue; - TREATMENT_PARAMETER_EDIT_REQUEST_T request; - TREATMENT_SET_POINTS_CHANGE_RESPONSE_T response; + TREATMENT_PRESCRIPTION_SETTINGS_EDIT_REQUEST_T request; + TREATMENT_PRESCRIPTION_SETTINGS_EDIT_RESPONSE_T response; memset( &requestedValue, 0, sizeof( requestedValue ) ); memset( &request, 0, sizeof( request ) ); memset( &response, 0, sizeof( response ) ); if ( message->hdr.payloadLen == sizeof( request ) ) { - memcpy( &request, message->payload, sizeof( TREATMENT_PARAMETER_EDIT_REQUEST_T ) ); + memcpy( &request, message->payload, sizeof( TREATMENT_PRESCRIPTION_SETTINGS_EDIT_REQUEST_T ) ); requestedValue.uInt = request.treatmentModality; if ( FALSE == isTreatmentParamInRange( TREATMENT_PARAM_TREATMENT_MODALITY, requestedValue ) ) @@ -2026,15 +2032,17 @@ response.rejectionReason[ TREATMENT_SETPOINT_BLOOD_FLOW ] = REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT; } - result = sendMessage( MSG_ID_TD_TREATMENT_SET_POINTS_CHANGE_RESPONSE, COMM_BUFFER_OUT_CAN_TD_2_UI, (U08 *)&response, sizeof( TREATMENT_SET_POINTS_CHANGE_RESPONSE_T ) ); + result = sendMessage( MSG_ID_TD_TREATMENT_SET_POINTS_CHANGE_RESPONSE, COMM_BUFFER_OUT_CAN_TD_2_UI, (U08 *)&response, sizeof( TREATMENT_PRESCRIPTION_SETTINGS_EDIT_RESPONSE_T ) ); return result; } /*********************************************************************//** * @brief - * The validateAndSetBloodFlowRate function handles a UI treatment set point blood flow rate change request during Treatment mode. - * @details \b Message \b Sent: MSG_ID_TD_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_RESPONSE including acceptance status and rejection reason. + * The validateAndSetBloodFlowRate function handles a UI treatment set point + * blood flow rate change request during Treatment mode. + * @details \b Message \b Sent: MSG_ID_TD_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_RESPONSE + * including acceptance status and rejection reason. * @details \b Inputs: none. * @details \b Outputs: none. * @param message set message from UI which includes the requested blood flow rate. @@ -2082,7 +2090,8 @@ * @brief * The validateAndSetDialysateFlowRate function handles a UI treatment set point * dialysate flow rate change request during Treatment mode. - * @details \b Message \b Sent: MSG_ID_TD_TREATMENT_SET_POINT_DIALYSATE_FLOW_CHANGE_RESPONSE including acceptance status and rejection reason. + * @details \b Message \b Sent: MSG_ID_TD_TREATMENT_SET_POINT_DIALYSATE_FLOW_CHANGE_RESPONSE + * including acceptance status and rejection reason. * @details \b Inputs: none. * @details \b Outputs: none. * @param message set message from UI which includes the requested dialysate flow rate. @@ -2129,7 +2138,8 @@ * @brief * The validateAndSetDialysateTemperature function handles a UI treatment * set point dialysate temperature change request during Treatment mode. - * @details \b Message \b Sent: MSG_ID_TD_TREATMENT_SET_POINT_DIALYSATE_TEMPERATURE_CHANGE_RESPONSE including acceptance status and rejection reason. + * @details \b Message \b Sent: MSG_ID_TD_TREATMENT_SET_POINT_DIALYSATE_TEMP_CHANGE_RESPONSE + * including acceptance status and rejection reason. * @details \b Inputs: none. * @details \b Outputs: none. * @param message set message from UI which includes the requested dialysate temperature. @@ -2176,26 +2186,30 @@ * @brief * The signalUserConfirmationOfTreatmentDuration function handles the UI * treatment duration confirmation request during Treatment mode. - * @details \b Message \b Sent: MSG_ID_TD_DURATION_CONFIRM_RESPONSE including acceptance status and rejection reason. - * @details \b Inputs: validTreatmentDurationReceived, validatedTreatmentDuration_min, validatedUFRateLhr, validatedHeparinDeliveryDuration_min. - * @details \b Outputs: validTreatmentDurationReceived, validatedTreatmentDuration_min, validatedUFRateLhr, validatedHeparinDeliveryDuration_min. - * @param message set message from UI which includes the confirmed treatment duration, UF rate and heparin delivery duration. + * @details \b Message \b Sent: MSG_ID_TD_DURATION_CONFIRM_RESPONSE including acceptance status + * and rejection reason. + * @details \b Inputs: validTreatmentDurationReceived, validatedTreatmentDuration_min, + * validatedUFRateLhr, validatedHeparinDeliveryDuration_min. + * @details \b Outputs: validTreatmentDurationReceived, validatedTreatmentDuration_min, + * validatedUFRateLhr, validatedHeparinDeliveryDuration_min. + * @param message set message from UI which includes the confirmed treatment duration, + * UF rate and heparin delivery duration. * @return TRUE if response message is sent successfully, FALSE otherwise. *************************************************************************/ BOOL signalUserConfirmationOfTreatmentDuration( MESSAGE_T *message ) { BOOL result = FALSE; - DURATION_CONFIRM_REQUEST_PAYLOAD_T request; + TREATMENT_DURATION_CONFIRM_REQUEST_PAYLOAD_T request; UI_RESPONSE_PAYLOAD_T response; F32 presUFVolumeMl = getTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME ) * (F32)ML_PER_LITER; F32 validatedUFRateMlMin = ( validatedUFRateLhr * (F32)ML_PER_LITER ) / (F32)MIN_PER_HOUR; response.accepted = FALSE; response.rejectionReason = REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT; - if ( message->hdr.payloadLen == sizeof( DURATION_CONFIRM_REQUEST_PAYLOAD_T ) ) + if ( message->hdr.payloadLen == sizeof( TREATMENT_DURATION_CONFIRM_REQUEST_PAYLOAD_T ) ) { - memcpy( &request, &message->payload[ 0 ], sizeof( DURATION_CONFIRM_REQUEST_PAYLOAD_T ) ); + memcpy( &request, &message->payload[ 0 ], sizeof( TREATMENT_DURATION_CONFIRM_REQUEST_PAYLOAD_T ) ); // Verify confirmed duration and UF rate match previously validated values. if ( ( TRUE == validTreatmentDurationReceived ) && ( request.duration == validatedTreatmentDuration_min ) && @@ -2235,7 +2249,8 @@ * @brief * The signalUserConfirmationOfUFVolume function handles the UI * ultrafiltration volume confirmation request during Treatment mode. - * @details \b Message \b Sent: MSG_ID_TD_ULTRAFILTRATION_CHANGE_CONFIRM_RESPONSE including acceptance status and rejection reason. + * @details \b Message \b Sent: MSG_ID_TD_ULTRAFILTRATION_CHANGE_CONFIRM_RESPONSE + * including acceptance status and rejection reason. * @details \b Inputs: validUFVolumeReceived, validatedUFVolumeGoalL, validatedUFRateLhr. * @details \b Outputs: validUFVolumeReceived, validatedUFVolumeGoalL, validatedUFRateLhr. * @param message set message from UI which includes the confirmed UF volume and UF rate. @@ -2265,7 +2280,6 @@ { setTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME, validatedUFVolumeGoalL ); updateTreatmentBroadcastData( validatedUFRateLhr ); - setDialysisDDParams( getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ), validatedUFVolumeGoalMl, validatedUFRateMlMin ); response.accepted = TRUE;