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

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.