SEPatient.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
6class SENutrition;
7
8// Keep enums in sync with appropriate schema/cdm/PatientEnums.proto file !!
9enum class ePatient_Sex { Male = 0, Female };
10extern CDM_DECL const std::string& ePatient_Sex_Name(ePatient_Sex m);
11
12class CDM_DECL SEPatient : public Loggable
13{
14 friend class PBPatient;//friend the serialization class
15public:
16
17 SEPatient(Logger* logger);
18 virtual ~SEPatient();
19
20 virtual void Clear();
21 void Copy(const SEPatient& src);
22
23 bool SerializeToString(std::string& output, eSerializationFormat m) const;
24 bool SerializeToFile(const std::string& filename) const;
25 bool SerializeFromString(const std::string& src, eSerializationFormat m);
26 bool SerializeFromFile(const std::string& filename);
27
36 virtual const SEScalar* GetScalar(const std::string& name);
37
38 virtual std::string GetName() const;
39 virtual void SetName(const std::string& name);
40 virtual bool HasName() const;
41 virtual void InvalidateName();
42
43 virtual ePatient_Sex GetSex() const;
44 virtual void SetSex(ePatient_Sex sex);
45
46 virtual bool HasAge() const;
47 virtual SEScalarTime& GetAge();
48 virtual double GetAge(const TimeUnit& unit) const;
49
50 virtual bool HasWeight() const;
51 virtual SEScalarMass& GetWeight();
52 virtual double GetWeight(const MassUnit& unit) const;
53
54 virtual bool HasHeight() const;
55 virtual SEScalarLength& GetHeight();
56 virtual double GetHeight(const LengthUnit& unit) const;
57
58 virtual bool HasAlveoliSurfaceArea() const;
59 virtual SEScalarArea& GetAlveoliSurfaceArea();
60 virtual double GetAlveoliSurfaceArea(const AreaUnit& unit) const;
61
62 virtual bool HasBasalMetabolicRate() const;
63 virtual SEScalarPower& GetBasalMetabolicRate();
64 virtual double GetBasalMetabolicRate(const PowerUnit& unit) const;
65
66 virtual bool HasBloodVolumeBaseline() const;
67 virtual SEScalarVolume& GetBloodVolumeBaseline();
68 virtual double GetBloodVolumeBaseline(const VolumeUnit& unit) const;
69
70 virtual bool HasBodyDensity() const;
71 virtual SEScalarMassPerVolume& GetBodyDensity();
72 virtual double GetBodyDensity(const MassPerVolumeUnit& unit) const;
73
74 virtual bool HasBodyFatFraction() const;
75 virtual SEScalar0To1& GetBodyFatFraction();
76 virtual double GetBodyFatFraction() const;
77
78 virtual bool HasBodyMassIndex() const;
79 virtual SEScalar& GetBodyMassIndex();
80 virtual double GetBodyMassIndex() const;
81
82 virtual bool HasDiastolicArterialPressureBaseline() const;
83 virtual SEScalarPressure& GetDiastolicArterialPressureBaseline();
84 virtual double GetDiastolicArterialPressureBaseline(const PressureUnit& unit) const;
85
86 virtual bool HasExpiratoryReserveVolume() const;
87 virtual SEScalarVolume& GetExpiratoryReserveVolume();
88 virtual double GetExpiratoryReserveVolume(const VolumeUnit& unit) const;
89
90 virtual bool HasFunctionalResidualCapacity() const;
91 virtual SEScalarVolume& GetFunctionalResidualCapacity();
92 virtual double GetFunctionalResidualCapacity(const VolumeUnit& unit) const;
93
94 virtual bool HasHeartRateBaseline() const;
95 virtual SEScalarFrequency& GetHeartRateBaseline();
96 virtual double GetHeartRateBaseline(const FrequencyUnit& unit) const;
97
98 virtual bool HasHeartRateMaximum() const;
99 virtual SEScalarFrequency& GetHeartRateMaximum();
100 virtual double GetHeartRateMaximum(const FrequencyUnit& unit) const;
101
102 virtual bool HasHeartRateMinimum() const;
103 virtual SEScalarFrequency& GetHeartRateMinimum();
104 virtual double GetHeartRateMinimum(const FrequencyUnit& unit) const;
105
106 virtual bool HasIdealBodyWeight() const;
107 virtual SEScalarMass& GetIdealBodyWeight();
108 virtual double GetIdealBodyWeight(const MassUnit& unit) const;
109
110 virtual bool HasInspiratoryCapacity() const;
111 virtual SEScalarVolume& GetInspiratoryCapacity();
112 virtual double GetInspiratoryCapacity(const VolumeUnit& unit) const;
113
114 virtual bool HasInspiratoryReserveVolume() const;
115 virtual SEScalarVolume& GetInspiratoryReserveVolume();
116 virtual double GetInspiratoryReserveVolume(const VolumeUnit& unit) const;
117
118 virtual bool HasLeanBodyMass() const;
119 virtual SEScalarMass& GetLeanBodyMass();
120 virtual double GetLeanBodyMass(const MassUnit& unit) const;
121
122 virtual bool HasMeanArterialPressureBaseline() const;
123 virtual SEScalarPressure& GetMeanArterialPressureBaseline();
124 virtual double GetMeanArterialPressureBaseline(const PressureUnit& unit) const;
125
126 virtual bool HasPulsePressureBaseline() const;
127 virtual SEScalarPressure& GetPulsePressureBaseline();
128 virtual double GetPulsePressureBaseline(const PressureUnit& unit) const;
129
130 virtual bool HasResidualVolume() const;
131 virtual SEScalarVolume& GetResidualVolume();
132 virtual double GetResidualVolume(const VolumeUnit& unit) const;
133
134 virtual bool HasRespirationRateBaseline() const;
135 virtual SEScalarFrequency& GetRespirationRateBaseline();
136 virtual double GetRespirationRateBaseline(const FrequencyUnit& unit) const;
137
138 virtual bool HasRightLungRatio() const;
139 virtual SEScalar0To1& GetRightLungRatio();
140 virtual double GetRightLungRatio() const;
141
142 virtual bool HasSkinSurfaceArea() const;
143 virtual SEScalarArea& GetSkinSurfaceArea();
144 virtual double GetSkinSurfaceArea(const AreaUnit& unit) const;
145
146 virtual bool HasSystolicArterialPressureBaseline() const;
147 virtual SEScalarPressure& GetSystolicArterialPressureBaseline();
148 virtual double GetSystolicArterialPressureBaseline(const PressureUnit& unit) const;
149
150 virtual bool HasTidalVolumeBaseline() const;
151 virtual SEScalarVolume& GetTidalVolumeBaseline();
152 virtual double GetTidalVolumeBaseline(const VolumeUnit& unit) const;
153
154 virtual bool HasTotalLungCapacity() const;
155 virtual SEScalarVolume& GetTotalLungCapacity();
156 virtual double GetTotalLungCapacity(const VolumeUnit& unit) const;
157
158 virtual bool HasVitalCapacity() const;
159 virtual SEScalarVolume& GetVitalCapacity();
160 virtual double GetVitalCapacity(const VolumeUnit& unit) const;
161
162protected:
163
164 std::string m_Name;
165 ePatient_Sex m_Sex;
174
178
188
198};
199
200inline std::ostream& operator<< (std::ostream& out, const SEPatient& p)
201{
202 std::string s;
203 if (!p.SerializeToString(s, eSerializationFormat::TEXT))
204 p.Error("Unable to serialize patient");
205 out << s;
206 return out;
207}
Definition: SEScalarArea.h:8
Definition: SEScalarFrequency.h:8
Definition: SEScalarLength.h:8
Definition: Logger.h:23
virtual void Error(std::string const &msg) const
Definition: SimpleLogger.cpp:377
Definition: Logger.h:71
Definition: SEScalarMassPerVolume.h:8
Definition: SEScalarMass.h:8
Definition: PBPatient.h:8
static bool SerializeToFile(const SEPatient &src, const std::string &filename)
Definition: PBPatient.cpp:176
static bool SerializeFromString(const std::string &src, SEPatient &dst, eSerializationFormat m)
Definition: PBPatient.cpp:183
static bool SerializeToString(const SEPatient &src, std::string &output, eSerializationFormat m)
Definition: PBPatient.cpp:170
static void Copy(const SEPatient &src, SEPatient &dst)
Definition: PBPatient.cpp:162
static bool SerializeFromFile(const std::string &filename, SEPatient &dst)
Definition: PBPatient.cpp:191
Definition: SEScalarPower.h:8
Definition: SEScalarPressure.h:8
Definition: SEEventManager.h:73
Definition: SENutrition.h:7
Definition: SEPatient.h:13
SEScalarMass * m_LeanBodyMass
Definition: SEPatient.h:172
SEScalarPressure * m_SystolicArterialPressureBaseline
Definition: SEPatient.h:186
SEScalarVolume * m_ResidualVolume
Definition: SEPatient.h:195
SEScalarVolume * m_BloodVolumeBaseline
Definition: SEPatient.h:180
SEScalar0To1 * m_BodyFatFraction
Definition: SEPatient.h:170
SEScalarVolume * m_TotalLungCapacity
Definition: SEPatient.h:196
SEScalarVolume * m_TidalVolumeBaseline
Definition: SEPatient.h:187
SEScalarArea * m_AlveoliSurfaceArea
Definition: SEPatient.h:175
SEScalarFrequency * m_HeartRateMinimum
Definition: SEPatient.h:190
SEScalarMass * m_Weight
Definition: SEPatient.h:167
std::string m_Name
Definition: SEPatient.h:164
SEScalarMassPerVolume * m_BodyDensity
Definition: SEPatient.h:169
SEScalarPressure * m_MeanArterialPressureBaseline
Definition: SEPatient.h:183
SEScalarPower * m_BasalMetabolicRate
Definition: SEPatient.h:179
SEScalarFrequency * m_HeartRateMaximum
Definition: SEPatient.h:189
SEScalarMass * m_IdealBodyWeight
Definition: SEPatient.h:173
SEScalar * m_BodyMassIndex
Definition: SEPatient.h:171
SEScalarVolume * m_InspiratoryReserveVolume
Definition: SEPatient.h:194
SEScalarTime * m_Age
Definition: SEPatient.h:166
SEScalarFrequency * m_RespirationRateBaseline
Definition: SEPatient.h:185
SEScalarPressure * m_DiastolicArterialPressureBaseline
Definition: SEPatient.h:181
bool SerializeToString(std::string &output, eSerializationFormat m) const
Definition: SEPatient.cpp:138
SEScalar0To1 * m_RightLungRatio
Definition: SEPatient.h:176
SEScalarVolume * m_InspiratoryCapacity
Definition: SEPatient.h:193
SEScalarPressure * m_PulsePressureBaseline
Definition: SEPatient.h:184
SEScalarVolume * m_FunctionalResidualCapacity
Definition: SEPatient.h:192
ePatient_Sex m_Sex
Definition: SEPatient.h:165
SEScalarVolume * m_VitalCapacity
Definition: SEPatient.h:197
SEScalarVolume * m_ExpiratoryReserveVolume
Definition: SEPatient.h:191
SEScalarArea * m_SkinSurfaceArea
Definition: SEPatient.h:177
SEScalarLength * m_Height
Definition: SEPatient.h:168
SEScalarFrequency * m_HeartRateBaseline
Definition: SEPatient.h:182
Definition: SEScalar0To1.h:8
Definition: SEScalarArea.h:25
Definition: SEScalarFrequency.h:26
Definition: SEScalar.h:19
Definition: SEScalarLength.h:29
Definition: SEScalarMass.h:28
Definition: SEScalarMassPerVolume.h:37
Definition: SEScalarPower.h:29
Definition: SEScalarPressure.h:29
Definition: SEScalarTime.h:28
Definition: SEScalarVolume.h:28
Definition: SEScalarTime.h:8
Definition: SEScalarVolume.h:8

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.