SEECMOSettings.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5#include "cdm/CommonDefs.h"
6#include "cdm/substance/SESubstanceManager.h"
7#include "cdm/substance/SESubstanceConcentration.h"
8#include "cdm/substance/SESubstanceFraction.h"
9#include "cdm/engine/SEAction.h"
10
12
13// Keep enums in sync with appropriate schema/cdm/ECMO.proto file !!
14enum class eECMO_CannulationLocation { NullCannulationLocation=0,
15 InternalJugular,
16 RightFemoralVein,
17 LeftFemoralVein,
18 RightSubclavianVein,
19 LeftSubclavianVein };
20extern CDM_DECL const std::string& eECMO_CannulationLocation_Name(eECMO_CannulationLocation m);
21
22class CDM_DECL SEECMOSettings : public Loggable
23{
24 friend class PBECMO;//friend the serialization class
25public:
26
27 SEECMOSettings(Logger* logger);
28 virtual ~SEECMOSettings();
29
30 virtual void Clear();
31
32 bool SerializeToString(std::string& output, eSerializationFormat m) const;
33 bool SerializeToFile(const std::string& filename) const;
34 bool SerializeFromString(const std::string& src, eSerializationFormat m, const SESubstanceManager& subMgr);
35 bool SerializeFromFile(const std::string& filename, const SESubstanceManager& subMgr);
36
37 virtual void Merge(const SEECMOSettings& from);
38 virtual void ProcessConfiguration(SEECMOConfiguration& config, SESubstanceManager& subMgr);
39
40 virtual const SEScalar* GetScalar(const std::string& name);
41
42 virtual bool HasInflowLocation() const;
43 virtual eECMO_CannulationLocation GetInflowLocation() const;
44 virtual void SetInflowLocation(eECMO_CannulationLocation c);
45
46 virtual bool HasOutflowLocation() const;
47 virtual eECMO_CannulationLocation GetOutflowLocation() const;
48 virtual void SetOutflowLocation(eECMO_CannulationLocation c);
49
50 virtual bool HasOxygenatorVolume() const;
51 virtual SEScalarVolume& GetOxygenatorVolume();
52 virtual double GetOxygenatorVolume(const VolumeUnit& unit) const;
53
54 virtual bool HasTransfusionFlow() const;
55 virtual SEScalarVolumePerTime& GetTransfusionFlow();
56 virtual double GetTransfusionFlow(const VolumePerTimeUnit& unit) const;
57
58 bool HasSubstanceConcentrations() const;
59 bool HasSubstanceConcentration(const SESubstance& substance) const;
60 const std::vector<SESubstanceConcentration*>& GetSubstanceConcentrations();
61 const std::vector<const SESubstanceConcentration*> GetSubstanceConcentrations() const;
62 SESubstanceConcentration& GetSubstanceConcentration(const SESubstance& substance);
63 const SESubstanceConcentration* GetSubstanceConcentration(const SESubstance& substance) const;
64 void RemoveSubstanceConcentration(const SESubstance& substance);
65 void RemoveSubstanceConcentrations();
66
67 virtual bool HasSubstanceCompound() const;
68 virtual void SetSubstanceCompound(const SESubstanceCompound& c);
69 virtual const SESubstanceCompound* GetSubstanceCompound() const;
70 virtual void RemoveSubstanceCompound();
71
72protected:
73
74 eECMO_CannulationLocation m_InflowLocation;
75 eECMO_CannulationLocation m_OutflowLocation;
79
80 std::vector<SESubstanceConcentration*> m_SubstanceConcentrations;
81};
Definition: Logger.h:23
Definition: Logger.h:71
Definition: PBECMO.h:10
static bool SerializeToString(const SEECMOSettings &src, std::string &output, eSerializationFormat m)
Definition: PBECMO.cpp:117
static bool SerializeFromString(const std::string &src, SEECMOSettings &dst, eSerializationFormat m, const SESubstanceManager &subMgr)
Definition: PBECMO.cpp:130
static bool SerializeToFile(const SEECMOSettings &src, const std::string &filename)
Definition: PBECMO.cpp:123
static bool SerializeFromFile(const std::string &filename, SEECMOSettings &dst, const SESubstanceManager &subMgr)
Definition: PBECMO.cpp:138
Definition: SEECMOConfiguration.h:9
Definition: SEECMOSettings.h:23
std::vector< SESubstanceConcentration * > m_SubstanceConcentrations
Definition: SEECMOSettings.h:80
SEScalarVolume * m_OxygenatorVolume
Definition: SEECMOSettings.h:76
SEScalarVolumePerTime * m_TransfusionFlow
Definition: SEECMOSettings.h:77
eECMO_CannulationLocation m_InflowLocation
Definition: SEECMOSettings.h:74
const SESubstanceCompound * m_SubstanceCompound
Definition: SEECMOSettings.h:78
eECMO_CannulationLocation m_OutflowLocation
Definition: SEECMOSettings.h:75
Definition: SEScalar.h:19
Definition: SEScalarVolume.h:28
Definition: SEScalarVolumePerTime.h:32
Definition: SESubstanceCompound.h:10
Definition: SESubstanceConcentration.h:11
Definition: SESubstance.h:15
Definition: SESubstanceManager.h:9
Definition: SEScalarVolumePerTime.h:8
Definition: SEScalarVolume.h:8

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.