Index: firmware/App/Services/TxParams.c =================================================================== diff -u -r12af1351f6db7747ebe2b4c52a9bac41ef551968 -r78f8971ee792bddaeb4c9c34294aa0929a908d5d --- firmware/App/Services/TxParams.c (.../TxParams.c) (revision 12af1351f6db7747ebe2b4c52a9bac41ef551968) +++ firmware/App/Services/TxParams.c (.../TxParams.c) (revision 78f8971ee792bddaeb4c9c34294aa0929a908d5d) @@ -123,7 +123,7 @@ { CRITICAL_DATA_TYPE_U32, {.uInt=300}, {.uInt=500}, {.uInt=300} }, // TREATMENT_PARAM_PRIME_RINSEBACK_VOLUME { CRITICAL_DATA_TYPE_U32, {.uInt=0}, {.uInt=3}, {.uInt=0} }, // TREATMENT_PARAM_HEPATITIS_B { CRITICAL_DATA_TYPE_U32, {.uInt=0}, {.uInt=2}, {.uInt=0} }, // TREATMENT_PARAM_ACID_CONCENTRATE - { CRITICAL_DATA_TYPE_U32, {.uInt=0}, {.uInt=1}, {.uInt=0} }, // TREATMENT_PARAM_CONFIRMATION +// { CRITICAL_DATA_TYPE_U32, {.uInt=0}, {.uInt=1}, {.uInt=0} }, // TREATMENT_PARAM_CONFIRMATION { CRITICAL_DATA_TYPE_F32, {.sFlt=0.0}, {.sFlt=48.0}, {.sFlt=1.0} }, // TREATMENT_PARAM_SUBST_FLUID_VOLUME { CRITICAL_DATA_TYPE_F32, {.sFlt=0.0}, {.sFlt=2.0}, {.sFlt=0.0} }, // TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME { CRITICAL_DATA_TYPE_F32, {.sFlt=0.0}, {.sFlt=3.0}, {.sFlt=0.0} }, // TREATMENT_PARAM_HEPARIN_DELIVERY_RATE @@ -230,8 +230,6 @@ sysConfigTreatmentParameters[ sysConfigTxParam ].maximum = SYS_CONFIG_TREAT_PARAMS_PROPERTIES[ sysConfigTxParam ].max; sysConfigTreatmentParameters[ sysConfigTxParam ].defValue = SYS_CONFIG_TREAT_PARAMS_PROPERTIES[ sysConfigTxParam ].def; resetCriticalData( &sysConfigTreatmentParameters[ sysConfigTxParam ] ); - // Set staged parameter values to zero -// stagedParams[ param ].uInt = 0; } // Zero original parameter values @@ -450,18 +448,20 @@ // Verify message payload length is valid if ( sizeof( TREATMENT_PARAMS_DATA_PAYLOAD_T ) == message->hdr.payloadLen ) { - memcpy( ¶ms, message->payload, sizeof( TREATMENT_PARAMS_DATA_PAYLOAD_T ) ); + // copy only the treatment parameters excluding the confirmation payload field + memcpy( ¶ms, message->payload + sizeof(BOOL), sizeof( TREATMENT_PARAMS_DATA_PAYLOAD_T ) - sizeof(BOOL) ); + // Flag indicating if the user have sent the tx params validation from pre-treatment create rx state, + // so that if all params are valid, TD software will transition state to patient connection + memcpy( ¶msConfirmed, message->payload, sizeof(BOOL) ); // Check the received arterial and venous pressure values from the UI to be checked and capped against the min and max // values in the institutional record // checkPressureParamsRange( ¶ms ); // TODO do as pre-check when user click create tx // Extract treatment parameters from given payload to staging array so we can more easily work with them extractTreatmentParamsFromPayload( params ); - // Flag that indicates if the user have sent the tx params validation from pre-treatment create rx state, - // so that if all params are valid, TD software will transition state to patient connection - paramsConfirmed = (BOOL)stagedParams[ TREATMENT_PARAM_TREATMENT_DURATION ].uInt; + // Range check each treatment parameter paramsAreInRange = checkTreatmentParamsInRange( &rejReasons[0] ); Index: firmware/App/Services/TxParams.h =================================================================== diff -u -r12af1351f6db7747ebe2b4c52a9bac41ef551968 -r78f8971ee792bddaeb4c9c34294aa0929a908d5d --- firmware/App/Services/TxParams.h (.../TxParams.h) (revision 12af1351f6db7747ebe2b4c52a9bac41ef551968) +++ firmware/App/Services/TxParams.h (.../TxParams.h) (revision 78f8971ee792bddaeb4c9c34294aa0929a908d5d) @@ -41,6 +41,7 @@ /// Record structure for a treatment parameters payload from UI. typedef struct { + BOOL finalConfirmation; ///< Confirmation flag indicating treatment params validated are final U32 treatmentModality; ///< User set treatment modality option U32 hdfDilution; ///< User set HDF dilution option U32 bloodFlowRate_mL_min; ///< User set blood flow rate (in mL/min) @@ -57,7 +58,6 @@ U32 rinsebackVolume_mL; ///< User set rinseback volume (in mL) U32 hepatitisBStatus; ///< User set Hepatitis B status option U32 acidConcentrate; ///< User set acid concentrate option - U32 finalConfirmation; ///< Confirmation flag indicating treatment params validated are final F32 substitutionFluidVolume_L; ///< User set substitution fluid volume (in L) F32 hepBolusVolume_mL; ///< User set Heparin bolus volume (in mL) F32 hepDeliveryRate_mL_hr; ///< User set Heparin delivery rate (in mL/hr)