diff --git a/addons/breathing/functions/fnc_checkBreathing.sqf b/addons/breathing/functions/fnc_checkBreathing.sqf
index 7f5042271..953aeae4f 100644
--- a/addons/breathing/functions/fnc_checkBreathing.sqf
+++ b/addons/breathing/functions/fnc_checkBreathing.sqf
@@ -28,11 +28,17 @@ private _breathing = LLSTRING(breathing_isNormal);
private _breathing_log = localize ACELSTRING(medical_treatment,Check_Pulse_Normal);
private _breath = "";
-if ((_patient getVariable [QGVAR(pneumothorax), 0] > 0) || (_patient getVariable [QEGVAR(chemical,airPoisoning), false])) then {
+private _respiratoryDepth = _patient getVariable [QEGVAR(vitals,respiratoryDepth), 10];
+if (((10 > _respiratoryDepth) && (_respiratoryDepth >= 7)) || (_patient getVariable [QEGVAR(chemical,airPoisoning), false])) then {
_breathing = LLSTRING(breathing_isShallow);
_breathing_log = LLSTRING(breathing_shallow);
};
+if (_respiratoryDepth < 7) then {
+ _breathing = LLSTRING(breathing_isVeryShallow);
+ _breathing_log = LLSTRING(breathing_Veryshallow);
+};
+
if (_ph < 7.2) then {
_breath = LLSTRING(breath_mild);
diff --git a/addons/breathing/stringtable.xml b/addons/breathing/stringtable.xml
index 4db0415a9..5c7815841 100644
--- a/addons/breathing/stringtable.xml
+++ b/addons/breathing/stringtable.xml
@@ -2379,6 +2379,12 @@
Oppervlakkig
Superficiale
+
+ Patient's breathing is very shallow
+
+
+ Very Shallow
+
Patient is not breathing
患者は呼吸していない
diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp
index a0396d871..610707747 100644
--- a/addons/main/script_macros.hpp
+++ b/addons/main/script_macros.hpp
@@ -280,6 +280,7 @@
#define DEFAULT_PH 7.4
#define DEFAULT_ETCO2 37
#define DEFAULT_BLOOD_GAS [DEFAULT_PACO2, DEFAULT_PAO2, DEFAULT_O2SAT, DEFAULT_HCO3, DEFAULT_PH, DEFAULT_ETCO2]
+#define DEFAULT_RESPIRATORY_DEPTH 10
#define DEFAULT_ANEROBIC_EXCHANGE 0.8
#define DEFAULT_TEMPERATURE 37
@@ -302,6 +303,9 @@
#define VAR_SURFACE_AREA 400
#define GET_KAT_SURFACE_AREA(unit) (VAR_SURFACE_AREA - (((unit getVariable [QEGVAR(breathing,pneumothorax), 0]) * 75)))
+#define VAR_RESPIRATORY_DEPTH QEGVAR(vitals,respiratoryDepth)
+#define GET_KAT_RESPIRATORY_DEPTH(unit) (unit getVariable [QEGVAR(vitals,respiratoryDepth), 10])
+
#define VAR_BLOOD_GAS QEGVAR(circulation,bloodGas)
#define VAR_BREATHING_RATE QEGVAR(breathing,breathRate)
diff --git a/addons/vitals/functions/fnc_fullHealLocal.sqf b/addons/vitals/functions/fnc_fullHealLocal.sqf
index 8b4cd8329..a34b00a0d 100644
--- a/addons/vitals/functions/fnc_fullHealLocal.sqf
+++ b/addons/vitals/functions/fnc_fullHealLocal.sqf
@@ -18,6 +18,7 @@
params ["_patient"];
_patient setVariable [QGVAR(simpleMedical), false, true];
+_patient setVariable [QGVAR(respiratoryDepth), DEFAULT_RESPIRATORY_DEPTH, true];
if (GVAR(enableSimpleMedical)) then {
_patient setVariable [QGVAR(simpleMedical), true, true];
diff --git a/addons/vitals/functions/fnc_handleOxygenFunction.sqf b/addons/vitals/functions/fnc_handleOxygenFunction.sqf
index 181936156..05b3ac6f4 100644
--- a/addons/vitals/functions/fnc_handleOxygenFunction.sqf
+++ b/addons/vitals/functions/fnc_handleOxygenFunction.sqf
@@ -31,8 +31,10 @@ params ["_unit", "_actualHeartRate", "_anerobicPressure", "_bloodGas", "_tempera
#define PACO2_MAX_CHANGE 0.05
#define PAO2_MAX_CHANGE 0.1
#define DEFAULT_FIO2 0.21
+#define MINIMUM_DEPTH 0.2
private _respiratoryRate = 0;
+private _respiratoryDepression = 0;
private _demandVentilation = 0;
private _actualVentilation = 0;
private _previousCyclePaco2 = (_bloodGas select 0);
@@ -41,6 +43,7 @@ private _previousCyclePao2 = (_bloodGas select 1);
if (IN_CRDC_ARRST(_unit)) then {
// When in arrest, there should be no effecive breaths but still a minimum O2 demand. Zero O2 demand would mean a dead patient. Actual ventilation is 1 to prevent issues in the gas tension functions
_demandVentilation = MINIMUM_VENTILATION;
+ _respiratoryDepression = 1;
_respiratoryRate = [0, 20] select (_unit getVariable [QEGVAR(breathing,BVMInUse), false]);
_actualVentilation = 1;
} else {
@@ -48,13 +51,17 @@ if (IN_CRDC_ARRST(_unit)) then {
_demandVentilation = ((((_actualHeartRate * HEART_RATE_CO2_MULTIPLIER) / _anerobicPressure) + ((_previousCyclePaco2 - DEFAULT_PACO2) * 200)) max MINIMUM_VENTILATION);
private _tidalVolume = GET_KAT_SURFACE_AREA(_unit);
- // Respiratory Rate is supressed by Opioids
- _respiratoryRate = [((_demandVentilation / _tidalVolume) - (_opioidDepression * 5)) min MAXIMUM_RR, 20] select (_unit getVariable [QEGVAR(breathing,BVMInUse), false]);
+ // Respiratory Depth is supressed by Opioids and pneumothorax
+ private _respiratoryDepth = (DEFAULT_RESPIRATORY_DEPTH - ((_unit getVariable [QEGVAR(breathing,pneumothorax), 0]) / 2));
+ _respiratoryDepression = [((_respiratoryDepth - (_opioidDepression * 5)) max MINIMUM_DEPTH), 10] select (_unit getVariable [QEGVAR(breathing,BVMInUse), false]);
+
+ // Respiratory Rate Calculation
+ _respiratoryRate = [((_demandVentilation / _tidalVolume)) min MAXIMUM_RR, 20] select (_unit getVariable [QEGVAR(breathing,BVMInUse), false]);
// If respiratory rate is low due to PaCO2, it starts increasing faster to compensate
if (_previousCyclePaco2 > 50) then { _respiratoryRate = (_respiratoryRate + ((_previousCyclePaco2 - 50) * 0.2)) min MAXIMUM_RR};
- _actualVentilation = _tidalVolume * _respiratoryRate;
+ _actualVentilation = _tidalVolume * _respiratoryRate * (_respiratoryDepression / 10);
};
private _paco2 = 40;
@@ -65,7 +72,7 @@ if (EGVAR(breathing,paco2Active)) then {
};
// Generated ETCO2 quadratic. Ensures ETCO2 moves with Respiratory Rate and is constantly below PaCO2
-private _etco2 = [((_paco2 - 3) - ((-0.0416667 * (_respiratoryRate^2)) + (3.09167 * (_respiratoryRate)) - DEFAULT_ETCO2) max 10), 0] select (IN_CRDC_ARRST(_unit));
+private _etco2 = [((((_paco2 - 3) - ((-0.0416667 * (_respiratoryRate^2)) + (3.09167 * (_respiratoryRate))) *(_respiratoryDepression / 10)) - DEFAULT_ETCO2) max 10), 0] select (IN_CRDC_ARRST(_unit));
private _externalPh = 0;
private _pH = 7.4;
@@ -105,5 +112,5 @@ private _o2Sat = ((_pao2 max 1)^2.7 / ((25 - (((_pH / DEFAULT_PH) - 1) * 150))^2
_unit setVariable [VAR_BREATHING_RATE, (_respiratoryRate max 0), _syncValues];
_unit setVariable [VAR_BLOOD_GAS, [_paco2, _pao2, _o2Sat, 24, _pH, _etco2], _syncValues];
-
+_unit setVariable [QGVAR(respiratoryDepth), (_respiratoryDepression max 0), _syncValues];
_o2Sat * 100