SEMechanicalVentilation.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"
6class Serializer;
7class SESubstance;
10class SEMechanicalVentilationConfiguration;
11
13{
14 friend class PBPatientAction;//friend the serialization class
15protected:
16
17public:
18
19 SEMechanicalVentilation(Logger* logger=nullptr);
21
22 static constexpr char const* Name = "Mechanical Ventilation";
23 std::string GetName() const override { return Name; }
24
25 void Clear() override;
26 void Copy(const SEMechanicalVentilation& src, const SESubstanceManager& subMgr, bool /*preserveState*/=false);
27
28 const SEScalar* GetScalar(const std::string& name) override;
29
30 bool IsValid() const override;
31 bool IsActive() const override;
32 void Deactivate() override;
33
34 virtual eSwitch GetState() const;
35 virtual void SetState(eSwitch name);
36
37 virtual bool HasFlow() const;
38 virtual SEScalarVolumePerTime& GetFlow();
39 virtual double GetFlow(const VolumePerTimeUnit& unit) const;
40
41 virtual bool HasPressure() const;
42 virtual SEScalarPressure& GetPressure();
43 virtual double GetPressure(const PressureUnit& unit) const;
44
45 bool HasGasFraction() const;
46 bool HasGasFraction(const SESubstance& substance) const;
47 const std::vector<SESubstanceFraction*>& GetGasFractions();
48 const std::vector<const SESubstanceFraction*>& GetGasFractions() const;
49 SESubstanceFraction& GetGasFraction(const SESubstance& substance);
50 const SESubstanceFraction* GetGasFraction(const SESubstance& substance) const;
51 void RemoveGasFraction(const SESubstance& substance);
52 void RemoveGasFractions();
53
54 bool HasAerosol() const;
55 bool HasAerosol(const SESubstance& substance) const;
56 const std::vector<SESubstanceConcentration*>& GetAerosols();
57 const std::vector<const SESubstanceConcentration*>& GetAerosols() const;
58 SESubstanceConcentration& GetAerosol(const SESubstance& substance);
59 const SESubstanceConcentration* GetAerosol(const SESubstance& substance) const;
60 void RemoveAerosol(const SESubstance& substance);
61 void RemoveAerosols();
62
63protected:
64
65 eSwitch m_State;
68
69 std::vector<SESubstanceFraction*> m_GasFractions;
70 std::vector<const SESubstanceFraction*> m_cGasFractions;
71
72 std::vector<SESubstanceConcentration*> m_Aerosols;
73 std::vector<const SESubstanceConcentration*> m_cAerosols;
74};
Definition: Logger.h:71
Definition: PBPatientActions.h:52
Definition: SEScalarPressure.h:8
virtual const SEScalar * GetScalar(const std::string &name)=0
static SEAction * Copy(const SEAction &, const SESubstanceManager &)
Definition: SEAction.cpp:53
Definition: SEMechanicalVentilation.h:13
std::string GetName() const override
Definition: SEMechanicalVentilation.h:23
eSwitch m_State
Definition: SEMechanicalVentilation.h:65
std::vector< const SESubstanceFraction * > m_cGasFractions
Definition: SEMechanicalVentilation.h:70
std::vector< const SESubstanceConcentration * > m_cAerosols
Definition: SEMechanicalVentilation.h:73
SEScalarVolumePerTime * m_Flow
Definition: SEMechanicalVentilation.h:66
SEScalarPressure * m_Pressure
Definition: SEMechanicalVentilation.h:67
std::vector< SESubstanceConcentration * > m_Aerosols
Definition: SEMechanicalVentilation.h:72
std::vector< SESubstanceFraction * > m_GasFractions
Definition: SEMechanicalVentilation.h:69
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: SEScalar.h:19
Definition: SEScalarPressure.h:29
Definition: SEScalarVolumePerTime.h:32
Definition: SESubstanceConcentration.h:11
Definition: SESubstanceFraction.h:10
Definition: SESubstance.h:15
Definition: SESubstanceManager.h:9
Definition: SEScalarVolumePerTime.h:8

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.