Pulse adds COVID-19 Simulation Support
×
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;
14 class SEConsumeMeal;
16 class SELobarPneumonia;
18 class SESepsis;
19 // Environment Conditions
21 class SESubstanceManager;
22 
23 class CDM_DECL SEConditionManager : public Loggable
24 {
25  friend class PBEngine;//friend the serialization class
26 public:
27 
30 
31  void Clear();
32  void Copy(const SEConditionManager& src);
33 
34  bool SerializeToString(std::string& output, SerializationFormat m) const;
35  bool SerializeToFile(const std::string& filename, SerializationFormat m) const;
36  bool SerializeFromString(const std::string& src, SerializationFormat m);
37  bool SerializeFromFile(const std::string& filename, SerializationFormat m);
38 
39  bool ProcessCondition(const SECondition& condition);// Will make a copy
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 HasSepsis() const;
90  SESepsis* GetSepsis();
91  const SESepsis* GetSepsis() const;
92 
93  // Environment Conditions
94 
95  bool HasInitialEnvironmentalConditions() const;
96  SEInitialEnvironmentalConditions* GetInitialEnvironmentalConditions();
97  const SEInitialEnvironmentalConditions* GetInitialEnvironmentalConditions() const;
98 
99  // Helper to get a list of the active conditions
100  void GetAllConditions(std::vector<const SECondition*>& v) const;
101 
102 protected:
103 
116 
118 
119  std::stringstream m_ss;
120 };
Definition: SESubstanceManager.h:8
Definition: SEChronicHeartFailure.h:7
Definition: SEConsumeMeal.h:8
SEChronicRenalStenosis * m_RenalStenosis
Definition: SEConditionManager.h:113
SELobarPneumonia * m_LobarPneumonia
Definition: SEConditionManager.h:112
Definition: SEChronicObstructivePulmonaryDisease.h:7
SEPulmonaryFibrosis * m_PulmonaryFibrosis
Definition: SEConditionManager.h:114
SEAcuteRespiratoryDistressSyndrome * m_ARDS
Definition: SEConditionManager.h:105
std::stringstream m_ss
Definition: SEConditionManager.h:119
static bool SerializeToFile(const SEPatientConfiguration &src, const std::string &filename, SerializationFormat m)
Definition: PBEngine.cpp:381
Definition: SEAcuteRespiratoryDistressSyndrome.h:7
Definition: SEImpairedAlveolarExchange.h:6
Definition: SEChronicPericardialEffusion.h:7
static bool SerializeFromFile(const std::string &filename, SEPatientConfiguration &dst, SerializationFormat m, SESubstanceManager &subMgr)
Definition: PBEngine.cpp:397
static bool SerializeFromString(const std::string &src, LogMessages &dst, SerializationFormat m, Logger *logger)
Definition: PBEngine.cpp:119
static bool SerializeToString(const LogMessages &src, std::string &output, SerializationFormat m, Logger *logger)
Definition: PBEngine.cpp:147
SEChronicObstructivePulmonaryDisease * m_COPD
Definition: SEConditionManager.h:108
Definition: Logger.h:11
Definition: SEConditionManager.h:23
Definition: SECondition.h:7
Definition: PBEngine.h:26
Definition: SELobarPneumonia.h:7
Definition: SEPulmonaryFibrosis.h:7
SEChronicPericardialEffusion * m_PericardialEffusion
Definition: SEConditionManager.h:111
static void Copy(const SEDataRequest &src, SEDataRequest &dst)
Definition: PBEngine.cpp:438
SEChronicVentricularSystolicDysfunction * m_ChronicVentricularSystolicDysfunction
Definition: SEConditionManager.h:109
Definition: SEChronicRenalStenosis.h:7
SEImpairedAlveolarExchange * m_ImpairedAlveolarExchange
Definition: SEConditionManager.h:110
SESubstanceManager & m_Substances
Definition: SEConditionManager.h:104
SEChronicAnemia * m_Anemia
Definition: SEConditionManager.h:106
SESepsis * m_Sepsis
Definition: SEConditionManager.h:115
Definition: SEInitialEnvironmentalConditions.h:7
SEInitialEnvironmentalConditions * m_InitialEnvironmentalConditions
Definition: SEConditionManager.h:117
Definition: SEChronicAnemia.h:7
Definition: SEChronicVentricularSystolicDysfunction.h:7
SEConsumeMeal * m_ConsumeMeal
Definition: SEConditionManager.h:107
Definition: SESepsis.h:7

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.