Skip to content
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

Medical - Add API for getting unit status (blood loss, injury, stability) #10514

Merged
merged 19 commits into from
Dec 16, 2024

Conversation

DartRuffian
Copy link
Contributor

When merged this pull request will:

  • Add API for checking if a unit has any injuries
    • Uses medical_ai's isInjured function
  • Add API for getting a unit's blood loss
    • Uses medical_status's getBloodLoss function

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

addons/medical/functions/fnc_getBloodLoss.sqf Outdated Show resolved Hide resolved
addons/medical/functions/fnc_getBloodLoss.sqf Show resolved Hide resolved
addons/medical/functions/fnc_getBloodLoss.sqf Outdated Show resolved Hide resolved
addons/medical/functions/fnc_isInjured.sqf Outdated Show resolved Hide resolved
addons/medical/functions/fnc_isInjured.sqf Outdated Show resolved Hide resolved
addons/medical/functions/fnc_getBloodLoss.sqf Outdated Show resolved Hide resolved
@DartRuffian
Copy link
Contributor Author

DartRuffian commented Nov 18, 2024

Making a checklist of things for fnc_isInjured. Not explicitly saying all of these should be considered.

  • Fractured limbs
    • Arms are checked in API function, legs are checked in medical_ai_fnc_isInjured
  • Blood volume
  • Blood pressure
  • Peripheral resistance
  • Oxygen demand
  • Open wounds
  • Unconsciousness
  • Tourniquets
  • Pain
  • Heart rate
  • SPO2

@LinkIsGrim
Copy link
Contributor

SPO2, Heart Rate, Blood Pressure and Oxygen Demand can't just be checked against default as they can vary with fatigue and altitude if SPO2 simulation is enabled.

@DartRuffian
Copy link
Contributor Author

I just added those to have them listed, I don't think any of them should be considered IMO

Comment on lines 26 to 27
{GET_BLOOD_VOLUME(_unit) != DEFAULT_BLOOD_VOLUME} ||
{!(_unit call EFUNC(common,isAwake))} ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily an indication of injury. Maybe stable condition, but not injury.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misunderstood your comment (#10514 (comment)) then, I thought you were suggesting to check that as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, was just proposing a solution. I think injury check should just be:

  • open wounds (even if blocked by tourniquet)
  • fractures
  • trauma beyond thresholds for death/unconsciousness (if we have a way to fix trauma, which we don't)

Which is less than medical_ai's implementation but makes more sense to me. If we need a more sensitive function indicating necessity of treatment at all, it should be a la https://github.com/acemod/ACE3/blob/master/addons/medical_status/functions/fnc_isInStableCondition.sqf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

I'll see if I'll have time tomorrow to make those changes

@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Nov 23, 2024
@PabstMirror PabstMirror added this to the 3.18.2 milestone Nov 23, 2024
@LinkIsGrim
Copy link
Contributor

LinkIsGrim commented Dec 13, 2024

Modify isInjured to be just be a wrapper around medical_ai_fnc_isInjured + arm fracture checking and add an API getter for medical_status_fnc_isInStableCondition, should be good enough and easier to do. Up to 3rd party to use them properly.

Copy link
Contributor

@LinkIsGrim LinkIsGrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments + merge conflicts.

addons/medical/functions/fnc_isInStableCondition.sqf Outdated Show resolved Hide resolved
addons/medical/functions/fnc_isInjured.sqf Outdated Show resolved Hide resolved
DartRuffian and others added 15 commits December 14, 2024 09:55
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Is injured just wraps medical ai's isInjured and checks for arm fractures. No longer is required to be local.

Add local check to getBloodLoss
addons/medical/functions/fnc_getBloodLoss.sqf Outdated Show resolved Hide resolved
DartRuffian and others added 3 commits December 15, 2024 15:22
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
@LinkIsGrim LinkIsGrim merged commit 24d2c61 into acemod:master Dec 16, 2024
3 checks passed
@DartRuffian DartRuffian deleted the medical/api-getters branch December 16, 2024 17:55
@LinkIsGrim LinkIsGrim changed the title Medical - Add more API getters Medical - Add API for getting unit status (blood loss, injury, stability) Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants