<
The Pulse Team is excited to announce the Pulse Physiology Engine 4.1.0 release. Upgrade now to get the best in dynamic simulation.
×
SEConditionManager.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 class SECondition;
6 //Patient Conditions
8 class SEChronicAnemia;
10 class SEChronicHeartFailure;
14 class SEConsumeMeal;
16 class SELobarPneumonia;
18 class SEPulmonaryShunt;
19 class SESepsis;
20 // Environment Conditions
22 class SESubstanceManager;
23 
24 class CDM_DECL SEConditionManager : public Loggable
25 {
26  friend class PBEngine;//friend the serialization class
27 public:
28 
29  SEConditionManager(Logger* logger=nullptr);
31 
32  void Clear();
33  void Copy(const SEConditionManager& src, const SESubstanceManager& subMgr);
34  bool Copy(const SECondition& condition, const SESubstanceManager&);
35 
36  bool SerializeToString(std::string& output, eSerializationFormat m) const;
37  bool SerializeToFile(const std::string& filename) const;
38  bool SerializeFromString(const std::string& src, eSerializationFormat m, const SESubstanceManager& subMgr);
39  bool SerializeFromFile(const std::string& filename, const SESubstanceManager& subMgr);
40 
41  // Not too many conditions, so just have one manager
42  // If we start getting alot, I will make patient/environment/equipment condition managers, like the action managers
43 
44  bool IsEmpty() const;
45 
46  // Patient Conditions
47 
48  bool HasAcuteRespiratoryDistressSyndrome() const;
49  SEAcuteRespiratoryDistressSyndrome& GetAcuteRespiratoryDistressSyndrome();
50  const SEAcuteRespiratoryDistressSyndrome* GetAcuteRespiratoryDistressSyndrome() const;
51 
52  bool HasChronicAnemia() const;
53  SEChronicAnemia& GetChronicAnemia();
54  const SEChronicAnemia* GetChronicAnemia() const;
55 
56  bool HasChronicObstructivePulmonaryDisease() const;
57  SEChronicObstructivePulmonaryDisease& GetChronicObstructivePulmonaryDisease();
58  const SEChronicObstructivePulmonaryDisease* GetChronicObstructivePulmonaryDisease() const;
59 
60  bool HasChronicHeartFailure() const;
61  bool HasChronicVentricularSystolicDysfunction() const;
62  SEChronicVentricularSystolicDysfunction& GetChronicVentricularSystolicDysfunction();
63  const SEChronicVentricularSystolicDysfunction* GetChronicVentricularSystolicDysfunction() const;
64 
65  bool HasChronicPericardialEffusion() const;
66  SEChronicPericardialEffusion& GetChronicPericardialEffusion();
67  const SEChronicPericardialEffusion* GetChronicPericardialEffusion() const;
68 
69  bool HasChronicRenalStenosis() const;
70  SEChronicRenalStenosis& GetChronicRenalStenosis();
71  const SEChronicRenalStenosis* GetChronicRenalStenosis() const;
72 
73  bool HasConsumeMeal() const;
74  SEConsumeMeal& GetConsumeMeal();
75  const SEConsumeMeal* GetConsumeMeal() const;
76 
77  bool HasImpairedAlveolarExchange() const;
78  SEImpairedAlveolarExchange& GetImpairedAlveolarExchange();
79  const SEImpairedAlveolarExchange* GetImpairedAlveolarExchange() const;
80 
81  bool HasLobarPneumonia() const;
82  SELobarPneumonia& GetLobarPneumonia();
83  const SELobarPneumonia* GetLobarPneumonia() const;
84 
85  bool HasPulmonaryFibrosis() const;
86  SEPulmonaryFibrosis& GetPulmonaryFibrosis();
87  const SEPulmonaryFibrosis* GetPulmonaryFibrosis() const;
88 
89  bool HasPulmonaryShunt() const;
90  SEPulmonaryShunt& GetPulmonaryShunt();
91  const SEPulmonaryShunt* GetPulmonaryShunt() const;
92 
93  bool HasSepsis() const;
94  SESepsis& GetSepsis();
95  const SESepsis* GetSepsis() const;
96 
97  // Environment Conditions
98 
99  bool HasInitialEnvironmentalConditions() const;
100  SEInitialEnvironmentalConditions& GetInitialEnvironmentalConditions();
101  const SEInitialEnvironmentalConditions* GetInitialEnvironmentalConditions() const;
102 
103  // Helper to get a list of the active conditions
104  void GetAllConditions(std::vector<const SECondition*>& v) const;
105 
106 protected:
107 
120 
122 
123  std::stringstream m_ss;
124 };
Definition: SEPulmonaryShunt.h:7
Definition: SESubstanceManager.h:8
static bool SerializeToFile(const SEPatientConfiguration &src, const std::string &filename)
Definition: PBEngine.cpp:423
Definition: SEConsumeMeal.h:8
static bool SerializeFromFile(const std::string &filename, SEPatientConfiguration &dst, const SESubstanceManager &subMgr)
Definition: PBEngine.cpp:437
static bool SerializeToString(const LogMessages &src, std::string &output, eSerializationFormat m, Logger *logger)
Definition: PBEngine.cpp:154
static bool SerializeFromString(const std::string &src, LogMessages &dst, eSerializationFormat m, Logger *logger)
Definition: PBEngine.cpp:126
SEChronicRenalStenosis * m_RenalStenosis
Definition: SEConditionManager.h:116
SELobarPneumonia * m_LobarPneumonia
Definition: SEConditionManager.h:115
Definition: Logger.h:66
Definition: SEChronicObstructivePulmonaryDisease.h:7
SEPulmonaryFibrosis * m_PulmonaryFibrosis
Definition: SEConditionManager.h:117
SEAcuteRespiratoryDistressSyndrome * m_ARDS
Definition: SEConditionManager.h:108
std::stringstream m_ss
Definition: SEConditionManager.h:123
Definition: SEAcuteRespiratoryDistressSyndrome.h:7
Definition: SEImpairedAlveolarExchange.h:6
Definition: SEChronicPericardialEffusion.h:7
SEChronicObstructivePulmonaryDisease * m_COPD
Definition: SEConditionManager.h:111
Definition: Logger.h:18
Definition: SEConditionManager.h:24
Definition: SECondition.h:7
Definition: PBEngine.h:29
Definition: SELobarPneumonia.h:7
SEPulmonaryShunt * m_PulmonaryShunt
Definition: SEConditionManager.h:118
Definition: SEPulmonaryFibrosis.h:7
SEChronicPericardialEffusion * m_PericardialEffusion
Definition: SEConditionManager.h:114
static void Copy(const SEDataRequest &src, SEDataRequest &dst)
Definition: PBEngine.cpp:484
SEChronicVentricularSystolicDysfunction * m_ChronicVentricularSystolicDysfunction
Definition: SEConditionManager.h:112
Definition: SEChronicRenalStenosis.h:7
SEImpairedAlveolarExchange * m_ImpairedAlveolarExchange
Definition: SEConditionManager.h:113
SEChronicAnemia * m_Anemia
Definition: SEConditionManager.h:109
SESepsis * m_Sepsis
Definition: SEConditionManager.h:119
Definition: SEInitialEnvironmentalConditions.h:7
SEInitialEnvironmentalConditions * m_InitialEnvironmentalConditions
Definition: SEConditionManager.h:121
Definition: SEChronicAnemia.h:7
Definition: SEChronicVentricularSystolicDysfunction.h:7
SEConsumeMeal * m_ConsumeMeal
Definition: SEConditionManager.h:110
Definition: SESepsis.h:7

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.