SEHemorrhage.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5#include "cdm/patient/actions/SEPatientAction.h"
6
7// Keep enums in sync with appropriate schema/cdm/PatientActionEnums.proto file !!
8enum class eHemorrhage_Compartment
9{
10 None = 0,
11 Aorta = 1,
12 Brain = 2,
13 Muscle = 3,
14 LargeIntestine = 4,
15 LeftArm = 5,
16 LeftKidney = 6,
17 LeftLeg = 7,
18 Liver = 8,
19 RightArm = 9,
20 RightKidney = 10,
21 RightLeg = 11,
22 Skin = 12,
23 SmallIntestine = 13,
24 Splanchnic = 14,
25 Spleen = 15,
26 VenaCava = 16
27};
28extern CDM_DECL const std::string& eHemorrhage_Compartment_Name(eHemorrhage_Compartment c);
29extern CDM_DECL eHemorrhage_Compartment eHemorrhage_Compartment_Parse(const std::string& s);
30
31enum class eHemorrhage_Type { External = 0, Internal };
32extern CDM_DECL const std::string& eHemorrhage_Type_Name(eHemorrhage_Type t);
33
34class CDM_DECL SEHemorrhage : public SEPatientAction
35{
36 friend class PBPatientAction;//friend the serialization class
37public:
38 SEHemorrhage(Logger* logger=nullptr);
39 virtual ~SEHemorrhage();
40
41 static constexpr char const* Name = "Hemorrhage";
42 std::string GetName() const override { return Name; }
43
44 void Clear() override;
45 virtual void Copy(const SEHemorrhage& src, bool /*preserveState*/=false);
46
47 bool IsValid() const override;
48 bool IsActive() const override;
49 void Deactivate() override;
50
51 virtual eHemorrhage_Type GetType() const { return m_Type; }
52 virtual void SetType(eHemorrhage_Type t) { m_Type = t; }
53
54 virtual bool HasCompartment() const;
55 virtual std::string GetCompartmentName() const;
56 virtual eHemorrhage_Compartment GetCompartment() const;
57 virtual void SetCompartment(eHemorrhage_Compartment cmpt);
58
59 virtual bool HasFlowRate() const;
60 virtual SEScalarVolumePerTime& GetFlowRate();
61 virtual double GetFlowRate(const VolumePerTimeUnit& unit) const;
62
63 virtual bool HasSeverity() const;
64 virtual SEScalar0To1& GetSeverity();
65 virtual double GetSeverity() const;
66
67 virtual bool HasTotalBloodLost() const;
68 virtual SEScalarVolume& GetTotalBloodLost();
69 virtual double GetTotalBloodLost(const VolumeUnit& unit) const;
70
71 const SEScalar* GetScalar(const std::string& name) override;
72
73protected:
74 eHemorrhage_Type m_Type;
75 std::string m_CompartmentName;
76 eHemorrhage_Compartment m_Compartment;
80};
Definition: Logger.h:71
Definition: PBPatientActions.h:52
virtual const SEScalar * GetScalar(const std::string &name)=0
static SEAction * Copy(const SEAction &, const SESubstanceManager &)
Definition: SEAction.cpp:53
Definition: SEHemorrhage.h:35
SEScalarVolume * m_TotalBloodLost
Definition: SEHemorrhage.h:79
SEScalar0To1 * m_Severity
Definition: SEHemorrhage.h:78
std::string m_CompartmentName
Definition: SEHemorrhage.h:75
virtual eHemorrhage_Type GetType() const
Definition: SEHemorrhage.h:51
eHemorrhage_Compartment m_Compartment
Definition: SEHemorrhage.h:76
std::string GetName() const override
Definition: SEHemorrhage.h:42
eHemorrhage_Type m_Type
Definition: SEHemorrhage.h:74
SEScalarVolumePerTime * m_FlowRate
Definition: SEHemorrhage.h:77
virtual void SetType(eHemorrhage_Type t)
Definition: SEHemorrhage.h:52
Definition: SEPatientAction.h:8
void Deactivate() override
Definition: SEPatientAction.h:23
void Clear() override
Definition: SEPatientAction.h:18
bool IsValid() const override
Definition: SEPatientAction.h:19
bool IsActive() const override
Definition: SEPatientAction.h:22
Definition: SEScalar0To1.h:8
Definition: SEScalar.h:19
Definition: SEScalarVolume.h:28
Definition: SEScalarVolumePerTime.h:32
Definition: SEScalarVolumePerTime.h:8
Definition: SEScalarVolume.h:8

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.