Systems.h
1/* Distributed under the Apache License, Version 2.0.
2See accompanying NOTICE file for details.*/
3
4#pragma once
5
6#include "engine/CommonDefs.h"
7#include "engine/common/controller/Controller.h"
8#include "cdm/system/physiology/SEBloodChemistrySystem.h"
9#include "cdm/system/physiology/SECardiovascularSystem.h"
10#include "cdm/system/physiology/SEDrugSystem.h"
11#include "cdm/system/physiology/SEEndocrineSystem.h"
12#include "cdm/system/physiology/SEEnergySystem.h"
13#include "cdm/system/physiology/SEGastrointestinalSystem.h"
14#include "cdm/system/physiology/SEHepaticSystem.h"
15#include "cdm/system/physiology/SENervousSystem.h"
16#include "cdm/system/physiology/SERenalSystem.h"
17#include "cdm/system/physiology/SERespiratorySystem.h"
18#include "cdm/system/physiology/SETissueSystem.h"
19#include "cdm/system/environment/SEEnvironment.h"
20#include "cdm/system/equipment/anesthesia_machine/SEAnesthesiaMachine.h"
21#include "cdm/system/equipment/bag_valve_mask/SEBagValveMask.h"
22#include "cdm/system/equipment/ecmo/SEECMO.h"
23#include "cdm/system/equipment/electrocardiogram/SEElectroCardioGram.h"
24#include "cdm/system/equipment/inhaler/SEInhaler.h"
25#include "cdm/system/equipment/mechanical_ventilator/SEMechanicalVentilator.h"
26#include "cdm/properties/SEScalarVolumePerPressure.h"
27#include "cdm/properties/SEScalarPressureTimePerVolume.h"
28
29// These classes are used to expose any methodology specific data to end users
30// This data would not belong in the cdm, and it's not a clinical assessment, nor on a compartment
31// It is data specific to the system implementation
32// Users only get this data if they are using the pulse engine
33// They should only contain const pure vitrual methods
34
35
36namespace pulse
37{
38 class PULSE_DECL BloodChemistrySystem : public SEBloodChemistrySystem
39 {
40 public:
41 BloodChemistrySystem(Logger* logger=nullptr) : SEBloodChemistrySystem(logger) {}
42 virtual ~BloodChemistrySystem() = default;
43
44 void Clear() override
45 {
47 }
48
49 virtual const SEScalar* GetScalar(const std::string& name) override
50 {
52 if (s != nullptr)
53 return s;
54 // Check to see if this a model specific request
55 //if (name.compare("ModelParameter") == 0)
56 // return m_ModelParameter;
57 return nullptr;
58 }
59 virtual void ComputeExposedModelParameters()=0;
60 protected:
61 //SEScalar m_ModelParameter;
62 };
63
64 class PULSE_DECL CardiovascularSystem : public SECardiovascularSystem
65 {
66 public:
67 CardiovascularSystem(Logger* logger=nullptr) : SECardiovascularSystem(logger) {}
68 virtual ~CardiovascularSystem() = default;
69
70 void Clear() override
71 {
73 }
74
75 virtual const SEScalar* GetScalar(const std::string & name) override
76 {
78 if (s != nullptr)
79 return s;
80 // Check to see if this a model specific request
81 //if (name.compare("ModelParameter") == 0)
82 // return m_ModelParameter;
83 return nullptr;
84 }
85 virtual void ComputeExposedModelParameters() = 0;
86 protected:
87 //SEScalar m_ModelParameter;
88 };
89
90 class PULSE_DECL DrugSystem : public SEDrugSystem
91 {
92 public:
93 DrugSystem(Logger* logger=nullptr) : SEDrugSystem(logger) {}
94 virtual ~DrugSystem() = default;
95
96 void Clear() override
97 {
99 }
100
101 virtual const SEScalar* GetScalar(const std::string & name) override
102 {
103 const SEScalar* s = SEDrugSystem::GetScalar(name);
104 if (s != nullptr)
105 return s;
106 // Check to see if this a model specific request
107 //if (name.compare("ModelParameter") == 0)
108 // return m_ModelParameter;
109 return nullptr;
110 }
111 virtual void ComputeExposedModelParameters() = 0;
112 protected:
113 //SEScalar m_ModelParameter;
114 };
115
116 class PULSE_DECL EndocrineSystem : public SEEndocrineSystem
117 {
118 public:
119 EndocrineSystem(Logger* logger=nullptr) : SEEndocrineSystem(logger) {}
120 virtual ~EndocrineSystem() = default;
121
122 void Clear() override
123 {
125 }
126
127 virtual const SEScalar* GetScalar(const std::string & name) override
128 {
129 const SEScalar* s = SEEndocrineSystem::GetScalar(name);
130 if (s != nullptr)
131 return s;
132 // Check to see if this a model specific request
133 //if (name.compare("ModelParameter") == 0)
134 // return m_ModelParameter;
135 return nullptr;
136 }
137 virtual void ComputeExposedModelParameters() = 0;
138 protected:
139 //SEScalar m_ModelParameter;
140 };
141
142 class PULSE_DECL EnergySystem : public SEEnergySystem
143 {
144 public:
145 EnergySystem(Logger* logger=nullptr) : SEEnergySystem(logger) {}
146 virtual ~EnergySystem() = default;
147
148 void Clear() override
149 {
151 }
152
153 virtual const SEScalar* GetScalar(const std::string & name) override
154 {
155 const SEScalar* s = SEEnergySystem::GetScalar(name);
156 if (s != nullptr)
157 return s;
158 // Check to see if this a model specific request
159 //if (name.compare("ModelParameter") == 0)
160 // return m_ModelParameter;
161 return nullptr;
162 }
163 virtual void ComputeExposedModelParameters() = 0;
164 protected:
165 //SEScalar m_ModelParameter;
166 };
167
168 class PULSE_DECL GastrointestinalSystem : public SEGastrointestinalSystem
169 {
170 public:
171 GastrointestinalSystem(Logger* logger=nullptr) : SEGastrointestinalSystem(logger) {}
172 virtual ~GastrointestinalSystem() = default;
173
174 void Clear() override
175 {
177 }
178
179 virtual const SEScalar* GetScalar(const std::string & name) override
180 {
182 if (s != nullptr)
183 return s;
184 // Check to see if this a model specific request
185 //if (name.compare("ModelParameter") == 0)
186 // return m_ModelParameter;
187 return nullptr;
188 }
189 virtual void ComputeExposedModelParameters() = 0;
190 protected:
191 //SEScalar m_ModelParameter;
192 };
193
194 class PULSE_DECL HepaticSystem : public SEHepaticSystem
195 {
196 public:
197 HepaticSystem(Logger* logger=nullptr) : SEHepaticSystem(logger) {}
198 virtual ~HepaticSystem() = default;
199
200 void Clear() override
201 {
203 }
204
205 virtual const SEScalar* GetScalar(const std::string & name) override
206 {
207 const SEScalar* s = SEHepaticSystem::GetScalar(name);
208 if (s != nullptr)
209 return s;
210 // Check to see if this a model specific request
211 //if (name.compare("ModelParameter") == 0)
212 // return m_ModelParameter;
213 return nullptr;
214 }
215 virtual void ComputeExposedModelParameters() = 0;
216 protected:
217 //SEScalar m_ModelParameter;
218 };
219
220 class PULSE_DECL NervousSystem : public SENervousSystem
221 {
222 public:
223 NervousSystem(Logger* logger=nullptr) : SENervousSystem(logger) {}
224 virtual ~NervousSystem() = default;
225
226 void Clear() override
227 {
229 }
230
231 virtual const SEScalar* GetScalar(const std::string & name) override
232 {
233 const SEScalar* s = SENervousSystem::GetScalar(name);
234 if (s != nullptr)
235 return s;
236 // Check to see if this a model specific request
237 //if (name.compare("ModelParameter") == 0)
238 // return m_ModelParameter;
239 return nullptr;
240 }
241 virtual void ComputeExposedModelParameters() = 0;
242 protected:
243 //SEScalar m_ModelParameter;
244 };
245
246 class PULSE_DECL RenalSystem : public SERenalSystem
247 {
248 public:
249 RenalSystem(Logger* logger=nullptr) : SERenalSystem(logger) {}
250 virtual ~RenalSystem() = default;
251
252 void Clear() override
253 {
255 }
256
257 virtual const SEScalar* GetScalar(const std::string & name) override
258 {
259 const SEScalar* s = SERenalSystem::GetScalar(name);
260 if (s != nullptr)
261 return s;
262 // Check to see if this a model specific request
263 //if (name.compare("ModelParameter") == 0)
264 // return m_ModelParameter;
265 return nullptr;
266 }
267 virtual void ComputeExposedModelParameters() = 0;
268 protected:
269 //SEScalar m_ModelParameter;
270 };
271
272 class PULSE_DECL RespiratorySystem : public SERespiratorySystem
273 {
274 public:
275 RespiratorySystem(Logger* logger=nullptr) : SERespiratorySystem(logger) {}
276 virtual ~RespiratorySystem() = default;
277
278 void Clear() override
279 {
281 m_TotalRespiratoryModelCompliance.Invalidate();
282 m_TotalRespiratoryModelResistance.Invalidate();
283 }
284
285 virtual const SEScalar* GetScalar(const std::string & name) override
286 {
288 if (s != nullptr)
289 return s;
290 // Check to see if this a model specific request
291 if (name.compare("TotalRespiratoryModelCompliance") == 0)
292 return &m_TotalRespiratoryModelCompliance;
293 if (name.compare("TotalRespiratoryModelResistance") == 0)
294 return &m_TotalRespiratoryModelResistance;
295 return nullptr;
296 }
297 virtual void ComputeExposedModelParameters() = 0;
298
299 DEFINE_UNIT_SCALAR(TotalRespiratoryModelCompliance, VolumePerPressure);
300 DEFINE_UNIT_SCALAR(TotalRespiratoryModelResistance, PressureTimePerVolume);
301 };
302
303 class PULSE_DECL TissueSystem : public SETissueSystem
304 {
305 public:
306 TissueSystem(Logger* logger=nullptr) : SETissueSystem(logger) {}
307 virtual ~TissueSystem() = default;
308
309 void Clear() override
310 {
312 }
313
314 virtual const SEScalar* GetScalar(const std::string & name) override
315 {
316 const SEScalar* s = SETissueSystem::GetScalar(name);
317 if (s != nullptr)
318 return s;
319 // Check to see if this a model specific request
320 //if (name.compare("ModelParameter") == 0)
321 // return m_ModelParameter;
322 return nullptr;
323 }
324 virtual void ComputeExposedModelParameters() = 0;
325 protected:
326 //SEScalar m_ModelParameter;
327 };
328
329 class PULSE_DECL EnvironmentSystem : public SEEnvironment
330 {
331 public:
332 EnvironmentSystem(Logger* logger=nullptr) : SEEnvironment(logger) {}
333 virtual ~EnvironmentSystem() = default;
334
335 void Clear() override
336 {
338 }
339
340 virtual const SEScalar* GetScalar(const std::string & name) override
341 {
342 const SEScalar* s = SEEnvironment::GetScalar(name);
343 if (s != nullptr)
344 return s;
345 // Check to see if this a model specific request
346 //if (name.compare("ModelParameter") == 0)
347 // return m_ModelParameter;
348 return nullptr;
349 }
350 virtual void ComputeExposedModelParameters() = 0;
351 protected:
352 //SEScalar m_ModelParameter;
353 };
354
355 class PULSE_DECL AnesthesiaMachineSystem : public SEAnesthesiaMachine
356 {
357 public:
358 AnesthesiaMachineSystem(Logger* logger=nullptr) : SEAnesthesiaMachine(logger) {}
359 virtual ~AnesthesiaMachineSystem() = default;
360
361 void Clear() override
362 {
364 }
365
366 virtual const SEScalar* GetScalar(const std::string & name) override
367 {
369 if (s != nullptr)
370 return s;
371 // Check to see if this a model specific request
372 //if (name.compare("ModelParameter") == 0)
373 // return m_ModelParameter;
374 return nullptr;
375 }
376 virtual void ComputeExposedModelParameters() = 0;
377 protected:
378 //SEScalar m_ModelParameter;
379 };
380
381 class PULSE_DECL BagValveMaskSystem : public SEBagValveMask
382 {
383 public:
384 BagValveMaskSystem(Logger* logger = nullptr) : SEBagValveMask(logger) {}
385 virtual ~BagValveMaskSystem() = default;
386
387 void Clear() override
388 {
390 }
391
392 virtual const SEScalar* GetScalar(const std::string& name) override
393 {
394 const SEScalar* s = SEBagValveMask::GetScalar(name);
395 if (s != nullptr)
396 return s;
397 // Check to see if this a model specific request
398 //if (name.compare("ModelParameter") == 0)
399 // return m_ModelParameter;
400 return nullptr;
401 }
402 virtual void ComputeExposedModelParameters() = 0;
403 protected:
404 //SEScalar m_ModelParameter;
405 };
406
407 class PULSE_DECL ECMOSystem : public SEECMO
408 {
409 public:
410 ECMOSystem(Logger* logger=nullptr) : SEECMO(logger) {}
411 virtual ~ECMOSystem() = default;
412
413 void Clear() override
414 {
416 }
417
418 virtual const SEScalar* GetScalar(const std::string & name) override
419 {
420 const SEScalar* s = SEECMO::GetScalar(name);
421 if (s != nullptr)
422 return s;
423 // Check to see if this a model specific request
424 //if (name.compare("ModelParameter") == 0)
425 // return m_ModelParameter;
426 return nullptr;
427 }
428 virtual void ComputeExposedModelParameters() = 0;
429 protected:
430 //SEScalar m_ModelParameter;
431 };
432
433 class PULSE_DECL ElectroCardioGramSystem : public SEElectroCardioGram
434 {
435 public:
436 ElectroCardioGramSystem(Logger* logger=nullptr) : SEElectroCardioGram(logger) {}
437 virtual ~ElectroCardioGramSystem() = default;
438
439 void Clear() override
440 {
442 }
443
444 virtual const SEScalar* GetScalar(const std::string & name) override
445 {
447 if (s != nullptr)
448 return s;
449 // Check to see if this a model specific request
450 //if (name.compare("ModelParameter") == 0)
451 // return m_ModelParameter;
452 return nullptr;
453 }
454 virtual void ComputeExposedModelParameters() = 0;
455 protected:
456 //SEScalar m_ModelParameter;
457 };
458
459 class PULSE_DECL InhalerSystem : public SEInhaler
460 {
461 public:
462 InhalerSystem(Logger* logger=nullptr) : SEInhaler(logger) {}
463 virtual ~InhalerSystem() = default;
464
465 void Clear() override
466 {
468 }
469
470 virtual const SEScalar* GetScalar(const std::string & name) override
471 {
472 const SEScalar* s = SEInhaler::GetScalar(name);
473 if (s != nullptr)
474 return s;
475 // Check to see if this a model specific request
476 //if (name.compare("ModelParameter") == 0)
477 // return m_ModelParameter;
478 return nullptr;
479 }
480 virtual void ComputeExposedModelParameters() = 0;
481 protected:
482 //SEScalar m_ModelParameter;
483 };
484
485 class PULSE_DECL MechanicalVentilatorSystem : public SEMechanicalVentilator
486 {
487 public:
488 MechanicalVentilatorSystem(Logger* logger=nullptr) : SEMechanicalVentilator(logger) {}
489 virtual ~MechanicalVentilatorSystem() = default;
490
491 void Clear() override
492 {
494 }
495
496 virtual const SEScalar* GetScalar(const std::string & name) override
497 {
499 if (s != nullptr)
500 return s;
501 // Check to see if this a model specific request
502 //if (name.compare("ModelParameter") == 0)
503 // return m_ModelParameter;
504 return nullptr;
505 }
506 virtual void ComputeExposedModelParameters() = 0;
507 protected:
508 //SEScalar m_ModelParameter;
509 };
510END_NAMESPACE
Definition: Logger.h:71
Definition: SEAnesthesiaMachine.h:24
const SEScalar * GetScalar(const std::string &name) override
Definition: SEAnesthesiaMachine.cpp:137
void Clear() override
Definition: SEAnesthesiaMachine.cpp:57
Definition: SEBagValveMask.h:14
const SEScalar * GetScalar(const std::string &name) override
Definition: SEBagValveMask.cpp:184
void Clear() override
Definition: SEBagValveMask.cpp:59
Definition: SEBloodChemistrySystem.h:10
const SEScalar * GetScalar(const std::string &name) override
A reflextion type call that will return the Scalar associated with the string. ex....
Definition: SEBloodChemistrySystem.cpp:121
void Clear() override
Deletes all members.
Definition: SEBloodChemistrySystem.cpp:86
Definition: SECardiovascularSystem.h:24
const SEScalar * GetScalar(const std::string &name) override
Definition: SECardiovascularSystem.cpp:152
void Clear() override
Definition: SECardiovascularSystem.cpp:108
Definition: SEDrugSystem.h:9
void Clear() override
Definition: SEDrugSystem.cpp:43
const SEScalar * GetScalar(const std::string &name) override
Definition: SEDrugSystem.cpp:60
Definition: SEECMO.h:10
void Clear() override
Definition: SEECMO.cpp:18
const SEScalar * GetScalar(const std::string &name) override
Definition: SEECMO.cpp:34
Definition: SEElectroCardioGram.h:9
const SEScalar * GetScalar(const std::string &name) override
Definition: SEElectroCardioGram.cpp:87
void Clear() override
Definition: SEElectroCardioGram.cpp:44
Definition: SEEndocrineSystem.h:8
const SEScalar * GetScalar(const std::string &name) override
Definition: SEEndocrineSystem.cpp:24
void Clear() override
Definition: SEEndocrineSystem.cpp:18
Definition: SEEnergySystem.h:8
void Clear() override
Definition: SEEnergySystem.cpp:46
const SEScalar * GetScalar(const std::string &name) override
Definition: SEEnergySystem.cpp:63
Definition: SEEnvironment.h:13
void Clear() override
Definition: SEEnvironment.cpp:53
const SEScalar * GetScalar(const std::string &name) override
Definition: SEEnvironment.cpp:75
Definition: SEGastrointestinalSystem.h:9
const SEScalar * GetScalar(const std::string &name) override
Definition: SEGastrointestinalSystem.cpp:33
void Clear() override
Definition: SEGastrointestinalSystem.cpp:24
Definition: SEHepaticSystem.h:8
const SEScalar * GetScalar(const std::string &name) override
Definition: SEHepaticSystem.cpp:23
void Clear() override
Definition: SEHepaticSystem.cpp:17
Definition: SEInhaler.h:12
const SEScalar * GetScalar(const std::string &name) override
Definition: SEInhaler.cpp:63
void Clear() override
Definition: SEInhaler.cpp:35
Definition: SEMechanicalVentilator.h:10
void Clear() override
Definition: SEMechanicalVentilator.cpp:84
const SEScalar * GetScalar(const std::string &name) override
Definition: SEMechanicalVentilator.cpp:161
Definition: SENervousSystem.h:9
void Clear() override
Definition: SENervousSystem.cpp:39
const SEScalar * GetScalar(const std::string &name) override
Definition: SENervousSystem.cpp:56
Definition: SERenalSystem.h:8
void Clear() override
Definition: SERenalSystem.cpp:146
const SEScalar * GetScalar(const std::string &name) override
Definition: SERenalSystem.cpp:210
Definition: SERespiratorySystem.h:25
void Clear() override
Definition: SERespiratorySystem.cpp:176
const SEScalar * GetScalar(const std::string &name) override
Definition: SERespiratorySystem.cpp:246
Definition: SEScalar.h:19
Definition: SETissueSystem.h:8
const SEScalar * GetScalar(const std::string &name) override
Definition: SETissueSystem.cpp:46
void Clear() override
Definition: SETissueSystem.cpp:33
Definition: Logger.h:14

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.