2016-07-15 10:23:47 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Local callback for checking the blood pressure of a patient
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The medic <OBJECT>
|
|
|
|
* 1: The patient <OBJECT>
|
2016-10-13 19:08:41 +00:00
|
|
|
* 2: Body part <STRING>
|
2016-07-15 10:23:47 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-10-13 19:08:41 +00:00
|
|
|
params ["_caller", "_target", "_bodyPart"];
|
|
|
|
|
2016-12-07 10:32:01 +00:00
|
|
|
private _bloodPressure = [0, 0];
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2016-12-07 10:32:01 +00:00
|
|
|
if (alive _target && !([_target, _bodyPart] call EFUNC(medical,hasTourniquetAppliedTo))) then {
|
|
|
|
_bloodPressure = _target call EFUNC(medical,getBloodPressure);
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|
2016-10-13 19:08:41 +00:00
|
|
|
|
2016-12-07 10:32:01 +00:00
|
|
|
private _bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_6);
|
|
|
|
private _logOutPut = ELSTRING(medical,Check_Bloodpressure_NoBloodpressure);
|
2016-10-13 19:08:41 +00:00
|
|
|
|
2016-12-07 10:32:01 +00:00
|
|
|
_bloodPressure params ["_bloodPressureLow", "_bloodPressureHigh"];
|
2016-10-13 19:08:41 +00:00
|
|
|
|
2016-12-07 10:32:01 +00:00
|
|
|
if (_bloodPressureHigh > 20) then {
|
|
|
|
if (_caller call EFUNC(medical,isMedic)) then {
|
|
|
|
_bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_1);
|
|
|
|
_logOutPut = format ["%1/%2", round _bloodPressureHigh, round _bloodPressureLow];
|
2016-07-15 10:23:47 +00:00
|
|
|
} else {
|
2016-12-07 10:32:01 +00:00
|
|
|
if (_bloodPressureHigh > 20) then {
|
|
|
|
_bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_2);
|
|
|
|
_logOutPut = ELSTRING(medical,Check_Bloodpressure_Low);
|
|
|
|
|
|
|
|
if (_bloodPressureHigh > 100) then {
|
|
|
|
_bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_3);
|
|
|
|
_logOutPut = ELSTRING(medical,Check_Bloodpressure_Normal);
|
|
|
|
|
|
|
|
if (_bloodPressureHigh > 160) then {
|
|
|
|
_bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_4);
|
|
|
|
_logOutPut = ELSTRING(medical,Check_Bloodpressure_High);
|
|
|
|
};
|
|
|
|
};
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-12-07 10:32:01 +00:00
|
|
|
[QEGVAR(common,displayTextStructured), [[_bloodPressureOutput, _target call EFUNC(common,getName), round _bloodPressureHigh, round _bloodPressureLow], 1.75, _caller], _caller] call CBA_fnc_targetEvent;
|
2016-07-15 10:23:47 +00:00
|
|
|
|
|
|
|
if (_logOutPut != "") then {
|
2016-10-13 19:08:41 +00:00
|
|
|
[_target, "activity", ELSTRING(medical,Check_Bloodpressure_Log), [_caller call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
|
|
|
|
[_target, "quick_view", ELSTRING(medical,Check_Bloodpressure_Log), [_caller call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|