Skip to content

Commit fbb73d0

Browse files
authored
Vitals - Fix respiratory depth (KAT-Advanced-Medical#763)
**When merged this pull request will:** - Fix resp depth to stop being 1 always ### 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}`.
1 parent 970a68a commit fbb73d0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

addons/vitals/functions/fnc_handleOxygenFunction.sqf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ if (IN_CRDC_ARRST(_unit)) then {
5454
_demandVentilation = ((((_actualHeartRate * HEART_RATE_CO2_MULTIPLIER) / _anerobicPressure) + ((_previousCyclePaco2 - DEFAULT_PACO2) * 200)) max MINIMUM_VENTILATION);
5555

5656
// Tidal Volume is modified by respiratory depth which can be supressed by opioids and pneumothroax
57-
_respiratoryDepth = [((DEFAULT_RESPIRATORY_DEPTH / 10) - (_opioidDepression / 1.5)), 10] select (_unit getVariable [QEGVAR(breathing,BVMInUse), false]);
58-
private _tidalVolume = GET_KAT_SURFACE_AREA(_unit) * (_respiratoryDepth / 1);
57+
_respiratoryDepth = [((DEFAULT_RESPIRATORY_DEPTH) - (_opioidDepression / 1.5)), 10] select (_unit getVariable [QEGVAR(breathing,BVMInUse), false]);
58+
private _tidalVolume = GET_KAT_SURFACE_AREA(_unit) * (_respiratoryDepth / 10);
5959

6060
// Respiratory Rate Calculation
6161
_respiratoryRate = [((_demandVentilation / _tidalVolume)) min MAXIMUM_RR, 20] select (_unit getVariable [QEGVAR(breathing,BVMInUse), false]);
@@ -85,7 +85,7 @@ if (IN_CRDC_ARRST(_unit)) then {
8585
};
8686
} else {
8787
// Generated ETCO2 quadratic. Ensures ETCO2 moves with Respiratory Rate and is constantly below PaCO2
88-
_etco2 = (((-0.0416667 * (_respiratoryRate^2)) + (3.09167 * (_respiratoryRate))) * (_respiratoryDepth)) max 5;
88+
_etco2 = (((-0.0416667 * (_respiratoryRate^2)) + (3.09167 * (_respiratoryRate))) * (_respiratoryDepth / 10 )) max 5;
8989
};
9090

9191
private _externalPh = 0;
@@ -132,5 +132,5 @@ private _o2Sat = (((_pao2 max 1)^2.7 / ((25 - (((_pH / DEFAULT_PH) - 1) * 150))^
132132

133133
_unit setVariable [VAR_BREATHING_RATE, (_respiratoryRate max 0), _syncValues];
134134
_unit setVariable [VAR_BLOOD_GAS, [_paco2, _pao2, _o2Sat, 24, _pH, _etco2], _syncValues];
135-
_unit setVariable [QGVAR(respiratoryDepth), ((_respiratoryDepth * 10) max 0), _syncValues];
135+
_unit setVariable [QGVAR(respiratoryDepth), ((_respiratoryDepth) max 0), _syncValues];
136136
_o2Sat * 100

0 commit comments

Comments
 (0)