PhysiologyEngine.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 
6 class SEEventHandler;
7 class SEAdvanceHandler;
8 class SEPatient;
11 
12 class SECondition;
13 class SEAction;
14 
15 class SESubstanceManager;
18 class SEDrugSystem;
19 class SEEndocrineSystem;
20 class SEEnergySystem;
22 class SEHepaticSystem;
23 class SENervousSystem;
24 class SERenalSystem;
26 class SETissueSystem;
27 class SEEnvironment;
29 class SEInhaler;
32 class SEActionManager;
33 class SEConditionManager;
34 
35 class SEEngineTracker;
37 
43 {
45  : CommonDataModelException( "Physiology Engine Error" ) {}
46 
47  PhysiologyEngineException(const std::string& _Message)
48  : CommonDataModelException(_Message) {}
49 };
50 
51 
52 class CDM_DECL PhysiologyEngine
53 {
54 public:
55  virtual ~PhysiologyEngine() {}
56 
57  //--------------------------------------------------------------------------------------------------
65  //--------------------------------------------------------------------------------------------------
66  virtual bool SerializeFromFile(const std::string& filename, SerializationFormat m, const SEScalarTime* simTime=nullptr, const SEEngineConfiguration* config = nullptr) = 0;
67 
68  //--------------------------------------------------------------------------------------------------
72  //--------------------------------------------------------------------------------------------------
73  virtual bool SerializeToFile(const std::string& filename, SerializationFormat m) const = 0;
74 
75  //--------------------------------------------------------------------------------------------------
85  //--------------------------------------------------------------------------------------------------
86  virtual bool SerializeFromString(const std::string& state, SerializationFormat m, const SEScalarTime* simTime = nullptr, const SEEngineConfiguration* config = nullptr) = 0;
87 
88  //--------------------------------------------------------------------------------------------------
94  //--------------------------------------------------------------------------------------------------
95  virtual bool SerializeToString(std::string& state, SerializationFormat m) const = 0;
96 
97  //--------------------------------------------------------------------------------------------------
105  //--------------------------------------------------------------------------------------------------
106  virtual bool InitializeEngine(const std::string& patient_configuration, SerializationFormat m, const SEEngineConfiguration* config = nullptr) = 0;
107 
108  //--------------------------------------------------------------------------------------------------
115  //--------------------------------------------------------------------------------------------------
116  virtual bool InitializeEngine(const SEPatientConfiguration& patient_configuration, const SEEngineConfiguration* config = nullptr) = 0;
117 
118  //--------------------------------------------------------------------------------------------------
123  //--------------------------------------------------------------------------------------------------
124  virtual const SEConditionManager& GetConditionManager() const = 0;
125 
126  //--------------------------------------------------------------------------------------------------
129  //--------------------------------------------------------------------------------------------------
130  virtual Logger* GetLogger() const = 0;
131 
132  //--------------------------------------------------------------------------------------------------
137  //--------------------------------------------------------------------------------------------------
138  virtual SEEngineTracker* GetEngineTracker() const = 0;
139 
140  //--------------------------------------------------------------------------------------------------
143  //--------------------------------------------------------------------------------------------------
144  virtual const SEEngineConfiguration* GetConfiguration() const = 0;
145 
146  //--------------------------------------------------------------------------------------------------
150  //--------------------------------------------------------------------------------------------------
151  virtual double GetTimeStep(const TimeUnit& unit) const = 0;
152 
153  //--------------------------------------------------------------------------------------------------
156  //--------------------------------------------------------------------------------------------------
157  virtual double GetSimulationTime(const TimeUnit& unit) const = 0;
158 
159  //--------------------------------------------------------------------------------------------------
166  //--------------------------------------------------------------------------------------------------
167  virtual void AdvanceModelTime() = 0;
168 
169  //--------------------------------------------------------------------------------------------------
177  //--------------------------------------------------------------------------------------------------
178  virtual void AdvanceModelTime(double time, const TimeUnit& unit) = 0;
179 
180  //--------------------------------------------------------------------------------------------------
183  //--------------------------------------------------------------------------------------------------
184  virtual void SetAdvanceHandler(SEAdvanceHandler* handler) = 0;
185 
186  //--------------------------------------------------------------------------------------------------
192  //--------------------------------------------------------------------------------------------------
193  virtual bool ProcessAction(const SEAction& action) = 0;
194 
195  //--------------------------------------------------------------------------------------------------
200  //--------------------------------------------------------------------------------------------------
201  virtual const SEActionManager& GetActionManager() const = 0;
202 
203  //--------------------------------------------------------------------------------------------------
207  //--------------------------------------------------------------------------------------------------
208  virtual SESubstanceManager& GetSubstanceManager() = 0;
209  virtual const SESubstanceManager& GetSubstanceManager() const = 0;
210 
211  //--------------------------------------------------------------------------------------------------
214  //--------------------------------------------------------------------------------------------------
215  virtual void SetEventHandler(SEEventHandler* handler) = 0;
216 
217  //--------------------------------------------------------------------------------------------------
221  //--------------------------------------------------------------------------------------------------
222  virtual const SEPatient& GetPatient() const = 0;
223 
224  //--------------------------------------------------------------------------------------------------
230  //--------------------------------------------------------------------------------------------------
231  virtual bool GetPatientAssessment(SEPatientAssessment& assessment) const = 0;
232 
233  //--------------------------------------------------------------------------------------------------
237  //--------------------------------------------------------------------------------------------------
238  virtual const SEEnvironment* GetEnvironment() const = 0;
239 
240  //--------------------------------------------------------------------------------------------------
244  //--------------------------------------------------------------------------------------------------
245  virtual const SEBloodChemistrySystem* GetBloodChemistrySystem() const = 0;
246 
247  //--------------------------------------------------------------------------------------------------
251  //--------------------------------------------------------------------------------------------------
252  virtual const SECardiovascularSystem* GetCardiovascularSystem() const = 0;
253 
254  //--------------------------------------------------------------------------------------------------
258  //--------------------------------------------------------------------------------------------------
259  virtual const SEDrugSystem* GetDrugSystem() const = 0;
260 
261  //--------------------------------------------------------------------------------------------------
265  //--------------------------------------------------------------------------------------------------
266  virtual const SEEndocrineSystem* GetEndocrineSystem() const = 0;
267 
268  //--------------------------------------------------------------------------------------------------
272  //--------------------------------------------------------------------------------------------------
273  virtual const SEEnergySystem* GetEnergySystem() const = 0;
274 
275  //--------------------------------------------------------------------------------------------------
279  //--------------------------------------------------------------------------------------------------
280  virtual const SEGastrointestinalSystem* GetGastrointestinalSystem() const = 0;
281 
282  //--------------------------------------------------------------------------------------------------
286  //--------------------------------------------------------------------------------------------------
287  virtual const SEHepaticSystem* GetHepaticSystem() const = 0;
288 
289  //--------------------------------------------------------------------------------------------------
293  //--------------------------------------------------------------------------------------------------
294  virtual const SENervousSystem* GetNervousSystem() const = 0;
295 
296  //--------------------------------------------------------------------------------------------------
300  //--------------------------------------------------------------------------------------------------
301  virtual const SERenalSystem* GetRenalSystem() const = 0;
302 
303  //--------------------------------------------------------------------------------------------------
307  //--------------------------------------------------------------------------------------------------
308  virtual const SERespiratorySystem* GetRespiratorySystem() const = 0;
309 
310  //--------------------------------------------------------------------------------------------------
314  //--------------------------------------------------------------------------------------------------
315  virtual const SETissueSystem* GetTissueSystem() const = 0;
316 
317  //--------------------------------------------------------------------------------------------------
321  //--------------------------------------------------------------------------------------------------
322  virtual const SEAnesthesiaMachine* GetAnesthesiaMachine() const = 0;
323 
324  //--------------------------------------------------------------------------------------------------
328  //--------------------------------------------------------------------------------------------------
329  virtual const SEElectroCardioGram* GetElectroCardioGram() const = 0;
330 
331  //--------------------------------------------------------------------------------------------------
335  //--------------------------------------------------------------------------------------------------
336  virtual const SEInhaler* GetInhaler() const = 0;
337 
338  //--------------------------------------------------------------------------------------------------
343  //--------------------------------------------------------------------------------------------------
344  virtual const SECompartmentManager& GetCompartments() const = 0;
345 };
Definition: SESubstanceManager.h:8
Definition: SEElectroCardioGram.h:7
Definition: SEInhaler.h:11
Definition: SEPatient.h:61
Definition: Logger.h:61
Definition: SEAnesthesiaMachine.h:30
Definition: SEEngineConfiguration.h:7
Definition: SEEngineTracker.h:59
Definition: SEAction.h:7
Definition: SENervousSystem.h:8
Definition: SEGastrointestinalSystem.h:8
Definition: SERespiratorySystem.h:8
Definition: SECardiovascularSystem.h:11
Definition: SEActionManager.h:12
Definition: SEEventHandler.h:8
Definition: SERenalSystem.h:7
Definition: SEScalarTime.h:7
Definition: SETissueSystem.h:7
Definition: SEHepaticSystem.h:7
PhysiologyEngineException(const std::string &_Message)
Definition: PhysiologyEngine.h:47
Definition: SECompartmentManager.h:24
Definition: SEConditionManager.h:20
Definition: SECondition.h:7
Definition: SEPatientConfiguration.h:10
Definition: SEBloodChemistrySystem.h:9
Definition: PhysiologyEngine.h:52
PhysiologyEngineException()
Definition: PhysiologyEngine.h:44
Definition: SEEnergySystem.h:7
Data formed at a level of a clinicians report. This is high level data, such as a mean or generalized...
Definition: SEPatientAssessment.h:21
Definition: SEEndocrineSystem.h:7
Definition: SEScalarTime.h:23
Definition: SEEnvironment.h:12
Definition: SEAdvanceHandler.h:7
virtual ~PhysiologyEngine()
Definition: PhysiologyEngine.h:55
Definition: CommonDataModel.h:107
Definition: SEDrugSystem.h:8
Base exception class that all CDM classes throw when an error occurs.
Definition: PhysiologyEngine.h:42