Pulse adds COVID-19 Simulation Support
×
SEMechanicalVentilator.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 #include "system/equipment/SEEquipment.h"
6 class SEEventHandler;
8 class SESubstance;
11 
12 // Keep enums in sync with appropriate schema/cdm/MechanicalVentilator.proto file !!
13 enum class eMechanicalVentilator_Connection { NullConnection = 0, Off, Mask, Tube };
14 extern const std::string& eMechanicalVentilator_Connection_Name(eMechanicalVentilator_Connection m);
15 
16 // Keep enums in sync with appropriate schema/cdm/MechanicalVentilator.proto file !!
17 enum class eMechanicalVentilator_DriverWaveform { NullDriverWaveform = 0, Square };
18 extern const std::string& eMechanicalVentilator_DriverWaveform_Name(eMechanicalVentilator_DriverWaveform m);
19 
20 class CDM_DECL SEMechanicalVentilator : public SEEquipment
21 {
22  friend class PBMechanicalVentilator;//friend the serialization class
23 protected:
25 public:
26 
28  virtual ~SEMechanicalVentilator();
29 
30  virtual void Clear();
31 
32  bool SerializeToString(std::string& output, SerializationFormat m) const;
33  bool SerializeToFile(const std::string& filename) const;
34  bool SerializeFromString(const std::string& src, SerializationFormat m, const SESubstanceManager& subMgr);
35  bool SerializeFromFile(const std::string& filename, const SESubstanceManager& subMgr);
36 
37 protected:
38 
44  virtual void StateChange(){};
45  virtual void Merge(const SEMechanicalVentilator& from, SESubstanceManager& subMgr);
46  virtual void ProcessConfiguration(SEMechanicalVentilatorConfiguration& config, SESubstanceManager& subMgr);
47 
48 public:
49 
50  virtual const SEScalar* GetScalar(const std::string& name);
51 
52  virtual eMechanicalVentilator_Connection GetConnection() const;
53  virtual void SetConnection(eMechanicalVentilator_Connection c);
54 
55  virtual bool HasEndotrachealTubeResistance() const;
56  virtual SEScalarPressureTimePerVolume& GetEndotrachealTubeResistance();
57  virtual double GetEndotrachealTubeResistance(const PressureTimePerVolumeUnit& unit) const;
58 
59  virtual bool HasPositiveEndExpiredPressure() const;
60  virtual SEScalarPressure& GetPositiveEndExpiredPressure();
61  virtual double GetPositiveEndExpiredPressure(const PressureUnit& unit) const;
62 
63  virtual bool HasFunctionalResidualCapacity() const;
64  virtual SEScalarPressure& GetFunctionalResidualCapacity();
65  virtual double GetFunctionalResidualCapacity(const PressureUnit& unit) const;
66 
67  virtual bool HasExpirationCycleFlow() const;
68  virtual SEScalarVolumePerTime& GetExpirationCycleFlow();
69  virtual double GetExpirationCycleFlow(const VolumePerTimeUnit& unit) const;
70 
71  virtual bool HasExpirationCyclePressure() const;
72  virtual SEScalarPressure& GetExpirationCyclePressure();
73  virtual double GetExpirationCyclePressure(const PressureUnit& unit) const;
74 
75  virtual bool HasExpirationCycleVolume() const;
76  virtual SEScalarVolume& GetExpirationCycleVolume();
77  virtual double GetExpirationCycleVolume(const VolumeUnit& unit) const;
78 
79  virtual bool HasExpirationCycleTime() const;
80  virtual SEScalarTime& GetExpirationCycleTime();
81  virtual double GetExpirationCycleTime(const TimeUnit& unit) const;
82 
83  virtual bool HasExpirationTubeResistance() const;
84  virtual SEScalarPressureTimePerVolume& GetExpirationTubeResistance();
85  virtual double GetExpirationTubeResistance(const PressureTimePerVolumeUnit& unit) const;
86 
87  virtual bool HasExpirationValveResistance() const;
88  virtual SEScalarPressureTimePerVolume& GetExpirationValveResistance();
89  virtual double GetExpirationValveResistance(const PressureTimePerVolumeUnit& unit) const;
90 
91  virtual eMechanicalVentilator_DriverWaveform GetExpirationWaveform() const;
92  virtual void SetExpirationWaveform(eMechanicalVentilator_DriverWaveform w);
93 
94  virtual bool HasInspirationLimitFlow() const;
95  virtual SEScalarVolumePerTime& GetInspirationLimitFlow();
96  virtual double GetInspirationLimitFlow(const VolumePerTimeUnit& unit) const;
97 
98  virtual bool HasInspirationLimitPressure() const;
99  virtual SEScalarPressure& GetInspirationLimitPressure();
100  virtual double GetInspirationLimitPressure(const PressureUnit& unit) const;
101 
102  virtual bool HasInspirationLimitVolume() const;
103  virtual SEScalarVolume& GetInspirationLimitVolume();
104  virtual double GetInspirationLimitVolume(const VolumeUnit& unit) const;
105 
106  virtual bool HasInspirationPauseTime() const;
107  virtual SEScalarTime& GetInspirationPauseTime();
108  virtual double GetInspirationPauseTime(const TimeUnit& unit) const;
109 
110  virtual bool HasPeakInspiratoryPressure() const;
111  virtual SEScalarPressure& GetPeakInspiratoryPressure();
112  virtual double GetPeakInspiratoryPressure(const PressureUnit& unit) const;
113 
114  virtual bool HasInspirationTargetFlow() const;
115  virtual SEScalarVolumePerTime& GetInspirationTargetFlow();
116  virtual double GetInspirationTargetFlow(const VolumePerTimeUnit& unit) const;
117 
118  virtual bool HasInspirationMachineTriggerTime() const;
119  virtual SEScalarTime& GetInspirationMachineTriggerTime();
120  virtual double GetInspirationMachineTriggerTime(const TimeUnit& unit) const;
121 
122  virtual bool HasInspirationPatientTriggerFlow() const;
123  virtual SEScalarVolumePerTime& GetInspirationPatientTriggerFlow();
124  virtual double GetInspirationPatientTriggerFlow(const VolumePerTimeUnit& unit) const;
125 
126  virtual bool HasInspirationPatientTriggerPressure() const;
127  virtual SEScalarPressure& GetInspirationPatientTriggerPressure();
128  virtual double GetInspirationPatientTriggerPressure(const PressureUnit& unit) const;
129 
130  virtual bool HasInspirationTubeResistance() const;
131  virtual SEScalarPressureTimePerVolume& GetInspirationTubeResistance();
132  virtual double GetInspirationTubeResistance(const PressureTimePerVolumeUnit& unit) const;
133 
134  virtual bool HasInspirationValveResistance() const;
135  virtual SEScalarPressureTimePerVolume& GetInspirationValveResistance();
136  virtual double GetInspirationValveResistance(const PressureTimePerVolumeUnit& unit) const;
137 
138  virtual eMechanicalVentilator_DriverWaveform GetInspirationWaveform() const;
139  virtual void SetInspirationWaveform(eMechanicalVentilator_DriverWaveform w);
140 
141  bool HasFractionInspiredGas() const;
142  bool HasFractionInspiredGas(const SESubstance& substance) const;
143  const std::vector<SESubstanceFraction*>& GetFractionInspiredGases();
144  const std::vector<const SESubstanceFraction*>& GetFractionInspiredGases() const;
145  SESubstanceFraction& GetFractionInspiredGas(const SESubstance& substance);
146  const SESubstanceFraction* GetFractionInspiredGas(const SESubstance& substance) const;
147  void RemoveFractionInspiredGas(const SESubstance& substance);
148  void RemoveFractionInspiredGases();
149 
150  bool HasConcentrationInspiredAerosol() const;
151  bool HasConcentrationInspiredAerosol(const SESubstance& substance) const;
152  const std::vector<SESubstanceConcentration*>& GetConcentrationInspiredAerosols();
153  const std::vector<const SESubstanceConcentration*>& GetConcentrationInspiredAerosols() const;
154  SESubstanceConcentration& GetConcentrationInspiredAerosol(const SESubstance& substance);
155  const SESubstanceConcentration* GetConcentrationInspiredAerosol(const SESubstance& substance) const;
156  void RemoveConcentrationInspiredAerosol(const SESubstance& substance);
157  void RemoveConcentrationInspiredAerosols();
158 
159 protected:
160 
161  eMechanicalVentilator_Connection m_Connection;
163 
164  // Expiratory Baseline Properties (Only set 1)
167 
168  // Expriatory Cycle Properties (Only Set 1)
173 
176  eMechanicalVentilator_DriverWaveform m_ExpirationWaveform;
177 
178  // Inspiratory Limit Properties (Only set 1)
182 
184 
185  // Inspiratory Target Properties (Only set 1)
188 
189  // Inspiratory Machine Trigger Properties (Only set 1)
191 
192  // Inspiratory Patient Trigger Properties (Only set 1)
195 
198  eMechanicalVentilator_DriverWaveform m_InspirationWaveform;
199 
200  std::vector<SESubstanceFraction*> m_FractionInspiredGases;
201  std::vector<const SESubstanceFraction*> m_cFractionInspiredGases;
202 
203  std::vector<SESubstanceConcentration*> m_ConcentrationInspiredAerosols;
204  std::vector<const SESubstanceConcentration*> m_cConcentrationInspiredAerosols;
205 };
std::vector< const SESubstanceFraction * > m_cFractionInspiredGases
Definition: SEMechanicalVentilator.h:201
Definition: SESubstanceManager.h:8
Definition: SESubstanceFraction.h:9
SEScalarTime * m_InspirationMachineTriggerTime
Definition: SEMechanicalVentilator.h:190
Definition: SEScalar.h:34
Definition: SEScalarVolume.h:7
Definition: SEScalarVolume.h:23
SEScalarPressureTimePerVolume * m_InspirationTubeResistance
Definition: SEMechanicalVentilator.h:196
Definition: Logger.h:75
Definition: SEMechanicalVentilator.h:20
SEScalarPressure * m_PeakInspiratoryPressure
Definition: SEMechanicalVentilator.h:186
eMechanicalVentilator_Connection m_Connection
Definition: SEMechanicalVentilator.h:161
Definition: SEScalarPressure.h:24
static bool SerializeToString(const SEMechanicalVentilator &src, std::string &output, SerializationFormat m)
Definition: PBMechanicalVentilator.cpp:186
SEScalarVolumePerTime * m_InspirationLimitFlow
Definition: SEMechanicalVentilator.h:179
static bool SerializeFromString(const std::string &src, SEMechanicalVentilator &dst, SerializationFormat m, const SESubstanceManager &subMgr)
Definition: PBMechanicalVentilator.cpp:199
friend SEMechanicalVentilatorConfiguration
Definition: SEMechanicalVentilator.h:24
Definition: SEEventManager.h:63
SEScalarTime * m_InspirationPauseTime
Definition: SEMechanicalVentilator.h:183
SEScalarPressure * m_PositiveEndExpiredPressure
Definition: SEMechanicalVentilator.h:165
std::vector< const SESubstanceConcentration * > m_cConcentrationInspiredAerosols
Definition: SEMechanicalVentilator.h:204
Definition: SEScalarVolumePerTime.h:7
Definition: SEScalarTime.h:7
static bool SerializeFromFile(const std::string &filename, SEMechanicalVentilator &dst, const SESubstanceManager &subMgr)
Definition: PBMechanicalVentilator.cpp:207
SEScalarVolumePerTime * m_InspirationPatientTriggerFlow
Definition: SEMechanicalVentilator.h:193
static bool SerializeToFile(const SEMechanicalVentilator &src, const std::string &filename)
Definition: PBMechanicalVentilator.cpp:192
Definition: SEScalarPressure.h:7
SEScalarVolumePerTime * m_ExpirationCycleFlow
Definition: SEMechanicalVentilator.h:169
SEScalarVolumePerTime * m_InspirationTargetFlow
Definition: SEMechanicalVentilator.h:187
virtual void StateChange()
Definition: SEMechanicalVentilator.h:44
SEScalarPressure * m_FunctionalResidualCapacity
Definition: SEMechanicalVentilator.h:166
eMechanicalVentilator_DriverWaveform m_InspirationWaveform
Definition: SEMechanicalVentilator.h:198
Definition: SESubstanceConcentration.h:10
SEScalarTime * m_ExpirationCycleTime
Definition: SEMechanicalVentilator.h:172
SEScalarPressureTimePerVolume * m_InspirationValveResistance
Definition: SEMechanicalVentilator.h:197
Definition: SEScalarPressureTimePerVolume.h:7
Definition: SEScalarVolumePerTime.h:26
eMechanicalVentilator_DriverWaveform m_ExpirationWaveform
Definition: SEMechanicalVentilator.h:176
Definition: SEMechanicalVentilatorConfiguration.h:8
SEScalarPressure * m_InspirationPatientTriggerPressure
Definition: SEMechanicalVentilator.h:194
Definition: PBMechanicalVentilator.h:8
SEScalarVolume * m_ExpirationCycleVolume
Definition: SEMechanicalVentilator.h:171
SEScalarVolume * m_InspirationLimitVolume
Definition: SEMechanicalVentilator.h:181
std::vector< SESubstanceFraction * > m_FractionInspiredGases
Definition: SEMechanicalVentilator.h:200
Definition: SEScalarTime.h:23
SEScalarPressure * m_ExpirationCyclePressure
Definition: SEMechanicalVentilator.h:170
SEScalarPressure * m_InspirationLimitPressure
Definition: SEMechanicalVentilator.h:180
SEScalarPressureTimePerVolume * m_EndotrachealTubeResistance
Definition: SEMechanicalVentilator.h:162
std::vector< SESubstanceConcentration * > m_ConcentrationInspiredAerosols
Definition: SEMechanicalVentilator.h:203
SEScalarPressureTimePerVolume * m_ExpirationTubeResistance
Definition: SEMechanicalVentilator.h:174
Definition: SEEquipment.h:8
Definition: SESubstance.h:14
Definition: SEScalarPressureTimePerVolume.h:24
SEScalarPressureTimePerVolume * m_ExpirationValveResistance
Definition: SEMechanicalVentilator.h:175

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.