-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circulation - Add/Change BP and HR default behavior #602
base: dev-Tomcat
Are you sure you want to change the base?
Changes from 4 commits
30d972f
54ba560
e8c90f1
e5b6e0d
9f24b4b
c1669dd
b54ece6
13a1a43
6d7be26
8a884ae
7447e1a
cafa460
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,11 @@ PREP(updateBloodPressureChange); | |
PREP(updateHeartRate); | ||
PREP(updateInternalBleeding); | ||
PREP(wrongBloodTreatment); | ||
PREP(checkBloodPressure); | ||
PREP(checkBloodPressureLocal); | ||
PREP(checkBloodPressureCuff); | ||
PREP(checkBloodPressureCuffLocal); | ||
PREP(checkPulse); | ||
PREP(checkPulseLocal); | ||
PREP(checkPulseSteth); | ||
PREP(checkPulseStethLocal); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PREP alphabetical order |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Glowbal | ||
* Checks the blood pressure of the patient. | ||
* | ||
* Arguments: | ||
* 0: Medic <OBJECT> | ||
* 1: Patient <OBJECT> | ||
* 2: Body Part <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [player, cursorObject, "LeftArm"] call kat_circulation_fnc_checkBloodPressure | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_medic", "_patient", "_bodyPart"]; | ||
|
||
[QGVAR(checkBloodPressureLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Glowbal modified by Cplhardcore | ||
* Checks the blood pressure of the patient. | ||
* | ||
* Arguments: | ||
* 0: Medic <OBJECT> | ||
* 1: Patient <OBJECT> | ||
* 2: Body Part <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [player, cursorObject, "LeftArm"] call kat_circulation_fnc_checkBloodPressure | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_medic", "_patient", "_bodyPart"]; | ||
|
||
[QGVAR(checkBloodPressureCuffLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Glowbal modified by Cplhardcore | ||
* Local callback for checking the blood pressure of a patient. | ||
* | ||
* Arguments: | ||
* 0: Medic <OBJECT> | ||
* 1: Patient <OBJECT> | ||
* 2: Body Part <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [player, cursorObject, "LeftArm"] call kat_circulation_fnc_checkBloodPressureCuffLocal | ||
* | ||
* Public: No | ||
*/ | ||
|
||
|
||
params ["_medic", "_patient", "_bodyPart"]; | ||
|
||
private _bloodPressure = [0, 0]; | ||
|
||
if (alive _patient && {!([_patient, _bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo))}) then { | ||
_bloodPressure = [_patient] call FUNC(getBloodPressure); | ||
}; | ||
|
||
private _bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_6); | ||
private _logOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_NoBloodpressure); | ||
|
||
_bloodPressure params ["_bloodPressureLow", "_bloodPressureHigh"]; | ||
|
||
if (_bloodPressureHigh > 20) then { | ||
_bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_1); | ||
_logOutput = format ["%1/%2", round _bloodPressureHigh, round _bloodPressureLow]; | ||
}; | ||
Cplhardcore marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[_patient, "quick_view", ACELSTRING(medical_treatment,Check_Bloodpressure_Log), [_medic call ACEFUNC(common,getName), _logOutput]] call ACEFUNC(medical_treatment,addToLog); | ||
|
||
[QACEGVAR(common,displayTextStructured), [[_bloodPressureOutput, _patient call ACEFUNC(common,getName), round _bloodPressureHigh, round _bloodPressureLow], 1.75, _medic], _medic] call CBA_fnc_targetEvent; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Glowbal modified by Cplhardcore | ||
* Local callback for checking the blood pressure of a patient. | ||
* | ||
* Arguments: | ||
* 0: Medic <OBJECT> | ||
* 1: Patient <OBJECT> | ||
* 2: Body Part <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [player, cursorObject, "LeftArm"] call kat_circulation_fnc_checkBloodPressureLocal | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_medic", "_patient", "_bodyPart"]; | ||
|
||
private _bloodPressure = [0, 0]; | ||
|
||
if (alive _patient && {!([_patient, _bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo))}) then { | ||
_bloodPressure = [_patient] call FUNC(getBloodPressure); | ||
}; | ||
|
||
private _bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_6); | ||
private _logOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_NoBloodpressure); | ||
|
||
_bloodPressure params ["_bloodPressureLow", "_bloodPressureHigh"]; | ||
|
||
if (_bloodPressureLow > 40) then { | ||
if (_medic call ACEFUNC(medical_treatment,isMedic)) then { | ||
_bloodPressureOutput = LSTRING(Check_Bloodpressure_Output_Palp); | ||
_logOutput = format [localize "STR_KAT_Circulation_Bloodpressure_Output_Palp", round ((_bloodPressureLow / 10) * 10) + (if (random 1 > 0.5) then {10} else {-10})]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not using macro for this localization? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because i haven't learned how to do Macro's properly yet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also ((_bloodPressureLow / 10) * 10)? Aren't you just undoing the division? Why not just pull _bloodPressureLow and then add the random? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That parenthathese is in the wrong position, it should be (round (_bloodPressureLow / 10) * 10) |
||
} else { | ||
if (_bloodPressureHigh > 20) then { | ||
_bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_2); | ||
_logOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Low); | ||
|
||
if (_bloodPressureHigh > 100) then { | ||
_bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_3); | ||
_logOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Normal); | ||
|
||
if (_bloodPressureHigh > 160) then { | ||
_bloodPressureOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_Output_4); | ||
_logOutput = ACELSTRING(medical_treatment,Check_Bloodpressure_High); | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
[_patient, "quick_view", ACELSTRING(medical_treatment,Check_Bloodpressure_Log), [_medic call ACEFUNC(common,getName), _logOutput]] call ACEFUNC(medical_treatment,addToLog); | ||
|
||
[QACEGVAR(common,displayTextStructured), [[_bloodPressureOutput, _patient call ACEFUNC(common,getName), round _bloodPressureHigh, round _bloodPressureLow], 1.75, _medic], _medic] call CBA_fnc_targetEvent; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Glowbal modified by Cplhardcore | ||
* Checks the pulse or heart rate of the patient. | ||
* | ||
* Arguments: | ||
* 0: Medic <OBJECT> | ||
* 1: Patient <OBJECT> | ||
* 2: Body Part <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [player, cursorObject, "Head"] call kat_circulation_fnc_checkPulse | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_medic", "_patient", "_bodyPart"]; | ||
|
||
[QGVAR(checkPulseLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,61 @@ | ||||
#include "..\script_component.hpp" | ||||
/* | ||||
* Author: Glowbal | ||||
* Local callback for checking the pulse or heart rate of a patient. | ||||
* | ||||
* Arguments: | ||||
* 0: Medic <OBJECT> | ||||
* 1: Patient <OBJECT> | ||||
* 2: Body Part <OBJECT> | ||||
* | ||||
* Return Value: | ||||
* None | ||||
* | ||||
* Example: | ||||
* [player, cursorObject, "Head"] call ace_medical_treatment_fnc_checkPulseLocal | ||||
* | ||||
* Public: No | ||||
*/ | ||||
|
||||
params ["_medic", "_patient", "_bodyPart"]; | ||||
|
||||
private _heartRate = 0; | ||||
|
||||
if !([_patient, _bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo)) then { | ||||
_heartRate = switch (true) do { | ||||
case (alive _patient): { | ||||
GET_HEART_RATE(_patient) | ||||
}; | ||||
case (alive (_patient getVariable [QACEGVAR(medical,CPR_provider), objNull])): { | ||||
random [25, 30, 35] // fake heart rate because patient is dead and off state machine | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldnt that show bigger number? 100-110 or smth like that we have defined for CPR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we dont have a heartrate defined for CPR, plus you are not going to get an accurate pulse rate when CPR is happening There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. of course we have
|
||||
}; | ||||
default { 0 }; | ||||
}; | ||||
}; | ||||
|
||||
private _heartRateOutput = ACELSTRING(medical_treatment,Check_Pulse_Output_5); | ||||
private _logOutput = ACELSTRING(medical_treatment,Check_Pulse_None); | ||||
|
||||
if (_heartRate > 1) then { | ||||
if (_medic call ACEFUNC(medical_treatment,isMedic)) then { | ||||
_heartRateOutput = LSTRING(Check_Pulse_Output); | ||||
_logOutput = format [localize "STR_KAT_Circulation_Pulse_Output", round ((_heartRateOutput / 5) * 5)]; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. once again, whats the point of rounding it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can only get an approximation of the pulse by doing it via palp, so that's why there's a round |
||||
} else { | ||||
_heartRateOutput = ACELSTRING(medical_treatment,Check_Pulse_Output_2); | ||||
_logOutput = ACELSTRING(medical_treatment,Check_Pulse_Weak); | ||||
|
||||
if (_heartRate > 60) then { | ||||
if (_heartRate > 100) then { | ||||
_heartRateOutput = ACELSTRING(medical_treatment,Check_Pulse_Output_3); | ||||
_logOutput = ACELSTRING(medical_treatment,Check_Pulse_Strong); | ||||
} else { | ||||
_heartRateOutput = ACELSTRING(medical_treatment,Check_Pulse_Output_4); | ||||
_logOutput = ACELSTRING(medical_treatment,Check_Pulse_Normal); | ||||
}; | ||||
}; | ||||
}; | ||||
}; | ||||
|
||||
[_patient, "quick_view", ACELSTRING(medical_treatment,Check_Pulse_Log), [_medic call ACEFUNC(common,getName), _logOutput]] call ACEFUNC(medical_treatment,addToLog); | ||||
|
||||
[QEGVAR(common,displayTextStructured), [[_heartRateOutput, _patient call ACEFUNC(common,getName), round _heartRate], 1.5, _medic], _medic] call CBA_fnc_targetEvent; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Glowbal modified by Cplhardcore | ||
* Checks the pulse or heart rate of the patient. | ||
* | ||
* Arguments: | ||
* 0: Medic <OBJECT> | ||
* 1: Patient <OBJECT> | ||
* 2: Body Part <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [player, cursorObject, "Head"] call kat_circulation_fnc_checkPulseSteth | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_medic", "_patient", "_bodyPart"]; | ||
|
||
[QGVAR(checkPulseStethLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo should inherit from CheckBloodPressure