From cff1f28e83961103a00ecd973434ea6a8d74b07c Mon Sep 17 00:00:00 2001 From: mazinskihenry <33608576+mazinskihenry@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:55:51 -0700 Subject: [PATCH] Vitals - Apply SpO2 Multipliers (#633) **When merged this pull request will:** - Applies SpO2 multipliers to PaO2 values - Fixes issue #632 ### IMPORTANT - [Development Guidelines](https://ace3.acemod.org/wiki/development/) are read, understood and applied. - Title of this PR uses our standard template `Component - Add|Fix|Improve|Change|Make|Remove {changes}`. --- addons/vitals/functions/fnc_handleOxygenFunction.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/vitals/functions/fnc_handleOxygenFunction.sqf b/addons/vitals/functions/fnc_handleOxygenFunction.sqf index dab0fab68..4922c4f99 100644 --- a/addons/vitals/functions/fnc_handleOxygenFunction.sqf +++ b/addons/vitals/functions/fnc_handleOxygenFunction.sqf @@ -95,7 +95,7 @@ private _pALVo2 = ((_fio2 * (_baroPressure - 47)) - (_paco2 / _anerobicPressure) private _pao2 = (DEFAULT_PAO2 - ((DEFAULT_ECB / ((GET_BODY_FLUID(_unit) select 0) max 100)) * ((_demandVentilation - _actualVentilation) / 120))) min _pALVo2; // PaO2 moves in controlled steps to prevent hard movements when Ventilation Demand spikes -_pao2 = if (_previousCyclePao2 != _pao2) then { ([ _previousCyclePao2 - (PAO2_MAX_CHANGE * _deltaT) , _previousCyclePao2 + (PAO2_MAX_CHANGE * _deltaT)] select ((_previousCyclePao2 - _pao2) < 0)) } else { _pao2 }; +_pao2 = if (_previousCyclePao2 != _pao2) then { ([ (_previousCyclePao2 - ((PAO2_MAX_CHANGE * EGVAR(breathing,SpO2_MultiplyNegative)) * _deltaT)) , (_previousCyclePao2 + ((PAO2_MAX_CHANGE * EGVAR(breathing,SpO2_MultiplyPositive)) * _deltaT))] select ((_previousCyclePao2 - _pao2) < 0)) } else { _pao2 }; // Oxy-Hemo Dissociation Curve, driven by PaO2 with shaping done by pH private _o2Sat = ((_pao2 max 1)^2.7 / ((25 - (((_pH / DEFAULT_PH) - 1) * 150))^2.7 + _pao2^2.7)) min 0.999;