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
7 class SEChronicAnemia;
12 class SEConsumeMeal;
13 class SELobarPneumonia;
16 // Environment Conditions
18 class SESubstanceManager;
19 
20 class CDM_DECL SEConditionManager : public Loggable
21 {
22  friend class PBEngine;//friend the serialization class
23 public:
24 
27 
28  void Clear();
29  void Copy(const SEConditionManager& src);
30 
31  bool SerializeToString(std::string& output, SerializationFormat m) const;
32  bool SerializeToFile(const std::string& filename, SerializationFormat m) const;
33  bool SerializeFromString(const std::string& src, SerializationFormat m);
34  bool SerializeFromFile(const std::string& filename, SerializationFormat m);
35 
36  bool ProcessCondition(const SECondition& condition);// Will make a copy
37 
38  // Not too many conditions, so just have one manager
39  // If we start getting alot, I will make patient/environment/equipment condition managers, like the action managers
40 
41  bool IsEmpty() const;
42 
43  // Patient Conditions
44 
45  bool HasChronicAnemia() const;
46  SEChronicAnemia* GetChronicAnemia();
47  const SEChronicAnemia* GetChronicAnemia() const;
48 
49  bool HasChronicObstructivePulmonaryDisease() const;
50  SEChronicObstructivePulmonaryDisease* GetChronicObstructivePulmonaryDisease();
51  const SEChronicObstructivePulmonaryDisease* GetChronicObstructivePulmonaryDisease() const;
52 
53  bool HasChronicHeartFailure() const;
54  bool HasChronicVentricularSystolicDysfunction() const;
55  SEChronicVentricularSystolicDysfunction* GetChronicVentricularSystolicDysfunction();
56  const SEChronicVentricularSystolicDysfunction* GetChronicVentricularSystolicDysfunction() const;
57 
58  bool HasChronicPericardialEffusion() const;
59  SEChronicPericardialEffusion* GetChronicPericardialEffusion();
60  const SEChronicPericardialEffusion* GetChronicPericardialEffusion() const;
61 
62  bool HasChronicRenalStenosis() const;
63  SEChronicRenalStenosis* GetChronicRenalStenosis();
64  const SEChronicRenalStenosis* GetChronicRenalStenosis() const;
65 
66  bool HasConsumeMeal() const;
67  SEConsumeMeal* GetConsumeMeal();
68  const SEConsumeMeal* GetConsumeMeal() const;
69 
70  bool HasImpairedAlveolarExchange() const;
71  SEImpairedAlveolarExchange* GetImpairedAlveolarExchange();
72  const SEImpairedAlveolarExchange* GetImpairedAlveolarExchange() const;
73 
74  bool HasLobarPneumonia() const;
75  SELobarPneumonia* GetLobarPneumonia();
76  const SELobarPneumonia* GetLobarPneumonia() const;
77 
78  // Environment Conditions
79 
80  bool HasInitialEnvironmentConditions() const;
81  SEInitialEnvironmentConditions* GetInitialEnvironmentConditions();
82  const SEInitialEnvironmentConditions* GetInitialEnvironmentConditions() const;
83 
84  // Helper to get a list of the active conditions
85  void GetAllConditions(std::vector<const SECondition*>& v) const;
86 
87 protected:
88 
98 
100 
101  std::stringstream m_ss;
102 };
Definition: SESubstanceManager.h:8
Definition: SEInitialEnvironmentConditions.h:7
Definition: SEChronicHeartFailure.h:7
Definition: SEConsumeMeal.h:8
SEChronicRenalStenosis * m_RenalStenosis
Definition: SEConditionManager.h:97
SELobarPneumonia * m_LobarPneumonia
Definition: SEConditionManager.h:96
Definition: SEChronicObstructivePulmonaryDisease.h:7
static bool SerializeToString(const SEPatientConfiguration &src, std::string &output, SerializationFormat m)
Definition: PBEngine.cpp:300
std::stringstream m_ss
Definition: SEConditionManager.h:101
static bool SerializeToFile(const SEPatientConfiguration &src, const std::string &filename, SerializationFormat m)
Definition: PBEngine.cpp:306
Definition: SEImpairedAlveolarExchange.h:6
Definition: SEChronicPericardialEffusion.h:7
static bool SerializeFromFile(const std::string &filename, SEPatientConfiguration &dst, SerializationFormat m, SESubstanceManager &subMgr)
Definition: PBEngine.cpp:322
SEChronicObstructivePulmonaryDisease * m_COPD
Definition: SEConditionManager.h:92
Definition: Logger.h:11
Definition: SEConditionManager.h:20
Definition: SECondition.h:7
Definition: PBEngine.h:24
Definition: SELobarPneumonia.h:7
SEChronicPericardialEffusion * m_PericardialEffusion
Definition: SEConditionManager.h:95
static void Copy(const SEDataRequest &src, SEDataRequest &dst)
Definition: PBEngine.cpp:363
SEChronicVentricularSystolicDysfunction * m_ChronicVentricularSystolicDysfunction
Definition: SEConditionManager.h:93
static bool SerializeFromString(const std::string &src, SEPatientConfiguration &dst, SerializationFormat m, SESubstanceManager &subMgr)
Definition: PBEngine.cpp:314
Definition: SEChronicRenalStenosis.h:7
SEImpairedAlveolarExchange * m_ImpairedAlveolarExchange
Definition: SEConditionManager.h:94
SESubstanceManager & m_Substances
Definition: SEConditionManager.h:89
SEInitialEnvironmentConditions * m_InitialEnvironmentConditions
Definition: SEConditionManager.h:99
SEChronicAnemia * m_Anemia
Definition: SEConditionManager.h:90
Definition: SEChronicAnemia.h:7
Definition: SEChronicVentricularSystolicDysfunction.h:7
SEConsumeMeal * m_ConsumeMeal
Definition: SEConditionManager.h:91